﻿

.navbar {
    background-color: #085A72;
    padding: 15px 15px 10px 15px;
    position: sticky;
    top: 0;
    z-index: 3000;
}

.nav-item {
    position: relative;
    margin-left: 20px;
}

.nav-link {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .nav-link {
    color: white !important;
}

    .navbar .nav-link:hover, .navbar .nav-link:focus {
        color: #E6511B !important;
        font-weight: bold;
    }

@media (max-width:576px) {
    .navbar {
        padding: 0;
    }
}

/* ==============================================
   1. دکمه‌ها و لینک‌های Navbar
   ============================================== */
.btn-shokofa {
    border: none;
    border-radius: 6px;
    transition: all 0.25s ease;
    color: white;
}

.btn-shokofa {
    background: #E6511B;
}

    .btn-shokofa:hover {
        background: #eee !important;
        color: #085A72 !important;
    }

        .btn-shokofa:hover i {
            color: #085A72 !important;
        }

.my-link {
    text-decoration: none;
    color: white;
}

    .my-link:hover {
        font-weight: bold;
    }

/* ==============================================
   2. مگامنو سه‌سطحی Navbar
   ============================================== */
/* ===== Mega Menu Wrapper ===== */
.dropdown-menu.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 980px;
    height: 420px;
    background: #fff;
    border: none;
    border-top: 3px solid #0d6efd;
    box-shadow: 0 12px 28px rgba(0,0,0,.15);
    padding: 0;
    margin-top: 0;
    z-index: 2000 !important;
}

/* ===== Container ===== */
.menu-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* ===== Column Base ===== */
.category-column,
.second-column,
.third-column {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* ===== First Column ===== */
.category-column {
    min-width: 220px;
    padding: 15px;
    border-left: 1px solid #eee;
    background: #fafafa;
}

/* ===== Category Item ===== */
.category-item {
    padding: 9px 12px;
    margin-bottom: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-radius: 6px;
    background: transparent;
    position: relative;
    transition: all .2s ease;
}

    .category-item:hover,
    .category-item.active {
        background: #eef4ff;
        color: #0d6efd;
    }

        .category-item.active::before {
            content: '';
            position: absolute;
            right: 0;
            top: 10%;
            width: 3px;
            height: 80%;
            background: #E6511B;
            border-radius: 4px;
        }

/* ===== Second Column ===== */
.second-column {
    min-width: 200px;
    padding: 15px;
    border-left: 1px solid #eee;
    background: #fff;
}

/* ===== Second Level ===== */
.second-level {
    display: none;
    flex-direction: column;
    gap: 4px;
    animation: fadeSlide .2s ease;
}

/* ===== Second Item ===== */
.second-item {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    border-radius: 6px;
    position: relative;
    transition: all .2s ease;
}

    .second-item:hover,
    .second-item.active {
        background: #f1f1f1;
        color: #0d6efd;
    }

        .second-item.active::before {
            content: '';
            position: absolute;
            right: 0;
            top: 10%;
            width: 3px;
            height: 80%;
            background: #E6511B;
            border-radius: 4px;
        }

/* ===== Third Column ===== */
.third-column {
    flex: 1;
    padding: 15px;
    background: #fff;
}

/* ===== Third Level (Grid) ===== */
.third-level {
    display: none;
    width: 100%;
    animation: fadeSlide .2s ease;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

/* ===== Product Card ===== */
.card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eee;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all .25s ease;
}

    .card-item:hover {
        background: #f9fbff;
        border-color: #0d6efd;
        color: #000;
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(0,0,0,.12);
    }

    .card-item img {
        width: 42px;
        height: 42px;
        object-fit: contain;
        flex-shrink: 0;
    }

    /* ===== Text Inside Card ===== */
    .card-item > div {
        flex: 1;
        min-width: 0;
    }

    .card-item small {
        display: block;
        font-size: 12px;
        color: #777;
    }

/* ===== Scrollbar (Webkit) ===== */
.category-column::-webkit-scrollbar,
.second-column::-webkit-scrollbar,
.third-column::-webkit-scrollbar {
    width: 6px;
}

.category-column::-webkit-scrollbar-thumb,
.second-column::-webkit-scrollbar-thumb,
.third-column::-webkit-scrollbar-thumb {
    background: #cfcfcf;
    border-radius: 10px;
}

/* ===== Animation ===== */
@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dropdown-menu.mega-menu {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}

#megaMenuParent:hover .dropdown-menu.mega-menu,
.nav-item:hover .dropdown-menu.mega-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

[dir="ltr"] .dropdown-menu.mega-menu {
    right: auto;
    left: 0;
}

[dir="ltr"] .category-item.active::before  {
    right: auto; 
    left: 0; 
}
[dir="ltr"] .second-item.active::before {
    right: auto; 
    left: 0; 
}

/* ==============================================
   3. Navbar موبایل
   ============================================== */
.offcanvas {
    background: rgba(8,90,114,0.45);
    backdrop-filter: blur(16px);
    color: #fff;
}

    .offcanvas a {
        color: #085A72;
    }

/* فقط موبایل */
@media (max-width:576px) {
    .offcanvas {
        background-color: #fff; /* سفید ساده */
        color: #000; /* متن سیاه */
    }

        .offcanvas a {
            color: #085A72; /* رنگ لینک */
            text-decoration: none;
            font-weight: 500;
        }

            .offcanvas a:hover {
                color: #E6511B; /* رنگ هنگام هاور */
            }

    .offcanvas-header {
        border-bottom: 1px solid #eee;
        padding: 10px 15px;
    }

    .offcanvas-body {
        padding: 10px 15px;
    }

    .dropdown-menu {
        background-color: #fff;
        border: 1px solid #eee;
    }

    .dropdown-item {
        color: #085A72;
    }

        .dropdown-item:hover {
            background-color: #f2f2f2;
            color: #E6511B;
        }
}

/* ===============================
   موبایل Navbar
   =============================== */
.mobile-container {
    padding: 0;
}

.mobile-row {
    background-color: #085A72;
}

.mobile-logo-col {
    margin: 3px;
}

.mobile-logo {
    width: 40px;
    height: 35px;
    object-fit: contain;
}

.mobile-search-wrapper {
    width: 100%;
}

.mobile-search-btn {
    width: 50px;
}

.mobile-search-icon {
    color: white;
}

.sidebar-logo {
    width: 150px;
    height: 40px;
    object-fit: contain;
}

.sidebar-link {
    color: #085A72;
    font-weight: 500;
    text-decoration: none;
}

    .sidebar-link.active {
        font-weight: bold;
    }

    .sidebar-link:hover {
        color: #E6511B;
    }

.sidebar-dropdown-item {
    color: #085A72;
}

    .sidebar-dropdown-item:hover {
        background-color: #f2f2f2;
        color: #E6511B;
    }

/* دکمه جستجو */
.btn-shokofa {
    border: none;
    border-radius: 6px;
    background-color: #E6511B;
    color: white;
    transition: all 0.25s ease;
}

    .btn-shokofa:hover {
        background-color: #eee;
        color: #085A72;
    }

        .btn-shokofa:hover i {
            color: #085A72;
        }

/* ===============================
   دسکتاپ Navbar
   =============================== */
.desktop-logo {
    width: 180px;
    height: 53px;
    object-fit: contain;
}

.desktop-search-wrapper {
    display: flex;
}

.desktop-search-input {
    width: 250px;
    height: 50px;
}

.desktop-search-btn {
    width: 50px;
    margin-right: 5px;
}

.desktop-dropdowns .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-cart-btn {
    height: 50px;
}

.cart-icon {
    color: #D2D2D2;
}

/* مگامنو دسکتاپ */
.dropdown-menu.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 900px;
    background: #fff;
    border: none;
    border-top: 3px solid #E6511B;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 0;
    margin-top: 0;
    z-index: 1000;
}

