* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    /*background: #f9fafb;*/
}

:root {
    --primary: #259bea;
    --primary-dark: #259bea;
    --primary-light: #259bea;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ===== هدر ===== */
header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-200);
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* ===== لوگو ===== */
.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* ===== دکمه موبایل ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-700);
    padding: 0.5rem;
}

/* ===== لینک‌های ناوبری ===== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.nav-links > li > a:hover {
    color: var(--primary);
}

/* ===== مگا منو ===== */
.mega-container {
    position: relative;
}

.mega-trigger .chevron-icon {
    transition: transform 0.3s ease;
}

.mega-container:hover .mega-trigger .chevron-icon {
    transform: rotate(180deg);
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    width: 950px;
    max-width: 90vw;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    pointer-events: none;
}

/* دسکتاپ - هاور */
@media (min-width: 769px) {
    .mega-container:hover .mega-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* ===== سایدبار دسته‌بندی‌ها ===== */
.mega-sidebar {
    border-left: 1px solid var(--gray-200);
    overflow-y: auto;
}

.category-item {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 3px solid transparent;
}

.category-item:hover,
.category-item.active {
    background: #f3f5ff;
    border-right-color: var(--primary);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-info svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.category-info span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

.arrow-icon {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

/* ===== محتوای سمت راست ===== */
.mega-content {
    height: 450px;
    overflow-y: auto;
    padding: 24px;
    background: #ffffff;
}

/* پنل‌های محتوا */
.mega-content-panel {
    display: none;
}

.mega-content-panel.active {
    display: block !important;
}

/* ===== گرید محصولات — ۳ ستون دسکتاپ ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 32px;
}

.product-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-100);
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-list a {
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-block;
    line-height: 1.6;
}

.product-list a:hover {
    color: var(--primary);
    padding-right: 6px;
}

/* ===== انتخاب‌گر زبان ===== */
.lang-selector {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    background: var(--white);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.lang-selector:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 155, 234, 0.15);
}

/* ======================================================
   ریسپانسیو
   ====================================================== */

/* تبلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .mega-dropdown {
        width: 780px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 24px;
    }
}

/* موبایل */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-200);
    }

    .nav-links.active {
        display: flex;
    }

    /* مگا منو */
    .mega-dropdown {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 8px;
        box-shadow: var(--shadow-lg);
        display: none !important;
        border-radius: 12px;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .mega-dropdown.active {
        display: block !important;
    }

    .mega-dropdown * {
        pointer-events: auto !important;
    }

    .mega-sidebar {
        height: auto;
        max-height: 280px;
        border-left: none;
        border-bottom: 1px solid var(--gray-200);
        overflow-y: auto;
    }

    .category-item {
        pointer-events: auto !important;
        position: relative;
        z-index: 5;
    }

    .mega-content {
        height: auto;
        max-height: 420px;
        padding: 16px;
    }

    .mega-content-panel {
        display: none !important;
    }

    .mega-content-panel.active {
        display: block !important;
    }

    /* گرید ۱ ستونه */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}