﻿/* =========================
   PRODUCT HERO (Premium)
   ========================= */
.sa-product-hero {
    direction: rtl;
    text-align: right;
    --sa-color-active: #3b82f6; /* ring color for selected color swatch */
    --sa-pill-active-bg: #4f46e5; /* selected background */
    --sa-pill-active-border: #4f46e5; /* selected border */
    --sa-pill-active-text: #fff; /* selected text */
}

/* Cards */
.sa-hero-gallery-card,
.sa-hero-info-card {
    background: var(--sa-card-bg);
    border: 1px solid var(--sa-border-color);
    border-radius: var(--sa-radius);
    padding: 14px;
}

/* Campaign strip */
.sa-campaign-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--sa-btn-radius);
    background: var(--sa-primary) !important;
    border: 1px solid rgba(var(--bs-danger-rgb), 0.12);
    margin-bottom: 5px;
    justify-content: space-between;
}

.sa-campaign-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    color: var(--sa-text-third);
}

.sa-part,
.sa-days {
    min-width: 2ch; /* fixed width digits */
    text-align: center;
}

.sa-sep {
    opacity: .6;
    font-size: 15px
}


.sa-campaign-pill {
    font-size: .8rem;
    font-weight: 700;
    color: var(--sa-text-third);
    border-radius: 999px;
    background: var(--sa-primary) !important;
    border: 1px solid rgba(var(--bs-danger-rgb), 0.12);
    padding: 6px 10px;
}

.sa-campaign-title {
    font-weight: 700;
    color: var(--sa-text-third);
    line-height: 1;
}

/* Main image */
.sa-main-image-wrap {
    position: relative;
    border-radius: calc(var(--sa-radius) - 6px);
    background: var(--sa-card-bg);
    overflow: hidden;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-main-image {
    width: 100%;
    height: 420px;
    object-fit: contain !important;
}

/* Floating actions */
.sa-hero-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 5;
}

.sa-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s ease;
}

    .sa-icon-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 18px rgba(15,23,42,.12);
    }

    .sa-icon-btn.is-active {
        border-color: rgba(var(--bs-danger-rgb), .35);
        box-shadow: 0 0 0 3px rgba(var(--bs-danger-rgb), .12);
        color: var(--bs-danger);
    }

/* Thumbs */
.sa-thumbs {
    --sa-thumb-cols: 5; /* desktop default */
    display: grid;
    grid-template-columns: repeat(var(--sa-thumb-cols), minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 576px) {
    .sa-main-image-wrap {
        min-height: 320px;
    }

    .sa-main-image {
    }
}

.sa-thumb {
    border: 1px solid rgba(var(--sa-text-rgb),0.06);
    border-radius: var(--sa-btn-radius);
    background: rgba(var(--sa-body-bg-secondary-rgb),0.4);
    overflow: hidden;
    transition: .15s ease;
    cursor: pointer;
    /* merged (centering) */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    padding: 6px;
}

    .sa-thumb img {
        display: block;
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .sa-thumb.is-active {
        border: 2px solid rgba(var(--sa-primary-rgb));
        box-shadow: 0 0 0 3px rgba(var(--sa-btn-primary-shadow-rgb), .18);
    }

/* Info (base) */
.sa-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.8;
    margin-bottom: 6px;
    color: var(--bs-heading-color);
}

.sa-hero-subtitle {
    color: var(--bs-muted-text);
    font-weight: 700;
    margin-bottom: 6px;
}

.sa-hero-code {
    color: var(--bs-muted-text);
    font-size: .9rem;
}

.sa-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(var(--bs-warning-rgb), 0.30);
    border: 1px solid rgba(var(--bs-warning-rgb), 0.14);
    padding: 8px 10px;
    border-radius: var(--sa-radius-inside);
    white-space: nowrap;
}

.sa-rating-star {
    color: var(--sa-warning);
}

.sa-hero-shortdesc {
    margin-top: 12px;
    color: var(--bs-body-color);
    line-height: 1.9;
}

