﻿

/* --- نوار ناوبری --- */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1000;
}


.logo span {
    font-size: 24px;
    font-weight: bold;
    color: #1a1a1a;
}

/* --- منوی اصلی --- */
.main-menu {
    display: flex;
    gap: 25px;
    height: 100%;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-link {
    color: #3f3f3f;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

    .menu-link:hover {
        color: #0056b3;
    }

.arrow {
    font-size: 10px;
}


/* کلاس کانتینر اصلی هدر باید position: relative داشته باشد */
.header-bottom .container {
    position: relative;
}

/* --- کانتینر مگا منو (کل عرض کانتینر) --- */
.mega-menu {
    position: absolute;
    top: 100%; /* دقیقاً زیر نوار منو باز می‌شود */
    left: 0;
    right: 0;
    width: 100%; /* کل عرض کانتینر را می‌گیرد */

    background: #ffffff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    border-radius: 0 0 12px 12px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    border-top: none;
    z-index: 999;
    /* برای وسط چین کردن محتوا */
    display: flex;
    justify-content: center;
}

/* این کلاس توسط جاوا اسکریپت به منو اضافه می‌شود */
.mega-menu.active {
    opacity: 1;
    visibility: visible;
}

    .mega-menu ul {
        list-style: none;
        padding-right: 0.5em;
    }

/* --- کانتینر داخلی برای نگه داشتن محتوا در وسط صفحه --- */
.mega-menu-inner {
    width: 100%;
    padding: 25px 20px;
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 20px;
}

/* تنظیمات "مشاهده همه" */
.view-all {
    display: block;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px 0 20px;
    border-top: 1px solid #eaeaea;
    color: #0066cc;
    font-weight: bold;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.view-all:hover {
    color: #004494;
}


.menu li ul {
    position: unset !important;
    background-color: transparent !important;
    visibility: visible !important;
    -webkit-box-shadow: unset !important;
}
  


/* === بخش سمت راست: ۶ ستون برند === */
.brands-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* در اینجا ۳ ستون می‌سازیم */
    gap: 15px 30px;
}

/* اما چون می‌خواهیم ۶ تا باکس داشته باشیم، در واقع این ۳ ستون هر کدام ۲ زیرمجموعه دارند */
/* برای سادگی، ما ۶ تا mega-column در HTML می‌گذاریم و در CSS آن‌ها را به صورت درهم */
.mega-columns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 25px;
    row-gap: 20px;
}

/* استایل تک تک ستون‌های برند */
.mega-column h3 {
    font-size: 13px;
    color: #2c4beb;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.brand-list li {
    margin-bottom: 8px;
}

    .brand-list li a {
        font-size: 13px;
        color: #444;
        transition: color 0.2s;
        display: flex;
        align-items: center;
    }

        .brand-list li a::before {
            content: "";
            display: inline-block;
            width: 5px;
            height: 5px;
            background-color: #2c4beb;
            border-radius: 50%;
            margin-left: 8px;
        }

        .brand-list li a:hover {
            color: #2c4beb;
        }

/* === بخش سمت چپ: بنرها و باکس‌های ویژه === */
.featured-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid #eaeaea; /* خط جداکننده */
    padding-right: 20px;
}

/* ۱. بنرهای تصویری */
.banner-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.banner-box {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 200px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: transform 0.3s;
}

    .banner-box:hover {
        transform: scale(1.02);
    }

    .banner-box img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 1;
    }


/* ۲. باکس‌های ویژه (کارت‌های پایین) */
.offer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* ۲ ستون برای باکس‌ها */
    gap: 10px;
}

.offer-box {
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 15px 12px 0;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .offer-box:hover {
        border-color: #0066cc;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

.menu-badge {
    
    background: #dbeafe;
    color: #0066cc;
    border-radius: 8px;
    display: block;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 8px;
    margin-left: 8px;
    padding: 2px 5px;
}

.offer-box h5 {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.offer-box p {
    font-size: 11px;
    color: #777;
}

/* --- دکمه مشاهده همه --- */
.view-all {
    display: block;
    text-align: left;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eaeaea;
    color: #0066cc;
    font-weight: bold;
    font-size: 14px;
}

    .view-all:hover {
        color: #004494;
    }

/* --- موبایل و همبرگر --- */
.user-actions {
    display: flex;
    gap: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #555;
}

.mobile-menu-toggle {
    display: none;
}

/* --- پاسخگو سازی (ریسپانسیو) --- */
@media (max-width: 1100px) {
    .mega-menu {
        width: 95%;
        left: 2.5%;
    }

    .mega-menu-inner {
        grid-template-columns: 1fr;
    }

    .featured-sidebar {
        border-right: none;
        padding-right: 0;
        border-top: 1px solid #eaeaea;
        padding-top: 15px;
    }

    .banner-container {
        flex-direction: row;
    }

    .banner-box {
        flex: 1;
        height: 80px;
    }

    .offer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .main-menu {
        flex-direction: column;
        background: #fff;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        display: none;
        height: auto;
        border-top: 1px solid #eee;
    }

        .main-menu.open {
            display: flex;
        }

    .menu-item {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
        width: 100%;
    }

    .mega-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        padding: 15px 0;
        border: none;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 10px;
    }

        .mega-menu.active {
            display: block;
        }

    .mega-columns-grid {
        grid-template-columns: 1fr 1fr;
    }

    .banner-container {
        flex-direction: column;
    }

    .offer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .mobile-menu-toggle {
        display: block !important;
    }
}

@media (max-width: 600px) {
    .mega-columns-grid {
        grid-template-columns: 1fr;
    }
}
