/* ============================================
   MEGA MENU V2 - Styles personnalisés
   Évite les conflits avec d'autres pages
   ============================================ */

/* Container du mega menu */
.mega-menu-v2 {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 950;
    pointer-events: none;
    border-top: 3px solid rgba(212, 175, 55, 0.5);
    min-height: 400px;
}

.mega-menu-v2.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Container intérieur */
.mega-menu-v2-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* Grille du mega menu */
.mega-menu-v2-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Colonnes */
.mega-menu-v2-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Items du menu */
.mega-menu-v2-item {
    margin: 0;
    padding: 0;
}

.mega-menu-v2-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.mega-menu-v2-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

.mega-menu-v2-link:hover {
    background-color: rgba(212, 175, 55, 0.1);
    border-left-color: #d4af37;
    padding-left: 20px;
    transform: translateX(4px);
}

.mega-menu-v2-link:hover::before {
    width: 100%;
}

.mega-menu-v2-link:hover .mega-menu-v2-icon {
    background-color: rgba(212, 175, 55, 0.2);
    transform: scale(1.1) rotate(5deg);
}

.mega-menu-v2-link:hover span {
    color: #d4af37;
}

/* Icônes */
.mega-menu-v2-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mega-menu-v2-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}

.mega-menu-v2-link span {
    flex: 1;
    transition: color 0.3s ease;
    line-height: 1.3;
}

/* Animation d'entrée des items */
.mega-menu-v2.active .mega-menu-v2-item {
    animation: fadeInUp 0.4s ease forwards;
}

.mega-menu-v2.active .mega-menu-v2-column:nth-child(1) .mega-menu-v2-item {
    animation-delay: 0.05s;
}

.mega-menu-v2.active .mega-menu-v2-column:nth-child(2) .mega-menu-v2-item {
    animation-delay: 0.1s;
}

.mega-menu-v2.active .mega-menu-v2-column:nth-child(3) .mega-menu-v2-item {
    animation-delay: 0.15s;
}

.mega-menu-v2.active .mega-menu-v2-column:nth-child(4) .mega-menu-v2-item {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour le lien "NOS SERVICES" avec indicateur */
.nav-menu-v2-has-mega {
    position: relative;
}

.nav-menu-v2-has-mega > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #d4af37;
    transition: width 0.3s ease;
}

.nav-menu-v2-has-mega:hover > a::after,
.nav-menu-v2-has-mega.active > a::after {
    width: 100%;
}

/* ============================================
   RESPONSIVE - Tablette et Mobile
   ============================================ */

@media (max-width: 1200px) {
    .mega-menu-v2-container {
        padding: 30px 20px;
    }
    
    .mega-menu-v2-grid {
        gap: 20px;
    }
    
    .mega-menu-v2-link {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .mega-menu-v2-icon {
        width: 32px;
        height: 32px;
    }
    
    .mega-menu-v2-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 992px) {
    /* Sur tablette, afficher le mega menu en 2 colonnes */
    .mega-menu-v2-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .mega-menu-v2-container {
        padding: 25px 15px;
    }
    
    .mega-menu-v2-link {
        font-size: 13px;
        padding: 10px 12px;
    }
}

@media (max-width: 768px) {
    /* Sur mobile, masquer le mega menu (utiliser le menu vertical à la place) */
    .mega-menu-v2 {
        display: none !important;
    }
    
    .mega-menu-v2-container {
        padding: 80px 20px 30px;
        min-height: 100vh;
    }
    
    .mega-menu-v2-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .mega-menu-v2-column {
        gap: 6px;
    }
    
    .mega-menu-v2-link {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .mega-menu-v2-icon {
        width: 38px;
        height: 38px;
    }
    
    .mega-menu-v2-icon svg {
        width: 20px;
        height: 20px;
    }
    
    /* Bouton de fermeture sur mobile */
    .mega-menu-v2::before {
        content: '✕';
        position: fixed;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(212, 175, 55, 0.2);
        color: #ffffff;
        font-size: 24px;
        border-radius: 50%;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s ease;
    }
    
    .mega-menu-v2::before:hover {
        background-color: rgba(212, 175, 55, 0.4);
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .mega-menu-v2-container {
        padding: 70px 15px 20px;
    }
    
    .mega-menu-v2-link {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .mega-menu-v2-icon {
        width: 34px;
        height: 34px;
    }
    
    .mega-menu-v2-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Overlay pour mobile */
.mega-menu-v2-overlay-mobile {
    display: none;
}

@media (max-width: 768px) {
    .mega-menu-v2-overlay-mobile {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(10, 22, 40, 0.9);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 899;
    }
    
    .mega-menu-v2-overlay-mobile.active {
        opacity: 1;
        visibility: visible;
    }
}