/* Price box (kept) */
.sa-price-box {
    border: 1px dashed rgba(var(--bs-primary-rgb), .22);
    background: rgba(var(--bs-primary-rgb), .04);
    border-radius: var(--sa-radius);
    padding: 12px;
}

.sa-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
}

.sa-badge-success {
    background: rgba(25,135,84,.12);
    color: #198754;
    border: 1px solid rgba(25,135,84,.18);
}

.sa-badge-danger {
    background: rgba(220,53,69,.12);
    color: #dc3545;
    border: 1px solid rgba(220,53,69,.18);
}

.sa-badge-muted {
    background: rgba(108,117,125,.12);
    color: #6c757d;
    border: 1px solid rgba(108,117,125,.18);
}

.sa-stock-text {
    color: var(--bs-muted-text);
    font-weight: 700;
}

.sa-discount-pill {
    background: var(--sa-badge-primary-bg);
    border: 1px solid rgba(var(--bs-danger-rgb), 0.18);
    color: var(--sa-text-second);
    font-weight: 700;
    border-radius: 999px;
    padding: 6px 10px;
    min-width: 58px;
    text-align: center;
}

.sa-old-price {
    color: var(--sa-muted-text);
    text-decoration: line-through;
    font-weight: 700;
    font-size: .9rem;
}

.sa-final-price {
    font-weight: 700;
    font-size: 1.55rem;
    color: var(--sa-heading-color);
}

/* Divider */
.sa-hr {
    opacity: .12;
    margin: 16px 0;
}

/* Variant rows */
.sa-variant-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sa-variant-label {
    font-weight: 700;
    color: var(--bs-heading-color);
    min-width: 48px;
}

.sa-variant-value {
    font-weight: 700;
    color: var(--bs-body-color);
}

.sa-size-guide {
    font-weight: 700;
    color: var(--sa-warning);
    text-decoration: none;
    font-size: .9rem;
}

    .sa-size-guide:hover {
        text-decoration: underline;
    }

/* Color swatches */
.sa-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sa-color-swatch {
    width: 46px;
    height: 46px;
    border-radius: var(--sa-btn-radius);
    border: 1px solid rgba(0,0,0,0.12);
    overflow: hidden;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .15s ease;
}

    .sa-color-swatch:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 18px rgba(15,23,42,.10);
    }

.sa-color-fill,
.sa-color-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Size pills (improved background) */
.sa-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sa-size-pill {
    border: 1px solid rgba(var(--sa-text-rgb), .2);
    background: var(--sa-card-bg);
    border-radius: var(--sa-btn-radius);
    font-size: .85rem;
    padding: 7px 12px;
    font-weight: 700;
    min-width: 58px;
    transition: .15s ease;
}

    .sa-size-pill:hover {
        background: var(--sa-navbar-item-hover-color);
    }

    .sa-size-pill.is-active {
        background: var(--sa-primary);
        border-color: var(--sa-success);
        color: var(--sa-text-third);
        box-shadow: 0 0 0 4px rgba(var(--sa-primary-rgb), .12);
    }

    .sa-size-pill.is-muted {
        opacity: .55;
        text-decoration: line-through;
    }

    .sa-size-pill:disabled {
        cursor: not-allowed;
        opacity: .45;
    }

/* Material */
.sa-material-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sa-material-img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.10);
    object-fit: cover;
}

.sa-material-chip {
    font-weight: 700;
    background: rgba(13,110,253,.08);
    border: 1px solid rgba(13,110,253,.12);
    color: var(--bs-heading-color);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: .8rem;
}

/* CTAs */
.sa-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 576px) {
    .sa-cta-row {
        grid-template-columns: 1fr;
    }
}

