/* Dropdown Menu Styles */
.nav-item {
    position: relative !important;
}

/* Level 1 Dropdown (Categories) */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 0;
    border-top: 3px solid #004aad;
    border-radius: 0 0 4px 4px;
    text-align: left;
}

.nav-item:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-menu li {
    position: relative;
    list-style: none;
}

.dropdown-menu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background-color: #f9f9f9;
    color: #004aad;
    padding-left: 25px;
    /* Slight movement on hover */
}

/* Level 2 Dropdown (Sub Categories) */
.dropdown-submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    /* Position to the right */
    min-width: 220px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    border-top: 3px solid #004aad;
    border-radius: 4px;
    margin-left: 0px;
    /* Gap correction if needed */
}

.dropdown-menu li:hover>.dropdown-submenu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Arrow indicator for items with submenus */
.has-submenu>a::after {
    content: '\f054';
    /* FontAwesome Right Angle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
}

/* Ensure container allows overflow */
header,
.header,
nav,
.nav-menu {
    overflow: visible !important;
}

.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    /* Use viewport width */
    margin-left: calc(-50vw + 50%);
    /* Center it if parent is centered */
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 30px 0;
    border-top: 3px solid #004aad;
    margin-top: 0px;
    /* Adjust if there is a gap */
}

.nav-item:hover .mega-menu {
    display: block !important;
    animation: fadeIn 0.2s ease-in-out;
    visibility: visible;
    opacity: 1;
}

/* Ensure hover state persists when moving to menu */
.nav-item {
    padding-bottom: 0px;
    /* Adjust if needed */
}

/* Hover effect for the brand button when menu is active */
.nav-item:hover .brand-nav-btn {
    background-color: #f0f0f0;
    color: #004aad;
}

/* Ensure container allows overflow */
header,
.header,
nav,
.nav-menu {
    overflow: visible !important;
}

.mega-menu-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    /* Standard container width */
    margin: 0 auto;
    padding: 0 20px;
}

.mega-menu-category {
    margin-bottom: 20px;
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: #004aad;
    margin-bottom: 12px;
    display: block;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.category-title:hover {
    color: #003380;
}

.sub-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sub-category-list li {
    margin-bottom: 8px;
}

.sub-category-list a {
    color: #555;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.sub-category-list a:hover {
    color: #004aad;
    padding-left: 5px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .mega-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        padding: 10px;
        display: none !important;
        /* Hide on mobile for now or implement toggle */
    }

    .mega-menu-content {
        grid-template-columns: 1fr;
    }
}