/* ---------- ۱. متغیرهای اصلی تم ---------- */
:root {
    /* رنگ‌های اصلی - پالت صورتی ارغوانی */
    --primary-light: #FFD3D5;
    --primary-medium: #E49BA6;
    --primary-dark: #92487A;
    --primary-deep: #540863;
    --accent-gold: #D4AF37;

    /* پس‌زمینه‌ها */
    --bg-body: #FFD3D5;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* متن */
    --text-primary: #2C1810;
    --text-secondary: #5D4037;
    --text-muted: #B8B8B8;
    --text-light: #FFFFFF;

    /* خطوط و بوردر */
    --border-light: #F0D6D8;
    --border-medium: #E49BA6;

    /* سایه‌ها */
    --shadow-sm: 0 2px 8px rgba(228, 155, 166, 0.1);
    --shadow-md: 0 4px 16px rgba(228, 155, 166, 0.15);
    --shadow-lg: 0 8px 32px rgba(84, 8, 99, 0.1);

    /* وضعیت‌ها */
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --info: #2196F3;

    /* حاشیه‌ها */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* فاصله‌ها */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* تایپوگرافی */
    --font-family: 'Vazirmatn', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --font-size-2xl: 28px;

    /* ارتفاع‌های ثابت - کاهش یافته برای فشرده‌سازی */
    --header-height: 64px;        /* کاهش از 80px */
    --sticky-header-height: 44px; /* کاهش از 50px */
    --bottom-nav-height: 56px;    /* کاهش از 60px */

    --tap-scale: 0.98;
}

body.dark {
    --primary-light: #E5B7C4;
    --primary-medium: #D08897;
    --primary-dark: #A65A73;
    --primary-deep: #6B364A;
    --accent-gold: #E7C38C;
    --accent-pearl: #F4EFEA;
    --bg-body: #1A1717;
    --bg-surface: #221E1F;
    --bg-card: #2C2527;
    --bg-overlay: rgba(32, 26, 28, 0.75);
    --text-primary: #F6F0EF;
    --text-secondary: #D6C9C6;
    --text-muted: #9A8E8C;
    --text-light: #FFFFFF;
    --border-light: #3E3335;
    --border-medium: #D08897;
    --shadow-sm: 0 2px 10px rgba(208, 136, 151, 0.14);
    --shadow-md: 0 4px 22px rgba(167, 90, 115, 0.20);
    --shadow-lg: 0 8px 38px rgba(107, 54, 74, 0.32);
    --success: #6CCF7A;
    --warning: #E8B15A;
    --error: #E57373;
    --info: #8AB4F8;
}

/* ---------- ۲. ریست و پایه صفحه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

img {
    content-visibility: auto;
}

body {
    font-family: 'Vazirmatn', sans-serif !important;
    background-color: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: persian;
    -webkit-font-feature-settings: "ss01";
    font-feature-settings: "ss01";
}

/* اعداد فارسی برای المان‌های خاص */
.price, .count, .badge, .quantity, .total,
.current-price-advanced, .original-price-advanced,
#totalAmount, .cart-item-info span, .price-row span {
    font-variant-numeric: persian !important;
    font-feature-settings: "ss01" !important;
    font-family: 'Vazirmatn', sans-serif;
}

/* ---------- ۳. پرلودر ---------- */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

#preloader.hide {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-medium);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-lg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-title {
    font-size: var(--font-size-xl);
    color: var(--primary-deep);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

/* ---------- ۴. هدر اصلی (ثابت بالای صفحه) ---------- */
.main-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--primary-deep);
    width: 100%;
    max-width: 480px;
    height: var(--header-height); /* 64px */
    padding: 8px 16px; /* کاهش padding */
    color: var(--text-light);
    box-sizing: border-box;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

/* لوگو و برند در کنار هم (افقی) */
.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px; /* کاهش از 12px */
    flex: 1;
}