.sa-btn-cta {
    border-radius: var(--sa-btn-radius);
    padding: 15px 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-outline-dark.is-active {
    border-color: rgba(var(--bs-danger-rgb), .45);
    color: var(--bs-danger);
}

/* =========================
   Lightbox Modal (Fixes)
   ========================= */
.sa-image-modal-content {
    background: var(--sa-body-bg-secondary);
    border: 0;
    border-radius: var(--sa-radius);
    overflow: hidden;
    height: min(82vh, 820px);
}

.sa-image-modal-header {
    border: 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sa-modal-counter {
    font-weight: 700;
    opacity: .75;
    color: var(--sa-heading-color);
}

.sa-modal-close {
    margin: 0;
}

.sa-image-modal-body {
    padding: 0 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100% - 54px);
}

.sa-lightbox-stage {
    flex: 1 1 auto;
    min-height: 320px;
    border-radius: var(--sa-radius-inside);
    border: 1px solid var(--sa-border-color);
    background: var(--sa-card-bg);
    overflow: hidden;
}

.sa-lightbox-carousel,
.sa-lightbox-carousel .carousel-inner,
.sa-lightbox-carousel .carousel-item {
    height: 100%;
}

    .sa-lightbox-carousel .carousel-item {
        height: 100%;
    }

        .sa-lightbox-carousel .carousel-item.active,
        .sa-lightbox-carousel .carousel-item-next,
        .sa-lightbox-carousel .carousel-item-prev {
            display: flex;
            align-items: center;
            justify-content: center;
        }

.sa-modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
}

.sa-carousel-btn {
    width: 70px;
    opacity: 1;
}

    .sa-carousel-btn:hover {
        opacity: 1;
    }

.sa-carousel-icon-wrap {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--sa-primary);
}

    .sa-carousel-icon-wrap i {
        color: var(--sa-text-third);
        line-height: 1;
        display: block;
        transform: translateY(1px);
    }

.sa-lightbox-carousel .carousel-control-prev,
.sa-lightbox-carousel .carousel-control-next {
    top: 0;
    bottom: 0;
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    background: transparent;
}

.sa-lightbox-carousel .carousel-item {
    transition-duration: .18s !important;
}

.sa-lightbox-thumbs {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 4px;
    border-radius: var(--sa-radius-inside);
    border: 1px solid var(--sa-border-color);
    background: var(--sa-card-bg);
}

.sa-modal-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--sa-btn-radius);
    border: 1px solid rgba(var(--sa-text-rgb),0.06);
    background: rgba(var(--sa-body-bg-secondary-rgb),0.4);
    padding: 6px;
    flex: 0 0 auto;
    cursor: pointer;
    transition: .12s ease;
}


    .sa-modal-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .sa-modal-thumb.is-active {
        border: 2px solid rgba(var(--sa-primary-rgb));
        box-shadow: 0 0 0 3px rgba(var(--sa-btn-primary-shadow-rgb), .18);
    }

.sa-image-modal-dialog {
    max-width: min(1100px, 96vw);
}

/* "More" thumb */
.sa-thumb-more {
    position: relative;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,0.03);
    padding: 0;
    overflow: hidden;
}

    .sa-thumb-more > img {
        width: 100%;
        height: 58px;
        object-fit: cover;
        opacity: .85;
    }

.sa-more-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,0.35);
}

.sa-more-icon {
    color: #fff;
    font-size: 1.35rem;
}

.sa-more-count {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-weight: 700;
    font-size: .85rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(17,24,39,0.85);
    color: #fff;
}

/* =========================
   INFO SECTION (Premium Compact)
   ========================= */
.sa-info-card {
    padding: 16px;
}

.sa-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sa-info-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.9;
    margin: 0;
    color: var(--sa-heading-color);
}

.sa-info-subtitle {
    margin-top: 2px;
    color: var(--sa-muted-text);
}

.sa-info-meta {
    color: var(--sa-text);
    margin-top: 6px;
    font-size: .8rem;
}

.sa-info-grid {
    margin-top: 6px;
}

.sa-info-section {
    border: 1px solid rgba(var(--sa-text-rgb),0.06);
    background: rgba(var(--sa-body-bg-secondary-rgb),0.4);
    border-radius: var(--sa-radius-inside);
    padding: 12px;
}

.sa-panel {
}

.sa-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.sa-section-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0;
    color: var(--sa-text);
}

