/* ==========================================================
   SERRURIER OISE — HEADER PARTAGÉ (pages zones)
   Copie du header de index.html (sections 1, 4, 5 et 6 de ses
   styles). Si vous modifiez le header de l'accueil, reportez
   les changements ici.
   ========================================================== */

/* --- Variables --- */
:root {
  --ink: #0F1D36;          /* nuit profonde, fonds sombres */
  --ink-2: #16294A;        /* surfaces sombres secondaires */
  --steel: #5B6B82;        /* texte secondaire */
  --steel-line: #D5DCE6;   /* filets, bordures claires */
  --mist: #EEF2F7;         /* fond clair froid */
  --white: #FFFFFF;
  --blue: #1D4ED8;         /* bleu de marque */
  --blue-soft: #DCE6FF;
  --signal: #FF6B1A;       /* orange d'appel, réservé aux actions */
  --signal-dark: #E0540A;
  --ok: #22C55E;

  --font-display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-body: "Figtree", "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(1.1rem, 4vw, 2rem);
  --header-h: 76px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 22px;
}


/* --- Base limitée au header et au menu mobile
   (le reste de la page garde ses propres styles) --- */
.site-header,
.mobile-panel {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
:where(.site-header, .mobile-panel) *,
:where(.site-header, .mobile-panel) *::before,
:where(.site-header, .mobile-panel) *::after { box-sizing: border-box; }
:where(.site-header, .mobile-panel) a { color: inherit; }
:where(.site-header, .mobile-panel) button { font: inherit; cursor: pointer; }
.site-header h3 {
  font-family: var(--font-display);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.site-header p { margin: 0 0 1em; }
.site-header :focus-visible,
.mobile-panel :focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--signal);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 200;
  border-radius: var(--r-sm);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }


/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.5rem;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 1.25em; }
.btn-call {
  background: var(--signal);
  color: #fff;
}
.btn-call:hover { background: var(--signal-dark); }
.btn-ghost {
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
.btn-ghost:hover {
  border-color: #fff;
  background: rgba(255,255,255,.08);
}
.btn-xl {
  padding: 1.15rem 1.8rem;
  font-size: 1.15rem;
}
.btn-xl .num {
  font-family: var(--font-display);
  font-stretch: 110%;
  font-weight: 800;
  letter-spacing: .01em;
}

/* --- Barre du header --- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  color: #fff;
  transition: background .3s, box-shadow .3s, color .3s;
}
.site-header.is-scrolled {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 var(--steel-line), 0 12px 30px -20px rgba(15,29,54,.45);
}
.header-inner {
  position: relative;          /* sert de repère aux méga-menus */
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: height .3s;
}
.is-scrolled .header-inner { height: calc(var(--header-h) - 12px); }

/* --- Logo --- */
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--signal);
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 16px; height: 24px; fill: #fff; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 850;
  font-stretch: 115%;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-text small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .72rem;
  font-stretch: 100%;
  letter-spacing: 0;
  opacity: .7;
}

/* --- Liens principaux --- */
.main-nav { margin-left: auto; height: 100%; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.nav-list > li { height: 100%; display: flex; align-items: center; }
.nav-link,
.nav-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .55rem .6rem;
  background: none;
  border: 0;
  color: inherit;
  font-weight: 600;
  font-size: .98rem;
  text-decoration: none;
  white-space: nowrap;
}
/* Soulignement orange qui s'étire au survol et sur la page active */
.nav-link::after,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: .7rem;
  right: .7rem;
  bottom: .15rem;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.nav-link:hover::after,
.nav-toggle:hover::after,
.nav-toggle[aria-expanded="true"]::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle i { font-size: 1.1rem; transition: transform .2s; }
.nav-toggle[aria-expanded="true"] i { transform: rotate(180deg); }

