/* Mega Menu */
.mega-menu-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-top: 3px solid #154c60;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-height: calc(100vh - 56px); /* Header height is ~56px */
    overflow-y: auto;
    scrollbar-width: thin; /* Firefox */
}
.mega-menu-wrapper::-webkit-scrollbar {
    width: 6px;
}
.mega-menu-wrapper::-webkit-scrollbar-thumb {
    background-color: #154c60;
    border-radius: 4px;
}
.mega-menu-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mega-menu-inner {
    padding: 40px 0;
}
.mega-menu-cols {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 4;
    column-gap: 30px;
    column-rule: 1px solid #eaedf1;
}

/* All li items in mega menu, including sub-menus */
.mega-menu-cols li {
    break-inside: avoid;
    border-bottom: 1px solid #eaedf1;
    display: block; 
}
.mega-menu-cols li:last-child {
    border-bottom: none;
}

/* All link items in mega menu, including sub-menus */
.mega-menu-cols li a {
    color: var(--text-color);
    font-size: 17px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    transition: color 0.3s ease;
    font-weight: 500;
}
.mega-menu-cols li a:hover {
    color: #154c60;
    padding-left: 5px;
}

/* Remove default WP sub-menu styling so it blends in */
.mega-menu-cols .sub-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Important Links Row (Buttons) */
.mega-menu-important-links {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eaedf1;
}
.important-links-row {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.important-links-row li {
    border-bottom: none; /* Override any global li borders */
}
.important-links-row li a {
    display: inline-block;
    padding: 10px 25px;
    background-color: #eaedf1;
    color: var(--text-color);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}
.important-links-row li a:hover {
    background-color: #154c60;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(21, 76, 96, 0.2);
}

/* Mega Menu Responsive */
@media (max-width: 991px) {
    .mega-menu-cols {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .mega-menu-wrapper {
        background-color: #f8f9fa; /* Light background to highlight buttons */
    }

    .mega-menu-cols {
        column-count: auto;
        column-rule: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-items: start;
    }
    
    .mega-menu-cols li {
        border-bottom: none;
    }

    /* All a tags styled as cards on mobile */
    .mega-menu-cols li a {
        font-size: 16px;
        padding: 12px 15px;
        background-color: #ffffff;
        border: 1px solid #eaedf1;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    }

    .mega-menu-cols li a::before {
        content: '';
        width: 6px;
        height: 6px;
        background-color: #d1d5db;
        border-radius: 50%;
        display: inline-block;
        flex-shrink: 0;
    }

    .important-links-row {
        gap: 10px;
    }

    .important-links-row li a {
        padding: 8px 16px;
        font-size: 14px;
        display: inline-block;
    }
}
