/* Navigation structurée — header global (header-nav.css) */

/* Bandeau plus haut — accueil + pages SEO uniquement (CGU / légal inchangés) */
body:has(> .site-header--landing) {
  --nav-h: 3.75rem;
}

@media (min-width: 768px) {
  body:has(> .site-header--landing) {
    --nav-h: 4.25rem;
  }
}

/* Bandeau pleine largeur, fixé en haut du viewport (SaaS-style) */
.site-header.site-header--landing {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  height: var(--nav-h);
  box-sizing: border-box;
  display: block;
  background: rgba(238, 245, 241, 0.94);
  border-bottom: 1px solid rgba(210, 224, 216, 0.72);
  box-shadow: none;
  backdrop-filter: blur(10px) saturate(1.04);
  -webkit-backdrop-filter: blur(10px) saturate(1.04);
}

.site-header.site-header--landing.is-scrolled {
  background: rgba(234, 242, 237, 0.97);
  border-bottom-color: rgba(204, 218, 208, 0.78);
  box-shadow: none;
  backdrop-filter: blur(10px) saturate(1.04);
  -webkit-backdrop-filter: blur(10px) saturate(1.04);
}

.site-header.site-header--landing.site-header--legal {
  position: fixed;
  top: 0;
  overflow: visible;
  z-index: 100;
}

/* Contenu centré dans le bandeau — fond transparent sur la ligne de nav */
.site-header--landing .site-nav.wrap {
  width: 100%;
  max-width: var(--max);
  height: 100%;
  min-height: var(--nav-h);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4.5vw, 2.25rem);
  padding-block: 0;
  box-sizing: border-box;
  align-items: center;
  background: transparent;
}

.site-header--landing .brand,
.site-header--landing .nav-links--bar,
.site-header--landing .nav-menu-btn,
.site-header--landing .btn-nav {
  align-self: center;
}

.site-header--landing.site-header--legal.is-nav-dropdown-open {
  z-index: 150;
}

.site-header--landing,
.site-header--landing .site-nav,
.site-header--landing .nav-links--bar {
  overflow: visible;
}

.site-header--landing.is-nav-dropdown-open {
  z-index: 150;
}

.site-header--landing .nav-dropdown {
  position: relative;
}

.site-header--landing .nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 200ms ease, opacity 200ms ease;
}

.site-header--landing .nav-dropdown__trigger:hover,
.site-header--landing .nav-dropdown__trigger:focus-visible,
.site-header--landing .nav-dropdown.is-open .nav-dropdown__trigger {
  color: var(--primary);
  opacity: 1;
}

.site-header--landing .nav-dropdown__caret {
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.site-header--landing .nav-dropdown.is-open .nav-dropdown__caret {
  transform: rotate(180deg);
}

.site-header--landing .nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 160;
  min-width: min(20rem, 78vw);
  margin: 0;
  padding: 0.55rem 0.45rem 0.45rem;
  list-style: none;
  transform: translateX(-50%);
  border: 1px solid var(--border-fine);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 36px rgba(16, 44, 29, 0.12);
  pointer-events: auto;
}

.site-header--landing .nav-dropdown__menu a {
  display: block;
  position: relative;
  z-index: 1;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
  text-decoration: none;
  white-space: normal;
}

.site-header--landing .nav-dropdown__menu a:hover,
.site-header--landing .nav-dropdown__menu a:focus-visible {
  color: var(--primary);
  background: var(--surface-soft);
}

#nav-mobile .nav-mobile__section {
  border-bottom: 1px solid rgba(217, 230, 222, 0.65);
}

#nav-mobile .nav-mobile__section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

#nav-mobile .nav-mobile__section-toggle:hover,
#nav-mobile .nav-mobile__section-toggle:focus-visible,
#nav-mobile .nav-mobile__section.is-open .nav-mobile__section-toggle {
  color: var(--primary);
  background: var(--surface-soft);
}

#nav-mobile .nav-mobile__caret {
  font-size: 0.62rem;
  line-height: 1;
  transition: transform 180ms ease;
}

#nav-mobile .nav-mobile__section.is-open .nav-mobile__caret {
  transform: rotate(180deg);
}

#nav-mobile .nav-mobile__sub {
  margin: 0;
  padding: 0 0 0.35rem;
  list-style: none;
}

#nav-mobile .nav-mobile__sub a {
  display: block;
  padding: 0.5rem 0.75rem 0.5rem 1.15rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
  text-decoration: none;
}

#nav-mobile .nav-mobile__sub a:hover,
#nav-mobile .nav-mobile__sub a:focus-visible {
  color: var(--primary);
  background: var(--surface-soft);
}

#nav-mobile .nav-mobile__link {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

#nav-mobile .nav-mobile__link:hover,
#nav-mobile .nav-mobile__link:focus-visible {
  color: var(--primary);
  background: var(--surface-soft);
}

.site-header--landing .nav-links--bar {
  align-items: center;
}

.site-header--landing .nav-links--bar > a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .site-header--landing .nav-links--bar {
    gap: 1.1rem;
  }
}

/* Desktop : grille 7 / auto / 3 — alignée sur .seo-columns (1024px+) */
@media (min-width: 1024px) {
  .site-header--landing .site-nav {
    display: grid;
    grid-template-columns: minmax(0, 7fr) auto minmax(0, 3fr);
    column-gap: clamp(1.75rem, 3vw, 2.75rem);
    row-gap: 0;
    align-items: center;
  }

  .site-header--landing .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin-right: 0;
  }

  .site-header--landing .nav-links--bar {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin-inline: auto;
  }

  .site-header--landing .btn-nav {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
  }
}

@media (max-width: 1023px) {
  .site-header--landing .site-nav {
    display: flex;
    align-items: center;
    gap: 0.65rem 1rem;
  }

  .site-header--landing .brand {
    margin-right: auto;
  }
}

/* CTA header toujours visible — contenu dans le bandeau, axe vertical commun */
.site-header--landing .btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  min-height: 2.25rem;
  max-height: calc(var(--nav-h) - 1.35rem);
  padding: 0 1rem;
  line-height: 1.2;
  white-space: nowrap;
}

.site-header--landing .btn-nav:hover {
  transform: none;
}

@media (max-width: 767px) {
  .site-header--landing .nav-menu-btn {
    min-width: 2.5rem;
    min-height: 2.35rem;
    max-height: calc(var(--nav-h) - 1.1rem);
    padding: 0 0.65rem;
  }

  .site-header--landing .btn-nav {
    min-height: 2.15rem;
    max-height: calc(var(--nav-h) - 1.1rem);
    padding-inline: 0.72rem;
    font-size: 0.8rem;
  }
}
