/* CORRECTION MEGA MENU - Affichage multiple */

/* Reset complet des mega menus pour éviter les conflits */
.mega-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(-15px) scale(0.98) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none !important;
    z-index: 9999 !important;
}

/* Affichage au hover avec priorité absolue */
.nav-item:hover > .mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
    pointer-events: auto !important;
    transition-delay: 0s !important;
}

/* Maintenir l'affichage quand on survole le mega menu */
.mega-menu:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

/* Zone de tolérance pour la souris entre le nav-item et le mega-menu */
.nav-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
    pointer-events: auto;
    z-index: 9998;
}

.nav-item:hover::after {
    pointer-events: auto;
}

/* Assurer que les animations se reset correctement */
@keyframes megaMenuShow {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.nav-item:hover .mega-menu {
    animation: megaMenuShow 0.3s ease-out forwards !important;
}

/* Desktop only - cache les mega menus sur mobile */
@media (max-width: 768px) {
    .mega-menu {
        display: none !important;
    }
}

/* Force la réinitialisation des styles JavaScript */
.mega-menu[style] {
    opacity: 0 !important;
    visibility: hidden !important;
}

.nav-item:hover .mega-menu[style] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
}
