/* Glow menu — élément racine unique (pas de <nav> wrapper) */

.glow-menu {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px 20px;
  border-radius: 0;
  border: none;
  background: var(--flow-accent);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 300;
  overflow: visible;
  box-sizing: border-box;
  --glow-menu-hero-gap: clamp(14px, 2.5vw, 22px);
  --glow-menu-hero-motion: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transition:
    background-color 0.28s ease,
    box-shadow var(--glow-menu-hero-motion),
    backdrop-filter 0.28s ease,
    -webkit-backdrop-filter 0.28s ease,
    top var(--glow-menu-hero-motion),
    width var(--glow-menu-hero-motion),
    margin-left var(--glow-menu-hero-motion),
    border-radius var(--glow-menu-hero-motion);
}

/* Accueil : au sommet, aligné sur `.home-hero-lead` (dimensions via custom props JS). */
.glow-menu.glow-menu--hero-aligned {
  top: var(--glow-menu-hero-gap);
  width: var(--glow-menu-hero-w, 100%);
  margin-left: var(--glow-menu-hero-x, 0);
  margin-right: 0;
  border-radius: 12px;
  box-shadow:
    0 4px 18px color-mix(in srgb, #000000 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, #ffffff 12%, transparent);
}

/* Sortie vers la barre pleine largeur : état cible explicite (les vars restent jusqu'à la fin JS). */
.glow-menu.glow-menu--hero-release {
  top: 0;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .glow-menu {
    --glow-menu-hero-motion: 0.01ms;
  }
}

html.home-hero-menu-phase {
  --glow-menu-hero-gap: clamp(14px, 2.5vw, 22px);
  /* Aéré sous la barre (pilule) avant le bloc vidéo / hero */
  --glow-menu-hero-under-nav: clamp(22px, 3.8vw, 22px);
}

/* Séparateur flux (sibling menu → main) : seul moyen fiable avec navbar sticky. */
.glow-menu-hero-spacer {
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  flex-shrink: 0;
  transition: height var(--glow-menu-hero-motion, 0.32s) cubic-bezier(0.4, 0, 0.2, 1);
}

html.home-hero-menu-phase .glow-menu-hero-spacer {
  height: var(--glow-menu-hero-gap);
}

html.home-hero-menu-phase:has(.glow-menu--hero-release) .glow-menu-hero-spacer {
  height: 0;
}

html.home-hero-menu-phase main.container.home-layout {
  margin-top: 0;
  padding-top: var(--glow-menu-hero-under-nav);
}

main.container.home-layout {
  transition:
    margin-top var(--glow-menu-hero-motion, 0.32s) cubic-bezier(0.4, 0, 0.2, 1),
    padding-top var(--glow-menu-hero-motion, 0.32s) cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-menu--scrolled {
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    0 8px 28px color-mix(in srgb, #000000 12%, transparent),
    inset 0 1px 0 color-mix(in srgb, #ffffff 14%, transparent);
}

.glow-menu--scrolled:not(.glow-menu--on-dark) {
  background: color-mix(in srgb, var(--flow-accent) 76%, transparent);
}

.glow-menu--scrolled.glow-menu--on-dark {
  background: color-mix(in srgb, #ffffff 76%, transparent);
}

.glow-menu__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.glow-menu__brand {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.glow-menu__brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.glow-menu__end {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.glow-menu__list--auth.nav-auth-guest {
  display: flex;
  align-items: center;
  gap: 6px;
}

.glow-menu__item {
  position: relative;
}

.glow-menu__item.nav-dash-wrap {
  position: relative;
}

.glow-menu__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.glow-menu__link iconify-icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #ffffff;
}

.glow-menu__link:hover,
.glow-menu__link:focus-visible {
  color: #ffffff;
  background: color-mix(in srgb, #ffffff 14%, transparent);
}

.glow-menu__item--active .glow-menu__link {
  color: #ffffff;
  font-weight: 700;
  background: color-mix(in srgb, #ffffff 18%, transparent);
}

.glow-menu__item.hidden {
  display: none;
}

.glow-menu .nav-user-avatar:not(.has-photo) {
  color: var(--flow-accent);
  background: var(--flow-surface-2);
  border: none;
}

.glow-menu .nav-user-avatar.has-photo {
  border: 2px solid color-mix(in srgb, #ffffff 55%, transparent);
}

.glow-menu__account {
  flex: 0 0 auto;
  position: relative;
}

.glow-menu .nav-user-wrap {
  position: relative;
}

.glow-menu .nav-user-menu--glow {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  border-radius: 16px;
  border: 1px solid var(--flow-accent-overlay, var(--flow-accent));
  background: var(--flow-accent) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 28px color-mix(in srgb, #000000 14%, transparent);
  z-index: 350;
  box-sizing: border-box;
  transition:
    background-color 0.28s ease,
    border-color 0.28s ease,
    backdrop-filter 0.28s ease,
    -webkit-backdrop-filter 0.28s ease;
}

.glow-menu .nav-user-menu--glow.hidden {
  display: none !important;
}

.glow-menu .glow-menu__dropdown-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #ffffff !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transform: none !important;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.glow-menu .glow-menu__dropdown-link:hover,
.glow-menu .glow-menu__dropdown-link:focus-visible {
  color: #ffffff !important;
  background: color-mix(in srgb, #ffffff 14%, transparent) !important;
  border: none !important;
}

.glow-menu .glow-menu__dropdown-link.nav-user-logout,
.glow-menu .glow-menu__dropdown-link.nav-user-logout.ui-button {
  color: var(--flow-danger) !important;
}

.glow-menu .glow-menu__dropdown-link.nav-user-logout:hover:not(:disabled),
.glow-menu .glow-menu__dropdown-link.nav-user-logout:focus-visible,
.glow-menu .glow-menu__dropdown-link.nav-user-logout.ui-button:hover:not(:disabled) {
  color: var(--flow-danger-hover) !important;
  background: color-mix(in srgb, #ffffff 14%, transparent) !important;
}

.glow-menu--scrolled .nav-user-menu--glow {
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, var(--flow-accent) 88%, transparent) !important;
  border-color: color-mix(in srgb, #ffffff 26%, transparent) !important;
}

.glow-menu--on-dark .nav-user-menu--glow {
  border: none !important;
  background: #ffffff !important;
  color: var(--flow-accent) !important;
  box-shadow: 0 8px 28px color-mix(in srgb, #000000 10%, transparent);
}

.glow-menu--on-dark .glow-menu__dropdown-link {
  color: var(--flow-accent) !important;
}

.glow-menu--on-dark .glow-menu__dropdown-link:hover,
.glow-menu--on-dark .glow-menu__dropdown-link:focus-visible {
  color: var(--flow-accent) !important;
  background: color-mix(in srgb, var(--flow-accent) 10%, transparent) !important;
}

.glow-menu--on-dark .glow-menu__dropdown-link.nav-user-logout,
.glow-menu--on-dark .glow-menu__dropdown-link.nav-user-logout.ui-button {
  color: var(--flow-danger) !important;
}

.glow-menu--on-dark .glow-menu__dropdown-link.nav-user-logout:hover:not(:disabled),
.glow-menu--on-dark .glow-menu__dropdown-link.nav-user-logout:focus-visible,
.glow-menu--on-dark .glow-menu__dropdown-link.nav-user-logout.ui-button:hover:not(:disabled) {
  color: var(--flow-danger-hover) !important;
  background: color-mix(in srgb, var(--flow-accent) 10%, transparent) !important;
}

.glow-menu--scrolled.glow-menu--on-dark .nav-user-menu--glow {
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, #ffffff 88%, transparent) !important;
  border: none !important;
}

html:not(.nav-hydrated) .glow-menu__item.nav-tarifs-main-wrap {
  opacity: 0;
  pointer-events: none;
}

html.nav-hydrated .glow-menu__item.nav-tarifs-main-wrap:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* Home : sur `.home-dark-band` (fond accent) — menu inversé. */
.glow-menu--on-dark {
  background: #ffffff;
  color: var(--flow-accent);
}

.glow-menu--on-dark .glow-menu__link {
  color: var(--flow-accent);
}

.glow-menu--on-dark .glow-menu__link iconify-icon {
  color: var(--flow-accent);
}

.glow-menu--on-dark .glow-menu__link:hover,
.glow-menu--on-dark .glow-menu__link:focus-visible {
  color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 10%, transparent);
}

.glow-menu--on-dark .glow-menu__item--active .glow-menu__link {
  color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 14%, transparent);
}

.glow-menu--on-dark .nav-user-avatar:not(.has-photo) {
  color: var(--flow-accent);
  background: var(--flow-surface-2);
  border: none;
}

.glow-menu--on-dark .nav-user-avatar.has-photo {
  border: 2px solid color-mix(in srgb, var(--flow-accent) 35%, transparent);
}

.builder-page > .glow-menu {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .glow-menu__link span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .glow-menu__link {
    padding: 10px 12px;
  }
}
