/* En-tête, modèle 14 : rang posé sur le carton (il part avec la page), barre collée encre
   (compteur, téléphone, touche), menu « Sommaire » au téléphone, barre de réservation basse. */
.rang {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--rang-h);
  padding-inline: max(var(--pad), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right));
  background: #fff; border-bottom: 2px solid var(--encre);
}
.logo { display: inline-flex; flex: none; align-items: center; min-height: 44px; color: var(--encre); }
.logo__svg { width: 170px; height: 24px; }
@media (max-width: 359px) { .logo__svg { width: 148px; height: 21px; } }
@media (min-width: 900px) { .logo__svg { width: 198px; height: 28px; } }

.nav { display: none; }
.nav ul { display: flex; gap: 20px; }
.nav a, .menu__nav a { text-decoration: none; }
.nav a { display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; font-size: 16px; }
.nav a::after { content: attr(data-t); height: 0; overflow: hidden; visibility: hidden; font-weight: 700; }
.nav a[aria-current] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (hover: hover) { .nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; } }
@media (min-width: 900px) { .nav { display: block; } .rang .bouton-menu { display: none; } }

.bouton-menu, .menu__fermer {
  display: inline-flex; flex: none; align-items: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 4px 0 8px;
  border: 0; background: none; font-weight: 700; font-size: 17px; cursor: pointer;
}
.bouton-menu svg { width: 24px; height: 24px; flex: none; }
.bouton-menu .tu-path, .bouton-menu .tu-branch { stroke: currentColor; }

/* Barre collée : même hauteur au seuil et collée ; au téléphone, logo court et « Menu » quand le rang est parti. */
.barre {
  position: sticky; z-index: 10; top: calc(var(--demobar-offset, 0px) + var(--bande));
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; height: var(--barre-h);
  padding-inline: max(var(--pad), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right));
  background: var(--encre); color: #fff;
}
.barre :focus-visible { outline-color: #fff; }
.barre__mono, .barre .bouton-menu { visibility: hidden; opacity: 0; transition: opacity .25s var(--ease), visibility 0s .25s; }
.barre.est-collee .barre__mono, .barre.est-collee .bouton-menu { visibility: visible; opacity: 1; transition-delay: 0s; }
.barre__mono { display: inline-flex; align-items: center; width: 44px; height: 44px; }
.barre__mono svg { width: 28px; height: 28px; }
.barre .bouton-menu { color: #fff; }
.barre__tel, .barre__touche { display: none; }

.compteur { display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 6px 4px; touch-action: none; cursor: ns-resize; user-select: none; -webkit-user-select: none; }
.compteur__tambours { display: inline-flex; align-items: baseline; font-weight: 700; font-size: 26px; line-height: 1.1; }
.tambour { display: inline-block; width: .6em; height: 1.1em; overflow: hidden; }
.bande { display: block; will-change: transform; }
.bande > span { display: block; height: 1.1em; text-align: center; }
.virgule.est-cachee { display: none; }
.compteur__lib { color: var(--lib); font-size: 14px; white-space: nowrap; }
.compteur.est-tenu .compteur__tambours { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

@media (min-width: 900px) {
  .barre { grid-template-columns: calc(var(--c-km) + var(--c-tu)) 1fr auto; gap: 0; }
  .barre__mono, .barre .bouton-menu { display: none; }
  .barre__tel { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; text-decoration: none; font-variant-numeric: tabular-nums; }
  .barre__touche { display: inline-flex; }
  .compteur { cursor: default; }
}

/* Menu : la case « Sommaire » descend de la barre, liens ancrés en bas, à portée de pouce. */
.menu {
  position: fixed; z-index: 60; inset: var(--demobar-offset, 0px) 0 0 0; display: flex; flex-direction: column;
  background: #fff; transform: translateY(-100%); transition: transform .35s var(--ease); overscroll-behavior: contain;
}
.menu[hidden] { display: none; }
.menu.est-ouvert { transform: none; }
.menu__tete {
  display: flex; align-items: center; justify-content: space-between; height: var(--rang-h); flex: none;
  padding-inline: max(var(--pad), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right));
  border-bottom: 2px solid var(--encre);
}
.menu__tete .logo__svg { width: 170px; height: 24px; }
.menu__nav { margin-top: auto; padding: 0 var(--pad); }
.menu__nav li { border-top: 2px solid var(--encre); }
.menu__nav a { display: flex; align-items: center; gap: 16px; min-height: 64px; font-weight: 700; font-size: 30px; }
.menu__nav svg { width: 40px; height: 40px; flex: none; }
.menu__nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.menu__pied {
  display: grid; gap: 4px; padding: 20px var(--pad) calc(24px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--encre); background: var(--case);
}
.menu__pied a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; font-size: 22px; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .menu { transition: none; } }

/* Barre de réservation basse, téléphone seulement. */
.resa-basse {
  position: fixed; z-index: 49; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: calc(64px + env(safe-area-inset-bottom));
  padding: 8px max(var(--pad), env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  background: var(--encre); color: #fff; transition: transform .3s var(--ease);
}
.resa-basse p { font-size: 16px; line-height: 1.3; }
.resa-basse .touche { min-height: 48px; min-width: 120px; box-shadow: 0 3px 0 #000; }
.resa-basse.est-retiree { transform: translateY(110%); }
:root:has(select:focus) .resa-basse { display: none; }
@media (min-width: 900px) { .resa-basse { display: none; } }
