/* En-tête responsive — styles isolés (préfixe ehr-) */
:root {
  --ehr-bg: #fbf3ec;
  --ehr-bg-scrolled: #ffffff;
  --ehr-ink: #2f4a6a;
  --ehr-accent: #ee9b80;
  --ehr-line: #ebdfd4; /* filet pleine largeur sous l'en-tête */
  --ehr-accent-txt: color-mix(in srgb, var(--ehr-accent) 72%, #7a2e14); /* corail assez foncé pour être lisible en texte */
  --ehr-h: 92px;
  --ehr-h-small: 66px;
  --ehr-logo: 62px;
  --ehr-logo-small: 44px;
  --ehr-logo-mobile: 46px;
  --ehr-max: 1180px;
  --ehr-gap: 40px; /* espace entre les liens du menu */
  --ehr-top: 0px;
}
html body .ehr-header *, html body .ehr-panel *, html body .ehr-header *::before, html body .ehr-panel *::before, html body .ehr-header *::after, html body .ehr-panel *::after { box-sizing: border-box; }

/* ---------- Barre ---------- */
html body .ehr-header {
  position: fixed; left: 0; right: 0; top: var(--ehr-top); z-index: 9990;
  height: var(--ehr-h);
  background: var(--ehr-bg);
  color: var(--ehr-ink);
  border-bottom: 1px solid var(--ehr-line);
  transition: height .3s ease, background-color .3s ease, box-shadow .3s ease;
}
html body .ehr-header.is-scrolled {
  height: var(--ehr-h-small);
  background: var(--ehr-bg-scrolled);
  box-shadow: 0 10px 30px -16px rgba(47, 74, 106, .22);
}
html body .ehr-spacer { height: var(--ehr-h); }

html body .ehr-inner {
  max-width: var(--ehr-max); height: 100%; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 24px;
}

html body .ehr-logo { flex: none; display: flex; align-items: center; height: 100%; text-decoration: none; color: inherit; }
html body .ehr-logo img { display: block; width: auto; height: var(--ehr-logo); max-height: calc(100% - 16px); max-width: 220px; object-fit: contain; transition: height .3s ease; }
html body .ehr-header.is-scrolled .ehr-logo img { height: var(--ehr-logo-small); }
html body .ehr-logo-text { font-weight: 700; font-size: 20px; letter-spacing: -.01em; }

/* ---------- Menu ordinateur ---------- */
html body .ehr-nav { margin-left: auto; }
html body .ehr-nav ul { list-style: none; margin: 0; padding: 0; }
html body .ehr-nav > ul { display: flex; align-items: center; gap: var(--ehr-gap); }
html body .ehr-nav li { position: relative; margin: 0; }
html body .ehr-nav > ul > li { display: flex; align-items: center; }
html body .ehr-nav a {
  display: block; color: var(--ehr-ink); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 10px 6px; border-radius: 10px; white-space: nowrap; transition: color .15s, background-color .15s;
}
html body .ehr-nav > ul > li > a { transform-origin: center; transition: color .2s ease, transform .2s ease; }
html body .ehr-nav > ul > li:hover > a, html body .ehr-nav > ul > li.is-open > a, html body .ehr-nav > ul > li > a:focus-visible, html body .ehr-nav > ul > li.current-menu-item > a, html body .ehr-nav > ul > li.current-menu-ancestor > a, html body .ehr-nav > ul > li.current_page_item > a { color: var(--ehr-accent-txt); transform: scale(1.08); }
html body .ehr-nav > ul > li:hover > .ehr-sub-toggle, html body .ehr-nav > ul > li.is-open > .ehr-sub-toggle, html body .ehr-nav > ul > li.current-menu-ancestor > .ehr-sub-toggle { color: var(--ehr-accent-txt); }
html body .ehr-nav a:focus-visible { outline: 2px solid var(--ehr-accent); outline-offset: 2px; }

html body .ehr-sub-toggle {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: -2px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer;
}
html body .ehr-sub-toggle svg { width: 12px; height: 12px; transition: transform .2s; }
html body .ehr-sub-toggle:focus-visible { outline: 2px solid var(--ehr-accent); outline-offset: 1px; }

html body .ehr-nav .sub-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; padding: 8px;
  background: #fff; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(47, 74, 106, .35), 0 1px 3px rgba(47, 74, 106, .08);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
html body .ehr-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
html body .ehr-nav .sub-menu a { font-weight: 500; padding: 9px 12px; }
html body .ehr-nav .sub-menu a { transform-origin: left center; transition: color .2s ease, transform .2s ease; }
html body .ehr-nav .sub-menu a:hover, html body .ehr-nav .sub-menu a:focus-visible, html body .ehr-nav .sub-menu .current-menu-item > a { color: var(--ehr-accent-txt); transform: scale(1.05); }
html body .ehr-nav .sub-menu .sub-menu { top: -8px; left: 100%; }
html body .ehr-nav li:hover > .sub-menu, html body .ehr-nav li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
html body .ehr-nav li:hover > .ehr-sub-toggle svg, html body .ehr-nav li.is-open > .ehr-sub-toggle svg { transform: rotate(180deg); }

/* ---------- Bouton devis ---------- */
html body .ehr-cta {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ehr-accent); color: var(--ehr-ink); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: 99px; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, padding .3s;
}
/* Survol : bleu nuit, texte corail, léger zoom */
html body .ehr-cta:hover, html body .ehr-cta:focus-visible {
  background: var(--ehr-ink); color: var(--ehr-accent); transform: scale(1.06);
}
html body .ehr-cta:active { transform: scale(1.02); }
html body .ehr-cta:focus-visible { outline: 2px solid var(--ehr-ink); outline-offset: 3px; }
html body .ehr-header.is-scrolled .ehr-cta { padding: 9px 20px; }
html body .ehr-inner > .ehr-nav + .ehr-cta { margin-left: calc(var(--ehr-gap) + 8px); }

