/**
 * NexaShop - Product Sticky Add To Cart & Bottom Sheet Drawer Styles
 * Matches media_1790779914462.png (Sticky bar) and media_1790779949650.png / media_1790780024678.png (Bottom Sheet)
 */

/* ==========================================================================
   1. Sticky Add To Cart Bar
   ========================================================================== */

.nexashop-sticky-add-to-cart {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    background-color: #ffffff;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #f0f0f1;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    direction: rtl;
}

.nexashop-sticky-add-to-cart.position-bottom {
    bottom: 0;
    transform: translateY(100%);
}

.nexashop-sticky-add-to-cart.position-top {
    top: 0;
    transform: translateY(-100%);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border-top: none;
    border-bottom: 1px solid #f0f0f1;
}

/* Device Visibility Control */
.nexashop-sticky-add-to-cart.device-desktop {
    display: block;
}
@media (max-width: 767px) {
    .nexashop-sticky-add-to-cart.device-desktop {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.nexashop-sticky-add-to-cart.device-mobile {
    display: block;
}
@media (min-width: 768px) {
    .nexashop-sticky-add-to-cart.device-mobile {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* When visible or inside Elementor editor */
.nexashop-sticky-add-to-cart.is-visible,
.elementor-editor-active .nexashop-sticky-add-to-cart {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.nexashop-sticky-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    direction: rtl;
}

/* Right: Product Thumbnail & Title (Desktop) */
.nexashop-sticky-product-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.nexashop-sticky-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nexashop-sticky-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nexashop-sticky-meta-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nexashop-sticky-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Group: Grouping prices & button on left side (desktop) */
.nexashop-sticky-action-group {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

/* Middle / Left: Prices */
.nexashop-sticky-middle-prices {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nexashop-sticky-prices-row {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.nexashop-sticky-top-price-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nexashop-sticky-discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ef394e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 99px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.nexashop-sticky-old-price {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
    line-height: 1.2;
}

.nexashop-sticky-main-price-row {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.nexashop-sticky-current-price-num {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.nexashop-sticky-toman-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

/* Left: Actions Area (Button vs Quantity Box) */
.nexashop-sticky-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nexashop-sticky-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* State A: Add to Cart Button (Default Red Pill Button) */
.nexashop-sticky-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    background-color: #ef394e;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.25s ease, transform 0.15s ease, opacity 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(239, 57, 78, 0.25);
}

.nexashop-sticky-btn:hover {
    background-color: #dc2626;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239, 57, 78, 0.35);
}

.nexashop-sticky-btn:active {
    transform: translateY(1px);
}

.nexashop-sticky-btn.is-hidden {
    display: none !important;
}

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

/* State B: Active Cart Quantity Controller */
.nexashop-sticky-qty-ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    min-width: 122px;
    background-color: #ffffff;
    border: 1.5px solid #ef394e;
    border-radius: 12px;
    padding: 0 6px;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nexashop-sticky-qty-ctrl.is-hidden {
    display: none !important;
}

.nexashop-sticky-qty-ctrl.is-active {
    display: inline-flex !important;
}

.ns-satc-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ef394e;
    font-size: 18px;
    font-weight: 800;
    padding: 0;
    margin: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
    user-select: none;
}

.ns-satc-qty-btn:active {
    transform: scale(0.85);
}

.ns-satc-qty-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    min-width: 32px;
    text-align: center;
    user-select: none;
}

.nexashop-sticky-out-of-stock {
    font-size: 14px;
    font-weight: 700;
    color: #ef394e;
    padding: 8px 16px;
    flex-shrink: 0;
}


/* ==========================================================================
   2. Bottom Sheet Drawer Modal (Cart Upsell Sheet)
   Matching media_1790779949650.png and media_1790780024678.png
   ========================================================================== */

/* Dark Backdrop Overlay */
.ns-satc-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ns-satc-sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Bottom Sheet Container */
.ns-satc-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    background-color: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.2);
    z-index: 99999;
    transform: translateY(105%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    height: 60vh;
    max-height: 92vh;
    box-sizing: border-box;
}

.ns-satc-sheet.is-open {
    transform: translateY(0);
}

/* When dragged or expanded to full height */
.ns-satc-sheet.is-expanded {
    height: 92vh !important;
}

/* Bottom Sheet is strictly mobile-only (never display on desktop / screens >= 768px) */
@media (min-width: 768px) {
    .ns-satc-sheet,
    .ns-satc-sheet-backdrop {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(150%) !important;
        opacity: 0 !important;
    }
}

/* Drag Handle */
.ns-satc-sheet-handle-wrap {
    padding: 10px 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    width: 100%;
    background-color: transparent;
}

.ns-satc-sheet-handle-wrap:active {
    cursor: grabbing;
}

.ns-satc-sheet-handle {
    width: 38px;
    height: 4.5px;
    border-radius: 99px;
    background-color: #cbd5e1;
    transition: background-color 0.2s ease, width 0.2s ease;
}

.ns-satc-sheet-handle-wrap:hover .ns-satc-sheet-handle {
    background-color: #94a3b8;
    width: 44px;
}

/* Header */
.ns-satc-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 18px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.ns-satc-sheet-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ns-satc-sheet-success-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #029a5b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ns-satc-sheet-success-icon svg {
    width: 16px;
    height: 16px;
}

.ns-satc-sheet-header-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.ns-satc-sheet-close {
    border: none;
    background: transparent;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 4px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.ns-satc-sheet-close:hover {
    color: #0f172a;
    background-color: #f1f5f9;
}

.ns-satc-sheet-header-left {
    display: flex;
    align-items: center;
}

.ns-satc-sheet-cart-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f1f5f9;
    color: #0f172a;
    padding: 7px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.ns-satc-sheet-cart-pill:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1px);
}

/* Scrollable Body */
.ns-satc-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 18px 24px;
    overscroll-behavior: contain;
}

.ns-satc-sheet-body::-webkit-scrollbar {
    width: 5px;
}

.ns-satc-sheet-body::-webkit-scrollbar-track {
    background: transparent;
}

.ns-satc-sheet-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}

.ns-satc-sheet-upsell-section {
    display: flex;
    flex-direction: column;
}

.ns-satc-sheet-upsell-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px;
    line-height: 1.3;
}

