/* Sainte-Hélène — éléments communs à toutes les pages du site public :
 * bouton WhatsApp flottant et transitions entre les pages (accueil ↔ parcours).
 * Les couleurs viennent de la palette déclarée dans site.css et preconsultation/flow.css. */

/* Bouton WhatsApp : rond 56 px, bleu, logo blanc ; étiquette au survol (ordinateur), bulle d'invitation une fois */
.wa {
  position: fixed;
  z-index: 60;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  animation: wa-arrivee 420ms cubic-bezier(.22, 1, .36, 1) 900ms backwards;
  transition: opacity .22s ease, visibility 0s linear 0s;
}
.wa > * {
  pointer-events: auto;
}
.wa.is-cache {
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility 0s linear .18s;
}
.wa .whatsapp-float {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pmsh-bleu);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(6, 47, 87, .24);
  transition: background .2s ease, transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease;
}
.wa .whatsapp-float:hover {
  background: var(--pmsh-marine);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(6, 47, 87, .28);
}
.wa .whatsapp-float:focus-visible {
  outline: 3px solid var(--pmsh-bleu);
  outline-offset: 3px;
}
.wa__logo {
  width: 28px;
  height: 28px;
  display: block;
}
.wa__etiquette {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  padding: 9px 14px;
  border: 1px solid var(--pmsh-bleu);
  border-radius: 999px;
  background: #fff;
  color: var(--pmsh-marine);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(6, 47, 87, .12);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(6px, -50%, 0);
  transition: opacity .18s ease, transform .2s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .18s;
}
@media (hover: hover) and (min-width: 901px) {
  .wa .whatsapp-float:hover .wa__etiquette,
  .wa .whatsapp-float:focus-visible .wa__etiquette {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, -50%, 0);
    transition: opacity .18s ease, transform .2s cubic-bezier(.22, 1, .36, 1), visibility 0s;
  }
}
.wa__bulle {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: min(270px, calc(100vw - 36px));
  padding: 12px 8px 12px 15px;
  border: 1px solid var(--pmsh-bord);
  border-radius: 14px;
  background: #fff;
  color: var(--pmsh-gris-1);
  box-shadow: 0 16px 40px rgba(6, 47, 87, .16);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
}
.wa__bulle.is-visible {
  opacity: 1;
  transform: none;
}
.wa__bulle::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  background: #fff;
  border-right: 1px solid var(--pmsh-bord);
  border-bottom: 1px solid var(--pmsh-bord);
  transform: rotate(45deg);
}
.wa__bulle p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.45;
  cursor: pointer;
}
.wa__bulle strong {
  display: block;
  color: var(--pmsh-marine);
  font-weight: 600;
}
.wa__fermer {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pmsh-gris-2);
  cursor: pointer;
}
.wa__fermer:hover {
  background: var(--pmsh-pale-2);
  color: var(--pmsh-marine);
}
.wa__fermer:focus-visible {
  outline: 3px solid var(--pmsh-bleu);
  outline-offset: 1px;
}
.wa__fermer svg {
  width: 16px;
  height: 16px;
}
@keyframes wa-arrivee { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

/* Transitions entre les pages : la carte de prestation devient l'en-tête du parcours (et inversement au retour) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 260ms;
    animation-timing-function: ease;
  }
  ::view-transition-group(parcours-entete) {
    animation-duration: 420ms;
    animation-timing-function: cubic-bezier(.22, 1, .36, 1);
  }
  ::view-transition-old(parcours-entete),
  ::view-transition-new(parcours-entete) {
    animation-duration: 420ms;
    height: 100%;
    object-fit: cover;
    overflow: clip;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa {
    animation: none;
  }
  .wa,
  .wa *,
  .wa__bulle {
    transition: none !important;
  }
}

@media print {
  .wa {
    display: none;
  }
}