.brand-logo {
    height: 40px; /* کاهش از 50px */
    width: auto;
    max-width: 80px; /* کاهش از 100px */
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.brand h1 {
    font-size: 16px; /* کاهش از 18px */
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
}

.brand p {
    font-size: 10px; /* کاهش از 11px */
    color: rgba(255, 255, 255, 0.8);
    margin: 2px 0 0;
}

/* ---------- ۵. چیپ سبد خرید ---------- */
.cart-chip {
    background: var(--bg-surface);
    border: 2px solid var(--primary-medium);
    border-radius: var(--radius-full);
    padding: 6px 12px; /* کاهش padding */
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary-dark);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.cart-chip:active {
    transform: scale(0.95);
    background: var(--primary-medium);
    color: var(--bg-surface);
}

.cart-chip i {
    font-size: 18px; /* کاهش از 20px */
}

.badge {
    background: var(--accent-gold);
    color: var(--primary-deep);
    width: 20px; /* کاهش از 22px */
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px; /* کاهش از var(--font-size-xs) */
    font-weight: 700;
    position: absolute;
    top: -4px;
    left: -4px;
}

/* ---------- ۶. هدر استیکی ---------- */
#stickyHeader {
    position: fixed;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 100%;
    max-width: 480px;
    background: var(--primary-deep);
    padding: 4px 12px; /* کاهش padding */
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 999;
    box-sizing: border-box;
}

#stickyHeader.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sticky-brand-filters,
.sticky-category-filters {
    display: flex;
    gap: 6px; /* کاهش از var(--space-sm) */
    padding: 4px 0; /* کاهش از var(--space-xs) */
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.sticky-brand-filters::-webkit-scrollbar,
.sticky-category-filters::-webkit-scrollbar {
    display: none;
}

.sticky-filter-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 4px 12px; /* کاهش padding */
    font-size: 11px; /* کاهش از var(--font-size-xs) */
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 28px; /* کاهش از 36px */
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sticky-filter-btn i {
    font-size: 12px; /* کاهش از 14px */
    transition: color 0.2s ease;
}

.sticky-filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sticky-filter-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

.sticky-filter-btn.active {
    background: var(--primary-medium);
    color: var(--text-light);
    box-shadow: 0 3px 10px rgba(228, 155, 166, 0.4);
    border-color: var(--primary-medium);
}

.sticky-filter-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    border-radius: inherit;
}

/* ---------- ۷. لایه اصلی صفحه (محدود به عرض موبایل) ---------- */
.screen-wrapper {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-body);
    min-height: 100vh;
}

.screen {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-body);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
}

#stickyHeader.show ~ .screen {
    padding-top: calc(var(--header-height) + var(--sticky-header-height));
}

main {
    padding-bottom: var(--space-xl);
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    overscroll-behavior-y: contain;
}

/* ---------- ۸. بخش جستجو ---------- */
.search-section {
    padding: 8px 16px; /* کاهش از var(--space-md) var(--space-lg) */
}

.search-container {
    background: var(--bg-surface);
    border: 1px solid var(--primary-deep);
    border-radius: var(--radius-full);
    padding: 6px 14px; /* کاهش padding */
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.search-container:focus-within {
    border-color: var(--primary-medium);
    box-shadow: var(--shadow-md);
}

.search-container i {
    color: var(--primary-deep);
    font-size: 18px; /* کاهش از 20px */
}

.search-container input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px; /* کاهش از var(--font-size-base) */
    color: var(--text-primary);
    font-family: var(--font-family);
    outline: none;
}

.search-container input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

/* ---------- ۹. بخش پروموشن ---------- */
.promotion-section {
    padding: 0 16px 10px; /* کاهش padding */
}

.promotion-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-deep));
    border-radius: var(--radius-lg);
    min-height: 100px; /* کاهش از 160px */
    display: flex;
    flex-direction: row-reverse;
    margin-top: 6px; /* کاهش از 10px */
    position: relative;
    overflow: visible;
}

.promotion-content {
    padding: 10px 14px; /* کاهش padding */
    color: var(--text-light);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.promotion-content h3 {
    font-size: 16px; /* کاهش از var(--font-size-lg) */
    margin-bottom: 4px; /* کاهش از var(--space-sm) */
    font-weight: 600;
}

.promotion-content p {
    font-size: 12px; /* کاهش از var(--font-size-sm) */
    margin-bottom: 8px; /* کاهش از var(--space-md) */
    opacity: 0.9;
}

.promotion-btn {
    background: #FFC85B;
    color: var(--primary-deep);
    border: none;
    border-radius: var(--radius-full);
    padding: 5px 14px; /* کاهش padding */
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: all 0.2s ease;
    font-size: 12px; /* کاهش از var(--font-size-sm) */
    text-decoration: none;
}

.promotion-btn:active {
    transform: scale(0.95);
}

.promotion-image {
    height: 90px; /* کاهش از 130px */
    width: 90px; /* کاهش از 130px */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    background: transparent;
    margin: 6px; /* کاهش از 10px */
    border-radius: 10px;
}

.promotion-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 10px;
}

