/* Ostéo Poitiers — Header autonome (Qwery 3.9.0). Modifier ici les couleurs. */
#oph-header {
  --oph-orange: #B16249;
  --oph-orange-dark: #9c4932;
  --oph-brown: #382d20;
  --oph-text: #47433e;
  --oph-cream: #fff9f3;
  --oph-white: #ffffff;
  position: relative;
  z-index: 60;
  width: 100%;
  color: var(--oph-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}
#oph-header,
#oph-header *,
#oph-header *::before,
#oph-header *::after { box-sizing: border-box; }
#oph-header a { text-decoration: none; transition: color .18s ease, background .18s ease, opacity .18s ease; }
#oph-header a:focus-visible,
#oph-header summary:focus-visible { outline: 3px solid var(--oph-brown); outline-offset: 4px; }
#oph-header .oph-container { width: min(100% - 48px, 1640px); margin-inline: auto; }

/* Ligne de coordonnées blanche, au-dessus de la navigation orange. */
#oph-header .oph-contact-strip {
  background: var(--oph-white);
  border-bottom: 1px solid rgba(56, 45, 32, .09);
}
#oph-header .oph-contact-inner {
  display: flex; align-items: center; justify-content: center;
  min-height: 49px; gap: 23px; padding-block: 9px;
}
#oph-header .oph-office { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; color: #625d58; font-weight: 500; white-space: nowrap; font-size: 12.5px; }
#oph-header .oph-office-name { font-size: 12.5px; font-weight: 700; color: #38332e; }
#oph-header .oph-office-phone { font-weight: 650; color: #3d3834; font-variant-numeric: tabular-nums; }
#oph-header .oph-office-phone:hover { color: var(--oph-orange-dark); }
#oph-header .oph-office-separator { height: 11px; width: 1px; background: #d8d2cc; }
#oph-header .oph-between-offices { width: 1px; height: 20px; background: #d9d2cb; flex: 0 0 1px; }

/* Bande de navigation orange. */
#oph-header .oph-nav-strip { background: var(--oph-orange); box-shadow: 0 5px 18px rgba(61, 37, 18, .10); }
#oph-header .oph-nav-inner { display: flex; align-items: center; gap: 22px; min-height: 99px; }
#oph-header .oph-brand { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0; }
#oph-header .oph-brand img {
  display: block; object-fit: contain; width: 76px; height: 76px;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  /* Le fichier d'origine comporte un trait clair sur un fond foncé.
     Le filtre transforme ce trait en blanc ; 'screen' laisse le fond
     sombre se confondre avec la couleur de la barre (aucun carré). */
  filter: grayscale(1) brightness(1.85) contrast(8);
  mix-blend-mode: screen;
}
#oph-header .oph-brand:hover { opacity: .9; }
#oph-header .oph-desktop-nav { min-width: 0; flex: 1 1 auto; }
#oph-header .oph-menu { list-style: none; display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: clamp(16px, 1.3vw, 25px); margin: 0; padding: 0; }
#oph-header .oph-menu > li { position: relative; list-style: none; margin: 0; padding: 0; }
#oph-header .oph-menu > li > a {
  display: block; color: #fff; font-size: 16px;
  font-weight: 650; line-height: 1.35; letter-spacing: .006em;
  white-space: nowrap; padding: 14px 0; border-bottom: 2px solid transparent;
}
#oph-header .oph-menu > li > a:hover,
#oph-header .oph-menu > li.current-menu-item > a,
#oph-header .oph-menu > li.current-menu-ancestor > a { color: #fff; border-bottom-color: #fff3e6; }
#oph-header .oph-menu .sub-menu {
  position: absolute; display: none; left: -13px; top: calc(100% - 2px); z-index: 5;
  min-width: 195px; list-style: none; margin: 0; padding: 9px;
  background: #fff; box-shadow: 0 12px 30px rgba(58, 40, 28, .18); border-radius: 4px;
}
#oph-header .oph-menu li:hover > .sub-menu,
#oph-header .oph-menu li:focus-within > .sub-menu { display: block; }
#oph-header .oph-menu .sub-menu li { margin: 0; list-style: none; }
#oph-header .oph-menu .sub-menu a { display: block; padding: 9px 11px; color: var(--oph-text); font-size: 15px; border-radius: 3px; white-space: nowrap; }
#oph-header .oph-menu .sub-menu a:hover { background: var(--oph-cream); color: var(--oph-orange-dark); }

