/* 
 * STYLES COMPLETS POUR HEADER ET MENU OVERLAY 
 * 1. Styles de base du header
 * 2. Menu hamburger et croix
 * 3. Menu overlay plein écran
 * 4. Menu commun des sous-sites (barre bleue)
 * 5. Menu spécifique des sous-sites
 * 6. Styles communs pour les sous-menus
 * 7. Media queries responsive
 */

/* -----------------------------------------------------
   1. Styles de base du header
   ----------------------------------------------------- */
.site-header {
  position: relative;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
  /* Ajouter une transition */
}

/* Changement de couleur du header quand le menu est ouvert */
body.menu-open .site-header {
  background-color: #003399;
  /* Passe au bleu quand menu ouvert */
}

/* Adaptation des icônes du burger menu */
body.menu-open .burger-icon {
  background-color: #fff;
  /* Blanc quand sur fond bleu */
}

/* Si vous avez d'autres éléments dans le header dont la couleur doit s'adapter */
body.menu-open .site-header a,
body.menu-open .site-header .site-title {
  color: #fff;
}

body.menu-open .site-header a,
body.menu-open .site-header .site-title .language-dropdown {
  color: #2e2e2e;
}

.header-wrapper {
  display: flex;
  align-items: center;
  padding: 15px 0;
  position: relative;
  /* Nouvelle structure équilibrée */
  justify-content: space-between;
  gap: 15px;
  flex-wrap: nowrap;
  min-height: 60px;
}

/* Section gauche - 40% */
.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 0 0 40%;
  justify-content: flex-start;
  min-width: 0;
}

/* Section centre - 20% pour le logo */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 15%;
  text-align: center;
  white-space: nowrap;
}

/* Section droite - 40% */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 40%;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: nowrap;
}

.site-branding,
.contact-button,
.partner-logos,
.site-logo-acf {
  z-index: 10001;
  position: relative;
}

/* Styles pour les logos normaux et blancs */
.site-logo-acf .logo-normal,
.site-logo-acf .logo-white {
  max-height: 35px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  transition: opacity 0.3s ease !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* S'assurer que le lien du logo est visible */
.site-logo-acf {
  display: block !important;
  line-height: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.site-logo-acf .logo-white {
  display: none !important;
}

/* Logique CSS pour changer le logo quand le menu est ouvert */
body.menu-open .site-logo-acf .logo-normal {
  display: none !important;
}

body.menu-open .site-logo-acf .logo-white {
  display: block !important;
}

/* Styles pour le logo principal du site basés sur .header-center */
.header-center .main-site-logo-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10001 !important;
  position: relative !important;
  text-decoration: none !important;
}

.header-center .main-site-logo {
  max-height: 35px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  transition: opacity 0.3s ease !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Styles pour le nom du site principal (fallback) basés sur .header-center */
.header-center .site-name-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10001 !important;
  position: relative !important;
  text-decoration: none !important;
}

.header-center .site-name {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--primary-color) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  margin: 10px 0 !important;
  text-align: center !important;
}

.site-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 10px 0;
  text-align: center;
}

/* Optimiser le widget météo */
.meteo-widget {
  font-size: 9px;
  flex-shrink: 0;
}

.meteo-widget .meteo-france-widget {
  gap: 2px;
  font-size: 8px !important;
}

.meteo-widget .meteo-france-widget>div {
  font-size: 8px !important;
  line-height: 1.1;
}

/* Optimiser le sélecteur de langue */
.language-selector {
  flex-shrink: 0;
  position: relative;
}

.custom-language-switcher {
  position: relative;
  margin-left: 10px;
}

.custom-language-switcher .selected-language {
  padding: 6px 12px 6px 4px;
  min-height: 24px;
}

/* Optimiser le bouton contact */
.contact-button {
  flex-shrink: 0;
}

.contact-button .btn {
  padding: 6px 12px;
  font-size: 12px;
}

