/* HEADER GLOBAL */
/* ========================================
   CD41 HEADER COMPLETE
   ======================================== */

/* 1. Header complet et son fond bleu */
.cd41-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000; /* suffisamment élevé pour surplomber tout */
  background-color: var(--bleu-principal);
  background-image:url("../img/bandeau_cd41.svg"); 
  background-repeat: repeat-x;
  background-position: top center;
 /* background-size: 1200px 175px; */
  height: var(--header-height);
  overflow: visible;
  border-bottom: 3px var(--orange-accent) solid;  
  box-shadow: 0 2px 2px rgba(0,0,0,.15)
}


/* =====================================
   4. Flex intérieur (menu – logo – right)
   ===================================== */
.cd41-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;  
  margin: 0 auto;
  height: 175px;
  padding: 0 1rem;
}


/* ========================================
   1. MENU PRINCIPAL (GAUCHE)
   ======================================== */
/* 3. Menu principal (gauche) */
.cd41-header-inner .main-nav  {
  flex: 1;
}
.cd41-header-inner .main-nav .navbar-nav, .secondary-nav .navbar-nav{  /*   */
  display: flex !important;
  gap: 20px;
  margin: 0;
  padding: 0;
  padding-left: 2rem;
  list-style: none;
  flex-direction: row !important;
}
.cd41-header-inner .secondary-nav .navbar-nav > li {
  margin-left: 1.5rem;
}
.cd41-header-inner .main-nav .navbar-nav > li > a, 
.secondary-nav .navbar-nav > li > a {
  font-family: var(--font-titre);	
  color: #fff !important;
  font-weight: 500;
  font-size: 1.5em;
  text-decoration: none;
  transition: color .3s;
}
.cd41-header-inner .main-nav .navbar-nav > li > a:hover,
.secondary-nav .navbar-nav > li > a:hover, 
.cd41-header-inner .main-nav .navbar-nav > li.current-menu-item > a
.secondary-nav .navbar-nav > li.current-menu-item > a {
  color: var(--orange-accent) !important;
}

/* Burger icon (mobile) */
.cd41-header-inner .navbar-toggler {
  border-color: rgba(255,255,255,0.5);
}
.cd41-header-inner .navbar-toggler-icon {
  filter: invert(1);
}

/* 2) On décale un peu la secondary-nav vers la droite pour aérer */
.cd41-header-inner .header-right {
  justify-content: flex-end;
  gap: 1.5rem;       /* espace entre nav + icônes */
  padding-right: 2rem;
}


/* 1. Boutons de menu au survol comme le bouton Contact */
.main-nav .nav-link:hover,
.main-nav .nav-item:hover > .nav-link,
.main-nav .dropdown-item:hover {
  background: var(--orange-accent);
  color: #fff !important;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

/* 2. Affichage du sous-menu au survol */
.main-nav .dropdown {
  position: relative;
}
.main-nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bleu-principal); 
  border: none;
  margin: 0;
  padding: 0.5rem 0;
  min-width: 200px;
  z-index: 100;
}
.main-nav .dropdown:hover > .dropdown-menu {
  display: block;
}

/* 3. Style des items du sous-menu */
.main-nav .dropdown-menu .dropdown-item {
  color: #fff;
  padding: 0.5rem 1rem;
  transition: background 0.3s, color 0.3s;
}
.main-nav .dropdown-menu .dropdown-item:hover {
  background: var(--orange-accent);
  color: #fff;
}

/* 4. Ajustement pour conserver l’espacement */
.main-nav .dropdown-menu .dropdown-item + .dropdown-item {
  margin-top: 0.25rem;
}



/* GESTION des sous-menus */

/* positionnement du parent */
.main-menu li {
  position: relative;
}
/* masquer par défaut la sous-liste */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #005AA7;
  padding: .5rem 0;
  list-style: none;
  min-width: 200px;
  z-index: 100;
}
/* afficher au survol du parent */
.main-menu li:hover > .sub-menu {
  display: block;
}
/* style des items du sous-menu */
.main-menu .sub-menu li a {
  display: block;
  padding: .5rem 1rem;
  color: #fff;
  white-space: nowrap;
}
.main-menu .sub-menu li a:hover {
  background: #EF6C00;
}


/* Sous-menus */
#primary-menu ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  list-style: none;
  padding: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 999;
  border-radius: 5px;
}

ul.sub-menu {
    min-width: 200px; /* Largeur minimale pour éviter les sous-menus trop étroits */
    width: auto; /* Permet d'ajuster automatiquement à la taille du contenu */
    max-width: 400px; /* Définir une largeur max pour éviter des sous-menus trop larges */
    white-space: nowrap; /* Empêche le retour à la ligne des éléments du menu */
    padding: 10px;
}

ul.sub-menu li {
    padding: 8px 15px; /* Ajuste le padding intérieur des éléments */
    margin-bottom: 5px; /* Ajoute un espacement en bas de chaque élément */
}


#primary-menu li:hover > ul {
  display: block;
}

#primary-menu ul li a {
  color: #333;
  padding: 8px 12px;
}

#primary-menu ul li a:hover {
  background-color: #ff4900;
  color: white;
}


/* — multi-niveaux : ouvre le 3e niveau à droite du 2e — */
.cd41-header .navbar .dropdown-submenu { position: relative; }

.cd41-header .navbar .dropdown-menu .dropdown-menu,
.cd41-header .navbar .sub-menu .sub-menu {
  position: absolute;
  top: 0;                 /* plus sous le parent */
  left: 100%;             /* décalé à droite du parent */
  margin-left: 8px;       /* gouttière pour ne rien masquer */
  display: none;
  z-index: 1000;
}

/* affichage au survol du 2e niveau */
.cd41-header .navbar .dropdown-submenu:hover > .dropdown-menu,
.cd41-header .navbar .sub-menu > li:hover > .sub-menu {
  display: block;
}

/* largeur et non-retour à la ligne pour éviter l’empilement */
.cd41-header .navbar .dropdown-menu,
.cd41-header .navbar .sub-menu {
  min-width: 220px;
  white-space: nowrap;
}








/* 4. Logo centré */
.logo-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 3;
}
.logo-center .custom-logo {
  max-height: 150px;
  width: auto;
  display: block;
}

/* 5. Zone droite (contact + ligue + ffbb + socials) */

.header-right {
  flex: 1;
  display: flex;
  align-items: center;
   justify-content: flex-end;
  gap: 1rem;
}
.header-right .btn-contact {
  color: #fff;
  border: 1px solid #fff;
  padding: .25rem .75rem;
  transition: background .3s, color .3s;
}
.header-right .btn-contact:hover {
  background: var(--orange-accent);
  border-color: var(--orange-accent);
  color: #fff;
}
.header-right img.header-icon {
  max-height: 40px;
  width: auto;
}
.header-right .social-icons {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: 1em;
}
.header-right .social-icons a {
  color: #fff;
  font-size: 1.25rem;
  transition: color .3s, transform .3s;
}
.header-right .social-icons a:hover {
  color: var(--orange-accent);
  transform: scale(1.1);
}

.header-right img.header-partenaire-logo {
  max-height: 60px;
  width: auto;
}

