:root {
    --bg: #f6f3ea;
    --bg-soft: #fbf9f3;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --line: rgba(32, 74, 52, 0.12);
    --line-strong: rgba(32, 74, 52, 0.2);

    --text: #1c2a22;
    --text-soft: #5a6b60;
    --text-muted: #7f8d84;

    --primary: #295c3b;
    --primary-2: #3c7a52;
    --primary-light: #e3f0e6;
    --accent: #d4b06a;
    --accent-soft: #f3e7c9;

    --danger: #b85c5c;
    --success: #2f7a52;

    --shadow-sm: 0 10px 30px rgba(34, 64, 45, 0.06);
    --shadow-md: 0 18px 50px rgba(34, 64, 45, 0.1);
    --shadow-lg: 0 30px 80px rgba(34, 64, 45, 0.14);

    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;

    --transition: 280ms ease;
}

.product-page {
    position: relative;
    padding: 28px 0 70px;
}

.product-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.product-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(212, 176, 106, 0.2), transparent 28%),
        radial-gradient(circle at left bottom, rgba(60, 122, 82, 0.15), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,0.72), rgba(255,255,255,0.92));
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: var(--shadow-md);
    padding: 34px 30px;
    backdrop-filter: blur(12px);
    margin-bottom: 26px;
}

.product-hero::before,
.product-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.product-hero::before {
    width: 220px;
    height: 220px;
    top: -80px;
    right: -50px;
    background: radial-gradient(circle, rgba(212,176,106,0.22), transparent 70%);
}

.product-hero::after {
    width: 260px;
    height: 260px;
    left: -70px;
    bottom: -120px;
    background: radial-gradient(circle, rgba(41,92,59,0.12), transparent 70%);
}

.product-hero__content {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(41, 92, 59, 0.08);
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(212,176,106,0.12);
}

.product-hero h1 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    line-height: 1.3;
}

.product-hero p {
    margin: 0;
    max-width: 760px;
    color: var(--text-soft);
    line-height: 1.9;
    font-size: 1rem;
}

.product-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.filters-card,
.section-card,
.product-card,
.detail-card,
.detail-gallery,
.detail-main,
.category-card,
.empty-state {
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.74));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.filters-card,
.section-card,
.empty-state,
.detail-card,
.detail-gallery,
.detail-main {
    border-radius: var(--radius-lg);
}

.filters-card {
    position: sticky;
    top: 100px;
    padding: 22px;
}

.filters-card__title {
    margin: 0 0 18px;
    font-size: 1.08rem;
    color: var(--text);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.94rem;
    font-weight: 700;
}

.filter-group input[type="text"],
.filter-group select {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(41, 92, 59, 0.14);
    background: rgba(255,255,255,0.88);
    padding: 0 14px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    border-color: rgba(41, 92, 59, 0.35);
    box-shadow: 0 0 0 4px rgba(41, 92, 59, 0.08);
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(41, 92, 59, 0.04);
    border: 1px solid rgba(41, 92, 59, 0.08);
}

