/*
 * Nova Addons for Elementor - Mega Menu Styles
 * Shine brighter with every page.
 */

.nova-mega-menu-container {
    /* Base container style for the menu */
}

.nova-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* For horizontal menu */
}

.nova-menu-list > li {
    position: relative; /* Important for positioning the panel */
    padding: 0 15px;
}

.nova-menu-list > li > a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
}

/* Mega Menu Panel */
.nova-mega-menu-panel {
    position: absolute;
    top: 100%; /* Displays just below the menu item */
    left: 0;
    width: 100%; /* Uses 100% of the parent container width (li) */
    max-width: 1200px; /* Max width to avoid overflow on very large screens */
    background: #ffffff;
    /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); */
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevents clicking while hidden */
    transition: opacity 0.3s, visibility 0.3s;
    /* Elementor content is injected here */
}

/* Dropdown icon style */
.nova-mega-menu-icon {
    margin-left: 5px;
    font-size: 0.8em;
}

/* Panel display on hover */
.nova-menu-list > li.nova-has-mega-menu:hover > .nova-mega-menu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Allows clicking when visible */
}

/* First level menu item style on hover */
.nova-menu-list > li.nova-has-mega-menu:hover > a {
    /* Highlight the active menu item */
    color: #4CAF50;
}

/* Rule for Elementor content inside the panel */
.nova-mega-menu-panel .elementor {
    padding: 20px;
}

/* Adjustment for classic submenus if the item is NOT a mega menu */
.nova-menu-list > li:not(.nova-has-mega-menu) > ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    padding: 10px;
    margin: 0;
    background: #f9f9f9;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.nova-menu-list > li:not(.nova-has-mega-menu):hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
}

/* Sur mobile, utiliser display au lieu de opacity/visibility */
@media (max-width: 768px) {
	.nova-menu-list > li:not(.nova-has-mega-menu) > ul.sub-menu {
		position: relative;
		top: auto;
		left: 0;
		margin-left: 20px;
		box-shadow: none;
		border-left: 2px solid rgba(0, 0, 0, 0.1);
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}
	
	.nova-menu-list > li:not(.nova-has-mega-menu).nova-submenu-open > ul.sub-menu {
		display: block;
	}
	
	.nova-menu-list > li:not(.nova-has-mega-menu):hover > ul.sub-menu {
		display: none;
		opacity: 1;
		visibility: visible;
	}
}

.nova-menu-list ul.sub-menu li a {
    padding: 5px 0;
    display: block;
}

/* ================================
   Mobile Breadcrumb Styles
================================ */

.nova-mobile-breadcrumb {
    position: relative;
}

.nova-mobile-breadcrumb-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 24px;
    color: inherit;
    z-index: 1000;
    position: relative;
}

.nova-mobile-breadcrumb-toggle svg,
.nova-mobile-breadcrumb-toggle i {
    width: 24px;
    height: 24px;
    display: block;
}

.nova-mobile-breadcrumb-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nova-mobile-breadcrumb-overlay.active {
    display: block;
    opacity: 1;
}

.nova-mobile-breadcrumb-content {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 90%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    /* GSAP will handle transforms, so we don't set initial transform here */
    /* Visibility will be controlled by GSAP animations */
    visibility: hidden;
    pointer-events: none;
}

.nova-mobile-breadcrumb-content.active {
    visibility: visible;
    pointer-events: auto;
}

.nova-mobile-breadcrumb-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    z-index: 10000;
    padding: 5px 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nova-mobile-breadcrumb-close:hover {
    color: #000;
}

.nova-mobile-breadcrumb-close-icon {
    display: block;
    font-weight: 300;
}

.nova-mobile-breadcrumb-close-icon svg,
.nova-mobile-breadcrumb-close-icon i {
    width: 1em;
    height: 1em;
    display: block;
}

.nova-mobile-breadcrumb-template-wrapper {
    padding: 60px 20px 20px;
    width: 100%;
}

/* S'assurer que le menu dans le popup est visible */
.nova-mobile-breadcrumb-template-wrapper .nova-icon-menu-container {
    display: block !important;
    visibility: visible !important;
}

.nova-mobile-breadcrumb-template-wrapper .nova-icon-menu-list {
    display: flex !important;
    flex-direction: column;
}

/* Show breadcrumb toggle based on responsive breakpoint */
/* JavaScript will handle the display based on configured breakpoints */
/* Default: hidden, JavaScript will show it when viewport <= breakpoint */
.nova-mobile-breadcrumb-toggle {
    display: none;
}

/* Fallback CSS: Show toggle on mobile/tablet if JavaScript fails */
/* This ensures the toggle is visible even if JS doesn't run */
@media (max-width: 1024px) {
    .nova-mobile-breadcrumb-toggle {
        display: block !important;
    }
    
    /* Hide the main menu when toggle is visible */
    .nova-mobile-breadcrumb ~ .nova-icon-menu-container,
    .nova-mobile-breadcrumb ~ .nova-mega-menu-container {
        display: none !important;
    }
}

/* Tablet adjustments */
@media (max-width: var(--breadcrumb-breakpoint-tablet, 768px)) {
    .nova-mobile-breadcrumb-content {
        max-width: 85%;
    }
}

/* Mobile adjustments */
@media (max-width: var(--breadcrumb-breakpoint-mobile, 480px)) {
    .nova-mobile-breadcrumb-content {
        max-width: 100%;
    }
    
    .nova-mobile-breadcrumb-template-wrapper {
        padding: 50px 15px 15px;
    }
}

