/* --- File: css/components/mobile-menu.css (Fichier complet et réécrit) --- */

/* --- Styles pour l'overlay principal --- */
.mobile-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  z-index: 499;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 0.3s ease, visibility 0s 0.3s, background-color 0.3s ease,
    backdrop-filter 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition-delay: 0s;
  height: 140%;
}

/* --- Styles pour le contenu du menu --- */
.mobile-menu-content {
  position: fixed;
  top: var(
    --mobile-bars-height,
    60px
  ); /* Positionné par rapport à la fenêtre */
  left: 0;
  bottom: 0;
  width: 70%;
  background-color: var(--clr-bg-card);
  padding: 1rem 0 1rem 1rem; /* Padding vertical, le padding horizontal sera sur les liens */
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  pointer-events: auto;
}

.mobile-menu-overlay.open .mobile-menu-content {
  transform: translateX(0);
}

/* --- Sections & Titres --- */
.mobile-menu-section {
  margin: 60px 0 2rem 0;
}

.mobile-menu-section:last-child {
  margin-bottom: 1rem;
}

/* --- Listes & Liens (Nouveau Style) --- */
.mobile-nav-links,
.mobile-social-links-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-links > li,
.mobile-social-links-menu > li {
  margin-bottom: 0.25rem;
}

/* Style commun pour les liens de premier niveau */
.mobile-nav-links > li > a,
.mobile-social-links-menu > li > a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--clr-text-sub);
  font-weight: 500;
  font-size: 1rem;
  border-left: 4px solid transparent; /* Indicateur d'activité, transparent par défaut */
  transition: background-color 0.2s ease, color 0.2s ease,
    border-left-color 0.2s ease;
}

.mobile-nav-links > li > a:hover,
.mobile-social-links-menu > li > a:hover {
  background-color: rgba(var(--clr-text-rgb), 0.03);
  color: var(--clr-text);
}

/* Style du lien ACTIF de premier niveau */
.mobile-nav-links > li.active-parent-link > a {
  background-color: rgba(var(--clr-text-rgb), 0.07);
  color: var(--clr-text);
  font-weight: 600;
  border-left-color: var(--clr-text);
}

/* --- Styles pour le sous-menu imbriqué --- */
.mobile-sub-nav {
  list-style: none;
  padding: 0.5rem 0 0.5rem 1rem;
  /* Marge alignée avec le texte du parent */
  margin: 0 0 0 calc(1rem + 4px); /* 1rem (padding parent) + 4px (bordure) */
  border-left: 1px solid rgba(var(--clr-text-rgb), 0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, margin-top 0.3s ease-out,
    margin-bottom 0.3s ease-out;
}

/* Expansion du sous-menu quand le parent est actif */
.mobile-nav-links > li.active-parent-link .mobile-sub-nav {
  max-height: 500px; /* Valeur arbitraire assez grande */
}

.mobile-sub-nav li {
  margin: 0;
}

/* Style des sous-liens */
.mobile-sub-nav a {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  color: var(--clr-text-sub);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  border-left: none; /* S'assurer qu'il n'y a pas de bordure héritée */
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-sub-nav a:hover {
  background-color: rgba(var(--clr-text-rgb), 0.05);
  color: var(--clr-text);
}

body.mobile-menu-is-open {
  overflow: hidden;
}