.ns-satc-sheet-upsell-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Upsell Product Card */
.ns-satc-upsell-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    gap: 12px;
}

.ns-satc-upsell-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.ns-satc-upsell-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ns-satc-upsell-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ns-satc-upsell-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ns-satc-upsell-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ns-satc-upsell-name a {
    color: inherit;
    text-decoration: none;
}

.ns-satc-upsell-name a:hover {
    color: #ef394e;
}

.ns-satc-upsell-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ns-satc-upsell-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
}

.ns-satc-star-icon {
    font-size: 11px;
    color: #f59e0b;
}

.ns-satc-upsell-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ns-satc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.ns-satc-upsell-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.ns-satc-upsell-old-price {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

.ns-satc-upsell-unit {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
}

/* Quick Add (+) Button on Left */
.ns-satc-upsell-action {
    flex-shrink: 0;
}

.ns-satc-upsell-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ef394e;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 57, 78, 0.25);
    user-select: none;
    position: relative;
}

.ns-satc-upsell-add-btn:hover {
    background-color: #dc2626;
    transform: scale(1.06);
}

.ns-satc-upsell-add-btn:active {
    transform: scale(0.92);
}

.ns-satc-upsell-add-btn.is-added {
    background-color: #029a5b !important;
    box-shadow: 0 2px 8px rgba(2, 154, 91, 0.3) !important;
}

.ns-satc-upsell-add-btn.is-loading .ns-satc-plus-icon,
.ns-satc-upsell-add-btn.is-loading .ns-satc-check-icon {
    display: none !important;
}

.ns-satc-upsell-add-btn.is-loading .ns-satc-loading-spinner {
    display: block !important;
}

.ns-satc-loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ns-satc-spin 0.6s linear infinite;
}

@keyframes ns-satc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sticky Footer inside Bottom Sheet Drawer */
.ns-satc-sheet-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    z-index: 10;
}

.ns-satc-sheet-footer-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.ns-satc-sheet-footer-old-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ns-satc-sheet-discount-badge {
    background-color: #ef394e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 99px;
    padding: 1px 6px;
    line-height: 1.2;
}

.ns-satc-sheet-old-price {
    color: #94a3b8;
    font-size: 12px;
    text-decoration: line-through;
}

.ns-satc-sheet-footer-current-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.ns-satc-sheet-final-price {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.ns-satc-sheet-currency-badge {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.ns-satc-sheet-footer-qty {
    display: flex;
    align-items: center;
}

.ns-satc-qty-box {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    height: 42px;
    width: 120px;
    background-color: #ffffff;
    border: 1.5px solid #ef394e;
    border-radius: 12px;
    padding: 0 6px;
    box-sizing: border-box;
}


/* ==========================================================================
   3. Responsive & Mobile Adaptations
   ========================================================================== */

@media (max-width: 767px) {
    /* Hide smoothly when Mobile Hamburger Menu is active */
    body.ns-hamburger-open .nexashop-sticky-add-to-cart {
        transform: translateY(135%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .nexashop-sticky-container {
        padding: 8px 14px;
        gap: 8px;
        max-width: 100%;
        width: 100%;
        justify-content: space-between;
    }

    .nexashop-sticky-product-info {
        display: none !important;
    }

    .nexashop-sticky-action-group {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    .nexashop-sticky-middle-prices {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nexashop-sticky-prices-row {
        align-items: flex-start;
        gap: 1px;
    }

    .nexashop-sticky-top-price-row {
        gap: 5px;
    }

    .nexashop-sticky-discount-badge {
        font-size: 10px;
        padding: 1px 6px;
    }

    .nexashop-sticky-old-price {
        font-size: 11px;
    }

    .nexashop-sticky-current-price-num {
        font-size: 17px;
    }

    .nexashop-sticky-toman-badge {
        font-size: 10px;
    }

    .nexashop-sticky-btn {
        padding: 0 16px;
        font-size: 13px;
        height: 40px;
        border-radius: 10px;
    }

    .nexashop-sticky-qty-ctrl {
        height: 40px;
        min-width: 108px;
        border-radius: 10px;
        padding: 0 4px;
    }

    .ns-satc-qty-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .ns-satc-qty-val {
        font-size: 14px;
        min-width: 26px;
    }

    /* Bottom Sheet on Mobile */
    .ns-satc-sheet {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        height: 60vh;
        max-height: 92vh;
    }

    .ns-satc-sheet-header {
        padding: 4px 14px 10px;
    }

    .ns-satc-sheet-body {
        padding: 12px 14px 20px;
    }

    .ns-satc-sheet-footer {
        padding: 10px 14px;
    }
}

@media (max-width: 380px) {
    .nexashop-sticky-container {
        padding: 6px 10px;
        gap: 4px;
    }

    .nexashop-sticky-action-group {
        gap: 6px !important;
    }

    .nexashop-sticky-btn {
        padding: 0 12px;
        font-size: 12px;
        height: 38px;
    }

    .nexashop-sticky-qty-ctrl {
        height: 38px;
        min-width: 98px;
    }

    .nexashop-sticky-current-price-num {
        font-size: 15px;
    }
}
