/* Destinations Menu - Clean Professional Style */
:root {
    --menu-text: #333333;
    --menu-hover: #0066cc;
    --menu-border: #e0e0e0;
    --menu-bg: #ffffff;
    --menu-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Main Menu Item */
.destinations-menu {
    position: relative;
    display: inline-block;
    /* Ensure hover area is contained within the menu item */
    overflow: visible;
    z-index: 10000;
    /* Prevent hover from being triggered by elements below */
    isolation: isolate;
}

.destinations-menu > a {
    color: var(--menu-text);
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    font-weight: 500;
    transition: color 0.2s ease;
}

.destinations-menu > a:hover {
    color: var(--menu-hover);
}

/* Mega Menu Container */
.mega-menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateX(0);
    width: 100vw;
    max-width: 850px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    margin-top: 10px;
    overflow: hidden;
    /* Prevent menu from being triggered by elements below */
    pointer-events: none;
    /* Ensure proper stacking during scroll */
    will-change: opacity, visibility;
    /* Prevent layout shift during scroll */
    contain: layout style paint;
}

/* Only show menu when hovering directly over the menu item link */
.destinations-menu.active .mega-menu-container {
    opacity: 1;
    visibility: visible;
    display: block;
    pointer-events: auto;
}

/* Ensure hover only works on the actual menu link, not child elements */
.destinations-menu > a:hover + .mega-menu-container {
    opacity: 1;
    visibility: visible;
    display: block;
    pointer-events: auto;
}

/* Inner Grid Layout */
.mega-menu-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1.2fr;
    grid-gap: 0;
    height: 100%;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
}

/* Column Base Styles */
.mega-menu-column {
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Left Column - Explore */
.mega-menu-column:first-child {
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
}

/* Center Column - Select Area */
.mega-menu-column:nth-child(2) {
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
}

/* Right Column - Destinations */
.mega-menu-column:nth-child(3) {
    background: #ffffff;
}

/* Ensure consistent left alignment across all columns */
.mega-menu-column:nth-child(3) .mega-menu-list {
    text-align: left;
}

.mega-menu-column:nth-child(3) .mega-menu-item > a {
    display: block;
    text-align: left;
}

/* Column Headers */
.mega-menu-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: -20px -20px 15px -20px;
    padding: 12px 20px;
    background: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
}

/* Explore Menu Links */
.explore-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.explore-menu li {
    margin: 0;
    padding: 0;
}

.explore-menu a {
    display: block;
    padding: 10px 15px;
    color: #333333 !important;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 2px 0;
}

.explore-menu a:hover,
.explore-menu a.active {
    background: #0066cc !important;
    color: #ffffff !important;
}

/* Sub-regions and Destinations Lists */
.mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-item {
    margin: 0;
    padding: 0;
}

.mega-menu-item > a {
    display: block;
    padding: 8px 10px;
    color: #333333 !important;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.mega-menu-item > a:hover {
    color: #0066cc !important;
    background: #f8f8f8 !important;
}

/* Select Area Content */
#select-area-content {
    margin: 0;
    padding: 0;
}

#select-area-content .mega-menu-list {
    margin: 0;
    padding: 0;
}

/* Empty State Messages */
.no-selection,
#select-area-content > p {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 50px 20px;
    margin: 0;
}

/* Center the destinations list items */
#destinations-list {
    text-align: center;
}

#destinations-list .no-selection {
    text-align: center;
    width: 100%;
}

/* Scrollbar styling */
.mega-menu-column::-webkit-scrollbar {
    width: 6px;
}

.mega-menu-column::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mega-menu-column::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.mega-menu-column::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure proper hover zones - contained within menu boundaries */
.destinations-menu::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -5px;
    right: -5px;
    height: 5px;
    z-index: 9998;
    /* Prevent this hover zone from interfering with elements below */
    pointer-events: none;
}

/* Only allow hover on the actual menu elements */
.destinations-menu > a {
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}

/* Remove any extra styling */
.mega-menu-container::before,
.mega-menu-container::after,
.mega-menu-column::before,
.mega-menu-column::after {
    display: none;
}

/* Remove any conflicting backgrounds */
.mega-menu-container ul,
.mega-menu-container li {
    background-color: transparent;
}

/*
 * RESET inherited submenu rules from legacy nav (#access ul ul ...)
 * These rules were applying width/height/scroll/borders that created
 * an extra inner boxed container in each column. Scope strong resets
 * to this mega menu only.
 */