.sa-section-sub {
    font-weight: 700;
    font-size: .86rem;
    color: var(--bs-body-color);
    opacity: .92;
    margin-top: 3px;
}

.sa-section-sub-strong {
    font-weight: 700;
    opacity: 1;
}

.sa-link-min {
    text-decoration: none;
    color: var(--bs-primary);
    font-weight: 700;
    font-size: .86rem;
    white-space: nowrap;
}

    .sa-link-min:hover {
        text-decoration: underline;
    }

.sa-variant-panels {
    display: grid;
    gap: 12px;
}

.sa-desc-text {
    line-height: 2;
    color: var(--bs-body-color);
}

/* Feature tiles (same height look) */
.sa-feature-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 576px) {
    .sa-feature-tiles {
        grid-template-columns: 1fr 1fr;
    }
}


.sa-feature-k {
    font-weight: 700;
    color: var(--bs-heading-color);
    font-size: .88rem;
    white-space: nowrap;
}

.sa-feature-v {
    font-weight: 700;
    color: var(--bs-body-color);
    text-align: left;
    direction: rtl;
    opacity: .95;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Full features list (DL) */
.sa-feature-dl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.70);
    margin-bottom: 8px;
}


.sa-feature-dt {
    margin: 0;
    font-weight: 700;
    color: var(--bs-muted-text);
}

.sa-feature-dd {
    margin: 0;
    font-weight: 700;
    color: var(--bs-heading-color);
    text-align: left;
    direction: rtl;
}

/* Buy box */
.sa-buybox {
    border: 1px solid var(--sa-border-color);
    background: var(--sa-card-bg);
    border-radius: var(--sa-radius-inside);
    padding: 14px;
}

@media (min-width: 992px) {
    .sa-buybox {
        position: sticky;
        top: calc(var(--sa-header-h, 0px) + 16px); /* 16px = gap */
    }
}

.sa-buybox-top {
    color: var(--sa-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.sa-buybox-title {
    font-weight: 700;
    font-size: .95rem;
}

.sa-buybox-note {
    font-size: .86rem;
    font-weight: 700;
    color: var(--bs-body-color);
    opacity: .9;
}

.sa-buybox-picks {
    display: grid;
    gap: 8px;
}

.sa-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.70);
}

.sa-pick-label {
    font-weight: 700;
    color: var(--bs-muted-text);
    font-size: .86rem;
}

.sa-pick-value {
    font-weight: 700;
    color: var(--bs-heading-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sa-pick-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.10);
}

.sa-price-inline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.sa-price-stack {
    text-align: left;
}

    .sa-price-stack .sa-old-price,
    .sa-price-stack .sa-final-price {
        margin: 0;
    }

.sa-buy-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
}

    .sa-buy-actions .sa-btn-cta {
        width: 100%;
    }

.sa-divider-soft {
    margin: 20px 0;
    opacity: .12;
}

/* =========================
   FEATURES (Digikala-like tiles)
   ========================= */

.sa-features-block {
    margin-top: 12px;
}

.sa-features-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

/* tiles grid */
.sa-features-tiles {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .sa-features-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* like Digikala row */
    }
}

/* each feature card */
.sa-feature-tile {
    border: 1px solid rgba(var(--sa-text-rgb),0.06);
    background: rgba(var(--sa-body-bg-secondary-rgb),0.4);
    border-radius: var(--sa-radius-inside);
    padding: 12px 12px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}


/* title + value */
.sa-feature-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--sa-muted-text);
    line-height: 1.6;
}

.sa-feature-value {
    font-size: .9rem;
    font-weight: 700;
    color: var(--sa-heading-color);
    line-height: 1.6;
    /* keep tile height clean */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* bottom "show all" centered */
.sa-features-more {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    position: relative;
}

    .sa-features-more::before,
    .sa-features-more::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: rgba(0,0,0,0.10);
    }

.sa-features-more-btn {
    margin: 0 12px;
    border-radius: 12px;
    font-weight: 700;
    padding: 8px 12px;
    white-space: nowrap;
}