.filter-check input {
    accent-color: var(--primary);
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn-lux,
.btn-ghost,
.btn-icon {
    border: none;
    outline: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-lux {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 12px 30px rgba(41, 92, 59, 0.18);
    font-weight: 700;
    text-decoration: none;
}

.btn-lux:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(41, 92, 59, 0.24);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    color: var(--primary);
    border: 1px solid rgba(41, 92, 59, 0.15);
    text-decoration: none;
    font-weight: 700;
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: rgba(41, 92, 59, 0.06);
}

.section-card {
    padding: 22px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.section-head h2,
.section-head h3 {
    margin: 0;
    color: var(--text);
}

.section-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.result-meta {
    color: var(--text-soft);
    font-size: 0.95rem;
    font-weight: 700;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.product-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(41, 92, 59, 0.18);
}

.product-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f1ecdf, #f8f6ef);
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.product-card:hover .product-card__media img {
    transform: scale(1.06);
}

.product-card__badge-wrap {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.badge--discount {
    background: rgba(184, 92, 92, 0.92);
    color: #fff;
}

.badge--category {
    background: rgba(255,255,255,0.84);
    color: var(--primary);
    border: 1px solid rgba(41,92,59,0.08);
}

.product-card__content {
    padding: 18px 18px 16px;
}

.product-card__title {
    margin: 0 0 10px;
    font-size: 1.04rem;
    line-height: 1.7;
}

.product-card__title a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition);
}

.product-card__title a:hover {
    color: var(--primary);
}

.product-card__desc {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 0.92rem;
    min-height: 50px;
}

.product-card__footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.price-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-old {
    color: #9b9b9b;
    text-decoration: line-through;
    font-size: 0.92rem;
}

.price-final {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
}

.price-final small {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-soft);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
    transition: gap var(--transition), color var(--transition);
}

.link-arrow:hover {
    gap: 12px;
    color: var(--primary-2);
}

.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.pagination a,
.pagination span {
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    transition: var(--transition);
}

.pagination a:hover {
    background: rgba(41, 92, 59, 0.08);
    color: var(--primary);
}

.pagination .is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 10px 24px rgba(41,92,59,0.18);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-card__glow {
    position: absolute;
    inset: auto auto -60px -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(41,92,59,0.12), transparent 70%);
}

.category-card__icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(41,92,59,0.12), rgba(212,176,106,0.16));
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.category-card__title {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.15rem;
}

.category-card__meta {
    color: var(--text-soft);
    line-height: 1.8;
    margin: 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.06fr 0.94fr;
    gap: 24px;
    /* align-items: start; */
    margin-bottom: 26px;
}

.detail-gallery,
.detail-main {
    padding: 24px;
}

.detail-gallery__main {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(135deg, #f1ecdf, #f8f6ef);
    aspect-ratio: 1 / 1;
    margin-bottom: 14px;
}

.detail-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.detail-thumb {
    border: 1px solid transparent;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.detail-thumb.is-active,
.detail-thumb:hover {
    border-color: rgba(41, 92, 59, 0.24);
    box-shadow: 0 8px 20px rgba(41, 92, 59, 0.1);
}

.detail-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.breadcrumb-lux {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.breadcrumb-lux a {
    color: var(--text-soft);
    text-decoration: none;
}

.breadcrumb-lux a:hover {
    color: var(--primary);
}

.detail-title {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 2.6vw, 2.3rem);
    line-height: 1.45;
    color: var(--text);
}

.detail-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(41, 92, 59, 0.08);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.86rem;
}

.chip--accent {
    background: rgba(212, 176, 106, 0.18);
    color: #8b6a2f;
}

.detail-desc {
    color: var(--text-soft);
    line-height: 2;
    margin: 0 0 20px;
}

.detail-price-box {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(41,92,59,0.06), rgba(212,176,106,0.08));
    border: 1px solid rgba(41,92,59,0.08);
    margin-bottom: 18px;
}

.detail-price-box .price-final {
    font-size: 1.5rem;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.info-list {
    display: grid;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.66);
    border: 1px solid rgba(41,92,59,0.08);
}

.info-row span:first-child {
    color: var(--text-muted);
}

.info-row span:last-child {
    color: var(--text);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 44px 20px;
}

.empty-state__icon {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(41,92,59,0.1), rgba(212,176,106,0.14));
    color: var(--primary);
    font-size: 1.7rem;
}

.empty-state h3 {
    margin: 0 0 10px;
    color: var(--text);
}

.empty-state p {
    margin: 0 0 18px;
    color: var(--text-soft);
    line-height: 1.9;
}

