/* Header Base Styles */

/* Header Grid Layout */
.header-grid {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    padding: 10px 0px;
}

.header-left {
    justify-self: start;
}

.header-center {
    justify-self: center;
}

.header-right {
    justify-self: end;
}

.mobile-menu-trigger {
    display: none;
}

/* Menu Styles */
.header-menu {
    display: flex;
    flex-wrap: wrap;
    /* gap: 2.5rem; */
    gap: 10px 40px;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

.header-menu-item {
    position: relative;
    padding: 0.5rem 0;
}

.header-menu-item a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-menu-item a:hover {
    color: var(--primary);
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 280px;
    background: #fff;
    z-index: 1100;
    transition: left 0.3s ease;
}

.mobile-sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1099;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Menu Section */
.menu-section {
    background: #fff;
    border-bottom: 1px solid #eee;
}

.menu-container {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

/* Utility Classes */
.user-menu {
    min-width: 180px;
    height: 40px;
    display: flex;
    align-items: center;
}

/* Dropdown and Menu Styles */
.dropdown-body {
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    position: absolute;
    background: #fff;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mega_menu_body {
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff !important;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Ensure this is the only container with styling */
    padding: 0;
    overflow: hidden;
}

/* Override Bootstrap dropdown-menu styles specifically for mega menu */
.mega_menu_body.dropdown-menu {
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 8px !important;
}

.mega_menu_body.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Hover functionality for mega menu */
.mega_menu_item:hover .mega_menu_body {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.attribute-menu-body,
.category-menu-body {
    min-width: 200px;
    padding: 10px 0;
}

/* Show dropdown on hover */
.attribute-menu-item:hover .attribute-menu-body,
.category-menu-item:hover .category-menu-body {
    visibility: visible;
    opacity: 1;
    transform: translateY(5px);
    pointer-events: auto;
}

/* Menu lists styling */
.attribute-menu-list,
.category-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attribute-menu-list li,
.category-menu-list li {
    padding: 0;
}

.attribute-menu-list .dropdown-item,
.category-menu-list .dropdown-item {
    padding: 6px 15px;
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.attribute-menu-list .dropdown-item:hover,
.category-menu-list .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.mega_menu_item.disabled {
    pointer-events: none;
    opacity: 0;
}

.dropdown.list-inline-item::after,
.dropdown-toggle::after {
    content: none !important;
}

/* Mobile Layout */
@media (max-width: 767px) {
    .header-logo {
        width: 145px !important;
        margin-left: 10px;
    }

    .header-grid {
        display: flex;
        align-items: center;
    }

    .header-left {
        display: none;
    }

    .mobile-menu-trigger {
        display: flex;
        align-items: center;
        margin-right: 15px;
    }

    .header-center {
        flex: 0 0 auto;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
    }

    .desktop-only {
        display: none !important;
    }

    .menu-section {
        display: none;
    }

}

/* Tablet: 768px to 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .header-logo {
        height: 26px !important;
        margin-left: 20px;
    }

    .header-grid {
        display: flex;
        align-items: center;
    }

    .header-left {
        display: none;
    }

    .mobile-menu-trigger {
        display: flex;
        align-items: center;
        margin-right: 15px;
    }

    .header-center {
        flex: 0 0 auto;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
    }

    .desktop-only {
        display: none !important;
    }

    .menu-section {
        display: none;
    }
}

/* Logo Styles */
.header-logo {
    width: 200px;
    min-height: 35px;
    object-fit: contain;
}

/* Shop Now Button */
.shop-now-btn {
    white-space: nowrap;
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-actions .badge {
    color: #fff !important;
}

/* Icons */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.icon-btn:hover {
    transform: scale(1.1);
    color: var(--primary);
}