.sa-price-inline {
    display: flex;
    align-items: end;
    gap: 10px;
}

    /* discount visible => pill right, price left */
    .sa-price-inline.has-discount {
        justify-content: space-between;
    }

    /* no discount => price still left */
    .sa-price-inline:not(.has-discount) {
        justify-content: flex-end;
    }

/* make price block stay on the left in RTL */
.sa-price-stack {
    text-align: left;
    margin-right: auto; /* pushes it to the left in RTL */
}

/* Selected Color (better ring) */
.sa-color-swatch {
    position: relative; /* needed for pseudo-elements */
}

    .sa-color-swatch.is-active {
        border: 2px solid rgba(var(--sa-primary-rgb));
        box-shadow: 0 0 0 3px rgba(var(--sa-btn-primary-shadow-rgb), .18);
    }

        /* Outer ring */
        .sa-color-swatch.is-active::after {
            content: "";
            position: absolute;
            inset: -4px; /* ring distance */
            border: 2px solid var(--sa-color-active, var(--bs-primary));
            box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .12);
        }

        /* Small check badge - centered */
        .sa-color-swatch.is-active::before {
            content: "✓";
            position: absolute;
            top: 4px;
            right: 6px;
            font-size: 14px;
            font-weight: 900;
            color: var(--sa-text-third);
            width: 18px;
            height: 18px;
            border-radius: 999px;
            background: var(--sa-primary);
            display: flex;
            align-items: center;
            justify-content: center;
        }

/* =========================
       SHIPPING WAYS (BuyBox)
       ========================= */
.sa-ship-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    margin-bottom: 8px;
}

.sa-ship-title {
    font-weight: 700;
    font-size: .92rem;
    color: var(--bs-heading-color);
}

.sa-ship-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sa-ship-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--sa-radius-inside);
    border: 1px solid rgba(var(--sa-text-rgb),0.06);
    background: rgba(var(--sa-body-bg-secondary-rgb),0.4);
    max-width: 100%;
}

.sa-ship-img {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
}

.sa-ship-ico {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,0.06);
    flex: 0 0 auto;
}

.sa-ship-text {
    font-weight: 700;
    font-size: .86rem;
    color: var(--bs-body-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sa-hero-gallery-card,
.sa-hero-info-card {
    width: 100%;
    height: 100%;
}

.sa-main-image-wrap {
    flex: 1 1 auto;
}
/* lets gallery fill nicely */

/* Make cart qty styles work inside Product Hero too */
.sa-buybox .cart-item-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.sa-buybox .cart-item-qty-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sa-heading-color);
}

.sa-buybox .cart-item-qty-number {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
}

/* =========================
   SHARED: Qty Controls (Cart + ProductHero)
   ========================= */

.cart-item-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

    .cart-item-qty-row .label {
        font-weight: 700;
        color: var(--bs-muted-text);
    }

.cart-item-qty-block {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.02);
    border-radius: 14px;
    overflow: hidden;
}

.cart-item-qty-btn {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .15s ease;
    user-select: none;
}

    .cart-item-qty-btn:hover {
        background: rgba(var(--sa-btn-success-shadow-rgb), 0.8);
    }

    .cart-item-qty-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    .cart-item-qty-btn i {
        font-size: 18px;
        line-height: 1;
    }

.cart-item-qty-number {
    min-width: 34px;
    text-align: center;
    font-weight: 800;
    color: var(--bs-heading-color);
}

/* =========================
   ProductHero - Qty UI polish (only in BuyBox)
   ========================= */

.sa-buybox .cart-item-qty-row {
    justify-content: flex-start; /* ✅ کنار هم */
    gap: 10px; /* فاصله کم بین "تعداد" و باکس */
}

    /* label */
    .sa-buybox .cart-item-qty-row .label {
        font-weight: 800;
        white-space: nowrap;
        color: var(--sa-text);
        opacity: .9;
    }

