/* ==========================================
   نیازی نو — استایل مشترک همه صفحات
   ========================================== */

:root {
    --primary: #00A3E0;
    --primary-dark: #0077A3;
    --primary-light: rgba(0, 163, 224, 0.08);
    --accent: #FF6600;
    --accent-hover: #E05500;
    --accent-light: rgba(255, 102, 0, 0.08);
    --navy: #0F172A;
    --navy-2: #1E293B;
    --bg-light: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --footer-bg: #0B0F17;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 4px 20px rgba(0,0,0,0.03);
    --shadow-md: 0 12px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 70px;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    body { padding-bottom: 0; }
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul { list-style: none; }

img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   هدر و نوار بالای سایت
   ========================================== */
.topbar {
    background-color: var(--footer-bg);
    color: #94A3B8;
    padding: 8px 0;
    font-size: 0.85rem;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
    gap: 16px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo span { color: var(--primary); }

/* لوگوی تصویری نیازی نو */
.logo-brand { display: flex; align-items: center; }
.logo-img {
    height: 50px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
@media (max-width: 576px) {
    .logo-img { height: 40px; }
}
@media (min-width: 577px) and (max-width: 991px) {
    .logo-img { height: 46px; }
}

/* لوگو در فوتر — بدون باکس سفید */
.footer-logo { display: inline-block; margin-bottom: 14px; }
.footer-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
    /* بدون پس‌زمینه سفید */
}

.nav-menu { display: none; }

@media (min-width: 992px) {
    .nav-menu {
        display: flex;
        gap: 25px;
        flex: 1;
        justify-content: center;
        align-items: center;
        /* در RTL، لوگو سمت راست است. برای نزدیک‌تر شدن منو به لوگو،
           margin-right منفی می‌دهیم تا منو به سمت لوگو (راست) شیفت پیدا کند */
        margin-right: -60px;
    }
    .nav-link {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-main);
        padding: 8px 0;
        transition: color 0.2s;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .nav-link:hover, .nav-link.active {
        color: var(--primary);
    }
}


/* ==========================================
   دکمه‌ها
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.btn-primary { background-color: var(--primary); color: #FFF; }
.btn-primary:hover { background-color: var(--primary-dark); }

.btn-accent { background-color: var(--accent); color: #FFF; }
.btn-accent:hover { background-color: var(--accent-hover); }

.btn-outline {
    background-color: #FFF;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background-color: var(--primary); color: #FFF; }

.btn-outline-accent {
    background-color: #FFF;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-outline-accent:hover { background-color: var(--accent); color: #FFF; }

.btn-ghost {
    background-color: rgba(0, 163, 224, 0.08);
    color: var(--primary);
}
.btn-ghost:hover { background-color: var(--primary); color: #FFF; }

.btn-block { width: 100%; }

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

.mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    color: var(--navy);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (min-width: 992px) {
    .mobile-menu-btn { display: none; }
}

/* ==========================================
   عنوان صفحات (Page Banner / Breadcrumb)
   ========================================== */
.page-banner {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #FFF;
    padding: 50px 0 40px;
    position: relative;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(0, 163, 224, 0.1);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    top: -150px; left: -100px;
    animation: shapeRotate 35s infinite linear;
}

.page-banner::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(255, 102, 0, 0.08);
    border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
    bottom: -100px; right: -80px;
    animation: shapeRotate 40s infinite linear reverse;
}

@keyframes shapeRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* انیمیشن نرم‌تر برای page-banner */
.page-banner::before,
.page-banner::after {
    animation-timing-function: ease-in-out;
}

.page-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.page-banner h1 {
    font-size: 1.9rem;
    font-weight: 900;
    color: #FFF;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .page-banner h1 { font-size: 2.3rem; }
}

.page-banner p {
    color: #94A3B8;
    font-size: 0.95rem;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #94A3B8;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { color: #FFF; }
.breadcrumb .sep { color: #475569; }
.breadcrumb .current { color: #FFF; font-weight: 600; }

/* ==========================================
   عنوان بخش مشترک
   ========================================== */
.category-section { padding: 50px 0; }

.category-main-title {
    text-align: center;
    margin-bottom: 30px;
}

.category-main-title h2 {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--navy);
    display: inline-block;
    position: relative;
    padding-bottom: 12px;
}

.category-main-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 4px;
}

.category-main-title p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 10px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   فوتر
   ========================================== */
.footer {
    background-color: var(--footer-bg);
    color: #94A3B8;
    padding: 55px 0 25px 0;
    font-size: 0.88rem;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-col h3 {
    color: #FFF;
    font-size: 1.1rem;
    margin-bottom: 18px;
    border-right: 4px solid var(--primary);
    padding-right: 10px;
    font-weight: 800;
}

.footer-col p { line-height: 1.7; margin-bottom: 8px; }
.footer-col a { color: #94A3B8; display: inline-block; margin-bottom: 8px; }
.footer-col a:hover { color: #FFF; }

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.footer-social a {
    width: 38px; height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    margin: 0;
}

.footer-social a:hover { background: var(--primary); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    text-align: center;
    color: #64748B;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-bottom > div {
    text-align: center;
}

/* ==========================================
   نماد اعتماد الکترونیکی (اینماد) — فوتر صفحات عمومی
   ========================================== */
.footer-enamad {
    margin-top: 6px;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 6px;
    line-height: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-enamad a {
    display: inline-block;
    line-height: 0;
    border-radius: 8px;
}

.footer-enamad img {
    width: 88px;
    height: auto;
    border-radius: 6px;
    display: block;
}

.footer-enamad:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

@media (max-width: 480px) {
    .footer-enamad img { width: 76px; }
}

/* ==========================================
   نوار پایین موبایل + منوی کشویی
   ========================================== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 65px;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

@media (min-width: 992px) { .bottom-nav { display: none; } }

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 20%;
}

.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--primary); }

.offcanvas {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    background-color: #FFF;
    z-index: 3000;
    transition: right 0.3s ease;
    padding: 25px 20px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.offcanvas.open { right: 0; }

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.offcanvas-close {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.4rem;
    cursor: pointer;
}

.offcanvas-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.offcanvas-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-link.active { color: var(--primary); }
.offcanvas-link:hover { color: var(--primary); padding-right: 6px; }

.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    z-index: 2500;
    display: none;
}

.overlay.active { display: block; }

/* ==========================================
   کارت‌های مشترک
   ========================================== */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* ==========================================
   فیلدهای فرم مشترک
   ========================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.form-label .req { color: var(--accent); }

.form-control {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background-color: #FFF;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.12);
}

textarea.form-control { resize: vertical; min-height: 110px; }

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748B'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 14px;
    appearance: none;
    padding-left: 40px;
}

/* فیلد روی پس‌زمینه تیره */
.qc-input, .qc-select {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid #334155;
    background-color: rgba(15, 23, 42, 0.6);
    color: #FFFFFF;
    font-size: 0.92rem;
    outline: none;
}

/* ==========================================
   پیام‌های اعلان (Alert / Badge)
   ========================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.alert-info {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid rgba(0, 163, 224, 0.25);
}

.alert-warning {
    background-color: var(--accent-light);
    color: var(--accent-hover);
    border: 1px solid rgba(255, 102, 0, 0.25);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.08);
    color: #15803D;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-accent { background: var(--accent-light); color: var(--accent-hover); }
.badge-success { background: rgba(34, 197, 94, 0.12); color: #15803D; }
.badge-muted { background: #F1F5F9; color: var(--text-muted); }

/* ==========================================
   کارت محصول (شبکه فروشگاه)
   ========================================== */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

@media (min-width: 576px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1400px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
    background-color: #FFF;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-md);
        border-color: rgba(0, 163, 224, 0.4);
    }
}

.product-img-box {
    position: relative;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #F1F5F9 0%, #E0F2FE 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.product-img-box img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
}

.product-card:active .product-img-box img {
    transform: scale(1.02);
}

@media (hover: hover) {
    .product-card:hover .product-img-box img {
        transform: scale(1.05);
    }
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: var(--accent);
    color: #FFF;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Pin badge — for products the admin has pinned to the top of /shop.
   Sits on the left side of the image so it doesn't clash with .product-badge
   (which sits on the right). Uses the primary brand color so it stands out
   without overwhelming the existing badge. */
.product-badge-pin {
    top: 12px;
    right: auto;
    left: 12px;
    background: var(--primary);
    color: #FFF;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Subtle outline on pinned cards so they're recognizable even when the
   pin badge is below the fold. */
.product-card-pinned {
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 163, 224, 0.10);
}

.product-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}

.product-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.6;
    flex: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.product-price {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--navy);
}

.product-price .currency {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 4px;
}

.product-footer {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.product-footer .btn {
    flex: 1;
    padding: 9px 14px;
    font-size: 0.82rem;
}

/* ==========================================
   تب‌ها
   ========================================== */
.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 22px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0; left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after { transform: scaleX(1); }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   استپ‌ها (Stepper)
   ========================================== */
.steps-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    position: relative;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.steps-bar::before {
    content: '';
    position: absolute;
    top: 22px;
    right: 30px; left: 30px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-circle {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #FFF;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFF;
    box-shadow: 0 0 0 6px rgba(0, 163, 224, 0.15);
}

.step-item.done .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFF;
}

.step-item.done .step-circle::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.step-item.done .step-circle .step-num { display: none; }

.step-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.step-item.active .step-label,
.step-item.done .step-label { color: var(--primary); }

/* ==========================================
   جدول‌ها
   ========================================== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFF;
    min-width: 600px;
}

.data-table thead {
    background: var(--navy);
    color: #FFF;
}

.data-table th {
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.88rem;
    color: var(--text-main);
    border-top: 1px solid var(--border-color);
}

.data-table tbody tr:hover { background: var(--primary-light); }

/* ==========================================
   utilities
   ========================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.fw-bold { font-weight: 800; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 20px; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 18px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
    border: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 18px;
}

.empty-state h3 {
    color: var(--navy);
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ==========================================
   ماژول انتخاب سایز
   ========================================== */
.size-option {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: #FFF;
    font-weight: 700;
    color: var(--navy);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-size: 0.9rem;
}

.size-option:hover { border-color: var(--primary); color: var(--primary); }
.size-option.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFF;
    box-shadow: 0 6px 14px rgba(0, 163, 224, 0.3);
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

/* استپ آیتم تعداد */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #FFF;
}

.qty-stepper button {
    width: 42px;
    height: 42px;
    border: none;
    background: #FFF;
    color: var(--navy);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-stepper button:hover { background: var(--primary-light); color: var(--primary); }

.qty-stepper input {
    width: 56px;
    height: 42px;
    border: none;
    text-align: center;
    font-weight: 800;
    color: var(--navy);
    font-size: 1rem;
    outline: none;
    background: #FFF;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* ==========================================
   استایل‌های گالری محصول
   ========================================== */
.product-gallery-main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #F1F5F9 0%, #E0F2FE 100%);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.product-gallery-main img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 24px rgba(0,0,0,0.18));
    transition: transform 0.4s ease;
}

.product-gallery-main:hover img { transform: scale(1.04); }

.product-gallery-badge {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 3;
    background: var(--accent);
    color: #FFF;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 80px; height: 80px;
    border-radius: 12px;
    background: var(--bg-light);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    overflow: hidden;
    padding: 6px;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.gallery-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Rating stars */
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-rating .stars { color: #F59E0B; }

/* Discount tag */
.discount-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-light);
    color: var(--accent-hover);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 8px;
}

/* School badge in cart item */
.cart-item-school {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.size-pill {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Hide on mobile utility */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

/* Cart badge pulse animation */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.4); }
}

/* Fly to cart animation */
.fly-to-cart {
    position: fixed;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.6, 1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    border: 2px solid #FFF;
}

/* ==========================================
   استایل آیکون‌های فیلتر در سایدبار فروشگاه
   ========================================== */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Empty state for cart */
.empty-cart-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 18px;
}

/* Image zoom overlay */
.image-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.image-zoom-overlay.show { display: flex; animation: fadeIn 0.3s ease; }

.image-zoom-overlay img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.zoom-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent);
    color: #FFF;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