/* CTA Doctolib à choix, sans script externe. */
#oph-header .oph-nav-actions { flex: 0 0 auto; }
#oph-header .oph-booking { position: relative; }
#oph-header .oph-booking summary {
  list-style: none; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 49px; padding: 12px 19px; background: #fff; color: #80422f;
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 3px;
  font-size: 16px; font-weight: 750;
}
#oph-header .oph-booking summary::-webkit-details-marker,
#oph-header .oph-mobile-navigation summary::-webkit-details-marker { display: none; }
#oph-header .oph-booking summary:hover { background: var(--oph-cream); }
#oph-header .oph-booking[open] summary svg { transform: rotate(180deg); }
#oph-header .oph-booking-options {
  position: absolute; z-index: 15; top: calc(100% + 8px); right: 0;
  min-width: 324px; padding: 16px; border-radius: 6px; background: #fff;
  box-shadow: 0 14px 38px rgba(58, 40, 28, .20); border: 1px solid #f2e6dc;
}
#oph-header .oph-booking-label { display: block; font-size: 18px; line-height: 1.35; font-weight: 700; color: #594b42; padding: 7px 9px 15px; }
#oph-header .oph-booking-options a { display: flex; justify-content: space-between; color: #40342c; font-size: 17px; font-weight: 650; padding: 13px 9px; border-radius: 3px; }
#oph-header .oph-booking-options a:hover { color: #ad673c; background: var(--oph-cream); }
#oph-header .oph-mobile-navigation { display: none; }

/* Les restes éventuels de l'ancien modèle Qwery ne doivent pas s'afficher. */
body.oph-custom-header .top_panel,
body.oph-custom-header .menu_mobile_overlay,
body.oph-custom-header .menu_mobile { display: none !important; }
/* Une ancienne marge appliquée par le layout ThemeREX peut laisser un blanc. */
body.oph-custom-header .page_content_wrap_custom_header_margin { padding-top: 0 !important; }

@media (max-width: 1440px) {
  #oph-header .oph-container { width: min(100% - 36px, 1640px); }
  #oph-header .oph-nav-inner { gap: 20px; }
  #oph-header .oph-office { gap: 7px; font-size: 11.7px; }
  #oph-header .oph-office-name { font-size: 11.8px; }
}
/* Le menu passe au format compact dès que les libellés agrandis risquent de se chevaucher. */
@media (max-width: 1380px) {
  #oph-header .oph-desktop-nav { display: none; }
  #oph-header .oph-mobile-navigation { display: block; margin-left: auto; position: relative; }
  #oph-header .oph-nav-actions { margin-left: auto; }
  #oph-header .oph-nav-inner { min-height: 80px; }
  #oph-header .oph-brand img { width: 68px; height: 68px; }
  #oph-header .oph-mobile-navigation summary {
    list-style: none; display: flex; align-items: center; gap: 8px;
    color: #fff; cursor: pointer; border: 1px solid rgba(255,255,255,.55);
    padding: 10px 14px; min-height: 42px; border-radius: 3px;
    font-size: 16px; font-weight: 650;
  }
  #oph-header .oph-mobile-panel {
    position: absolute; z-index: 12; top: calc(100% + 18px); right: 0;
    width: min(345px, calc(100vw - 36px)); max-height: min(75vh, 670px);
    padding: 15px; background: #fff; border: 1px solid #f1e3d7;
    box-shadow: 0 16px 40px rgba(58,40,28,.20); border-radius: 5px; overflow-y: auto;
  }
  #oph-header .oph-mobile-panel .oph-menu { display: block; }
  #oph-header .oph-mobile-panel .oph-menu > li { border-bottom: 1px solid #f0ece7; }
  #oph-header .oph-mobile-panel .oph-menu > li > a { padding: 12px 7px; border: 0; font-size: 16px; color: #3d332d; font-weight: 600; white-space: normal; }
  #oph-header .oph-mobile-panel .oph-menu > li > a:hover,
  #oph-header .oph-mobile-panel .oph-menu > li.current-menu-item > a { color: #bd784c; }
  #oph-header .oph-mobile-panel .oph-menu .sub-menu {
    display: block; position: static; background: transparent; box-shadow: none;
    border-radius: 0; min-width: 0; padding: 0 0 8px 14px;
  }
  #oph-header .oph-mobile-panel .oph-menu .sub-menu a { padding-block: 6px; }
  #oph-header .oph-mobile-booking { padding: 15px 6px 2px; display: grid; gap: 9px; }
  #oph-header .oph-mobile-booking span { font-size: 15px; font-weight: 700; color: #84786f; }
  #oph-header .oph-mobile-booking a { display: block; font-size: 16px; font-weight: 650; border-radius: 3px; padding: 11px; background: #f9f0e8; color: #875432; }
}
@media (max-width: 1130px) {
  #oph-header .oph-office-hours, #oph-header .oph-office-address,
  #oph-header .oph-address-separator, #oph-header .oph-optional-separator { display: none; }
  #oph-header .oph-contact-inner { gap: 20px; min-height: 43px; }
}
@media (max-width: 650px) {
  #oph-header .oph-container { width: calc(100% - 26px); }
  #oph-header .oph-contact-inner { justify-content: space-between; gap: 7px; min-height: 43px; padding-block: 7px; }
  #oph-header .oph-office { display: flex; flex-direction: column; gap: 1px; align-items: flex-start; line-height: 1.25; }
  #oph-header .oph-office-separator, #oph-header .oph-between-offices { display: none; }
  #oph-header .oph-office-name { font-size: 11px; }
  #oph-header .oph-office-phone { font-size: 11px; }
  #oph-header .oph-nav-inner { gap: 9px; min-height: 73px; }
  #oph-header .oph-brand img { width: 60px; height: 60px; }
  #oph-header .oph-nav-actions { margin-left: auto; }
  #oph-header .oph-booking summary { padding: 10px 11px; min-height: 43px; font-size: 13px; gap: 5px; }
  #oph-header .oph-booking-options { min-width: min(318px, calc(100vw - 26px)); right: -52px; }
  #oph-header .oph-mobile-navigation { margin-left: 0; }
  #oph-header .oph-mobile-navigation summary { min-height: 43px; padding: 10px; }
  #oph-header .oph-mobile-navigation summary span { display: none; }
  #oph-header .oph-mobile-panel { top: calc(100% + 16px); }
}
@media (prefers-reduced-motion: reduce) {
  #oph-header a { transition: none; }
}