/* ---------- ۱۰. فیلتر برندها (اسکرول افقی) ---------- */
.brands-filter {
    padding: 0 16px 10px; /* کاهش padding */
    margin-bottom: 0; /* حذف فاصله اضافی */
}

.brands-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* کاهش از var(--space-md) */
}

.section-title {
    font-size: 16px; /* کاهش از var(--font-size-lg) */
    font-weight: 600;
    color: var(--primary-deep);
}

.view-all-brands,
.view-all-categories,
.view-all-btn {
    background: var(--primary-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 2px 10px; /* کاهش padding */
    font-size: 11px; /* کاهش از var(--font-size-xs) */
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-all-brands:active,
.view-all-categories:active,
.view-all-btn:active {
    background: var(--primary-medium);
    color: var(--text-light);
}

.view-all-btn.active {
    background: var(--primary-deep);
    color: var(--text-light);
    border-color: var(--primary-medium);
    box-shadow: 0 2px 8px rgba(228, 155, 166, 0.3);
}

.brands-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px; /* کاهش از 15px */
    padding: 8px 0; /* کاهش از 12px */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    min-height: 85px; /* کاهش از 110px */
}

.brands-grid::-webkit-scrollbar {
    display: none;
}

/* استایل اصلی برندها */
.brand-item {
    flex: 0 0 auto;
    width: 80px; /* کاهش از 100px */
    min-height: 80px; /* کاهش از 100px */
    padding: 6px; /* کاهش از 10px */
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    overflow: visible !important;
}

.brand-item:active {
    transform: scale(0.95);
}

.brand-item.active {
    border-color: var(--primary-medium);
    background: rgba(228, 155, 166, 0.05);
    box-shadow: 0 4px 12px rgba(228, 155, 166, 0.15);
}

.brand-logo-container {
    width: 48px; /* کاهش از 60px */
    height: 48px; /* کاهش از 60px */
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px; /* کاهش از 8px */
    border: 2px solid var(--primary-medium);
    background: white;
    padding: 2px; /* کاهش از 3px */
}

.brand-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-icon-container {
    width: 48px; /* کاهش از 60px */
    height: 48px; /* کاهش از 60px */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-medium));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px; /* کاهش از 8px */
    border: 2px solid var(--primary-medium);
}

.brand-icon-container i {
    font-size: 20px; /* کاهش از 24px */
    color: white;
}

