:root {
    --primary: #0284c7;
    --primary-dark: #075985;
    --primary-light: #e0f2fe;
    --text: #1e293b;
    --text-muted: #64748b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --sidebar-w: 290px;
    --header-h: 68px;
    --success: #059669;
    --danger: #ef4444;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ساختار کلی پوسته */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* هدر اصلی بالای صفحه */
.site-header {
    background: #ffffff;
    height: var(--header-h);
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.site-header .inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.site-header h1 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-dark);
}

.site-header p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.badge-stock-count {
    font-size: 0.82rem;
    background: #dcfce7;
    color: #166534;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid #bbf7d0;
}

/* دکمه همبرگری منو در موبایل */
.menu-hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}

.menu-hamburger-btn:hover {
    background: #f1f5f9;
}

/* بخش بدنه: سایدبار راست + محتوای سمت چپ */
.app-body {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-h));
    position: relative;
}

/* سایدبار سمت راست */
.app-sidebar {
    width: var(--sidebar-w);
    background: #ffffff;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 995;
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
}

.sidebar-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-heading {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* بخش‌های فرم فیلتر در سایدبار */
.sidebar-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.filter-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* چیپ‌های سایز در سایدبار */
.sizes-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.size-chip-item {
    cursor: pointer;
}

.size-chip-item input {
    display: none;
}

.size-chip-item span {
    display: inline-block;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text);
    transition: all 0.2s;
    user-select: none;
}

.size-chip-item input:checked + span {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: bold;
}

.btn-clear-filters {
    width: 100%;
    padding: 0.55rem;
    background: #fff;
    color: var(--danger);
    border: 1px dashed var(--danger);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-clear-filters:hover {
    background: #fef2f2;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.2rem 0;
}

.sidebar-title {
    font-size: 0.78rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0 0.25rem 0.5rem;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav a .nav-icon {
    font-size: 1.1rem;
}

.sidebar-nav a:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: bold;
}

/* اوورلی پس‌زمینه برای موبایل */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    z-index: 990;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* بخش اصلی باز شدن صفحات */
.app-content {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1.5rem;
}

/* گرید کالاهای فروشگاه */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-nav {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 2;
}

.img-nav button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 0;
}

.img-nav button.active {
    background: var(--primary);
}

.main-badge-tag {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: rgba(2, 132, 199, 0.9);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.img-count-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background-color: rgba(30, 41, 59, 0.75);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 2;
}

.card-body {
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.card-body h2 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.45;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.meta-tag {
    font-size: 0.68rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
}

.variant-price-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border);
}

.variant-price-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fraction-tag {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 32px;
    line-height: 1.2;
}

.fraction-num {
    font-size: 0.68rem;
    font-weight: bold;
    color: var(--text);
    border-bottom: 1.5px solid #64748b;
    width: 100%;
    text-align: center;
}

.fraction-den {
    font-size: 0.68rem;
    font-weight: bold;
    color: var(--primary);
    width: 100%;
    text-align: center;
}

.fraction-den.out-of-stock {
    color: var(--danger);
}

/* عدم نمایش سایزهای ناموجود به‌صورت دائمی */
body.hide-zero-sizes .fraction-tag.is-zero-stock,
body.hide-zero-sizes .is-no-fee {
    display: none !important;
}

.price-text {
    font-weight: bold;
    color: var(--success);
    font-size: 0.82rem;
    margin-right: auto;
}

.stock-status {
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

.stock-status.in {
    background: #dcfce7;
    color: #166534;
}

.no-items-message {
    grid-column: 1 / -1;
    text-align: center;
    color: #777;
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* فوتر سایت */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    margin-top: auto;
}

.site-footer .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.page-loader {
    display: none;
    text-align: center;
    padding: 3rem 0;
    color: var(--primary);
    font-size: 1rem;
}

/* مودال پیش‌نمایش تصویر */
#imgModal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 3rem;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    text-align: center;
}

#imgModal img {
    max-width: 92%;
    max-height: 82vh;
    border-radius: 6px;
}

#modalClose {
    position: absolute;
    top: 12px;
    right: 24px;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
}

/* واکنش‌گرایی */
@media (max-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .menu-hamburger-btn {
        display: inline-flex;
    }
    .sidebar-close-btn {
        display: block;
    }
    .app-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        transform: translateX(100%);
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.15);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-content {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    .site-header h1 {
        font-size: 1.05rem;
    }
    .site-footer .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
/* =========================================
   استایل‌های اختصاصی صفحه اول (home.php)
   ========================================= */

.home-landing-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

/* ۱. بنرهای دوتایی بالای صفحه (Hero Split) */
.home-hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.hero-split-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-split-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.hero-clothing {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    border-color: #fed7aa;
}

.hero-bags {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}

.hero-card-content {
    flex: 1;
    z-index: 2;
}

.hero-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: inline-block;
    margin-bottom: 0.4rem;
}

.hero-card-content h2 {
    font-size: 1.35rem;
    margin: 0 0 0.4rem 0;
    color: #0f172a;
    font-weight: 800;
}

.hero-card-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1.2rem 0;
}

.btn-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #0284c7;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 0.55rem 1.15rem;
    border-radius: 30px;
    transition: background 0.2s;
}

.hero-bags .btn-hero-action {
    background: #059669;
}

.btn-hero-action:hover {
    filter: brightness(0.92);
}

.hero-card-img {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* تیترهای بخش‌های صفحه اول */
.home-section-head {
    margin-bottom: 1rem;
}

.home-section-head h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
}

.home-section-head p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.home-section-head.center {
    text-align: center;
}

.home-section-head.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.view-all-link {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: bold;
}

/* ۲. کارت‌های دایره‌ای دسته‌بندی دخترانه و پسرانه */
.category-circles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.circle-cat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.circle-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.circle-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 4px;
    flex-shrink: 0;
    border: 3px solid;
    background: #fff;
    overflow: hidden;
}

.girl-theme .circle-avatar { border-color: #f472b6; }
.boy-theme .circle-avatar { border-color: #38bdf8; }
.unisex-theme .circle-avatar { border-color: #fbbf24; }

.circle-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.circle-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.circle-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.circle-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.circle-arrow-btn {
    align-self: flex-start;
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: bold;
}

/* ۳. طرح‌های جدید */
.home-arrivals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.arrival-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arrival-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.arrival-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
}

.arrival-img {
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
}

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

.arrival-body {
    padding: 0.75rem;
}

.arrival-body h5 {
    margin: 0 0 0.4rem 0;
    font-size: 0.88rem;
    color: var(--text);
}

.arrival-price {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--success);
}

/* ۴. نوار برندهای همکار */
.home-brands-section {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1rem;
}

.brands-logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    gap: 1.5rem;
    margin-top: 1rem;
}

.brand-item {
    font-size: 1.05rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.brand-item:hover {
    color: var(--primary);
}

/* واکنش‌گرایی صفحه اول برای تبلت و موبایل */
@media (max-width: 992px) {
    .home-hero-split {
        grid-template-columns: 1fr;
    }
    .category-circles-grid {
        grid-template-columns: 1fr;
    }
    .home-arrivals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .home-arrivals-grid {
        grid-template-columns: 1fr;
    }
}