.menu-container {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.category-column, .second-column {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #eee;
    padding: 15px;
}

    .category-column .category-item,
    .second-column .second-item {
        padding: 8px 10px;
        cursor: pointer;
        font-weight: 600;
        color: #333;
        background: #fff;
        border-radius: 4px;
        transition: background 0.2s;
        text-decoration: none;
    }

        .category-column .category-item:hover,
        .category-column .category-item.active,
        .second-column .second-item:hover,
        .second-column .second-item.active {
            background: #f2f2f2;
            color: #000;
        }

.third-column {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    max-height: 70px;
    overflow-y: auto;
}

.card-item {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s,color 0.2s,border-color 0.2s;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

    .card-item:hover {
        background: #f2f2f2;
        color: #000;
        border-color: #0d6efd;
    }

.card-item-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}
.desktop-dropdowns {
    display: flex;
    align-items: center; /* تراز کردن عناصر عمودی */
    gap: 10px;
}

.desktop-cart-btn {
    height: 50px;
    display: flex;
    align-items: center;
}
.desktop-dropdowns {
    display: flex;
    align-items: center; /* تراز کردن dropdown ها */
    gap: 10px;
}

.desktop-cart-btn {
    height: 50px;
    display: flex;
    align-items: center; /* تراز کردن آیکون */
    margin-left: 10px;
}

/* Navbar دسکتاپ */
.desktop-navbar .navbar-nav {
    display: flex;
    align-items: center; /* وسط چین عمودی همه آیتم‌ها */
}

.desktop-navbar .nav-item {
    margin-left: 20px;
    display: flex;
    align-items: center; /* وسط چین عمودی لینک‌ها */
}

.desktop-navbar .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: white !important;
}

    .desktop-navbar .nav-link:hover {
        color: #E6511B !important;
        font-weight: bold;
    }

/* Navbar موبایل */
.mobile-container {
    padding: 0;
}

.mobile-row {
    background-color: #085A72;
    align-items: center;
}

.mobile-logo-col {
    margin: 3px;
}

.mobile-logo {
    width: 40px;
    height: 35px;
    object-fit: contain;
}

/* جستجو موبایل */
.mobile-search-wrapper {
    display: flex;
    width: 100%;
}

    .mobile-search-wrapper input {
        flex: 1; /* input فضای باقی‌مانده را می‌گیرد */
    }

.mobile-search-btn {
    flex-shrink: 0; /* دکمه کوچک نشود و در یک خط بماند */
}

.mobile-search-icon {
    color: white;
}

/* پنل کناری موبایل */
.offcanvas {
    background-color: #fff;
    color: #000;
}

.sidebar-logo {
    width: 150px;
    height: 40px;
    object-fit: contain;
}

.sidebar-link {
    color: #085A72;
    font-weight: 500;
    text-decoration: none;
}

    .sidebar-link.active {
        font-weight: bold;
    }

    .sidebar-link:hover {
        color: #E6511B;
    }

.sidebar-dropdown-item {
    color: #085A72;
}

    .sidebar-dropdown-item:hover {
        background-color: #f2f2f2;
        color: #E6511B;
    }

.btn-shokofa {
    border: none;
    border-radius: 6px;
    background-color: #E6511B;
    color: white;
    transition: all 0.25s ease;
}

    .btn-shokofa:hover {
        background-color: #eee;
        color: #085A72;
    }

        .btn-shokofa:hover i {
            color: #085A72;
        }

