/* IMPORTANT : l’overlay ne doit jamais apparaître dans le flux */
.mobile-overlay {
  display: none;
}

/* ==========================================================================
   NAVBAR — Desktop hover dropdowns + Mobile overlay fullscreen
   ========================================================================== */

.site-header {
  width: 100%;
}

.navbar {
  width: 100%;
  background: var(--c-nav-bg, #141414);
  color: var(--c-nav-text, #f2f2f2);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: transform 0.3s ease-out;
  transform: translateY(0);
}

.site-header,
.navbar,
.navbar__inner {
  overflow: visible;
}

/* TOKENS */
:root {
  --nav-h: clamp(86px, 7vw, 104px);
  --nav-pad-x: clamp(16px, 3vw, 48px);

  --nav-fs: clamp(13px, 1.1vw, 15px);
  --nav-gap: clamp(14px, 2vw, 22px);

  --btn-h: clamp(40px, 4.6vw, 46px);
  --btn-pad-x: clamp(14px, 2.2vw, 20px);

  --dd-radius: 14px;
  --dd-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --dd-bg: rgba(20, 20, 20, 0.98);
  --dd-bd: 1px solid rgba(255, 255, 255, 0.08);

  --z-dd: 1000;

  --dd-min: 220px;
  --dd-max: 360px;

  --dd-gap-top: 16px;
  --dd-gap-top-lang: 4px;

  --ul-h: 2px;
  --ul-color: rgba(255, 255, 255, 0.92);
  --ul-speed: 220ms;

  --dd-link-hover-bg: rgba(255, 255, 255, 0.08);
  --ico: 16px;

  --lang-w: 44px;

  /* overlay cards */
  --mob-card-bg: rgba(255, 255, 255, 0.06);
  --mob-card-bd: 1px solid rgba(255, 255, 255, 0.22);
  --mob-card-r: 16px;

  /* largeur fixe colonne overlay */
  --mob-col-w: min(420px, 100%);
}

/* LAYOUT */
.navbar__inner {
  height: var(--nav-h);
  padding: 0 var(--nav-pad-x);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.navbar__logo img {
  height: clamp(56px, 6.2vw, 74px);
  width: auto;
  display: block;
}

/* MENU */
.navbar__menu {
  justify-self: center;
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  font-size: var(--nav-fs);
}

.navbar__menu,
.nav-link,
.lang__btn,
.btn-cta {
  line-height: 1;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  padding: clamp(8px, 1vw, 10px) clamp(6px, 1vw, 8px);
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 1;
}
.nav-link.is-active {
  opacity: 1;
}

/* UNDERLINE HOVER (liens sans dropdown) */
.nav-item:not(.has-dropdown) > .nav-link {
  position: relative;
}

.nav-item:not(.has-dropdown) > .nav-link::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -10px;
  height: var(--ul-h);
  border-radius: 999px;
  background: var(--ul-color);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform var(--ul-speed) ease, opacity var(--ul-speed) ease;
}

.nav-item:not(.has-dropdown) > .nav-link:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

/* SVG ALIGN */
.chev {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.85;
  vertical-align: -0.04em;
}
.chev svg {
  width: var(--ico);
  height: var(--ico);
  display: inline-block;
  vertical-align: middle;
}

/* CTA navbar icon */
.btn-cta__icon {
  width: 0;
  opacity: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  transform: translateX(-6px);
  transition: width 180ms ease, opacity 180ms ease, transform 180ms ease;
}
.btn-cta__icon svg {
  width: var(--ico);
  height: var(--ico);
  display: block;
}
.btn-cta:hover .btn-cta__icon {
  width: var(--ico);
  opacity: 1;
  transform: translateX(0);
}

/* ACTIONS */
.navbar__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cta {
  height: var(--btn-h);
  padding: 0 var(--btn-pad-x);
  border-radius: 12px;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  background: var(--c-cta, var(--color-accent-gold));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--nav-fs);

  transition: transform 0.18s ease, filter 0.18s ease;
}
.btn-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* DROPDOWNS desktop */
.has-dropdown::after,
.lang::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 20px;
  z-index: var(--z-dd);
}

