/**
 * Barre de navigation des PAGES INTERNES (reprise du bloc NAVBAR + du menu de la home).
 * -----------------------------------------------------------------------------
 * Tout est SCOPÉ sous .eco-topnav-wrap / .eco-topnav pour ne rien casser ailleurs
 * (le thème charge déjà Bootstrap : .navbar, .logo…). Aucun reset global.
 * Menus déroulants (3 niveaux), sélecteur de langue et burger repris de la home,
 * mais isolés ici pour fonctionner SANS charger homepage.css / homepage.js.
 * Police : Source Sans 3 déjà chargée globalement.
 */

.eco-topnav-wrap {
  --eco-terra: #AD4F2E;
  --eco-gold2: #f4cf1e;
  --eco-pagew: 1355px;

  width: 100%;
  max-width: var(--eco-pagew);
  margin: 0 auto;
  padding: 0 24px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  box-sizing: border-box;
}

.eco-topnav-wrap *,
.eco-topnav-wrap *::before,
.eco-topnav-wrap *::after {
  box-sizing: border-box;
}

/* ================= NAVBAR ================= */
/* PAS d'overflow:hidden ici, sinon les panneaux déroulants seraient coupés :
   l'arrondi + le rognage de l'image de fond sont portés par .nav-bg. */
.eco-topnav {
  position: relative;
  border-radius: 22px;
  background: #23282f;
  margin-top: 22px;
}

.eco-topnav .nav-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 22px;
  overflow: hidden;
}

.eco-topnav .nav-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: brightness(.62) saturate(.85);
}

.eco-topnav .gl-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 26px;
  text-shadow: 0 1px 10px rgba(4, 40, 16, .25);
}

.eco-topnav .gl-brand2 {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  text-decoration: none;
}

.eco-topnav .gl-brand2-img {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .25));
}

.eco-topnav .gl-brand2-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  color: #fff;
}

.eco-topnav .gl-brand2-txt b {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.eco-topnav .gl-brand2-txt i {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  opacity: .9;
  margin-top: 1px;
}

/* ================= MENU PRINCIPAL ================= */
.eco-topnav .gl-mainmenu {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: 1 1 auto;
  justify-content: center;
  overflow: visible;
}

.eco-topnav .gl-mitem {
  position: relative;
  display: flex;
  align-items: center;
}

.eco-topnav .gl-mlink {
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  opacity: .92;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding-bottom: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s;
}

.eco-topnav .gl-mlink:hover {
  opacity: 1;
}

.eco-topnav .gl-mlink .gl-plus {
  color: var(--eco-gold2);
  font-weight: 800;
  font-size: 16px;
  display: inline-block;
  transition: transform .25s ease;
}

.eco-topnav .gl-mitem.has-sub:hover > .gl-mlink .gl-plus,
.eco-topnav .gl-mitem.has-sub.open > .gl-mlink .gl-plus {
  transform: rotate(45deg);
}

.eco-topnav .gl-mlink.active {
  opacity: 1;
}

.eco-topnav .gl-mlink.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2.5px;
  background: var(--eco-gold2);
  border-radius: 2px;
}

/* ---- Panneau déroulant (blanc, absolu) ---- */
.eco-topnav .gl-submenu {
  position: absolute;
  top: 100%;
  left: -14px;
  margin-top: 12px;
  min-width: 234px;
  background: #fff;
  border-top: 3px solid #edc006;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 20px 46px rgba(4, 40, 16, .26);
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .24s ease, transform .24s ease, visibility .24s;
  z-index: 120;
  text-shadow: none;
}

/* pont invisible pour franchir l'espace entre le lien et le panneau */
.eco-topnav .gl-submenu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.eco-topnav .gl-mitem.has-sub:hover > .gl-submenu,
.eco-topnav .gl-mitem.has-sub.open > .gl-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.eco-topnav .gl-submenu a {
  color: #1a1a2e;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 22px;
  white-space: nowrap;
  text-decoration: none;
  display: block;
  transition: background .18s ease, color .18s ease;
}

.eco-topnav .gl-submenu a:hover {
  background: #F4F2ED;
  color: #018949;
}

.eco-topnav .gl-sub-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e8e8df;
}

.eco-topnav .gl-sub-label {
  display: block;
  padding: 4px 22px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: #018949;
}

.eco-topnav .gl-sub-group a {
  padding: 7px 22px 7px 32px;
  font-weight: 500;
  font-size: 14px;
}

/* ================= ACTIONS (langue + recherche + burger) ================= */
.eco-topnav .gl-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* ---- Sélecteur de langue ---- */
.eco-topnav .lang-wrap {
  position: relative;
}