.fade-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .product-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .filters-card {
        position: static;
    }

    .product-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .product-shell {
        width: min(100% - 20px, 100%);
    }

    .product-hero {
        padding: 24px 18px;
        border-radius: 24px;
    }

    .section-card,
    .filters-card,
    .detail-gallery,
    .detail-main,
    .empty-state {
        padding: 18px;
    }

    .product-grid,
    .category-grid,
    .detail-thumbs {
        grid-template-columns: 1fr;
    }

    .product-card__desc {
        min-height: auto;
    }

    .section-head {
        align-items: flex-start;
    }
}

.product-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 12px 26px rgba(41, 92, 59, 0.18);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(41, 92, 59, 0.24);
}

.detail-cart-form {
    margin: 0;
}

.detail-cart-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-quantity-input {
    width: 86px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(41, 92, 59, 0.16);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    text-align: center;
    font-weight: 800;
    outline: none;
    transition: var(--transition);
}

.cart-quantity-input:focus {
    border-color: rgba(41, 92, 59, 0.35);
    box-shadow: 0 0 0 4px rgba(41, 92, 59, 0.08);
}

.cart-nav-link {
    position: relative;
}

.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #e2c47f);
    color: #3f3117;
    font-size: 0.78rem;
    font-weight: 900;
    margin-right: 6px;
}

.ajax-add-to-cart-form.is-loading button {
    opacity: 0.72;
    pointer-events: none;
}

