/* ============================================================================
   entete.css — le bandeau commun à toutes les pages (Outils Excel / Tools Excel)
   Le HTML est posé par _charte/entete.py ; cette feuille est chargée en
   dernier et préfixe tout par header.oe-entete pour passer devant les styles
   écrits dans chaque page. Bascule vers le menu mobile : 1180 px (la même
   valeur que BASCULE dans entete.py).
   ============================================================================ */

/* Safari (macOS, iOS, iPadOS) annule `position: sticky` dès qu'un ancêtre
   porte `overflow-x: hidden` — le bandeau se figeait en haut de page et
   disparaissait au défilement. `clip` coupe le débordement horizontal sans
   créer de conteneur de défilement, donc sans casser le sticky. Posé ici en
   `!important` parce que chaque page déclare encore son propre `body`. */
body { overflow-x: clip !important; }

header.oe-entete {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  max-width: none; margin: 0;
  padding: 12px max(16px, 4vw);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  font-family: 'Inter', 'Inter repli', system-ui, sans-serif;
}

/* ---------- logo ---------- */
header.oe-entete .logo {
  display: flex; align-items: center; gap: 11px;
  flex: 0 0 auto; margin-right: auto;
  text-decoration: none; white-space: nowrap;
  font-size: inherit; color: #0f172a;
}
header.oe-entete .logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: #107c41; color: #fff;
  display: grid; place-items: center; flex: 0 0 auto;
  font-family: 'Outfit', 'Outfit repli', sans-serif; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(16, 124, 65, .22);
}
header.oe-entete .logo-text { display: block; line-height: 1.15; }
header.oe-entete .logo-brand {
  display: block; font-family: 'Outfit', 'Outfit repli', sans-serif;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em; line-height: 1.15;
  color: #0f172a;
}
header.oe-entete .logo-brand .accent { color: #107c41; }
header.oe-entete .logo-def {
  display: block; font-size: 11.5px; line-height: 1.3; font-weight: 400;
  color: #64748b;
}

/* ---------- navigation ---------- */
header.oe-entete nav {
  display: flex; align-items: center; gap: 22px;
  margin: 0; font-size: 14.5px; font-weight: 500;
}
header.oe-entete nav a {
  display: inline; padding: 0; border: 0; background: none;
  color: #334155; text-decoration: none; white-space: nowrap;
  transition: color .2s;
}
header.oe-entete nav a:hover { color: #107c41; }
header.oe-entete nav a.on { color: #107c41; font-weight: 600; }

/* ---------- sélecteur de langue, panier, bouton ---------- */
header.oe-entete > .lang-switch { margin-left: 4px; flex: 0 0 auto; }
header.oe-entete .oe-cart-btn { flex: 0 0 auto; white-space: nowrap; }
header.oe-entete .btn-header {
  flex: 0 0 auto; display: inline-block;
  background: #107c41; color: #fff;
  font-weight: 700; font-size: 14.5px; line-height: 1.2;
  padding: 10px 18px; border-radius: 10px; border: 0;
  text-decoration: none; white-space: nowrap; transition: background .2s;
}
header.oe-entete .btn-header:hover { background: #0b5e31; color: #fff; }

/* ---------- menu mobile ---------- */
header.oe-entete .menu-mobile { display: none; flex: 0 0 auto; }
header.oe-entete .menu-mobile > summary {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; list-style: none; cursor: pointer;
  color: #0f172a; background: #fff;
  border: 1px solid #cbd5e1; border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
header.oe-entete .menu-mobile > summary::-webkit-details-marker { display: none; }
header.oe-entete .menu-mobile > summary::marker { content: ""; }
header.oe-entete .menu-mobile > summary:hover { background: #f1f5f9; }
header.oe-entete .menu-mobile > summary:focus-visible { outline: 2px solid #107c41; outline-offset: 2px; }
header.oe-entete .menu-mobile-barres {
  position: relative; display: block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; transition: background .2s;
}
header.oe-entete .menu-mobile-barres::before,
header.oe-entete .menu-mobile-barres::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; transition: transform .2s, top .2s;
}
header.oe-entete .menu-mobile-barres::before { top: -6px; }
header.oe-entete .menu-mobile-barres::after { top: 6px; }
header.oe-entete .menu-mobile[open] > summary .menu-mobile-barres { background: transparent; }
header.oe-entete .menu-mobile[open] > summary .menu-mobile-barres::before { top: 0; transform: rotate(45deg); }
header.oe-entete .menu-mobile[open] > summary .menu-mobile-barres::after { top: 0; transform: rotate(-45deg); }
header.oe-entete .menu-mobile-panneau {
  position: absolute; top: calc(100% + 8px); right: max(16px, 4vw); z-index: 70;
  display: flex; flex-direction: column; gap: 0;
  min-width: min(260px, calc(100vw - 32px)); max-width: calc(100vw - 32px);
  padding: 8px;
  max-height: 78vh; max-height: calc(100dvh - 84px);
  overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
}
header.oe-entete .menu-mobile-panneau a {
  display: block; padding: 11px 14px; border-radius: 9px;
  font-size: 15px; line-height: 1.35; font-weight: 500;
  color: #334155; background: none; text-decoration: none;
}
header.oe-entete .menu-mobile-panneau a:hover,
header.oe-entete .menu-mobile-panneau a:focus-visible { background: #e6f4ea; color: #107c41; }
header.oe-entete .menu-mobile-panneau a.on { color: #107c41; font-weight: 700; }
header.oe-entete .menu-mobile-titre {
  margin: 8px 6px 2px; padding-top: 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #64748b; border-top: 1px solid #e2e8f0;
}
header.oe-entete .menu-mobile-panneau > .lang-switch { align-self: flex-start; margin: 12px 6px 4px; }

/* ---------- largeurs intermédiaires ---------- */
@media (max-width: 1400px) {
  header.oe-entete { gap: 14px; }
  header.oe-entete nav { gap: 18px; font-size: 14px; }
  header.oe-entete .logo-def { display: none; }
}
@media (max-width: 1180px) {
  header.oe-entete nav { display: none; }
  header.oe-entete .menu-mobile { display: block; }
  header.oe-entete .logo-def { display: block; }
}
@media (max-width: 600px) {
  header.oe-entete { gap: 10px; padding: 10px 16px; }
  header.oe-entete .logo-def { display: none; }
  header.oe-entete .logo-mark { width: 32px; height: 32px; font-size: 16px; }
  header.oe-entete .logo-brand { font-size: 17px; }
  header.oe-entete .btn-header { padding: 9px 12px; font-size: 13.5px; }
  header.oe-entete .oe-cart-lbl { display: none; }
  header.oe-entete .menu-mobile-panneau { left: 16px; right: 16px; min-width: 0; }
}
@media (max-width: 400px) {
  header.oe-entete .btn-header { display: none; }
}

/* Le bandeau colle en haut de l'écran : une ancre (#devis, #tarifs…) doit
   s'arrêter sous lui, pas derrière. */
html { scroll-padding-top: 84px; }