/* Lien « Urgence 24h » : point rouge qui pulse pour attirer l'œil */
.nav-urgent .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239,68,68,.6);
  animation: ping-red 1.8s infinite;
}
@keyframes ping-red {
  70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* --- Page active : repérée par aria-current="page" (ajouté en JS) --- */
.nav-toggle.is-current::after { transform: scaleX(1); }
.mega-link[aria-current="page"],
.mega-link[aria-current="page"]:hover {
  position: relative;
  background: linear-gradient(135deg, rgba(29,78,216,.11) 0%, rgba(29,78,216,.03) 100%);
  color: var(--blue);
  box-shadow:
    inset 0 0 0 1px rgba(29,78,216,.16),
    0 10px 24px -16px rgba(29,78,216,.55);
}
.mega-link[aria-current="page"] strong,
.mega-link.simple[aria-current="page"] { font-weight: 700; }
.mega-link.simple[aria-current="page"] { align-items: center; gap: .4rem; }
.mega-link[aria-current="page"] .ico {
  background: linear-gradient(145deg, var(--blue), #3B6CF0);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(29,78,216,.7);
}
/* Épingle orange devant le lien actif (ajoutée en JS) */
.mega-link .pin {
  display: inline-grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  margin-right: .3rem;
  border-radius: 50%;
  background: rgba(255,107,26,.14);
  color: var(--signal);
  font-size: .9em;
  font-weight: 400;
  vertical-align: -.2em;
}
.mega-link.simple .pin { margin-right: 0; }

/* --- Méga-menu (panneau commun à Services et Zones) --- */
.mega {
  position: absolute;
  top: 100%;
  left: var(--gutter);
  right: var(--gutter);
  display: none;
  grid-template-columns: 1fr 280px;
  background: #fff;
  color: var(--ink);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: 0 30px 60px -25px rgba(15,29,54,.5), 0 0 0 1px var(--steel-line);
  overflow: hidden;
}
.mega.is-open { display: grid; animation: mega-in .2s ease; }
@keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* Pont invisible : garde le menu ouvert quand la souris descend vers lui */
.mega::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px; }

.mega-main {
  padding: 1.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.mega-main.cols-3 { grid-template-columns: 1.4fr 1fr 1fr; }
.mega-col h3 {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .75rem;
  font-size: .95rem;
  font-stretch: 100%;
  color: var(--steel);
}
.mega-col h3 i { color: var(--signal); font-size: 1.1rem; }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col.two-cols ul { columns: 2; column-gap: 1rem; }
.mega-link {
  display: flex;
  gap: .75rem;
  padding: .6rem;
  margin-inline: -.6rem;
  border-radius: 10px;
  text-decoration: none;
  break-inside: avoid;
}
.mega-link:hover { background: var(--mist); }
.mega-link .ico {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.mega-link strong { display: block; font-size: .96rem; line-height: 1.25; }
.mega-link span { display: block; font-size: .83rem; color: var(--steel); line-height: 1.35; margin-top: 2px; }
.mega-link.simple { padding: .45rem .6rem; font-weight: 600; font-size: .95rem; }

/* Colonne de droite du méga-menu : encadré sombre d'action */
.mega-aside {
  background: var(--ink);
  color: #fff;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.mega-aside h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.mega-aside p { color: rgba(255,255,255,.72); font-size: .93rem; }
.mega-aside .btn { margin-top: auto; }
.mega-aside .mega-all { margin-top: .9rem; color: #fff; font-weight: 600; font-size: .92rem; }

/* --- Actions à droite : devis, téléphone, burger --- */
.header-actions { display: flex; align-items: center; gap: .6rem; }
.header-quote {
  padding: .66rem 1rem;
  font-size: .95rem;
  border-color: currentColor;
  color: inherit;
}
.is-scrolled .header-quote:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.05rem;
  border-radius: var(--r-sm);
  background: var(--signal);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 108%;
  /* Caché en haut de page, visible après le scroll */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .25s, transform .25s, visibility .25s, background .2s;
}
.header-phone:hover { background: var(--signal-dark); }
.is-scrolled .header-phone { opacity: 1; visibility: visible; transform: none; }
.burger {
  display: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(127,140,160,.18);
  color: inherit;
  font-size: 1.5rem;
  place-items: center;
}


/* Pages dont le haut est clair : header blanc dès le chargement */
.site-header.is-solid {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 var(--steel-line), 0 12px 30px -20px rgba(15,29,54,.45);
}
.site-header.is-solid .header-inner { height: var(--header-h); }

/* --- Menu mobile --- */
/* --- Panneau plein écran ouvert par le burger --- */
.mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;          /* au-dessus de la barre d'appel des pages */
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: #fff;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s ease, visibility .3s;
}
.mobile-panel.is-open { transform: none; visibility: visible; }
.mobile-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + .9rem) var(--gutter) .9rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-close {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.5rem;
}
.mobile-scroll { flex: 1; overflow-y: auto; padding: .5rem var(--gutter) 1.5rem; }

/* Liens et accordéons */
.mobile-nav > a,
.mobile-nav summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 750;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary i { transition: transform .2s; }
.mobile-nav details[open] summary i { transform: rotate(180deg); }
.mobile-nav .pulse { margin-left: auto; margin-right: .2rem; }

/* Services en tuiles à l'intérieur de l'accordéon */
.m-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  padding: 1rem 0;
}
.m-tiles a {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .85rem;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.06);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.25;
}
.m-tiles a i { font-size: 1.4rem; color: var(--signal); }
.m-tiles a.is-urgent { background: rgba(255,107,26,.16); }

/* Villes en liste compacte */
.m-cities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .1rem 1rem;
  padding: .75rem 0 1rem;
}
.m-cities a {
  padding: .5rem 0;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: .98rem;
}

/* Page active dans le menu mobile */
.mobile-nav > a[aria-current="page"],
.mobile-nav summary.is-current { color: var(--signal); }
.m-tiles a[aria-current="page"] { background: rgba(255,107,26,.16); box-shadow: inset 0 0 0 2px var(--signal); }
.m-cities a[aria-current="page"] { color: var(--signal); font-weight: 700; }

/* Pied du panneau : boutons toujours visibles */
.mobile-foot {
  display: grid;
  gap: .6rem;
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.1);
}
.mobile-foot .btn { width: 100%; }


/* --- Responsive --- */
@media (max-width: 1280px) {
  .is-scrolled .header-quote { display: none; }
}
@media (max-width: 1180px) {
  .mega-main { grid-template-columns: repeat(2, 1fr); }
  .mega { grid-template-columns: 1fr 240px; }
}
@media (max-width: 1080px) {
  .main-nav, .header-quote { display: none; }
  .burger { display: grid; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 768px) {
  :root { --header-h: 66px; }
  .header-phone { padding: .6rem .8rem; }
  .header-phone .num { display: none; }
}
@media (max-width: 420px) {
  .brand-text small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header *, .mobile-panel, .mobile-panel * {
animation: none !important;
transition: none !important;
  }
}