/* Lisibilité et comportement du logo sur fonds orange. */
#oph-header .oph-brand { background: transparent; isolation: auto; }
#oph-header .oph-booking-options a:focus-visible,
#oph-header .oph-menu a:focus-visible { outline-color: #643023; }
@media (min-width: 1381px) and (max-width: 1540px) {
  #oph-header .oph-nav-inner { gap: 16px; }
  #oph-header .oph-menu { gap: 13px; }
  #oph-header .oph-menu > li > a { font-size: 15px; }
  #oph-header .oph-booking summary { padding-inline: 13px; font-size: 15px; }
}
@media (max-width: 380px) {
  #oph-header .oph-brand img { width: 52px; height: 52px; }
  #oph-header .oph-booking summary { font-size: 12px; padding: 8px; }
  #oph-header .oph-booking-options { right: -43px; }
}

/* v1.2.0 — personnalisation depuis Outils > En-tête Ostéo Poitiers */
#oph-header .oph-contact-strip { background: var(--oph-contact-bg, #fff); }
#oph-header .oph-office { color: var(--oph-contact-color, #625d58); font-size: var(--oph-contact-size, 13px); }
#oph-header .oph-menu { gap: clamp(16px, var(--oph-menu-spacing, 24px), 36px); }
#oph-header .oph-menu > li > a { color: var(--oph-menu-color, #fff); font-size: var(--oph-menu-size, 16px); }
#oph-header .oph-menu > li > a:hover,
#oph-header .oph-menu > li.current-menu-item > a,
#oph-header .oph-menu > li.current-menu-ancestor > a { color: var(--oph-menu-color, #fff); }
#oph-header .oph-brand img { width: var(--oph-logo-size, 76px); height: var(--oph-logo-size, 76px); }
#oph-header.oph-logo-original .oph-brand img { filter: none; mix-blend-mode: normal; }
#oph-header .oph-nav-inner { min-height: var(--oph-nav-height, 99px); }
#oph-header .oph-booking summary { background: var(--oph-button-bg, #fff); color: var(--oph-button-color, #80422f); }
#oph-header .oph-booking-label { font-size: var(--oph-booking-heading-size, 18px); }

/* Header intelligent : visible au défilement vers le haut, caché vers le bas.
   Un espace réservé est ajouté par JS pour éviter un saut de contenu. */
#oph-header.oph-sticky-active {
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0px);
  inset-inline: 0;
  width: 100%;
  z-index: 9990;
  transform: translate3d(0, -125%, 0);
  transition: transform .25s ease-out;
  will-change: transform;
}
#oph-header.oph-sticky-active.oph-sticky-visible { transform: translate3d(0, 0, 0); }
#oph-header.oph-sticky-active.oph-sticky-compact .oph-contact-strip { display: none; }
.oph-sticky-placeholder { display: block; height: 0; margin: 0; padding: 0; visibility: hidden; pointer-events: none; }
/* Ajuste les ancres du menu et laisse apparaître les titres sous la barre flottante. */
html:has(#oph-header.oph-sticky-visible) { scroll-padding-top: 110px; }
@media (max-width: 1380px) {
  #oph-header .oph-nav-inner { min-height: min(var(--oph-nav-height, 99px), 80px); }
  #oph-header .oph-brand img { width: min(var(--oph-logo-size, 76px), 68px); height: min(var(--oph-logo-size, 76px), 68px); }
}
@media (min-width: 1381px) and (max-width: 1540px) {
  #oph-header .oph-menu { gap: min(var(--oph-menu-spacing, 24px), 13px); }
  #oph-header .oph-menu > li > a { font-size: min(var(--oph-menu-size, 16px), 15px); }
}
@media (max-width: 650px) {
  #oph-header .oph-nav-inner { min-height: min(var(--oph-nav-height, 99px), 73px); }
  #oph-header .oph-brand img { width: min(var(--oph-logo-size, 76px), 60px); height: min(var(--oph-logo-size, 76px), 60px); }
}
@media (max-width: 380px) {
  #oph-header .oph-brand img { width: min(var(--oph-logo-size, 76px), 52px); height: min(var(--oph-logo-size, 76px), 52px); }
}
@media (prefers-reduced-motion: reduce) {
  #oph-header.oph-sticky-active { transition: none; }
}