/* make the qty block look like primary button */
.sa-buybox .cart-item-qty-block {
    display: inline-flex;
    align-items: center;
    border-radius: var(--sa-btn-radius);
    border: 1px solid var(--sa-border-color);
    overflow: hidden;
    font-size: .95rem;
    background-color: rgba(0,0,0,0.02);
}

/* buttons inside (plus/minus) */
.sa-buybox .cart-item-qty-btn {
    border: none;
    background-color: transparent;
    padding: .25rem .75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .sa-buybox .cart-item-qty-btn i {
        line-height: 1;
        font-size: 1rem;
    }

    .sa-buybox .cart-item-qty-btn:hover {
        background: rgba(var(--sa-btn-success-shadow-rgb), 0.8);
    }

    .sa-buybox .cart-item-qty-btn:active {
        transform: scale(.98);
    }

.sa-buybox .cart-item-qty-number {
    color: var(--sa-heading-color);
    min-width: 40px;
    text-align: center;
    padding: .25rem .6rem;
    border-left: 1px solid rgba(var(--sa-text-rgb),.2);
    border-right: 1px solid rgba(var(--sa-text-rgb),.2);
}


/* === AddToCart disabled look (exact target) === */
#saAddToCartBtn:disabled,
#saAddToCartBtn[disabled],
#saAddToCartBtn[aria-disabled="true"],
#saAddToCartBtn.is-disabled {
    background: var(--sa-btn-disabled-color) !important;
    border-color: var(--sa-btn-disabled-color) !important;
    color: var(--sa-muted-text) !important; /* muted text */
    box-shadow: none !important;
    opacity: 0.9 !important; /* keep solid (not faded) */
    cursor: not-allowed !important;
}

    /* prevent hover/active styles from your normal button */
    #saAddToCartBtn:disabled:hover,
    #saAddToCartBtn.is-disabled:hover,
    #saAddToCartBtn:disabled:active,
    #saAddToCartBtn.is-disabled:active {
        background: var(--sa-btn-disabled-color) !important;
        border-color: var(--sa-btn-disabled-color) !important;
        transform: none !important;
    }

    /* icon color in disabled mode */
    #saAddToCartBtn:disabled i,
    #saAddToCartBtn.is-disabled i {
        color: #6c757d !important;
    }

.cart-item-qty-btn:disabled,
.cart-item-qty-btn[disabled] {
    opacity: .55 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* make it look like hover when already favorite */
#saFavBtn.is-locked,
#saFavBtn:disabled {
    background: var(--bs-danger) !important;
    border-color: var(--bs-danger) !important;
    color: #fff !important;
    opacity: .85 !important;
    cursor: not-allowed !important;
    pointer-events: none !important; /* extra safety */
}

    #saFavBtn.is-locked:hover,
    #saFavBtn:disabled:hover {
        background: var(--bs-danger) !important;
        border-color: var(--bs-danger) !important;
    }

.text-muted {
    color: var(--sa-muted-text) !important;
}

.sa-chip-label {
    color: var(--sa-muted-text);
}

.sa-chip-value {
    color: var(--sa-text);
}

/* Center column: number + max label stacked */
.cart-item-qty-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 2px 6px;
    border-left: 1px solid rgba(var(--sa-text-rgb), .2);
    border-right: 1px solid rgba(var(--sa-text-rgb), .2);
}

    .cart-item-qty-center .cart-item-qty-number {
        border: none; /* remove old borders — parent handles them */
        padding: 0;
        min-width: auto;
        line-height: 1.2;
    }

    .cart-item-qty-center .cart-item-max-label {
        font-size: 0.6rem;
        font-weight: 700;
        color: var(--bs-danger, #dc3545);
        line-height: 1;
        margin-top: 2px;
        white-space: nowrap;
    }

.sa-buybox .cart-item-qty-number {
    border-left: none;
    border-right: none;
    padding: 0;
    min-width: auto;
}
/* ── Qty Row: flex container ── */
.cart-item-qty-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* 👈 KEY FIX: allows items to wrap */
    gap: 10px;
    width: 100%;
}

    /* ── Label: fixed, don't grow ── */
    .cart-item-qty-row .label {
        flex-shrink: 0;
    }