.destinations-menu .mega-menu-container ul {
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.destinations-menu .mega-menu-container ul li {
    border: 0 !important;
}

.destinations-menu .mega-menu-container ul li a {
    border: 0 !important;
}

/* Remove any gradients or effects */
.explore-menu a.active,
.explore-menu a:hover {
    background: var(--menu-hover) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Clean item hover */
.mega-menu-item > a:hover {
    background-color: #f8f8f8 !important;
    transform: none !important;
}

/* Remove icons and extra content */
.mega-menu-item > a::after {
    display: none;
}

/* Ensure text is visible */
.mega-menu-column,
.mega-menu-title,
.explore-menu,
.explore-menu li,
.explore-menu a,
.mega-menu-list,
.mega-menu-item,
.mega-menu-item a,
#select-area-content,
#select-area-content * {
    opacity: 1 !important;
    visibility: visible !important;
    color: #333333 !important;
}

/* Override color for hover states */
.explore-menu a:hover,
.explore-menu a.active {
    color: #ffffff !important;
}

.mega-menu-item > a:hover {
    color: #0066cc !important;
}

/* Remove backdrop filters */
.mega-menu-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Ensure proper stacking */
.mega-menu-column {
    position: relative;
    z-index: 1;
}

/* Clean transitions */
* {
    transition-duration: 0.2s !important;
}

/* Prevent menu activation during scrolling */
.destinations-menu {
    /* Ensure smooth scrolling doesn't interfere */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Additional scroll safety */
html.scrolling .destinations-menu.active .mega-menu-container {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* ========================================
   TABLET AND SMALL DESKTOP RESPONSIVE DESIGN
   ======================================== */

/* Medium screens - Adjust menu width and positioning */
@media screen and (max-width: 1024px) {
    .mega-menu-container {
        width: 90vw;
        max-width: 750px;
        left: 0;
        transform: translateX(0);
        margin-left: 0;
    }

    .mega-menu-inner {
        grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr) minmax(200px, 1fr);
    }

    .mega-menu-column {
        padding: 12px;
        min-height: 220px;
    }

    /* Ensure first column (Explore) is always visible */
    .mega-menu-column:first-child {
        min-width: 180px;
    }
}

/* Small screens - Maintain 3-column layout with better proportions */
@media screen and (max-width: 900px) {
    .mega-menu-container {
        width: 90vw;
        max-width: 700px;
        left: 0;
        transform: translateX(0);
        margin-left: 0;
    }

    .mega-menu-inner {
        grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.15fr) minmax(180px, 1fr);
    }

    .mega-menu-column {
        padding: 10px;
        min-height: 180px;
    }

    /* Ensure first column (Explore) is always visible */
    .mega-menu-column:first-child {
        min-width: 160px;
    }
}

/* Extra small screens - Stack columns vertically but keep all visible */
@media screen and (max-width: 768px) {
    .mega-menu-container {
        width: 90vw;
        max-width: 650px;
        left: 0;
        transform: translateX(0);
        margin-left: 0;
    }

    .mega-menu-inner {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
    }

    .mega-menu-column {
        padding: 12px;
        min-height: 160px;
    }

    /* Adjust column positioning for 2-column layout */
    .mega-menu-column:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        border-bottom: 1px solid #e0e0e0;
        border-right: 1px solid #e0e0e0;
        min-width: 130px;
    }

    .mega-menu-column:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        border-bottom: 1px solid #e0e0e0;
        border-right: 0;
        min-width: 130px;
    }

    .mega-menu-column:nth-child(3) {
        grid-column: 1 / span 2;
        grid-row: 2;
        border-right: 0;
        border-bottom: 0;
        margin-top: 8px;
    }
}

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */

/* Mobile Devices - Hide Mega Menu Completely */
@media screen and (max-width: 600px) {
    /* Hide the mega menu completely on mobile */
    .destinations-menu .mega-menu-container {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* Ensure the menu item behaves like a normal link on mobile */
    .destinations-menu:hover .mega-menu-container,
    .destinations-menu.active .mega-menu-container {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* Style the destinations link as a simple menu item */
    .destinations-menu > a {
        display: block;
        padding: 15px 20px;
        color: var(--menu-text);
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid var(--menu-border);
        transition: background-color 0.2s ease;
        width: 100%;
        box-sizing: border-box;
    }
    
    .destinations-menu > a:hover,
    .destinations-menu > a:focus,
    .destinations-menu > a:active {
        background-color: #f8f9fa;
        color: var(--menu-hover);
    }
    
    /* Remove any hover effects that might trigger the menu */
    .destinations-menu {
        position: static !important;
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        z-index: auto !important;
    }
    
    /* Ensure no mega menu classes interfere */
    .destinations-menu.mega-menu {
        position: static !important;
    }
    
    /* Remove the hover zone helper */
    .destinations-menu::before {
        display: none !important;
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
    .destinations-menu > a {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .destinations-menu > a .mega-menu-destinations {
        font-size: 16px;
    }
}