/* Mega Menu Styles */

/* Ensure the parent li has relative positioning for the absolute mega menu */
ul.nav li.has-mega {
    position: static;
    /* We want the mega menu to be relative to the nav container, not the li */
}

/* Mega Menu Container */
.mega-menu {
    position: absolute;
    top: 44px;
    /* Reduced to match nav height and avoid gap */
    left: -9999px;
    /* Move off-screen when hidden */
    width: 100%;
    background: #fbf9f4;
    /* Premium cream background from sample */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Ignore mouse events when hidden */
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    transform: translateY(10px);
    z-index: 1000;
    border-radius: 0 0 10px 10px;
    overflow: visible;
    /* Changed to allow the bridge pseudo-element */
    min-height: 250px;
}

/* Bridging element to maintain hover state between nav and menu */
.mega-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
    pointer-events: auto;
}

/* Show mega menu on hover */
ul.nav li:hover .mega-menu {
    left: 0;
    /* Move back to position */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Enable mouse events */
    transform: translateY(0);
}

/* Left Image Section */
.mega-menu-image {
    flex: 0 0 350px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.mega-menu-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.mega-image-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    color: #fff;
}

.mega-image-content h2 {
    font-size: 30px;
    font-weight: 500;
    margin: 0;
    font-family: 'Lora', serif;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

/* Right Links Section */
.mega-menu-links {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 30px 40px;
    gap: 15px;
    background: #fbf9f4;
}

.mega-column {
    display: flex;
    flex-direction: column;
}

.mega-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
}

.mega-column li {
    margin-bottom: 8px;
    text-align: left !important;
    padding: 0 !important;
    background: none !important;
}

.mega-column li a {
    font-size: 16px !important;
    color: #444 !important;
    font-weight: 500 !important;
    transition: all 0.3s ease;
    padding: 5px 0 !important;
    display: inline-block !important;
    background: none !important;
    text-align: left !important;
    border-radius: 0 !important;
    width: auto !important;
    min-height: auto !important;
}

.mega-column li a:hover {
    color: #246883 !important;
    padding-left: 5px !important;
}

/* Mobile Fallback */
.mobile-only-nav {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 990px) {
    .mega-menu {
        display: none !important;
    }

    .mobile-only-nav {
        display: block !important;
    }
}