/* --- Mobile Responsive Mega Menu Styling --- */
@media (max-width: 991px) {
    /* Base Container */
    .navbar-nav .nav-item.mega-menu {
        position: relative !important;
        width: 100% !important;
    }
    /* Content Box - Overrides desktop rules so it's not invisible */
    .mega-menu-content {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: none; /* Crucial for JS slideToggle */
        width: 100% !important;
        min-width: 100%;
        padding: 15px 20px;
        background-color: transparent !important;
        box-shadow: none !important;
        border-top: none;
        transform: none !important;
    }

    /* Highlight link text when open */
    .nav-item.mega-menu.is-open .nav-link {
        color: #00ABE4 !important;
    }

    /* Layout inside the dropdown */
    .mega-menu-content .container {
        padding: 0;
    }

    .mega-menu-content .row {
        margin: 0;
    }

    .mega-menu-intro {
        display: none !important;
    }
    /* Inset grey box for the links */
    .mega-menu-content .col-lg-9 {
        padding: 20px 25px !important;
        background-color: #f8f9fa !important;
        border-radius: 0;
    }

    /* List Item Formatting */
    .mega-menu-card {
        text-align: left;
        margin-bottom: 24px;
    }

        .mega-menu-card:last-child {
            margin-bottom: 0;
        }

        .mega-menu-card a {
            flex-direction: row;
            align-items: center;
            gap: 0;
            text-decoration: none;
        }

    .card-img-wrapper {
        display: none !important;
    }
    /* Text styling */
    .card-title {
        font-family: 'Noto Sans', sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: #333;
        text-transform: none;
        letter-spacing: normal;
        margin-top: 0;
    }
    /* Learn More Button styling on mobile */
    .mega-menu-mobile-more {
        display: block;
        margin-top: 10px;
        font-weight: 700;
        color: #00ABE4;
        text-decoration: none;
        text-transform: uppercase;
        font-size: 14px;
    }
    /* Link Flex Layout */
    .nav-item.mega-menu .nav-link {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        width: 100% !important;
    }
}
/* Chevron is <img class="feather"> (not .feather > img) */
.nav-item.mega-menu > .nav-link img.feather {
    display: inline-block;
    transition: transform 0.4s ease;
    transform-origin: center center;
}

.nav-item.mega-menu.is-open > .nav-link img.feather {
    transform: rotate(-180deg);
}
.mega-menu-content {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 100vw;
    background-color: #fff;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 80px 0;
    z-index: 1000;
    border-top: 1px solid #f0f0f0;
    transform: translateY(10px);
}

.nav-item.mega-menu.is-open .mega-menu-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-intro {
    padding-right: 60px;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.mega-menu-title {
    font-family: 'Sabon', 'Besley', serif;
    font-size: 48px;
    color: #004860;
    margin-bottom: 24px;
    font-weight: 700;
    line-height: 1.1;
    display: block;
    width: 100%;
}

.mega-menu-desc {
    font-family: 'Noto Sans', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 40px;
    max-width: 320px;
    display: block;
}

.mega-menu-learn-more {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    color: #00ABE4;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .mega-menu-learn-more:hover {
        color: #0084b0;
        gap: 16px;
    }

.mega-menu-card {
    text-align: center;
}

    .mega-menu-card a {
        text-decoration: none;
        display: flex;
        flex-direction: column;
    }

.card-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1.3;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    background: #f8f8f8;
}

.mega-menu-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1.15); /* Start zoomed in */
}

.mega-menu-card:hover img {
    transform: scale(1); /* Zoom out on hover */
}

.card-title {
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #232323;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    transition: color 0.3s ease;
    margin-top: 10px;
}

.mega-menu-card:hover .card-title {
    color: #00ABE4;
}
.navbar-nav .nav-item.mega-menu {
    position: static !important;
}
    /* 2. Optional: Hide the default dropdown caret if it's showing */
    .navbar-nav .nav-item.mega-menu .nav-link::after {
        display: none !important;
    }