/* ── Qty block: fixed, don't grow ── */
.cart-item-qty-block {
    flex-shrink: 0;
}

/* ── View Cart link: stretches to fill ALL remaining space ── */
.sa-goto-cart-link {
    flex: 1;
    min-width: 130px; /* 👈 KEY FIX: when space < 130px, wraps to next line */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--sa-btn-radius, 12px);
    border: 1.5px solid rgba(226, 99, 144, 0.35);
    transition: background .18s ease, border-color .18s ease, color .18s ease;
    background: rgba(226, 99, 144, 0.08);
    color: var(--sa-text, #e26390);
}

    .sa-goto-cart-link i {
        font-size: 1rem;
    }

    .sa-goto-cart-link:hover {
        background: rgba(226, 99, 144, 0.16);
        border-color: rgba(226, 99, 144, 0.55);
        color: var(--sa-primary, #e26390);
        text-decoration: none;
    }



/* Horizontal action bar - narrower, no borders, no vertical padding */
.sa-gallery-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    background: var(--sa-card-bg);
    border: none;
    align-items: center;
    justify-content: flex-start;
    height: 52px;
}


/* Remove the old sa-gallery-row styles if you no longer need them */
.sa-gallery-row {
    flex: 1;
    display: flex;
}

.sa-main-image-wrap {
    flex: 1;
    position: relative;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sa-card-bg);
}

/* Action buttons styling - centered icons */
.sa-action-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--sa-btn-radius);
    background: var(--sa-card-bg);
    border: 1px solid rgba(var(--sa-text-rgb),.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0;
    position: relative; /* ✅ added */
}

    .sa-action-btn:hover {
        background: var(--sa-navbar-item-hover-color);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

    .sa-action-btn i {
        font-size: 1.1rem;
        color: var(--sa-heading-color);
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        transition: color 0.18s ease; /* ✅ smooth color transition */
    }

    /* Active state — only color changes */
    .sa-action-btn.is-active i {
        color: var(--sa-danger);
    }

/* Mobile adjustments */
@media (max-width: 576px) {
    .sa-gallery-actions {
        height: 48px;
        gap: 6px;
    }

    .sa-action-btn {
        width: 36px;
        height: 36px;
    }

        .sa-action-btn i {
            font-size: 1rem;
        }
}

#sizeGuideModal .modal-content.size-guide-modal {
    background-color: var(--sa-body-bg-modal);
}

#sizeGuideModal .table tbody {
    --bs-table-bg: var(--sa-body-bg-modal);
}

/* ==========================================================================
   1. BASE MOBILE STYLES (Up to 768.98px)
   ========================================================================== */
