/*
 * MEGA MENU STYLES
 * Desktop: Centered dropdown
 * Mobile: SLIDE NAVIGATION like reference
 * Version: 5.7.0
 */

/* ============================================
   MAIN NAVIGATION WITH MEGA MENU
   ============================================ */

.primary-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.primary-menu > li {
    position: static;
}

/* TOP LEVEL MENU LINKS - These are the main navigation items */
.primary-menu > li > a {
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 5px;
    transition: color 0.3s ease;
    position: relative;
    display: block;
    /* Color will be controlled by header settings */
}

.primary-menu > li:hover > a {
    color: #E94E3D !important;
}

/* ============================================
   MEGA MENU DROPDOWN - CENTERED, LIMITED WIDTH
   ============================================ */

.mega-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #f8f4f0;
    width: auto;
    min-width: 900px;
    max-width: 1200px;
    padding: 40px 50px 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    margin-top: 0;
}

.primary-menu > li:hover .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
}

.mega-menu-inner {
    display: grid;
    gap: 30px;
    grid-auto-rows: max-content;
}

.mega-menu-dropdown[data-columns="2"] .mega-menu-inner {
    grid-template-columns: repeat(2, 1fr);
}

.mega-menu-dropdown[data-columns="3"] .mega-menu-inner {
    grid-template-columns: repeat(3, 1fr);
}

.mega-menu-dropdown[data-columns="4"] .mega-menu-inner {
    grid-template-columns: repeat(4, 1fr);
}

.mega-menu-dropdown[data-columns="5"] .mega-menu-inner {
    grid-template-columns: repeat(5, 1fr);
}

.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mega-menu-continent-header {
    display: block;
    background: #c34f5a;
    color: #ffffff !important;
    padding: 11px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    margin-bottom: 5px;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    width: 125px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mega-menu-continent-header:hover {
    background: #a74149;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(195, 79, 90, 0.3);
}

.mega-menu-destinations {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mega-menu-destinations li {
    margin: 0;
    padding: 0;
}

/* DROPDOWN DESTINATION LINKS - Controlled separately from main menu */
.mega-menu-destinations a {
    display: block;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 0;
    transition: all 0.2s ease;
    line-height: 1.3;
    /* Color will be set by theme options - NOT by header color */
}

.mega-menu-destinations a:hover {
    background: rgba(233, 78, 61, 0.08);
    /* Hover color will be set by theme options */
}

.mega-menu-single-link a {
    display: block;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.2s ease;
    /* Color will be set by theme options - NOT by header color */
}

.mega-menu-single-link a:hover {
    background: rgba(233, 78, 61, 0.1);
    /* Hover color will be set by theme options */
}

.mega-menu-footer {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}

.mega-menu-view-all {
    display: inline-block;
    text-decoration: none;
    font-weight: 400;
    font-size: 10px;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    /* Color will be set by theme options */
}

.mega-menu-view-all:hover {
    background: none;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1200px) {
    .mega-menu-dropdown {
        min-width: 700px;
        padding: 40px 30px 30px;
    }
    
    .mega-menu-dropdown[data-columns="5"] .mega-menu-inner {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .mega-menu-dropdown {
        min-width: 600px;
        padding: 40px 20px 30px;
    }
    
    .mega-menu-dropdown[data-columns="5"] .mega-menu-inner,
    .mega-menu-dropdown[data-columns="4"] .mega-menu-inner {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   MOBILE MENU - SLIDE NAVIGATION
   ============================================ */

@media (max-width: 767px) {
    .primary-menu {
        display: none;
    }
    
    .mega-menu-dropdown {
        display: none !important;
    }
    
    /* Mobile menu list */
    .mobile-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
        position: relative;
        overflow: hidden;
    }
    
    /* Main menu items */
    .mobile-menu-list > li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        position: relative;
        opacity: 1;
        transform: translateX(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    /* Hide main menu when submenu is active */
    .mobile-menu-list.hide-main > li:not(.menu-item-has-children) {
        display: none;
    }
    
    .mobile-menu-list.hide-main > li.menu-item-has-children {
        opacity: 0;
        transform: translateX(-100%);
        pointer-events: none;
    }
    
    .mobile-menu-list > li > a {
        display: block;
        padding: 15px 50px 15px 20px;
        color: #2C3E50;
        text-decoration: none;
        font-weight: 500;
        font-size: 16px;
        transition: color 0.2s ease;
        position: relative;
        cursor: pointer;
    }
    
    /* Arrow icon for items with children */
    .mobile-menu-list > li.menu-item-has-children > a::after {
        content: '\203A';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 24px;
        font-weight: bold;
        font-family: Arial, sans-serif;
        pointer-events: none;
    }
    
    /* Submenu - hidden by default */
    .mobile-menu-list .sub-menu {
        display: none;
        background: #ffffff;
        padding: 0;
        margin: 0;
        list-style: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        transform: translateX(100%);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    /* Show submenu when active */
    .mobile-menu-list .sub-menu.active-submenu {
        display: block;
        opacity: 1;
        transform: translateX(0);
        position: relative;
    }
    
    /* Submenu title */
    .mobile-menu-list .sub-menu .submenu-title {
        padding: 20px 20px;
        font-weight: 600;
        font-size: 18px;
        color: #2C3E50;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        text-align: center;
    }
    
    /* Back button */
    .mobile-menu-list .sub-menu .submenu-back {
        padding: 15px 20px;
        font-weight: 500;
        font-size: 16px;
        color: #2C3E50;
        cursor: pointer;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .mobile-menu-list .sub-menu .submenu-back .back-arrow {
        font-size: 24px;
        font-weight: bold;
        line-height: 1;
    }
    
    .mobile-menu-list .sub-menu .submenu-back:hover {
        background: rgba(233, 78, 61, 0.05);
        color: #E94E3D;
    }
    
    /* Submenu regular items */
    .mobile-menu-list .sub-menu li:not(.submenu-title):not(.submenu-back) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .mobile-menu-list .sub-menu li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-list .sub-menu a {
        display: block;
        padding: 15px 20px;
        color: #2C3E50;
        text-decoration: none;
        font-size: 15px;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .mobile-menu-list .sub-menu a:hover {
        background: rgba(233, 78, 61, 0.05);
        color: #E94E3D;
    }
    
    /* Second level submenu */
    .mobile-menu-list .sub-menu .sub-menu {
        background: #f8f8f8;
    }
    
    .mobile-menu-list .sub-menu.hide-parent {
        opacity: 0;
        transform: translateX(-100%);
        pointer-events: none;
    }
    
    /* Icons for second level with children */
    .mobile-menu-list .sub-menu .menu-item-has-children > a::after {
        content: '\203A';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        font-weight: bold;
        font-family: Arial, sans-serif;
        pointer-events: none;
    }
}

/* ============================================
   DYNAMIC COLORS FROM THEME OPTIONS
   ============================================ */

body .mega-menu-dropdown {
    background: var(--mega-menu-bg-color, #f8f4f0);
}

body .mega-menu-continent-header {
    background: var(--mega-menu-continent-bg-color, #c34f5a);
    color: #ffffff !important;
}

/* ============================================
   DROPDOWN ARROW - FONT AWESOME ICON
   ============================================ */

/* Show dropdown arrows ONLY on menu items with submenus using Font Awesome */
.primary-menu > li.menu-item-has-children > a::after {
    content: '\f107' !important;
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    margin-left: 7px !important;
    display: inline !important;
    position: relative !important;
    top: 1px !important;
    transition: transform 0.3s ease !important;
}

.primary-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg) !important;
    opacity: 1 !important;
}