@media (max-width: 1000px) {

  /* Masquer éléments sur tablette et mobile */
  .contact-button,
  .meteo-widget,
  .site-logo-acf,
  .site-branding,
  body.menu-open .contact-button,
  #overlay-menu .contact-button,
  .overlay-custom-content .contact-button,
  .header-right .contact-button {
    display: none !important;
  }

  /* Adapter la structure pour tablette */
  .header-wrapper {
    gap: 10px;
  }

  .header-left,
  .header-right {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .site-name {
    font-size: 20px;
  }

  /* Adapter la structure pour mobile */
  .header-wrapper {
    gap: 8px;
  }

  /* Ajuster les proportions du header sur tablette */
  .header-left {
    flex: 0 0 30%;
  }

  .header-center {
    flex: 1 1 40%;
  }

  .header-right {
    flex: 0 0 30%;
  }

  .header-left,
  .header-right {
    gap: 8px;
  }

  /* Réduire légèrement les éléments sur tablette */
  .custom-language-switcher {
    margin-left: 8px;
  }
}

@media (max-width: 480px) {
  .site-name {
    font-size: 18px;
  }

  /* Structure très compacte pour très petits écrans */
  .header-wrapper {
    gap: 5px;
  }

  /* Ajuster les proportions du header sur mobile */
  .header-left {
    flex: 0 0 25% !important; /* Réduire de 40% à 25% */
  }

  .header-center {
    flex: 1 1 auto !important; /* Laisser le centre s'adapter */
  }

  .header-right {
    flex: 0 0 25% !important; /* Réduire de 40% à 25% */
  }

  .header-left,
  .header-right {
    gap: 5px;
  }

  /* Masquer le texte des langues sur mobile, garder seulement le drapeau */
  .language-selector .lang-name,
  .language-selector li a span:not(.flag),
  .language-selector .selected-language span:first-of-type,
  .language-selector .language-dropdown .language-item span {
    display: none !important;
  }

  .language-selector li a {
    padding: 5px !important;
    min-width: auto !important;
  }

  .language-selector .selected-language {
    min-width: auto !important;
  }

  .custom-language-switcher {
    min-width: auto !important;
    margin-left: 5px !important;
  }

  .language-dropdown {
    min-width: auto !important;
  }

  /* Réduire la taille du drapeau sur mobile */
  .selected-language img,
  .language-item img {
    width: 16px !important;
    max-height: 16px !important;
  }
}

/* Changer la couleur du nom du site en blanc quand le menu est ouvert - Toutes tailles */
body.menu-open .site-header .site-name,
body.menu-open p.site-name {
  color: white !important;
}

/* -----------------------------------------------------
    2. Menu hamburger et croix
    ----------------------------------------------------- */
/* Style du burger menu et sa transformation */
.burger-menu-wrapper {
  position: relative;
  z-index: 10002;
  /* Plus élevé que l'overlay à 10000 */
  background-color: #003399;
  /* Bleu par défaut */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  /* Transition pour le changement de couleur */
  cursor: pointer;
  /* Curseur pointer pour indiquer que c'est cliquable */
}

/* Changer la couleur du wrapper en blanc quand le menu est ouvert */
.burger-menu.close+.burger-menu-wrapper,
.burger-menu-wrapper:has(.burger-menu.close),
body.menu-open .burger-menu-wrapper {
  background-color: white;
  /* Blanc quand le menu est ouvert */
}

.burger-menu {
  position: relative;
  z-index: 10002;
  background: none;
  border: none;
  cursor: pointer;
  width: 20px;
  height: 20px;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

/* Position des lignes */
.burger-icon {
  position: absolute;
  display: block;
  width: 20px;
  height: 2px;
  background-color: white;
  /* Couleur par défaut blanche */
  transition: all 0.3s ease;
  left: 0;
}

/* Positions initiales */
.burger-icon:nth-child(1) {
  top: 4px;
}

.burger-icon:nth-child(2) {
  top: 10px;
}

.burger-icon:nth-child(3) {
  top: 16px;
}

/* Transformations en croix */
.burger-menu.close .burger-icon {
  background-color: #003399;
  /* Lignes bleues quand le fond est blanc */
}

.burger-menu.close .burger-icon:nth-child(1) {
  top: 10px;
  transform: rotate(45deg);
}

.burger-menu.close .burger-icon:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.burger-menu.close .burger-icon:nth-child(3) {
  top: 10px;
  transform: rotate(-45deg);
}

/* -----------------------------------------------------
    3. Menu overlay plein écran
    ----------------------------------------------------- */
.main-navigation {
  display: block;
  position: relative;
}

#overlay-menu {
  display: none;
  position: fixed;
  left: 0;
  width: 100%;
  height: calc(100vh);
  /* Ajuster la hauteur pour tenir compte du header */
  background-color: var(--primary-color);
  z-index: 9999;
  /* Légèrement en dessous des éléments header qui doivent rester visibles */
  align-items: flex-start;
  /* Aligner en haut plutôt qu'au centre */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 0;
  overflow-y: auto;
  /* Permettre le défilement à l'intérieur du menu */
}

#overlay-menu.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  flex-direction: column;
}