.brand-title {
    font-size: 11px; /* کاهش از 12px */
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
    text-align: center;
    max-width: 76px; /* کاهش از 90px */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* برند "همه" */
.brand-item[data-id="0"] {
    background: rgba(93, 134, 108, 0.05);
    border: 2px dashed var(--primary-medium);
}

.brand-item[data-id="0"] .brand-icon-container {
    background: var(--primary-deep);
    border-color: var(--primary-deep);
}

.brand-item[data-id="0"] .brand-title {
    color: var(--primary-deep);
    font-weight: 600;
}

.brand-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ---------- ۱۱. فیلتر دسته‌بندی‌ها (اسکرول افقی) ---------- */
.categories-filter {
    padding: 0 16px 10px; /* کاهش padding */
    margin-top: 0; /* حذف فاصله اضافی */
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* کاهش از var(--space-md) */
}

.categories-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px; /* کاهش از 10px */
    padding: 8px 0; /* کاهش از 12px */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.categories-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex: 0 0 auto;
    min-width: 80px; /* کاهش از 100px */
    padding: 6px 10px; /* کاهش padding */
    background: var(--primary-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: all 0.2s ease;
}

.category-tab:active {
    transform: scale(0.95);
}

.category-tab.active {
    background: var(--primary-deep);
    color: var(--text-light);
    border-color: var(--primary-medium);
}

.category-tab i {
    font-size: 16px; /* کاهش از 20px */
    color: var(--text-light);
}

.category-tab span {
    font-size: 11px; /* کاهش از var(--font-size-xs) */
    font-weight: 500;
}

/* ---------- ۱۲. لیست محصولات ---------- */
.products-container {
    padding: 0 12px 16px; /* کاهش padding */
}

.products-header {
    margin-bottom: 10px; /* کاهش از var(--space-md) */
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; /* کاهش از 16px */
    padding: 0 4px; /* کاهش از 8px */
}

.product-card-advanced {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.product-card-advanced:active {
    transform: scale(0.99);
}

.product-card-advanced .product-content-advanced {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-advanced .product-footer-advanced {
    margin-top: auto;
}

.product-image-container {
    position: relative;
    height: 160px; /* کاهش از 200px */
    overflow: hidden;
    background: linear-gradient(135deg, #f8f0f5 0%, #fef7fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.status-badges {
    position: absolute;
    top: 10px; /* کاهش از var(--space-md) */
    right: 10px; /* کاهش از var(--space-md) */
    display: flex;
    flex-direction: column;
    gap: 4px; /* کاهش از var(--space-xs) */
    z-index: 2;
}

.status-badge {
    padding: 3px 8px; /* کاهش padding */
    border-radius: var(--radius-sm);
    font-size: 9px; /* کاهش از 10px */
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 50px; /* کاهش از 60px */
}

.status-badge.discount {
    background: linear-gradient(135deg, var(--primary-deep), #7a3a9c);
    color: var(--text-light);
}

.status-badge.out-of-stock {
    background: rgba(231, 76, 60, 0.95);
    color: var(--text-light);
}

.product-content-advanced {
    padding: 10px 12px; /* کاهش از var(--space-md) */
}

.product-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px; /* کاهش از var(--space-sm) */
}

.product-brand-advanced {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px; /* کاهش padding */
    background: rgba(148, 72, 122, 0.08);
    color: var(--primary-dark);
    border-radius: var(--radius-full);
    font-size: 9px; /* کاهش از 10px */
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(148, 72, 122, 0.15);
}

.product-category-advanced {
    font-size: 9px; /* کاهش از 10px */
    color: var(--primary-medium);
    background: rgba(0, 0, 0, 0.03);
    padding: 2px 6px; /* کاهش padding */
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 3px;
}

.product-name-advanced {
    font-size: 14px; /* کاهش از var(--font-size-base) */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px; /* کاهش از var(--space-sm) */
    line-height: 1.4;
    min-height: 36px; /* کاهش از 44px */
}

.product-description-advanced {
    font-size: 12px; /* کاهش از var(--font-size-sm) */
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px; /* کاهش از var(--space-md) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer-advanced {
    display: flex;
    flex-direction: column;
    gap: 8px; /* کاهش از var(--space-md) */
}

.price-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.original-price-advanced {
    font-size: 12px; /* کاهش از var(--font-size-sm) */
    color: var(--text-muted);
    text-decoration: line-through;
}

.current-price-advanced {
    font-size: 18px; /* کاهش از var(--font-size-xl) */
    font-weight: 800;
    color: var(--primary-deep);
    letter-spacing: -0.3px;
}

.cart-btn-section {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    justify-content: space-around;
}

.add-to-cart-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-deep));
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-md);
    padding: 6px 10px; /* کاهش padding */
    font-size: 12px; /* کاهش از var(--font-size-sm) */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: 32px; /* کاهش از 36px */
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

.add-to-cart-btn.disabled-btn {
    background: #e0e0e0;
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

.quantity-controls-compact {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    height: 32px; /* کاهش از auto */
}

.qty-btn {
    width: 30px; /* کاهش از 36px */
    height: 30px; /* کاهش از 36px */
    border: none;
    background: transparent;
    color: var(--primary-medium);
    font-size: 16px; /* کاهش از var(--font-size-lg) */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:active {
    background: rgba(228, 155, 166, 0.1);
}

.qty-value {
    min-width: 24px; /* کاهش از 30px */
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px; /* کاهش از var(--font-size-sm) */
}

/* انیمیشن‌ها */
@keyframes cartShake {
    0% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-3px) rotate(-5deg); }
    50% { transform: translateX(3px) rotate(5deg); }
    75% { transform: translateX(-2px) rotate(-3deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.cart-shake {
    animation: cartShake 0.4s ease;
    display: inline-block;
}

@keyframes scalePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-btn-section.updated {
    animation: scalePulse 0.3s ease;
}

.qty-value.changed {
    color: var(--primary-medium);
    font-weight: bold;
    animation: numberChange 0.3s ease;
}

@keyframes numberChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ---------- ۱۳. حالت خالی (empty state) ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

.empty-state i {
    font-size: 48px;
    color: var(--border-light);
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-md);
}

/* ---------- ۱۴. ناوبری پایین (bottom nav) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--primary-deep);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    z-index: 1000;
    height: var(--bottom-nav-height); /* 56px */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px; /* کاهش از 4px */
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 10px; /* کاهش از var(--font-size-xs) */
    transition: all 0.2s ease;
    padding: 4px 8px; /* کاهش padding */
    border-radius: var(--radius-sm);
    flex: 1;
    max-width: 80px; /* کاهش از 100px */
}

.nav-item.active {
    color: var(--primary-medium);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item i {
    font-size: 18px; /* کاهش از 20px */
}

/* ---------- ۱۵. فوتر اصلی ---------- */
.main-footer {
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    color: var(--primary-deep);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-lg);
    width: 100%;
    max-width: 480px;
    margin: var(--space-lg) auto 0;
}

/* ---------- ۱۶. دراور سبد خرید ---------- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--bg-surface);
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.cart-drawer.open {
    right: 0;
}

@media (max-width: 480px) {
    .cart-drawer {
        width: 100vw;
        max-width: 100%;
        left: 0;
        transform: none;
    }
}

.drawer-header {
    padding: var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 1;
}

.drawer-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--text-primary);
}

#closeCartBtn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#closeCartBtn:active {
    background: var(--bg-body);
    color: var(--primary-medium);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.cart-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 75px;
    height: 75px;
    min-width: 75px;
    min-height: 75px;
    object-fit: contain;
    background: linear-gradient(135deg, #f8f0f5 0%, #fef7fa 100%);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(228, 155, 166, 0.2);
    box-sizing: border-box;
    display: block;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-body);
    border-radius: var(--radius-full);
    padding: 4px 8px;
}

.qty-controls button {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-medium);
    font-size: var(--font-size-lg);
    transition: all 0.2s ease;
}

.qty-controls button:active {
    background: var(--primary-medium);
    color: var(--bg-surface);
}

.qty-controls span {
    min-width: 24px;
    text-align: center;
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.drawer-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
}

.total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-lg);
}

.total-price span:first-child {
    color: var(--text-primary);
}

.total-price span:last-child {
    color: var(--primary-dark);
    font-weight: 600;
}

.checkout-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--primary-medium);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-btn:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.social-checkout-options {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border-light);
}

.social-checkout-options p {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

.social-icons-row {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin: var(--space-md) 0;
}

.social-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-icon-btn:active {
    transform: scale(0.95);
}

.whatsapp-icon { background: #25D366; }
.instagram-icon { background: linear-gradient(135deg, #833AB4, #E1306C); }
.telegram-icon { background: #26A5E4; }
.bale-icon { background: #2C3E50; }

/* ---------- ۱۷. صفحات ثانویه (درباره ما - نظرات) ---------- */
.sub-hero {
    background: var(--bg-surface);
    margin: var(--space-lg);
    margin-bottom: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.hero-label {
    font-size: var(--font-size-sm);
    color: var(--primary-medium);
    margin-bottom: 4px;
    font-weight: 500;
}

.hero-title.small {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.hero-desc {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.5;
}

.back-link {
    background: var(--primary-deep);
    color: var(--text-light);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.back-link:active {
    transform: scale(0.95);
}

.secondary-content {
    padding: 0 var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.about-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.about-panel h2 {
    font-size: var(--font-size-lg);
    color: var(--primary-deep);
    font-weight: 600;
    margin: 0;
}

.center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    min-width: 100px;
    box-shadow: var(--shadow-sm);
}

.stat-card .farsi-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-deep);
}

.highlights-list {
    list-style: none;
    padding: 0;
}

.highlights-list li {
    margin-bottom: 8px;
    padding-right: 20px;
    position: relative;
}

.highlights-list li::before {
    content: "✓";
    color: var(--primary-medium);
    position: absolute;
    right: 0;
}

/* شبکه‌های اجتماعی در درباره ما */
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    color: white;
}

.social-btn i {
    font-size: 18px;
}

.social-btn.instagram {
    background: linear-gradient(135deg, #833AB4, #E1306C);
}
.social-btn.whatsapp {
    background: #25D366;
}
.social-btn.telegram {
    background: #26A5E4;
}
.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.social-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .social-buttons {
        flex-direction: column;
    }
    .social-btn {
        justify-content: center;
    }
}

/* ---------- ۱۸. صفحه نظرات ---------- */
.reviews-page {
    padding: 20px;
}

.review-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ---------- ۱۹. صفحه لندینگ (در صورت استفاده) ---------- */


/* ---------- ۲۰. رسپانسیو و تنظیمات نهایی ---------- */
@media (max-width: 360px) {
    :root {
        --font-size-xs: 11px;
        --font-size-sm: 13px;
        --font-size-base: 15px;
        --font-size-lg: 17px;
        --font-size-xl: 20px;
        --font-size-2xl: 24px;
    }
    .brand-item {
        width: 70px; /* کاهش بیشتر */
    }
}

@media (min-width: 481px) {
    body {
        background: #f5f5f5;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 20px;
    }
    .screen {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        border-radius: 20px;
        overflow: hidden;
    }
    .main-header, #stickyHeader, .bottom-nav {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    body {
        background: var(--bg-body) linear-gradient(
            to bottom,
            var(--primary-light) 0%,
            var(--bg-body) 100px
        );
    }
    .social-buttons {
        flex-direction: column;
    }
    .social-btn {
        justify-content: center;
    }
}

@media (max-width: 320px) {
    .promotion-card {
        flex-direction: column;
        min-height: auto;
    }
    .promotion-image {
        width: 100%;
        height: 80px; /* کاهش */
        order: -1;
    }
}

@supports (padding: max(0px)) {
    .main-header, .bottom-nav {
        padding-left: max(var(--space-lg), env(safe-area-inset-left));
        padding-right: max(var(--space-lg), env(safe-area-inset-right));
    }
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-medium);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.no-scroll {
    overflow: hidden;
}
.hidden {
    display: none !important;
}

/* انیمیشن‌های عمومی */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.fade-in {
    animation: fadeIn 0.3s ease;
}
.slide-up {
    animation: slideUp 0.3s ease;
}

/* ---------- دکمه جزئیات روی کارت محصول ---------- */
.product-info-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary-dark);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.9;
    transition: all 0.2s ease;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.product-info-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: var(--primary-medium);
}