/* ---------- Burger ---------- */
html body .ehr-burger {
  display: none; flex: none; margin-left: auto; width: 46px; height: 46px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ehr-ink); cursor: pointer;
  align-items: center; justify-content: center;
}
html body .ehr-burger:focus-visible { outline: 2px solid var(--ehr-accent); outline-offset: 2px; }
html body .ehr-burger span { position: relative; display: block; width: 24px; height: 2px; border-radius: 2px; background: currentColor; }
html body .ehr-burger span::before, html body .ehr-burger span::after { content: ""; position: absolute; left: 0; height: 2px; border-radius: 2px; background: currentColor; }
html body .ehr-burger span::before { top: -7px; width: 24px; }
html body .ehr-burger span::after { top: 7px; width: 16px; transition: width .2s; }
html body .ehr-burger:hover span::after { width: 24px; }

/* ---------- Panneau latéral ---------- */
html body .ehr-overlay {
  position: fixed; inset: 0; z-index: 9998; background: rgba(28, 38, 54, .42);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
html body .ehr-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 9999;
  width: min(380px, 88vw);
  display: flex; flex-direction: column;
  background: var(--ehr-bg); color: var(--ehr-ink);
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) 22px;
  transform: translateX(105%); visibility: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility .35s;
  box-shadow: -20px 0 50px -20px rgba(28, 38, 54, .35);
  overflow-y: auto; overscroll-behavior: contain;
}
html.ehr-open .ehr-overlay { opacity: 1; visibility: visible; }
html.ehr-open .ehr-panel { transform: none; visibility: visible; }
html.ehr-open, html.ehr-open body { overflow: hidden; }

html body .ehr-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 52px; }
html body .ehr-panel-head .ehr-logo img { height: 42px; max-height: none; }
html body .ehr-close {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--ehr-ink) 8%, transparent); color: var(--ehr-ink);
  display: grid; place-items: center;
}
html body .ehr-close svg { width: 18px; height: 18px; }
html body .ehr-close:focus-visible { outline: 2px solid var(--ehr-accent); outline-offset: 2px; }

html body .ehr-panel-nav ul { list-style: none; margin: 0; padding: 0; }
html body .ehr-panel-nav > ul > li { border-bottom: 1px solid color-mix(in srgb, var(--ehr-ink) 12%, transparent); }
html body .ehr-panel-nav li { display: flex; flex-wrap: wrap; align-items: center; margin: 0; }
html body .ehr-panel-nav a {
  flex: 1; display: block; padding: 15px 4px; color: var(--ehr-ink); text-decoration: none;
  font-weight: 600; font-size: 18px;
}
html body .ehr-panel-nav .current-menu-item > a, html body .ehr-panel-nav .current_page_item > a { color: color-mix(in srgb, var(--ehr-accent) 72%, #7a2e14); }
html body .ehr-panel-nav .ehr-sub-toggle { width: 44px; height: 44px; margin: 0; border-radius: 50%; }
html body .ehr-panel-nav .ehr-sub-toggle svg { width: 14px; height: 14px; }
html body .ehr-panel-nav li.is-open > .ehr-sub-toggle svg { transform: rotate(180deg); }
html body .ehr-panel-nav .sub-menu { flex-basis: 100%; display: none; padding: 0 0 10px 14px; border-left: 2px solid var(--ehr-accent); margin-left: 4px; }
html body .ehr-panel-nav li.is-open > .sub-menu { display: block; }
html body .ehr-panel-nav .sub-menu a { font-size: 16px; font-weight: 500; padding: 10px 4px; }

html body .ehr-panel-foot { margin-top: auto; padding-top: 26px; display: grid; gap: 12px; }
html body .ehr-panel-foot .ehr-cta { justify-content: center; padding: 15px 22px; font-size: 16px; }
html body .ehr-phone {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px;
  border-radius: 99px; color: var(--ehr-ink); text-decoration: none; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--ehr-ink) 20%, transparent);
}
html body .ehr-phone svg { width: 17px; height: 17px; }