.dropdown {
  position: absolute;
  top: calc(100% + var(--dd-gap-top));
  left: 0;

  background: var(--dd-bg);
  border: var(--dd-bd);
  border-radius: var(--dd-radius);
  box-shadow: var(--dd-shadow);

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;

  transition: opacity 0.2s ease, transform 0.2s ease, pointer-events 0.2s ease;
  z-index: var(--z-dd);

  max-width: min(var(--dd-max), calc(100vw - 24px));
}

.has-dropdown:hover::after,
.lang:hover::after {
  pointer-events: auto;
}

.has-dropdown > .dropdown {
  min-width: var(--dd-min);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.dropdown__link {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  border-radius: 10px;

  color: #fff;
  font-weight: 200;
  text-decoration: none;
  opacity: 0.95;

  transition: background 0.15s ease, opacity 0.15s ease;
}
.dropdown__link:hover {
  opacity: 1;
  background: var(--dd-link-hover-bg);
}

.has-dropdown:hover > .dropdown,
.lang:hover > .dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* LANG desktop */
.lang--switch {
  position: relative;
  width: var(--lang-w);
}
.lang--switch .lang__btn {
  width: 100%;
  height: var(--btn-h);
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  background: transparent;
  border: none;
  color: var(--c-nav-text, #f2f2f2);

  font: inherit;
  font-weight: 600;
  font-size: var(--nav-fs);

  cursor: default;
  white-space: nowrap;
}
.lang--switch > .dropdown {
  top: calc(100% + var(--dd-gap-top-lang));
  left: 0;
  width: 100%;
  min-width: 0;
  max-width: none;

  padding: 8px;
  display: grid;
  gap: 4px;
}
.lang--switch > .dropdown .dropdown__link {
  width: 100%;
  justify-content: center;
  padding: 10px 0;
}

/* BURGER (desktop caché) */
.nav-burger {
  display: none;
  width: var(--btn-h);
  height: var(--btn-h);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
}
.nav-burger svg {
  display: block;
}

/* ==========================================================================
   MOBILE OVERLAY (plein écran)
   ========================================================================== */

@media (max-width: 980px) {
  .navbar__menu {
    display: none;
  }
  .navbar__actions .lang--switch {
    display: none;
  }

  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.98);
    z-index: 9999;

    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .mobile-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-overlay__inner {
    height: 100%;
    padding: 18px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .mobile-overlay__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-overlay__logo img {
    height: 52px;
    width: auto;
    display: block;
  }

  .mobile-overlay__close {
    width: var(--btn-h);
    height: var(--btn-h);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font: inherit;
    cursor: pointer;
  }

  .mobile-overlay__content {
    flex: 1;
    overflow: auto;
    padding: 18px 0 28px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  /* MENU CLONÉ */
  .mobile-overlay__menu-slot {
    width: var(--mob-col-w);
    margin: 0 auto;
  }

  .mobile-overlay__menu-slot ul {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;
    gap: 14px;

    align-items: stretch;
  }

  .mobile-overlay__menu-slot li {
    width: 100%;
  }

  .mobile-overlay__menu-slot .nav-link {
    width: 100% !important;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 20px;

    border-radius: var(--mob-card-r);
    background: var(--mob-card-bg);
    border: var(--mob-card-bd);

    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;

    box-sizing: border-box;
  }

  .mobile-overlay__menu-slot .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .mobile-overlay__menu-slot .dropdown,
  .mobile-overlay__menu-slot .chev {
    display: none !important;
  }

  /* LANG MOBILE (2 boutons) */
  .mobile-lang {
    width: var(--mob-col-w);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-lang__label {
    font-size: 14px;
    opacity: 0.8;
    text-align: center;
  }

  .mobile-lang__row {
    width: 100%;
    display: flex;
    gap: 12px;
  }

  .mobile-lang__pill {
    flex: 1;
    height: 56px;
    border-radius: var(--mob-card-r);

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--mob-card-bg);
    border: var(--mob-card-bd);

    color: #fff;
    text-decoration: none;
    font-weight: 200;
    letter-spacing: 0.02em;
  }

  .mobile-lang__pill.is-active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.34);
  }
}

/* Navbar scroll behavior */
.navbar-hidden {
  transform: translateY(-100%);
}

.navbar-visible {
  transform: translateY(0);
}
