/* Navigation à deux niveaux - mutualisée (build-i18n.mjs) */

:root {
  --global-header-h: 3.65rem;
  --app-header-h: 2.7rem;
  --header-h: var(--global-header-h);
  --chrome-z: 40;
}

body.has-app-nav {
  --header-h: var(--global-header-h);
}

@media (min-width: 900px) {
  body.has-app-nav {
    --header-h: calc(var(--global-header-h) + var(--app-header-h));
  }
}

.site-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--chrome-z);
}

.global-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: var(--global-header-h);
  padding: 0 clamp(1rem, 4vw, 2rem);
  background: rgba(17, 17, 19, 0.78);
  border-bottom: 1px solid rgba(74, 74, 84, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.global-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text, #fff);
  flex-shrink: 0;
  min-width: 0;
}

.global-header__logo {
  width: 1.85rem;
  height: 1.85rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.global-header__name,
.global-header__collection {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.global-header__collection {
  color: var(--text, #fff);
}

.global-header__toggle {
  appearance: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(74, 74, 84, 0.75);
  border-radius: 8px;
  background: rgba(28, 28, 32, 0.88);
  color: rgba(255, 255, 255, 0.82);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.global-header__toggle:focus-visible {
  outline: 2px solid var(--accent, #b0b0bc);
  outline-offset: 2px;
}

.global-header__nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.global-header__link,
.app-header__link {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.58);
  transition: color 0.2s ease;
}

.global-header__link:hover,
.app-header__link:hover,
.global-header__link[aria-current="page"],
.app-header__link[aria-current="page"] {
  color: rgba(255, 255, 255, 0.92);
}

.global-header__dropdown {
  position: relative;
}

.global-header__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  cursor: pointer;
}

.global-header__summary::-webkit-details-marker {
  display: none;
}

.global-header__summary::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform 0.2s ease;
}

.global-header__dropdown[open] .global-header__summary::after {
  transform: translateY(0.08rem) rotate(225deg);
}

.global-header__menu {
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 50%;
  min-width: 13.5rem;
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(74, 74, 84, 0.72);
  background: rgba(17, 17, 19, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(-50%);
  z-index: 45;
}

.global-header__menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.85rem;
  height: 0.85rem;
}

.global-header__menu-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.72rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.74);
  transition: background 0.2s ease, color 0.2s ease;
}

.global-header__menu-link img {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.global-header__menu-link:hover,
.global-header__menu-link:focus-visible,
.global-header__menu-link[aria-current="page"] {
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.07);
}

.app-header {
  position: relative;
  z-index: 1;
  display: none;
  align-items: center;
  gap: 1rem;
  height: var(--app-header-h);
  padding: 0 clamp(1rem, 4vw, 2rem);
  background: rgba(14, 14, 16, 0.88);
  border-bottom: 1px solid rgba(74, 74, 84, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text, #fff);
  flex-shrink: 0;
}

.app-header__logo {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
}

.app-header__name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.app-header__nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-left: auto;
  min-width: 0;
  overflow-x: auto;
}

.app-header--collection {
  justify-content: flex-end;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(74, 74, 84, 0.75);
  background: rgba(28, 28, 32, 0.88);
  flex-shrink: 0;
}

.global-header .lang-switch {
  margin-left: 0;
}

.global-header__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: 0.15rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.global-header__social:hover,
.global-header__social:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

.global-header__social:focus-visible {
  outline: 2px solid var(--accent, #b0b0bc);
  outline-offset: 2px;
}

.global-header__social-icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
}

a.lang-switch__btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

.lang-switch__btn {
  appearance: none;
  margin: 0;
  min-width: 2.85rem;
  padding: 0.45rem 0.72rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-switch__btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lang-switch__btn.is-active {
  color: var(--bg-deep, #111113);
  background: #d8d8e0;
  box-shadow: 0 0 0 1px rgba(74, 74, 84, 0.4);
}

.lang-switch__btn:focus-visible {
  outline: 2px solid var(--accent, #b0b0bc);
  outline-offset: 2px;
}

/* Drawer mobile */
.site-chrome__drawer {
  display: none;
  max-height: min(70vh, 28rem);
  overflow: auto;
  padding: 0.75rem clamp(1rem, 4vw, 2rem) 1.1rem;
  background: rgba(14, 14, 16, 0.97);
  border-bottom: 1px solid rgba(74, 74, 84, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.site-chrome.is-open .site-chrome__drawer {
  display: block;
}

.site-chrome__section + .site-chrome__section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(74, 74, 84, 0.35);
}

.site-chrome__section-title {
  margin: 0 0 0.55rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.site-chrome__drawer-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.15rem;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
}

.site-chrome__drawer-link img {
  width: 1.4rem;
  height: 1.4rem;
  object-fit: contain;
}

.site-chrome__drawer-link:hover,
.site-chrome__drawer-link[aria-current="page"] {
  color: #fff;
}

body.nav-drawer-open {
  overflow: hidden;
}

@media (min-width: 900px) {
  .global-header__toggle {
    display: none;
  }

  .global-header__nav {
    display: flex;
  }

  .global-header .lang-switch {
    margin-left: 0.25rem;
  }

  .site-chrome--with-app .app-header {
    display: flex;
  }

  .site-chrome__drawer,
  .site-chrome.is-open .site-chrome__drawer {
    display: none;
  }
}

@media (max-width: 899px) {
  .global-header .lang-switch {
    order: 3;
  }

  .global-header__toggle {
    order: 2;
  }

  .global-header__social {
    order: 4;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .global-header__collection {
    display: none;
  }

  .global-header__name {
    font-size: 1rem;
  }

  .lang-switch__btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 380px) {
  .global-header {
    gap: 0.55rem;
  }

  .lang-switch__btn {
    min-width: 2.35rem;
    padding-inline: 0.55rem;
  }
}
