/**
 * NexaShop - Product Add To Cart Widget Styles
 */

.nexashop-single-add-to-cart {
    width: 100%;
    margin-bottom: 16px;
    --nexashop-atc-primary: var(--e-global-color-primary, var(--nexashop-primary-color, var(--primary, #eab308)));
}

/* Hide native variations table and clear link (handled by Swatches widget) */
.nexashop-single-add-to-cart .variations,
.nexashop-single-add-to-cart .reset_variations,
.nexashop-single-add-to-cart .nexashop-hidden-variations-selects {
    display: none !important;
}

.nexashop-single-add-to-cart .woocommerce-variation.single_variation {
    display: none !important;
}

.nexashop-single-add-to-cart .woocommerce-variation-add-to-cart.variations_button {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.nexashop-add-to-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Quantity Box - Pixel-perfect match for media_1790620482007.png */
.nexashop-qty-counter {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    box-sizing: border-box;
    flex-shrink: 0;
    min-width: 110px;
}

.nexashop-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 38px;
    background-color: var(--nexashop-atc-primary, #eab308);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: transform 0.15s ease, filter 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.nexashop-qty-btn:hover {
    filter: brightness(0.92);
    transform: scale(1.04);
}

.nexashop-qty-btn:active {
    transform: scale(0.94);
}

.nexashop-qty-input {
    width: 38px;
    height: 36px;
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -moz-appearance: textfield;
}

.nexashop-qty-input::-webkit-outer-spin-button,
.nexashop-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add To Cart Button - Pixel-perfect match for media_1790620482007.png */
.nexashop-add-to-cart-btn,
.nexashop-single-add-to-cart .single_add_to_cart_button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    flex-grow: 1;
    background-color: var(--nexashop-atc-primary, #eab308);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease, filter 0.2s ease;
    white-space: nowrap;
}

.nexashop-add-to-cart-btn:hover,
.nexashop-single-add-to-cart .single_add_to_cart_button.button:hover {
    background-color: var(--nexashop-atc-primary, #eab308);
    filter: brightness(0.92);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
}

.nexashop-add-to-cart-btn:active,
.nexashop-single-add-to-cart .single_add_to_cart_button.button:active {
    transform: translateY(1px);
}

/* Waiting for option selection state ("یک گزینه را انتخاب کنید") */
.nexashop-add-to-cart-btn.is-selection-needed,
.nexashop-add-to-cart-btn.disabled,
.nexashop-single-add-to-cart .single_add_to_cart_button.disabled,
.nexashop-single-add-to-cart .single_add_to_cart_button.wc-variation-selection-needed {
    background-color: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    opacity: 0.75 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transform: none !important;
}

.nexashop-add-to-cart-btn.is-selection-needed:hover,
.nexashop-single-add-to-cart .single_add_to_cart_button.disabled:hover {
    background-color: #64748b !important;
    opacity: 0.9 !important;
}

@keyframes nexashopShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.nexashop-shake-attention {
    animation: nexashopShake 0.45s ease-in-out;
}

.nexashop-btn-icon {
    display: inline-flex;
    align-items: center;
    font-size: 18px;
}

.nexashop-btn-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Interactive AJAX Mode (Digikala style button to counter animation) */
.nexashop-add-to-cart-wrapper.is-interactive-ajax.is-empty .nexashop-qty-counter {
    display: none !important;
}

.nexashop-add-to-cart-wrapper.is-interactive-ajax.is-empty .nexashop-add-to-cart-btn {
    display: inline-flex !important;
    animation: nexashopFadeIn 0.3s ease;
}

.nexashop-add-to-cart-wrapper.is-interactive-ajax.has-in-cart .nexashop-add-to-cart-btn {
    display: none !important;
}

.nexashop-add-to-cart-wrapper.is-interactive-ajax.has-in-cart .nexashop-qty-counter {
    display: inline-flex !important;
    animation: nexashopScaleUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nexashop-add-to-cart-wrapper.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

@keyframes nexashopScaleUp {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes nexashopFadeIn {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .nexashop-add-to-cart-wrapper:not(.is-interactive-ajax) {
        flex-direction: column;
        align-items: stretch;
    }

    .nexashop-qty-counter {
        width: 100%;
        justify-content: space-around;
    }

    .nexashop-add-to-cart-btn {
        width: 100%;
    }
}

/* ==================== Price Box Above Add to Cart ==================== */
.nexashop-atc-price-box {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    gap: 4px;
}

.nexashop-atc-discount-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nexashop-atc-discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ef394e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    line-height: 1.4;
    letter-spacing: 0;
}

.nexashop-atc-regular-price {
    font-size: 14px;
    color: #9e9fb1;
    text-decoration: line-through;
}

.nexashop-atc-regular-price .woocommerce-Price-amount {
    color: inherit;
}

.nexashop-atc-final-price-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.nexashop-atc-final-price {
    font-size: 22px;
    font-weight: 800;
    color: #23254e;
    line-height: 1.2;
}

.nexashop-atc-final-price.nexashop-is-free {
    color: #10b981;
    font-weight: 800;
    font-size: 20px;
}

/* ==================== Call For Price Button ==================== */
.nexashop-call-for-price-wrapper {
    width: 100%;
}

.nexashop-call-for-price-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    background-color: #0284c7;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.nexashop-call-for-price-btn:hover {
    background-color: #0369a1;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transform: translateY(-1px);
}

.nexashop-call-for-price-btn:active {
    transform: translateY(1px);
}

.nexashop-call-for-price-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.nexashop-call-btn-tel {
    font-size: 13px;
    opacity: 0.9;
    direction: ltr;
    display: inline-block;
    font-weight: 600;
}