.eco-topnav .lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  font-family: inherit;
  text-decoration: none;
}

.eco-topnav .lang-pill svg {
  width: 11px;
  height: 11px;
  transition: transform .25s ease;
}

.eco-topnav .lang-pill.open svg {
  transform: rotate(180deg);
}

.eco-topnav .lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 14px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
  z-index: 130;
  text-shadow: none;
}

.eco-topnav .lang-menu.open {
  display: flex;
}

.eco-topnav .lang-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #2b2b2b;
  text-decoration: none;
  transition: background .2s;
}

.eco-topnav .lang-opt:hover {
  background: #f1f1ee;
}

.eco-topnav .lang-opt.active {
  color: #018949;
}

/* ---- Recherche : loupe seule, champ dépliable au clic (classe .open via JS) ---- */
.eco-topnav .gl-search-mini {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

/* Champ en ABSOLU (ancré à droite) : il se déploie par-dessus, vers la gauche,
   SANS pousser le bouton loupe -> le bouton reste toujours visible et cliquable. */
.eco-topnav .gl-search-mini input[type="search"] {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, .16);
  border: 1px solid transparent;
  border-radius: 22px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  z-index: 1;
  transition: width .28s ease, padding .28s ease, opacity .2s ease, border-color .2s;
}

.eco-topnav .gl-search-mini.open input[type="search"] {
  width: clamp(180px, 30vw, 260px);
  /* 50px de marge à droite : le texte ne passe pas sous le bouton loupe */
  padding: 0 50px 0 18px;
  opacity: 1;
  border-color: rgba(255, 255, 255, .35);
  pointer-events: auto;
}

.eco-topnav .gl-search-mini input[type="search"]::placeholder {
  color: rgba(255, 255, 255, .75);
}

.eco-topnav .gl-search-mini.open input[type="search"]:focus {
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .55);
}

.eco-topnav .gl-search {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--eco-terra);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}

.eco-topnav .gl-search:hover {
  background: rgba(255, 255, 255, .3);
}

.eco-topnav .gl-search svg {
  width: 18px;
  height: 18px;
}

/* ---- Burger (mobile/tablette) ---- */
.eco-topnav .gl-burger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.eco-topnav .gl-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}

.eco-topnav .gl-burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.eco-topnav .gl-burger.is-open span:nth-child(2) {
  opacity: 0;
}

.eco-topnav .gl-burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================= RESPONSIVE : burger + menu en tiroir (<=1010px) ================= */
@media (max-width: 1010px) {
  .eco-topnav .gl-brand2-img {
    height: 56px;
  }

  .eco-topnav .gl-burger {
    display: inline-flex;
  }

  .eco-topnav .gl-mainmenu {
    position: absolute;
    top: calc(100% + 12px);
    left: 14px;
    right: 14px;
    flex: initial;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    max-height: 66vh;
    overflow-y: auto;
    background: rgba(8, 52, 25, .97);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 26px 54px rgba(4, 40, 16, .45);
    text-shadow: none;
    z-index: 140;
    display: none;
  }

  .eco-topnav .gl-mainmenu.is-open {
    display: flex;
  }

  .eco-topnav .gl-mitem {
    flex-direction: column;
    align-items: stretch;
  }

  .eco-topnav .gl-mlink {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 16px;
    opacity: 1;
    justify-content: space-between;
  }

  .eco-topnav .gl-mlink:hover {
    background: rgba(255, 255, 255, .08);
  }

  .eco-topnav .gl-mlink.active::after {
    display: none;
  }

  .eco-topnav .gl-submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    margin: 2px 6px 6px;
    min-width: 0;
    background: rgba(255, 255, 255, .07);
    border-top: none;
    border-radius: 10px;
    box-shadow: none;
    padding: 6px 0;
  }

  .eco-topnav .gl-submenu::before {
    display: none;
  }

  .eco-topnav .gl-mitem.has-sub.open > .gl-submenu {
    display: flex;
  }

  .eco-topnav .gl-submenu a {
    color: #eaf3ec;
  }

  .eco-topnav .gl-submenu a:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--eco-gold2);
  }

  .eco-topnav .gl-sub-label {
    color: var(--eco-gold2);
  }

  .eco-topnav .gl-sub-group {
    border-top-color: rgba(255, 255, 255, .2);
  }
}

@media (max-width: 560px) {
  .eco-topnav .gl-search-mini.open input[type="search"] {
    width: clamp(150px, 52vw, 210px);
  }

  .eco-topnav .gl-brand2-txt i {
    display: none;
  }
}