/* ---------- Bascule mobile (point de rupture réglable via la classe) ---------- */
@media (max-width: 1024px) {
  html body .ehr-bp-1024 .ehr-nav, html body .ehr-bp-1024 .ehr-inner > .ehr-cta { display: none; }
  html body .ehr-bp-1024 .ehr-burger { display: inline-flex; }
}
@media (max-width: 900px) {
  html body .ehr-bp-900 .ehr-nav, html body .ehr-bp-900 .ehr-inner > .ehr-cta { display: none; }
  html body .ehr-bp-900 .ehr-burger { display: inline-flex; }
}
@media (max-width: 768px) {
  :root { --ehr-h: 74px; --ehr-h-small: 60px; }
  html body .ehr-bp-768 .ehr-nav, html body .ehr-bp-768 .ehr-inner > .ehr-cta { display: none; }
  html body .ehr-bp-768 .ehr-burger { display: inline-flex; }
  html body .ehr-header .ehr-logo img { height: var(--ehr-logo-mobile); }
  html body .ehr-header.is-scrolled .ehr-logo img { height: calc(var(--ehr-logo-mobile) * .8); }
}
html body .ehr-cta-short { display: none; }
@media (max-width: 560px) {
  html body .ehr-inner { gap: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  html body .ehr-inner > .ehr-cta .ehr-cta-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body .ehr-inner > .ehr-cta .ehr-cta-short { display: inline; }
  html body .ehr-logo { min-width: 0; flex: 0 1 auto; }
  html body .ehr-logo img { max-width: 100%; }
  html body .ehr-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  html body .ehr-header, html body .ehr-header *, html body .ehr-panel, html body .ehr-overlay { transition: none !important; }
}

/* ---------- Protection contre les styles du thème ---------- */
html body .ehr-header button, html body .ehr-panel button,
html body .ehr-header button:hover, html body .ehr-panel button:hover,
html body .ehr-header button:focus, html body .ehr-panel button:focus {
  background-color: transparent; background-image: none; border: 0; box-shadow: none; color: var(--ehr-ink);
  text-transform: none; letter-spacing: normal; min-height: 0; min-width: 0; line-height: 1; font-size: 16px;
}
html body .ehr-panel .ehr-close, html body .ehr-panel .ehr-close:hover, html body .ehr-panel .ehr-close:focus { background-color: color-mix(in srgb, var(--ehr-ink) 8%, transparent); }
html body .ehr-header a, html body .ehr-panel a,
html body .ehr-header a:hover, html body .ehr-panel a:hover,
html body .ehr-header a:focus, html body .ehr-panel a:focus { text-decoration: none; box-shadow: none; text-transform: none; letter-spacing: normal; line-height: 1.35; }
html body .ehr-header .ehr-nav a, html body .ehr-panel .ehr-panel-nav a { color: var(--ehr-ink); }
html body .ehr-header .ehr-nav > ul > li:hover > a, html body .ehr-header .ehr-nav > ul > li.is-open > a,
html body .ehr-header .ehr-nav > ul > li.current-menu-item > a, html body .ehr-header .ehr-nav > ul > li.current-menu-ancestor > a,
html body .ehr-header .ehr-nav > ul > li.current_page_item > a, html body .ehr-header .ehr-nav .sub-menu a:hover,
html body .ehr-header .ehr-nav .sub-menu .current-menu-item > a,
html body .ehr-panel .ehr-panel-nav a:hover,
html body .ehr-panel .ehr-panel-nav .current-menu-item > a, html body .ehr-panel .ehr-panel-nav .current_page_item > a { color: var(--ehr-accent-txt); }
html body .ehr-header a.ehr-cta, html body .ehr-panel a.ehr-cta { color: var(--ehr-ink); background-color: var(--ehr-accent); }
html body .ehr-header a.ehr-cta:hover, html body .ehr-panel a.ehr-cta:hover,
html body .ehr-header a.ehr-cta:focus-visible, html body .ehr-panel a.ehr-cta:focus-visible { color: var(--ehr-accent); background-color: var(--ehr-ink); }
html body .ehr-panel a.ehr-phone, html body .ehr-panel a.ehr-phone:hover { color: var(--ehr-ink); }
html body .ehr-header ul, html body .ehr-panel ul { list-style: none; margin: 0; padding: 0; }
html body .ehr-header li, html body .ehr-panel li { margin: 0; padding: 0; list-style: none; }
html body .ehr-header li::before, html body .ehr-panel li::before { content: none; }
html body .ehr-header .ehr-nav .sub-menu { padding: 8px; }
html body .ehr-panel .ehr-panel-nav .sub-menu { padding: 0 0 10px 14px; margin-left: 4px; }
html body .ehr-header img, html body .ehr-panel img { border: 0; box-shadow: none; border-radius: 0; }