.product-info-btn i {
    font-size: 16px;
}

/* ---------- مودال محصول ---------- */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.product-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding: 25px;
    z-index: 100001;
    animation: modalFadeIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes modalFadeIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    left: 15px;
    top: 15px;
    background: var(--primary-deep);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100002;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.modal-header-content {
    margin-bottom: 15px;
    text-align: center;
}

.modal-header-content h3 {
    font-size: var(--font-size-xl);
    color: var(--primary-deep);
    margin: 0;
}

.modal-image-container {
    text-align: center;
    margin-bottom: 15px;
}

.modal-image-container img {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.modal-description {
    line-height: 1.8;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    text-align: justify;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.share-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.share-title {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.share-btn i {
    font-size: 16px;
}

.share-btn.copy-link {
    background: var(--primary-deep);
    color: white;
}

.share-btn.copy-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.share-btn.telegram {
    background: #0088cc;
    color: white;
}

.share-btn.telegram:hover {
    background: #006699;
    transform: translateY(-2px);
}

.share-btn.whatsapp {
    background: #25D366;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #20bd5a;
    transform: translateY(-2px);
}

/* پیام toast برای کپی لینک */
.toast-message {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-deep);
    color: white;
    padding: 12px 25px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    z-index: 100002;
    animation: toastFade 2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid white;
    text-align: center;
}

@keyframes toastFade {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}