.cart-toast-wrap {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.cart-toast {
    min-width: 260px;
    max-width: min(360px, calc(100vw - 44px));
    padding: 14px 16px;
    border-radius: 18px;
    color: #fff;
    font-weight: 800;
    line-height: 1.8;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(14px);
    transition: 280ms ease;
    backdrop-filter: blur(14px);
}

.cart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cart-toast--success {
    background: linear-gradient(135deg, rgba(41, 92, 59, 0.94), rgba(60, 122, 82, 0.94));
}

.cart-toast--error {
    background: linear-gradient(135deg, rgba(184, 92, 92, 0.95), rgba(150, 60, 60, 0.95));
}


/* =========================
   Responsive Improvements
   ========================= */

/* General safety */
*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

.product-page {
    overflow-x: clip;
}

.product-shell,
.section-card,
.filters-card,
.detail-gallery,
.detail-main,
.product-card,
.empty-state {
    min-width: 0;
}

.product-layout,
.detail-layout,
.section-head,
.product-card__footer,
.detail-actions,
.detail-cart-controls,
.info-row {
    min-width: 0;
}

/* Better button behavior */
.btn-lux,
.btn-ghost {
    text-align: center;
    white-space: nowrap;
    font-family: 'Vazirmatn';
}

.btn-row > * {
    flex: 1 1 160px;
}

.product-card__title a,
.detail-title,
.info-row span,
.price-final,
.price-old,
.result-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Slightly better large tablet behavior */
@media (max-width: 1200px) {
    .product-shell {
        width: min(100% - 28px, 100%);
    }

    .product-layout {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

/* Tablet */
@media (max-width: 1100px) {
    .product-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .filters-card {
        position: static;
        top: auto;
        order: -1;
    }

    .product-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-layout {
        gap: 18px;
    }

    .detail-gallery,
    .detail-main {
        padding: 20px;
    }

    .detail-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Medium mobile / small tablets */
@media (max-width: 820px) {
    .product-page {
        padding: 20px 0 56px;
    }

    .product-shell {
        width: min(100% - 20px, 100%);
    }

    .product-hero {
        padding: 24px 20px;
        border-radius: 24px;
        margin-bottom: 18px;
    }

    .product-hero h1 {
        font-size: clamp(1.45rem, 6vw, 2rem);
        line-height: 1.45;
    }

    .product-hero p {
        font-size: 0.95rem;
        line-height: 1.9;
    }

    .section-card,
    .filters-card,
    .detail-gallery,
    .detail-main,
    .empty-state {
        padding: 18px;
        border-radius: 22px;
    }

    .filters-card__title {
        margin-bottom: 14px;
    }

    .filter-group {
        margin-bottom: 14px;
    }

    .filter-group input[type="text"],
    .filter-group select {
        height: 46px;
        font-size: 16px; /* جلوگیری از زوم iOS */
    }

    .filter-check {
        align-items: flex-start;
        gap: 8px;
    }

    .section-head {
        align-items: flex-start;
        margin-bottom: 16px;
    }

    .section-head h2,
    .section-head h3 {
        font-size: 1.15rem;
        line-height: 1.6;
    }

    .section-head p {
        font-size: 0.9rem;
    }

    .result-meta {
        font-size: 0.9rem;
    }

    .product-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .product-card {
        border-radius: 20px;
    }

    .product-card__content {
        padding: 14px;
    }

    .product-card__title {
        font-size: 0.98rem;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .product-card__desc {
        min-height: auto;
        font-size: 0.88rem;
        line-height: 1.7;
        margin-bottom: 12px;
    }

    .product-card__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .product-card__actions {
        width: 100%;
        justify-content: space-between;
    }

    .link-arrow {
        font-size: 0.92rem;
    }

    .badge {
        min-height: 28px;
        padding: 0 10px;
        font-size: 0.75rem;
    }

    .detail-title {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
        line-height: 1.6;
    }

    .detail-desc {
        font-size: 0.95rem;
        line-height: 1.95;
    }

    .detail-price-box {
        padding: 16px;
        gap: 10px;
    }

    .detail-price-box .price-final {
        font-size: 1.3rem;
    }

    .detail-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-actions > * {
        width: 100%;
    }

    .detail-cart-controls {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        width: 100%;
    }

    .cart-quantity-input {
        width: 100%;
        font-size: 16px; /* جلوگیری از زوم iOS */
    }

    .detail-cart-controls .btn-lux,
    .detail-actions .btn-ghost {
        width: 100%;
    }

    .info-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .pagination-wrap {
        margin-top: 22px;
    }

    .pagination {
        width: 100%;
        justify-content: center;
        padding: 10px;
        gap: 6px;
    }

    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 680px) {
    .product-shell {
        width: min(100% - 16px, 100%);
    }

    .product-page {
        padding: 16px 0 48px;
    }

    .product-hero {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .hero-kicker {
        font-size: 0.8rem;
        padding: 7px 12px;
        margin-bottom: 12px;
    }

    .product-hero h1 {
        margin-bottom: 8px;
        font-size: clamp(1.3rem, 6vw, 1.7rem);
    }

    .product-hero p {
        font-size: 0.92rem;
        line-height: 1.85;
    }

    .section-card,
    .filters-card,
    .detail-gallery,
    .detail-main,
    .empty-state {
        padding: 16px;
        border-radius: 18px;
    }

    .product-grid,
    .category-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* مهم: تامبنیل‌ها تو موبایل 1 ستونه نباشن */
    .detail-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .detail-thumb {
        border-radius: 12px;
    }

    .product-card__media {
        aspect-ratio: 1 / 1;
    }

    .product-card__badge-wrap {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .product-card__content {
        padding: 14px 14px 15px;
    }

    .price-old {
        font-size: 0.84rem;
    }

    .price-final {
        font-size: 1rem;
    }

    .price-final small {
        font-size: 0.72rem;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row > * {
        width: 100%;
        flex: 1 1 auto;
    }

    .btn-lux,
    .btn-ghost {
        width: 100%;
        min-height: 46px;
        padding: 0 14px;
    }

    .breadcrumb-lux {
        gap: 6px;
        font-size: 0.84rem;
        line-height: 1.8;
    }

    .detail-sub {
        gap: 8px;
        margin-bottom: 14px;
    }

    .chip {
        min-height: 30px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .detail-price-box {
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .detail-cart-controls {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .cart-quantity-input {
        height: 46px;
        border-radius: 12px;
    }

    .empty-state {
        padding: 32px 16px;
    }

    .empty-state__icon {
        width: 62px;
        height: 62px;
        border-radius: 18px;
        font-size: 1.45rem;
        margin-bottom: 14px;
    }

    .empty-state h3 {
        font-size: 1.05rem;
    }

    .empty-state p {
        font-size: 0.92rem;
        line-height: 1.8;
    }

    .cart-toast-wrap {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .cart-toast {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 14px;
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

/* Very small mobile */
@media (max-width: 420px) {
    .product-shell {
        width: min(100% - 12px, 100%);
    }

    .product-hero,
    .section-card,
    .filters-card,
    .detail-gallery,
    .detail-main,
    .empty-state {
        border-radius: 16px;
    }

    .product-hero {
        padding: 18px 14px;
    }

    .section-card,
    .filters-card,
    .detail-gallery,
    .detail-main,
    .empty-state {
        padding: 14px;
    }

    .product-card {
        border-radius: 18px;
    }

    .product-card__content {
        padding: 12px;
    }

    .product-card__title {
        font-size: 0.94rem;
    }

    .product-card__desc {
        font-size: 0.84rem;
    }

    .detail-title {
        font-size: 1.2rem;
    }

    .detail-desc {
        font-size: 0.9rem;
    }

    .detail-price-box .price-final {
        font-size: 1.15rem;
    }

    .detail-thumbs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pagination a,
    .pagination span {
        min-width: 34px;
        height: 34px;
        font-size: 0.84rem;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1.2rem;
    }
}

/* =========================
   Final Detail Gallery Responsive Fix
   ========================= */

/* Desktop detail gallery */
.detail-gallery {
    width: 100%;
    max-width: 700px;
    justify-self: center;
}

.detail-gallery__main {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    max-height: 520px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1ecdf, #f8f6ef);
}

.detail-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Tablet */
@media (max-width: 1100px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-gallery {
        width: min(100%, 640px);
        max-width: 640px;
        justify-self: center;
        margin-inline: auto;
    }

    .detail-gallery__main {
        aspect-ratio: auto;
        height: clamp(360px, 58vw, 520px);
        max-height: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .detail-gallery__main img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
    }

    .detail-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 680px) {
    .detail-gallery {
        width: min(100%, 460px);
        max-width: 460px;
        justify-self: center;
        margin-inline: auto;
    }

    .detail-gallery__main {
        height: clamp(280px, 78vw, 380px);
        border-radius: 18px;
    }

    .detail-gallery__main img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
    }

    .detail-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }
}

/* Very small mobile */
@media (max-width: 420px) {
    .detail-gallery {
        width: 100%;
        max-width: 100%;
    }

    .detail-gallery__main {
        height: clamp(250px, 82vw, 320px);
    }

    .detail-thumbs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --- quantity-input-group برای صفحه محصول --- */
.quantity-input-group {
    display: inline-flex;
    align-items: center;
    border: 2px solid rgba(41, 92, 59, 0.15);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.qty-btn {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    width: 42px;
    height: 48px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Vazirmatn';
    line-height: 1;
}

.qty-btn:hover {
    background: rgba(41, 92, 59, 0.08);
}

.detail-qty-input {
    width: 68px;
    text-align: center;
    border: none;
    outline: none;
    font-family: 'Vazirmatn';
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    background: transparent;
    padding: 0;
    height: 48px;
    -moz-appearance: textfield;
}

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

/* اگر توی موبایل layout عوض کردی، توی media queryها هم پهنای کامل رو بدیم */
@media (max-width: 820px) {
    .detail-cart-controls {
        grid-template-columns: 1fr;  /* کل کنترل‌ها تو یه خط */
    }
    .quantity-input-group {
        width: 100%;
        justify-content: space-between;
    }
    .detail-qty-input {
        width: 100%;
    }
}