@media (max-width: 768.98px) {
    /* 1. Add bottom padding to body so content isn't hidden */
    body {
        padding-bottom: 100px;
    }

    /* 2. Sticky Container Styling */
    .sa-buybox {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        width: 100%;
        margin: 0 !important;
        padding: 14px 20px;
        border-top-left-radius: var(--sa-radius);
        border-top-right-radius: var(--sa-radius);
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-bottom: none !important;
        box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        /* Ensure a consistent minimum height to prevent jumping */
        min-height: 80px;
    }

    /* 3. Hide desktop sections */
    .sa-buybox-top, .sa-chips-row, .sa-divider-soft, .sa-ship-head, .sa-ship-list, #saVariantError {
        display: none !important;
    }

    /* 4. Action Section (Button/Qty) */
    .sa-buy-actions {
        order: 1;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-top: 0 !important;
        gap: 12px; /* Gap between Qty and Cart Icon Button */
    }

    /* 5. Price Section */
    #saPriceBox {
        order: 2;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* 6. Button and Qty Block sizing - UNIFIED HEIGHT */
    #saHeroAddBox {
        width: 100%;
    }

    #saAddToCartBtn {
        width: 75% !important;
        margin: 0;
        height: 48px; /* Fixed height for consistency */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Match Qty block height to Add Button height */
    .cart-item-qty-block {
        width: auto !important;
        margin: 0;
        height: 48px; /* Matches Button height */
        display: flex;
        align-items: center;
    }

    #saHeroQtyBox .cart-item-qty-row {
        margin: 0;
        height: 100%;
        display: flex; /* Ensure horizontal layout for children */
    }

    /* Ensure inputs/buttons inside qty match the 48px height */
    #saHeroQtyBox .btn-qty,
    #saHeroQtyBox .qty-input {
        height: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 7. Icon-only Go To Cart Button */
    #saHeroQtyBox .label {
        display: none !important;
    }

    #saGotoCartLink {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 0;
        width: 48px; /* Square button */
        height: 48px; /* Matches Qty height */
        padding: 0 !important;
        margin: 0 !important;
        flex-shrink: 0;
        gap: 0;
        line-height: 1;
        font-size: 0; /* Hides text */
    }

        #saGotoCartLink i {
            font-size: 1.2rem; /* Keeps icon visible */
        }

    /* 8. Fix Price and Discount spacing */
    .sa-price-inline {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px !important;
    }

    .sa-price-stack {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        line-height: 1.1;
    }

    /* Font size refinements */
    .sa-final-price {
        font-size: 1.4rem;
    }

    .sa-old-price {
        font-size: 0.9rem;
    }

    .sa-discount-pill {
        font-size: 0.9rem;
        padding: 2px 8px;
        margin: 0 !important;
    }

    .sa-btn-instagram{
        height : 48px
    }
}

@media (max-width: 480px) {
    /* Add to cart button takes full container width */
    #saAddToCartBtn {
        width: 90% !important;
    }
}

/* ==========================================================================
   2. SMALL MOBILE STYLES (Under 420px)
   ========================================================================== */
@media (max-width: 420px) {
    /* Padding-X and inner gap for the main container */
    .sa-buybox {
        padding-left: 10px !important;
        padding-right: 10px !important;
        gap: 5px !important;
    }

    /* Gap in the quantity row controls */
    #saHeroQtyBox .cart-item-qty-row {
        gap: 3px !important;
    }

    /* Add to cart button takes full container width */
    #saAddToCartBtn {
        width: 90% !important;
    }

    /* Discount pill refinements */
    .sa-discount-pill {
        padding: 2px !important;
        min-width: 40px !important;
        text-align: center;
    }

    /* Price font sizing for smaller screens */
    .sa-final-price {
        font-size: 1.2rem !important;
    }

    .sa-old-price {
        font-size: 0.85rem !important;
    }
}

/* ==========================================================================
   3. EXTRA SMALL MOBILE STYLES (Under 330px)
   ========================================================================== */
@media (max-width: 330px) {
    /* Hide icon in Add to Cart button to save horizontal space */
    #saAddToCartBtn i,
    #saAddToCartBtn svg,
    #saNotifyInstaBtn i,
    #saNotifyInstaBtn svg {
        display: none !important;
    }

    #saGotoCartLink {
        display: none !important
    }
}

/* ==========================================================================
   Notify me in Instagram button
   ========================================================================== */
.sa-hero-cta-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
}

    .sa-hero-cta-row > * {
        flex: 1 1 50%;
        width: 50%;
        min-width: 0;
    }

.sa-btn-instagram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--sa-info);
    color: var(--sa-danger);
    border: 1px solid var(--sa-danger);
}

    .sa-btn-instagram:hover {
        color: #fff;
        background: var(--sa-danger);
        border-color: var(--sa-danger);
    }

/* 992px to 1199.98px: each button goes to its own row */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sa-hero-cta-row {
        flex-wrap: wrap;
    }

        .sa-hero-cta-row > * {
            flex: 0 0 100%;
            width: 100%;
        }
}

/* ==========================================================================
   Move Upper Back-To-Top Button in this page
   ========================================================================== */
@media (max-width: 768.98px) {
    body.product-details-page .jquery-back-to-top {
        bottom: 90px !important;
    }
}