/* ==========================================================================
   PARCOURS PATIENT — menu par besoin, sélecteur de rendez-vous, urgence,
   infos pratiques du héros, barre d'actions mobile.
   Chargé après site.css et theme.css.
   ========================================================================== */

/* ---------- Menu : sous-menus (desktop) ---------- */
.nav-links > li { position: relative; }
.nav-links a .chev { width: .9em; height: .9em; margin-left: 4px; vertical-align: -0.1em; transition: transform .3s var(--ease); }
.nav-links .has-sub:hover > a .chev, .nav-links .has-sub:focus-within > a .chev { transform: rotate(180deg); }
.nav-links .has-sub.is-section > a { color: var(--primary-dark); background: var(--mist); }
.nav-links a.nav-urgence { color: var(--red); }
.nav-links a.nav-urgence:hover { background: var(--red-bg); color: var(--red); }
.nav-links a.nav-urgence .i { width: 1.05em; height: 1.05em; margin-right: 5px; }

.nav-links .sub {
  list-style: none; position: absolute; top: calc(100% + 10px); left: -8px; min-width: 330px; padding: 10px; z-index: 50;
  background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s var(--ease), transform .35s var(--ease), visibility .25s;
}
.nav-links .sub::before { /* zone tampon pour ne pas perdre le survol */
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.nav-links .has-sub:hover > .sub, .nav-links .has-sub:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.nav-links .sub li { display: block; }
.nav-links .sub a { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 12px; white-space: normal; font-weight: 500; }
.nav-links .sub a:hover, .nav-links .sub a.active { background: var(--mist); color: var(--primary-dark); }
.nav-links .sub .sub-t { font-weight: 650; color: var(--ink); font-size: .95rem; }
.nav-links .sub .sub-d { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.nav-links .sub a:hover .sub-t { color: var(--primary-dark); }

@media (max-width: 1100px) {
  /* Dans le panneau mobile : les groupes sont dépliés, avec un titre de groupe */
  .nav-links .sub { position: static; min-width: 0; padding: 0 0 6px 10px; margin: 0 0 4px; background: transparent; border: 0; box-shadow: none;
    opacity: 1; visibility: inherit; transform: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-left: 2px solid var(--mist); margin-left: 12px; }
  /* le panneau replié ne doit capter aucun toucher */
  .nav-links:not(.open) { pointer-events: none; }
  .nav-links:not(.open) .sub, .nav-links:not(.open) a { visibility: hidden; }
  .nav-links .sub::before { display: none; }
  .nav-links .has-sub > a { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 13px 4px; pointer-events: none; }
  .nav-links .has-sub.is-section > a { background: transparent; }
  .nav-links .has-sub > a .chev { display: none; }
  .nav-links .sub a { padding: 9px 12px; }
  .nav-links .sub .sub-d { display: none; }
  .nav-links a.nav-urgence { background: var(--red-bg); margin-top: 4px; }
}

/* ---------- Splash : ordinateur uniquement ---------- */
@media (max-width: 767px) { .splash { display: none !important; } }

/* ---------- Héros : infos pratiques ---------- */
.hero-practical {
  display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 26px;
}
.hero-practical a, .hero-practical .hp-open {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: .92rem; font-weight: 600;
  background: rgba(255,255,255,.85); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s;
}
.hero-practical a:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: #fff; color: var(--ink); }
.hero-practical .i { color: var(--primary); }
.hero-practical .hp-open .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(15,122,85,.5); animation: pulse 2.4s infinite; }
.hero-practical .hp-open.closed .dot { background: var(--red); animation: none; }
.hero-practical .hp-open.closed { color: var(--text-light); }
.hero-practical .hp-open strong { color: var(--ink); font-weight: 700; }
.hero-practical .hp-open .today-hours { color: var(--text-light); font-weight: 500; }

/* ---------- Rendez-vous : sélecteur guidé ---------- */
.rdv-wizard { position: relative; z-index: 1; margin-top: 34px; text-align: left; }
.rdv-q { font-size: 1.02rem; color: rgba(230,244,242,.9); margin-bottom: 12px; text-align: center; }
.rdv-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 8px; }
.rdv-choice {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); color: #fff; font: 600 .97rem/1.2 var(--sans);
  transition: background .25s, border-color .25s, transform .35s var(--ease), box-shadow .35s var(--ease);
}
.rdv-choice:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.6); transform: translateY(-2px); }
.rdv-choice[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 12px 26px -12px rgba(0,0,0,.5); }
.rdv-choice .i { width: 1.1em; height: 1.1em; }
.rdv-choice small { font-size: .8rem; font-weight: 500; opacity: .8; }
.rdv-step { display: none; margin-top: 22px; animation: slideUp .5s var(--ease); }
.rdv-step.show { display: block; }
.rdv-result {
  display: none; margin: 22px auto 0; max-width: 620px; padding: 24px 26px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); text-align: center; animation: slideUp .5s var(--ease);
}
.rdv-result.show { display: block; }
.rdv-result p { margin: 0 0 16px; font-size: 1.02rem; }
.rdv-result p strong { color: #fff; }
.rdv-result .rdv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rdv-result .rdv-note { margin: 14px 0 0; font-size: .9rem; color: rgba(230,244,242,.7); }
.rdv-result .rdv-note a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cta-banner .rdv-wizard .btn { background: #fff; color: var(--ink); border-color: #fff; }
.cta-banner .rdv-wizard .btn:hover { background: var(--lagoon); border-color: var(--lagoon); }
.cta-banner .rdv-wizard .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.cta-banner .rdv-wizard .btn-outline:hover { background: #fff; color: var(--ink); }
.rdv-reset { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; background: none; border: 0; color: rgba(230,244,242,.7); font: 500 .9rem var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rdv-reset:hover { color: #fff; }
.rdv-reset[hidden] { display: none; }
.cta-banner > p.rdv-fallback { font-size: .95rem; color: rgba(230,244,242,.65); margin: 26px auto 0; max-width: 560px; }
.cta-banner > p.rdv-fallback a { color: #fff; }

/* ---------- Urgence dentaire ---------- */
#urgence { background: #fff; padding-top: 0 !important; }
.urgence-card {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; overflow: hidden;
  border-radius: var(--r-xl); border: 1px solid #f3c9c4; background: linear-gradient(135deg, #fff5f3, #fff 60%);
  box-shadow: var(--shadow);
}
.urgence-main { padding: 44px 44px 40px; }
.urgence-main .kicker { color: var(--red); }
.urgence-main .kicker::before { background: currentColor; }
.urgence-main h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 14px; }
.urgence-main > p { color: var(--text-light); font-size: 1.05rem; max-width: 56ch; }
.urgence-steps { list-style: none; display: grid; gap: 12px; margin-top: 24px; }
.urgence-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
.urgence-steps .ub { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.25rem; color: #fff; background: var(--red); }
.urgence-steps li.alt .ub { background: var(--ink); }
.urgence-steps strong { display: block; color: var(--ink); margin-bottom: 2px; }
.urgence-steps span { color: var(--text-light); font-size: .97rem; }
.urgence-steps a.tel { font-weight: 700; color: var(--red); font-size: 1.08rem; white-space: nowrap; }
.urgence-steps li.alt a.tel { color: var(--ink); }
.urgence-side { padding: 44px 40px; background: var(--ink); color: rgba(230,244,242,.86); display: flex; flex-direction: column; justify-content: center; }
.urgence-side h3 { color: #fff; font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin-bottom: 14px; letter-spacing: 0; }
.urgence-side ul { list-style: none; display: grid; gap: 10px; }
.urgence-side li { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; }
.urgence-side li .i { color: var(--lagoon); flex: none; margin-top: 3px; }
.urgence-side .btn { margin-top: 24px; align-self: flex-start; background: #fff; color: var(--ink); border-color: #fff; font-size: 1.05rem; }
.urgence-side .btn:hover { background: var(--lagoon); border-color: var(--lagoon); color: var(--ink); }
.topbar-urgence a { display: inline-flex; align-items: center; gap: 6px; color: #ffd4cf !important; font-weight: 600; }
.topbar-urgence .i { color: #ff9d94 !important; }
.topbar-urgence a:hover { color: #fff !important; }

/* ---------- Barre d'actions mobile ---------- */
.action-bar { display: none; }
@media (max-width: 767px) {
  html { scroll-padding-bottom: 100px; }
  body { padding-bottom: 84px; }
  .action-bar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90; display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; padding: 8px;
    background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .action-bar a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 10px; border-radius: 16px; font-weight: 650; font-size: .98rem; }
  .action-bar .ab-call { background: var(--mist); color: var(--ink); }
  .action-bar .ab-rdv { background: var(--primary); color: #fff; box-shadow: 0 10px 20px -10px rgba(0,109,110,.8); }
  
  .back-to-top { bottom: 96px; }
  .call-bar { display: none !important; } /* remplacée par la barre d'actions */
  
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .urgence-card { grid-template-columns: 1fr; }
  .urgence-main, .urgence-side { padding: 30px 24px; }
}
@media (max-width: 640px) {
  .hero-practical { margin-top: 20px; gap: 8px; }
  .hero-practical a, .hero-practical .hp-open { font-size: .88rem; padding: 8px 12px; }
  .rdv-choices { flex-direction: column; align-items: stretch; }
  .rdv-choice { justify-content: center; flex-direction: column; gap: 2px; padding: 12px 16px; }
  .rdv-choice small { display: block; }
  .action-bar .ab-rdv .long { display: none; }
  .rdv-result { padding: 20px 16px; }
  .urgence-steps li { flex-direction: column; gap: 8px; }
}
.action-bar .short { display: none; }
@media (max-width: 767px) { .action-bar .short { display: inline; } }

/* ---------- Ancres : ne jamais atterrir sous la barre collante ----------
   La barre collante = barre du haut (≈42 px, visible > 1100 px) + en-tête.
   On applique la marge à tout élément ciblable, y compris les titres des pages légales. */
[id] { scroll-margin-top: calc(var(--header-h) + 28px); }
@media (min-width: 1101px) {
  [id], section[id], main[id], [id].procedure, #carte { scroll-margin-top: calc(var(--header-h) + 70px); }
}

/* ---------- Menu mobile plus compact : sous-rubriques sur deux colonnes ---------- */
@media (max-width: 1100px) and (min-width: 400px) {
  .nav-links .sub { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; }
  .nav-links .sub a { padding: 8px 10px; font-size: .92rem; }
}
@media (max-width: 1100px) {
  .nav-links { max-height: calc(100dvh - 92px); }
}

/* ---------- Bandeau cookies compact sur mobile (il cohabite avec la barre d'actions) ---------- */

/* ---------- Espace patient : les tuiles 2 × 2 ne débordent plus sur les petits écrans ---------- */
.p-portal .actions.tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.p-portal .actions.tiles > .action-card { min-width: 0; }
.p-portal .actions.tiles .action-title, .p-portal .actions.tiles .action-desc { overflow-wrap: anywhere; }

/* ==========================================================================
   Mobile : les barres fixes s'effacent pendant la lecture
   • l'en-tête se cache quand on descend, revient dès qu'on remonte
   • la barre Appeler/RDV n'apparaît qu'après le héros, disparaît pendant le
     défilement vers le bas et dans les sections qui ont déjà ces boutons
   • le bouton « retour en haut » est retiré (l'en-tête qui revient suffit)
   ========================================================================== */
@media (max-width: 1100px) {
  .site-top { transition: transform .35s var(--ease); will-change: transform; }
  .site-top.bar-hidden { transform: translateY(-100%); }
  .site-top.bar-hidden header { box-shadow: none; }
}
@media (max-width: 767px) {
  .back-to-top { display: none !important; }
  .action-bar { transform: translateY(calc(100% + 24px)); opacity: 0; transition: transform .4s var(--ease), opacity .3s; pointer-events: none; }
  .action-bar.show { transform: none; opacity: 1; pointer-events: auto; }
  body { padding-bottom: 0; }
  body.has-action-bar { padding-bottom: 84px; }
  
  
}

/* ==========================================================================
   Conseils post-op : recherche par soin ou par symptôme
   ========================================================================== */
.postop-search { margin: 0 0 22px; }
.postop-search.has-results { margin-bottom: 26px; }
.postop-search-label { display: block; font-weight: 650; color: var(--ink); margin-bottom: 10px; }
.postop-search-field { position: relative; display: flex; align-items: center; }
.postop-search-field > .i { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--primary); pointer-events: none; }
.postop-search-field input {
  width: 100%; padding: 15px 48px 15px 46px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  font: inherit; font-size: 1.02rem; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .25s, box-shadow .25s;
  -webkit-appearance: none; appearance: none;
}
.postop-search-field input::-webkit-search-cancel-button { display: none; }
.postop-search-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 5px rgba(59,184,173,.18); }
.postop-clear { position: absolute; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--mist); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.postop-clear .i { width: 18px; height: 18px; }
.postop-hint { margin-top: 8px; font-size: .88rem; color: var(--muted); }
.postop-results { margin-top: 12px; }
.postop-procs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.postop-proc { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 999px; border: 1.5px solid var(--primary); background: var(--primary); color: #fff; font: 600 .95rem var(--sans); cursor: pointer; }
.postop-proc:hover { background: var(--primary-dark); }
.postop-proc-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.18); }
.postop-proc .i { width: 16px; height: 16px; }
.postop-hits { list-style: none; display: grid; gap: 6px; }
.postop-hit-btn { width: 100%; text-align: left; display: block; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: var(--text); transition: border-color .2s, background .2s, transform .3s var(--ease); }
.postop-hit-btn:hover { border-color: var(--primary); background: var(--porcelain); transform: translateX(3px); }
.postop-hit-meta { display: block; font-size: .78rem; font-weight: 650; color: var(--primary-dark); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.postop-hit-text { display: block; font-size: .95rem; line-height: 1.45; color: var(--text-light); }
.postop-hit-text mark { background: rgba(59,184,173,.25); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.postop-empty { padding: 14px 16px; border-radius: var(--r-md); background: var(--amber-bg); color: #5d3a06; font-size: .95rem; line-height: 1.5; }
.postop-empty a { color: #5d3a06; font-weight: 650; text-decoration: underline; }
/* le passage trouvé est mis en évidence dans la fiche */
.postop-hit { animation: postopHit 2.4s var(--ease) 1; border-radius: 8px; }
@keyframes postopHit { 0%, 40% { background: rgba(59,184,173,.28); box-shadow: 0 0 0 6px rgba(59,184,173,.28); } 100% { background: transparent; box-shadow: none; } }
@media (max-width: 640px) {
  .postop-search-field input { font-size: 16px; padding: 14px 44px 14px 42px; } /* 16px : évite le zoom automatique d'iOS */
  .postop-proc { width: 100%; justify-content: center; }
}

/* v8 — sélecteur de rendez-vous : fondu de sortie avant l'étape suivante */
.rdv-step.leaving, .rdv-result.leaving { animation: rdvOut .15s ease forwards; }
@keyframes rdvOut { to { opacity: 0; transform: translateY(-6px); } }
/* v8 — écrans tactiles */
@media (hover: none) { .hero-practical a:hover, .rdv-choice:hover, .postop-hit-btn:hover { transform: none; } }
.hero-practical a:active, .rdv-choice:active, .postop-hit-btn:active, .action-bar a:active { transform: scale(.97); transition-duration: .1s; }

/* v8 — statut « Ouvert / Fermé » : le point surgit, le texte glisse, juste après l'arrivée du héros */
@media (prefers-reduced-motion: no-preference) {
  .hero-practical .hp-open.is-set .dot { animation: hpDot .6s cubic-bezier(.34,1.56,.64,1) calc(.9s + var(--intro, 0s)) backwards, pulse 2.4s calc(1.5s + var(--intro, 0s)) infinite; }
  .hero-practical .hp-open.is-set.closed .dot { animation: hpDot .6s cubic-bezier(.34,1.56,.64,1) calc(.9s + var(--intro, 0s)) backwards, hpRing 1.2s ease-out calc(1.4s + var(--intro, 0s)) 1; }
  .hero-practical .hp-open.is-set strong { animation: hpText .5s var(--ease) calc(1s + var(--intro, 0s)) backwards; }
  .hero-practical .hp-open.is-set .today-hours { animation: hpText .5s var(--ease) calc(1.1s + var(--intro, 0s)) backwards; }
}
@keyframes hpDot { from { transform: scale(0); } }
@keyframes hpText { from { opacity: 0; transform: translateX(-6px); } }
@keyframes hpRing { from { box-shadow: 0 0 0 0 rgba(180,35,24,.45); } to { box-shadow: 0 0 0 9px rgba(180,35,24,0); } }

/* ==========================================================================
   v9 — navigation mobile
   ========================================================================== */
/* En-tête opaque une fois la page défilée : sans flou d'arrière-plan, le texte de la page transparaissait */
@media (hover: none), (max-width: 960px) {
  header.scrolled, .site-top.scrolled header { background: #fff; }
}
.nav-backdrop { display: none; }
@media (max-width: 1100px) {
  /* menu ouvert : voile sombre, page figée */
  html.menu-open { overflow: hidden; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(6,57,58,.4); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s; }
  .menu-open .nav-backdrop { opacity: 1; visibility: visible; }
  /* le panneau garde son défilement pour lui et signale par une ombre qu'il reste des rubriques plus bas */
  .nav-links { overscroll-behavior: contain;
    background: linear-gradient(rgba(255,255,255,0), #fff 70%) bottom / 100% 40px no-repeat local,
                radial-gradient(farthest-side at 50% 100%, rgba(6,57,58,.2), transparent) bottom / 100% 14px no-repeat scroll, #fff; }
  .nav-links a { -webkit-tap-highlight-color: transparent; }
  .nav-links a:active { background: var(--mist); }
  .nav-links .sub a[aria-current="page"] { background: var(--mist); }
  .nav-links .sub a[aria-current="page"] .sub-t { color: var(--primary-dark); }
}
.nav-links .sub a[aria-current="page"] { background: var(--mist); }
/* sous-rubriques sur deux colonnes dès 340 px : le menu tient sur un écran, « Urgence » et « Contact » restent visibles */
@media (max-width: 1100px) and (min-width: 340px) {
  .nav-links .sub { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; }
  .nav-links .sub a { padding: 10px 10px; font-size: .92rem; justify-content: center; min-height: 44px; }
  .nav-links .sub .sub-t { font-size: .92rem; line-height: 1.25; }
}
@media (max-width: 1100px) and (max-height: 720px) {
  .nav-links { padding: 10px; }
  .nav-links a { padding: 11px 16px; }
  .nav-links .has-sub > a { padding: 8px 13px 2px; }
}
/* sommaire des pages de soins : bord droit estompé tant qu'il reste des rubriques à faire défiler */
@media (max-width: 960px) {
  .toc.can-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
}
/* « Urgence » et « Contact » côte à côte en bas du panneau */
@media (max-width: 1100px) {
  .nav-links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; align-content: start; }
  .nav-links > li { grid-column: 1 / -1; }
  .nav-links > li:nth-last-child(-n/**/+2) { grid-column: auto; margin-top: 4px; }
  .nav-links > li:nth-last-child(-n/**/+2) > a { display: flex; align-items: center; justify-content: center; height: 100%; margin-top: 0; text-align: center; }
  .nav-links > li:last-child > a { background: var(--porcelain); border: 1px solid var(--line); }
}
