/* ==================== MENU HAMBURGER MOBILE ==================== */

/* Bouton hamburger - caché sur desktop */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 8px;
  z-index: 101;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(212, 175, 55, 0.1);
}

.mobile-menu-toggle:focus {
  outline: none;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background: var(--gold);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Animation du hamburger en X */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive - Menu mobile */
@media (max-width: 768px) {
  /* Afficher le bouton hamburger */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Header modifications */
  .header-inner {
    position: relative;
  }
  
  /* Menu navigation */
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 26, 42, 0.98);
    backdrop-filter: blur(12px);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid transparent;
    box-shadow: none;
    z-index: 99;
  }
  
  /* Menu ouvert */
  .nav.mobile-open {
    max-height: calc(100vh - var(--header-height));
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  
  /* Liens du menu mobile */
  .nav a {
    width: 100%;
    height: auto;
    padding: 16px 24px;
    border-radius: 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.05);
    justify-content: flex-start;
    font-size: 16px;
    transform: translateX(-20px);
    opacity: 0;
    transition: all 0.3s ease;
  }
  
  /* Animation des liens quand le menu s'ouvre */
  .nav.mobile-open a {
    transform: translateX(0);
    opacity: 1;
  }
  
  /* Délai d'animation progressif pour chaque lien */
  .nav.mobile-open a:nth-child(1) { transition-delay: 0.05s; }
  .nav.mobile-open a:nth-child(2) { transition-delay: 0.1s; }
  .nav.mobile-open a:nth-child(3) { transition-delay: 0.15s; }
  .nav.mobile-open a:nth-child(4) { transition-delay: 0.2s; }
  .nav.mobile-open a:nth-child(5) { transition-delay: 0.25s; }
  .nav.mobile-open a:nth-child(6) { transition-delay: 0.3s; }
  
  .nav a:last-child {
    border-bottom: none;
  }
  
  .nav a:hover,
  .nav a:focus {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
  }
  
  /* Lien actif - utiliser seulement la surbrillance */
  .nav a.active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
  }
  
  /* Désactiver la barre verticale pour mobile */
  .nav a.active::after {
    display: none;
  }
  
  /* Sélecteur de langue dans le menu mobile */
  .nav a.lang-switch {
    margin: 12px auto 16px;
    width: auto;
    min-width: 80px;
    padding: 12px 24px;
    justify-content: center;
    border-radius: 8px;
  }
  
  /* Overlay pour fermer le menu en cliquant dehors */
  .mobile-menu-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
  }
  
  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Empêcher le scroll du body quand le menu est ouvert */
  body.mobile-menu-open {
    overflow: hidden;
  }
  
  /* S'assurer que le header reste fixe */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
  
  /* Ajouter un padding-top au body pour compenser le header fixe */
  body {
    padding-top: var(--header-height);
  }
  
  /* Ajuster la hero section */
  .hero {
    padding-top: 60px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .mobile-menu-toggle {
    width: 38px;
    height: 38px;
    padding: 8px 6px;
  }
  
  .logo {
    width: 36px;
    height: 36px;
  }
  
  .brand-name {
    font-size: 1.1rem;
  }
  
  .nav a {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* Assurer que les éléments interactifs restent accessibles */
@media (max-width: 768px) {
  /* Les toggles et autres éléments interactifs doivent être au-dessus du menu */
  .workflow-toggle,
  .toggle-btn,
  .twin-controls-compact,
  .toggle-switch-compact,
  .canvas,
  .workflow-demo,
  .digital-twin-simple {
    position: relative;
    z-index: 1;
  }
  
  /* Les modaux doivent rester au-dessus de tout */
  .approach-modal,
  .approach-modal-overlay,
  .metadata-panel,
  .metadata-overlay {
    z-index: 9999 !important;
  }
}