/* Structure du contenu du menu overlay */

/* Les styles pour overlay-custom-content sont désormais gérés par la classe container */
.overlay-custom-content {
  padding: 0;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Container pour le contenu du menu burger */
.burger-menu-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}


/* Layout en colonnes pour le menu burger */
.burger-menu-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

/* Colonne de gauche - liens */
.burger-menu-links-column {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.burger-menu-links-column h3 {
  color: white;
  font-size: 24px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.burger-menu-links-column h3:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
}

/* Styles pour les liens personnalisés du menu burger */
.burger-menu-links ul {
  list-style: none !important;
  padding: 40px 0 !important;
  margin: 0 !important;
  text-align: center !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 20px !important;
}

.burger-menu-links ul li {
  margin: 0 !important;
  width: 100% !important;
  display: block !important;
}

.burger-menu-links ul li a {
  color: white;
  font-size: 28px;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  line-height: 1.4;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  transform-origin: center;
}

.burger-menu-links ul li a:hover {
  transform: scale(1.1) !important;
  /* Effet d'agrandissement au survol */
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Colonne de droite - carte */
.burger-menu-map-column {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Styles pour la carte dans le menu burger */
.burger-menu-map {
  padding: 0;
  height: 100%;
}

.burger-menu-map h3 {
  color: white;
  font-size: 24px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.burger-menu-map h3:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
}

.burger-menu-map .map-container {
  position: relative;
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.burger-menu-map .static-map,
.burger-menu-map .interactive-map {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.burger-menu-map .static-map img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.burger-menu-map .interactive-map {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.burger-menu-map .france-map-burger {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Style spécifique pour la carte plein écran */
.full-size-map {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.full-size-map iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

.burger-menu-map .btn-carte {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: white;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 30px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 14px;
  transition: all 0.3s ease;
}

.burger-menu-map .btn-carte:hover {
  background-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-3px);
}

/* Style pour les appareils mobiles */
@media (max-width: 768px) {
  .burger-menu-row {
    flex-direction: column;
  }

  .burger-menu-links-column,
  .burger-menu-map-column {
    max-width: 100%;
    width: 100%;
  }

  .burger-menu-map .map-container {
    width: 100%;
    height: 400px;
  }

  .full-size-map iframe {
    height: 400px;
  }
  
  /* Masquer le bouton contact dans le burger menu sur tablette et mobile */
  #overlay-menu .contact-button,
  .burger-menu-container .contact-button,
  .overlay-custom-content .contact-button,
  .header-right .contact-button,
  div.contact-button[style*="display: block"] {
    display: none !important;
  }
}

/* Fin des styles du menu burger */

/* Suppression des styles du menu WordPress automatique */

/* Bouton de fermeture X */
.close-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 10001;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  transition: transform 0.3s ease;
}

.close-overlay:hover {
  transform: rotate(90deg);
}

.close-overlay span {
  position: relative;
  width: 30px;
  height: 30px;
}

.close-overlay span::before,
.close-overlay span::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: white;
  top: 50%;
  left: 0;
}

.close-overlay span::before {
  transform: rotate(45deg);
}

.close-overlay span::after {
  transform: rotate(-45deg);
}

/* -----------------------------------------------------
    4. Menu commun des sous-sites (barre bleue)
    ----------------------------------------------------- */
.common-subsites-menu {
  background-color: #4367ae;
  padding: 0;
  width: 100%;
}

.common-nav-menu .menu-nav-wrapper {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 8px 0;
}

.common-nav-menu .nav-item {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  display: inline-block;
  font-weight: 600;
  position: relative;
  transition: all 0.3s ease;
}

.common-nav-menu .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* -----------------------------------------------------
    5. Menu spécifique des sous-sites
    ----------------------------------------------------- */
.menu-navigation {
  padding: 0;
  position: relative;
  margin-bottom: 30px;
  margin-top: 30px;
}

.menu-navigation .menu-nav-wrapper {
  display: flex;
  justify-content: space-around;
  background-color: var(--primary-color);
  border-radius: 8px;
  padding: 0;
}

.menu-navigation .nav-item {
  color: white;
  text-decoration: none;
  padding: 15px 20px;
  display: inline-block;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

.menu-navigation .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* -----------------------------------------------------
    6. Styles communs pour les sous-menus
    ----------------------------------------------------- */
.nav-item-with-submenu {
  position: relative;
}

.submenu-indicator {
  font-size: 10px;
  margin-left: 5px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.nav-item-with-submenu:hover .submenu-indicator {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-color: white;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.nav-item-with-submenu:hover .submenu {
  display: block;
}

.submenu a {
  color: #333;
  padding: 12px 15px;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.submenu a:hover {
  background-color: #f5f5f5;
}

.common-nav-menu .submenu {
  background-color: white;
  color: #333;
}

.menu-navigation .submenu {
  background-color: var(--primary-color);
}

.menu-navigation .submenu a {
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-navigation .submenu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* -----------------------------------------------------
    7. Styles pour le sélecteur de langue personnalisé
    ----------------------------------------------------- */

/* Styles pour le sélecteur de langue personnalisé */
.custom-language-switcher {
  position: relative;
  z-index: 10001;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
  margin-left: auto;
}

.selected-language {
  display: flex;
  align-items: center;
  border-radius: 20px;
  border: 1px solid #333;
  background-color: transparent;
  color: #333;
  gap: 5px;
  padding: 5px 10px;
}

.selected-language::after {
  content: '';
  border: solid #333;
  border-width: 0 1px 1px 0;
  display: inline-block;
  padding: 3.5px;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.custom-language-switcher.open .selected-language::after {
  transform: rotate(-135deg);
}

.selected-language img {
  width: 20px;
  height: auto;
  border-radius: 2px;
  object-fit: contain;
  max-height: 20px;
}

.language-arrow {
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.custom-language-switcher.open .language-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 10002;
}

.custom-language-switcher.open .language-dropdown {
  display: block;
}

.language-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
  gap: 8px;
  transition: background-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.language-item:hover {
  background-color: #f5f5f5;
  color: #333 !important;
}

.language-item.selected {
  font-weight: bold;
  background-color: rgba(0, 51, 153, 0.05);
}

.language-item img {
  width: 20px;
  height: auto;
  border-radius: 2px;
  object-fit: contain;
  max-height: 20px;
}

/* Adaptation au menu ouvert */
body.menu-open .selected-language {
  border-color: white;
  color: white;
}

body.menu-open .selected-language::after {
  border-color: white;
}

.custom-language-switcher.menu-open .selected-language {
  border-color: white;
  color: white;
}

/* -----------------------------------------------------
    8. Styles pour le sélecteur de langue (Polylang) - Fallback
    ----------------------------------------------------- */
.language-selector {
  position: relative;
  z-index: 10001;
}

/* Style du sélecteur principal */
.language-selector select,
.pll-parent-menu-item>a {
  background-color: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  font-weight: 500;
  min-width: 80px;
  justify-content: center;
}

/* Adapter les couleurs quand le menu est ouvert */
body.menu-open .language-selector select,
body.menu-open .pll-parent-menu-item>a {
  color: white;
  border-color: white;
}

/* Style pour le dropdown */
.language-selector .pll-select-box {
  position: relative;
}

/* Style pour les langues dans le dropdown */
.language-selector ul {
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  padding: 0;
  margin: 5px 0 0;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-width: 120px;
  z-index: 10002;
}

.language-selector li {
  padding: 0;
  margin: 0;
}

.language-selector li a {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s;
  font-size: 14px;
}

.language-selector li a:hover {
  background-color: #f5f5f5;
}

/* Style des drapeaux */
.language-selector img {
  width: 18px;
  height: auto;
  margin-right: 8px;
  border-radius: 2px;
}

/* Style pour la langue active */
.language-selector li.current-lang a {
  font-weight: bold;
  background-color: rgba(0, 51, 153, 0.05);
}

/* Flèche dropdown */
.pll-parent-menu-item>a::after {
  content: "▼";
  font-size: 10px;
  margin-left: 5px;
  display: inline-block;
}

/* -----------------------------------------------------
    8. Media queries responsive
    ----------------------------------------------------- */

/* Personnalisation spécifique pour les différents types de sélecteurs de langue de Polylang */
/* 1. Select dropdown */
.language-selector select {
  background-color: transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L0 3h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  padding-right: 25px;
  text-align: center;
}

body.menu-open .language-selector select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L0 3h12z'/%3E%3C/svg%3E");
}

/* 2. Liste de langues avec drapeaux en ligne */
.language-selector:not(.pll-dropdown) ul {
  display: flex;
  position: static;
  background: transparent;
  box-shadow: none;
  gap: 5px;
}

.language-selector:not(.pll-dropdown) li {
  margin: 0 2px;
}

.language-selector:not(.pll-dropdown) li a {
  background-color: transparent;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.language-selector:not(.pll-dropdown) li a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.language-selector:not(.pll-dropdown) img {
  margin-right: 3px;
  width: 20px;
  height: 20px;
}

.language-selector:not(.pll-dropdown) .lang-name {
  display: none;
  /* Masquer le nom de la langue en mode drapeau */
}

body.menu-open .language-selector:not(.pll-dropdown) li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Style pour tous les écrans - bloquer le scroll quand menu ouvert */
body.menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Style pour les tablettes et mobiles */
@media (max-width: 768px) {

  /* Sur mobile et desktop */
  body.menu-open {
    overflow: hidden !important;
    /* Bloquer le scroll quand menu ouvert */
    position: fixed;
    width: 100%;
    height: 100%;
  }

  /* Cacher le menu principal et les éléments non nécessaires (mais pas les éléments importants) */
  .main-navigation>ul,
  .header-icons {
    display: none;
  }

  /* S'assurer que les éléments importants restent visibles même quand le menu est ouvert */
  body.menu-open .site-branding,
  body.menu-open .site-name,
  body.menu-open .language-selector,
  body.menu-open .contact-button,
  body.menu-open .partner-logos {
    display: block;
    z-index: 10001;
    position: relative;
  }

  .burger-menu-separator-vertical,
  .map-intro-burger,
  .burger-menu-map-section {
    display: none !important;
  }

  /* Changer la couleur du nom du site en blanc quand le menu est ouvert */
  body.menu-open .site-header .site-name,
  body.menu-open p.site-name {
    color: white !important;
  }

  /* Style des éléments qui doivent rester visibles quand le menu est ouvert */
  body.menu-open .contact-button,
  body.menu-open .partner-logos {
    position: relative !important;
    z-index: 10001 !important;
    display: block !important;
  }

  body.menu-open .contact-button .btn {
    background-color: white;
    color: var(--primary-color);
  }

  /* Effet hover sur le bouton contact quand le menu est ouvert */
  body.menu-open .contact-button .btn:hover {
    background-color: #f5f5f5;
    color: #002970;
  }

  /* Styles pour le header mobile */
  .site-header .container {
    padding: 10px;
  }

  .header-wrapper {
    justify-content: space-between;
    padding: 10px 0;
  }

  .site-branding {
    flex: 1;
  }

  /* Styles pour les items-center lorsque le menu est ouvert */
  body.menu-open .items-center {
    display: flex !important;
    z-index: 10001 !important;
    position: relative;
  }

  /* Fixer la hauteur du header pour le menu overlay */
  .site-header {
    height: 70px;
    display: flex;
    align-items: center;
  }

  /* Ajustements pour les menus sous-sites en mode mobile */
  .common-nav-menu .menu-nav-wrapper,
  .menu-navigation .menu-nav-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .common-nav-menu .nav-item,
  .menu-navigation .nav-item {
    padding: 12px 15px;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-item-with-submenu {
    position: static;
  }

  .submenu {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
  }

  .common-nav-menu .submenu {
    background-color: rgba(67, 103, 174, 0.8);
  }

  .menu-navigation .submenu {
    background-color: rgba(62, 58, 120, 0.8);
  }

  .nav-item-with-submenu:hover .submenu {
    display: none;
  }

  .nav-item-with-submenu.open .submenu {
    display: block;
  }

  .submenu a {
    padding-left: 30px;
  }

  /* Dans le menu overlay, ajuster les sous-menus */
  #overlay-menu .submenu {
    position: relative;
    background-color: transparent;
    box-shadow: none;
    margin-top: 10px;
  }

  #overlay-menu .submenu a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
  }

  /* Gérer les sous-menus dans l'overlay */
  #overlay-menu .nav-item-with-submenu.open .submenu {
    display: block;
  }
}

/* -----------------------------------------------------
   9. Styles pour les onglets de pays du menu burger
   ----------------------------------------------------- */
/* Nouveaux styles pour la structure du menu burger */
.burger-menu-content {
  width: 100%;
  height: 100%;
}

.burger-menu-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

.burger-menu-column {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 30px;
  justify-content: flex-start;
  padding: 20px;
}

/* Section du haut en colonne */
.burger-menu-top-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
}

.burger-menu-links {
  width: 100%;
}

/* Séparation horizontale entre les sections */
.burger-menu-separator-vertical {
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 5px 0 10px 0;
}

.burger-menu-map-section {
  width: 100%;
}

/* Adaptation pour mobile */
@media (max-width: 768px) {
  .burger-menu-column {
    padding: 15px;
  }

  .burger-menu-top-section {
    gap: 15px;
  }
}

/* Styles pour les liens */
.burger-menu-links ul {
  list-style: none !important;
  padding: 15px 0 !important;
  margin: 0 !important;
  text-align: left !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

.burger-menu-links ul li {
  margin: 0 !important;
  width: 100% !important;
  display: block !important;
}

.burger-menu-links ul li a {
  color: white;
  font-size: 22px;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  padding: 4px 0;
  line-height: 1.3;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  transform-origin: left center;
}

.burger-menu-links ul li a:hover {
  transform: scale(1.05) !important;
  opacity: 0.9 !important;
  padding-left: 10px !important;
}

/* Styles pour la map intro */
.map-intro-burger {
  width: 100%;
}

.map-title {
  color: white;
  font-size: 24px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

/* ================================
   STYLES BURGER MENU - DÉPARTEMENTS ACTIFS
   ================================
   NOTE: Ces styles sont spécifiques au burger menu.
   Les styles généraux de carte sont dans map-common.css
   ================================ */

.active-departments-badge {
  background-color: rgba(151, 193, 43, 0.2);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  border-left: 4px solid #9ACA3C;
  font-size: 14px;
}

.active-departments-badge .badge-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: #9ACA3C;
}

.active-departments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.department-badge {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.department-badge .dept-code {
  font-weight: 700;
  color: #9ACA3C;
}

.department-badge .dept-name {
  font-size: 12px;
  opacity: 0.9;
}

.department-badge[data-country="it"] {
  background-color: rgba(67, 103, 174, 0.2);
}

.department-badge[data-country="it"] .dept-code {
  color: #4367AE;
}

.map-title:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
}

.department-selector {
  margin-bottom: 20px;
  width: 100%;
}

/* ================================
   STYLES ONGLETS PAYS DÉPLACÉS VERS map-common.css
   ================================
   
   Les styles d'onglets pays ont été consolidés dans map-common.css
   avec des sélecteurs spécifiques pour chaque contexte:
   - #overlay-menu .country-tabs pour le burger menu
   - .choisir-departement-page .country-tabs pour la page département
   - .map-risks-section .country-tabs pour la page d'accueil
   
   ================================ */

/* ================================
   STYLES DROPDOWN DÉPARTEMENT DÉPLACÉS VERS map-common.css
   ================================
   
   Les styles de dropdown ont été consolidés dans map-common.css
   avec des sélecteurs spécifiques:
   - #overlay-menu .department-dropdown pour le burger menu
   - .choisir-departement-page .department-dropdown pour la page département
   - .map-risks-section .department-dropdown pour la page d'accueil
   
   ================================ */

/* Map container */
.burger-map-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ================================
   STYLES SVG ET DÉPARTEMENTS DÉPLACÉS VERS map-common.css
   ================================
   
   Les styles suivants ont été consolidés dans map-common.css :
   - .department (tous les états)
   - svg.france-map-burger, svg.italy-map-burger
   - .department-tooltip
   - .map-loading-message
   
   ================================ */

/* Adaptations responsive */
@media (max-width: 768px) {
  .burger-menu-column {
    padding: 15px;
    flex-direction: column;
  }

  .burger-menu-links ul li a {
    font-size: 20px;
    padding: 8px 0;
  }

  .map-title {
    font-size: 20px;
  }

  /* Styles dropdown consolidés dans map-common.css */

}

/* Styles pour le conteneur du site enfant */
.child-site-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Styles pour le wrapper du site enfant */
.child-site-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Styles pour le nom du site enfant */
.child-site-name {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #ECEFFA;
  border-radius: 15px 15px 0px 0px;
  padding: 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  -webkit-border-radius: 15px 15px 0px 0px;
  -moz-border-radius: 15px 15px 0px 0px;
  -ms-border-radius: 15px 15px 0px 0px;
  -o-border-radius: 15px 15px 0px 0px;
}

.child-site-name h2 {
  color: var(--primary-color);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

/* Styles pour le lien "Changer de département" */
.changer-departement {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 0px;
  border-bottom: 1px solid #003399;
  white-space: nowrap;
  position: absolute;
  top: 20px;
  right: 20px;
}

.changer-departement:hover {
  transform: translateY(-2px);
  color: var(--primary-color);
  text-decoration: none;
}

.changer-departement .icone-localisation {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.changer-departement:hover .icone-localisation {
  opacity: 1;
}

@media (max-width: 768px) {
  .child-site-container {
    padding: 0 15px;
    flex-direction: column-reverse;
    gap: 15px;
  }

  .child-site-name {
    padding: 15px;
  }

  .child-site-name h2 {
    font-size: 24px;
  }

  .changer-departement {
    font-size: 12px;
    padding: 6px 10px;
    gap: 6px;
    top: 15px;
    right: 15px;
  }

  .changer-departement .icone-localisation {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .child-site-container {
    padding: 0 15px;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .child-site-name {
    padding: 12px;
  }

  .child-site-name h2 {
    font-size: 20px;
  }

  .changer-departement {
    font-size: 11px;
    padding: 5px 8px;
    gap: 5px;
    position: relative;
    top: auto;
    right: auto;
  }

  .changer-departement .icone-localisation {
    width: 12px;
    height: 12px;
  }
}


@media (max-width: 480px) {

  .burger-menu-column {
    flex-direction: column;
  }

  .contact-button {
    display: none !important;
  }
  
  /* Masquer le bouton contact dans le burger menu sur mobile */
  #overlay-menu .contact-button,
  .burger-menu-container .contact-button,
  .overlay-custom-content .contact-button,
  .header-right .contact-button,
  div.contact-button[style*="display: block"],
  div.contact-button {
    display: none !important;
  }
}

/* -----------------------------------------------------
   10. Menu burger local pour mobile uniquement
   ----------------------------------------------------- */

/* Menu burger local - masqué par défaut sur desktop */
.local-burger-menu-wrapper {
  display: none;
}

/* Dropdown menu local - masqué par défaut */
.local-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 12px 12px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  max-height: 70vh;
  overflow-y: auto;
}

.local-menu-dropdown.active {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}



.local-nav-item {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.local-nav-item:hover {
  background-color: #f8f9ff;
  color: #002970;
}

.local-nav-item:last-child {
  border-bottom: none;
}

.local-submenu-indicator {
  font-size: 10px;
  color: #666;
  transition: transform 0.2s ease;
}

.local-nav-item-with-submenu.open .local-submenu-indicator {
  transform: rotate(180deg);
}

.local-submenu {
  background-color: #f8f9ff;
  display: none;
  flex-direction: column;
  border-left: 3px solid var(--primary-color);
}

.local-submenu.active {
  display: flex;
}

.local-submenu-item {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 20px 10px 35px;
  display: block;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.local-submenu-item:hover {
  background-color: rgba(0, 51, 153, 0.05);
  color: var(--primary-color);
}

.local-submenu-item:last-child {
  border-bottom: none;
}

/* Media queries pour mobile uniquement */
@media (max-width: 768px) {
  
  /* Positionner le child-site-name relativement pour le dropdown */
  .child-site-name {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
  }

  /* Afficher le menu burger local sur mobile */
  .local-burger-menu-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 51, 153, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 10003;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }

  .local-burger-menu {
    background: none;
    border: none;
    cursor: pointer;
    width: 16px;
    height: 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .local-burger-icon {
    position: absolute;
    display: block;
    width: 14px;
    height: 1.5px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    left: 0;
  }

  .local-burger-icon:nth-child(1) {
    top: 2px;
  }

  .local-burger-icon:nth-child(2) {
    top: 7px;
  }

  .local-burger-icon:nth-child(3) {
    top: 12px;
  }

  /* Transformation en croix quand actif */
  .local-burger-menu.active .local-burger-icon:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
  }

  .local-burger-menu.active .local-burger-icon:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }

  .local-burger-menu.active .local-burger-icon:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
  }

  /* Changer le style du wrapper quand actif */
  .local-burger-menu-wrapper.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
  }

  .local-burger-menu.active .local-burger-icon {
    background-color: white;
  }

  /* Masquer le menu desktop sur mobile */
  .desktop-menu {
    display: none !important;
  }

  /* Positionner le dropdown sous le child-site-container */
  .menu-navigation {
    position: relative;
  }

  .local-menu-dropdown {
    position: absolute;
    top: calc(100% + 0px);
    left: 20px;
    right: 20px;
    z-index: 9999;
  }
}