/* Menu hamburger mobile - système de navigation slide-in */

/* Bouton hamburger - caché par défaut sur desktop */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.mobile-menu-toggle:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* Icône hamburger */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hamburger-icon span {
  display: block;
  width: 24px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Animation du bouton quand le menu est ouvert */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay sombre quand menu ouvert */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Sur mobile uniquement - incluant mode paysage */
@media (max-width: 768px), (max-height: 600px) and (max-width: 1024px) {
  /* Afficher le bouton hamburger */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Menu par défaut caché hors écran */
  #nav-container {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: #ffffff;
    z-index: 999;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #e2e8f0;
    border-bottom: none !important;
  }

  /* Menu ouvert - slide in depuis la gauche */
  #nav-container.mobile-open {
    left: 0 !important;
  }

  /* Ajuster le padding du menu */
  #nav-container .rtc-main-nav {
    padding-top: 1rem;
  }

  /* Le contenu principal prend toute la largeur */
  .layout {
    flex-direction: column;
    gap: 0;
  }

  .main-content {
    width: 100%;
    padding: 1rem;
    margin-top: 0;
  }

  /* Améliorer la lisibilité des items de menu sur mobile */
  .nav-link,
  .nav-dropdown-toggle {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .nav-dropdown-item {
    padding: 0.65rem 1rem 0.65rem 1.5rem;
    font-size: 0.875rem;
  }

  /* Language switcher au bas du menu mobile */
  .nav-lang-switcher {
    margin-top: auto;
    padding: 1rem;
    border-top: 2px solid #e2e8f0;
    justify-content: center;
  }
}

/* Empêcher le scroll du body quand menu ouvert */
body.mobile-menu-open {
  overflow: hidden;
}
