/* ==========================================================================
   MWS — Vérification d'âge : le portail.
   Structure seule ; la charte est dans tokens.css (surchargé par le thème).

   Tailles en em sur une base posée ici : certains thèmes fixent
   html { font-size: 10px } (Reignac), d'autres 16px. En rem, le portail
   changerait de taille d'une boutique à l'autre.
   Mobile d'abord.
   ========================================================================== */

/* Le portail est un <dialog> : on efface les marges, bordures et largeurs
   maximales que le navigateur donne à une boîte de dialogue, pour qu'il
   couvre tout l'écran, ouvert simplement ou en modal. */
.mws-agegate {
  position: fixed;
  inset: 0;
  /* Sans modal (pas de script), le z-index fait le travail ; en modal, la
     couche supérieure du navigateur passe de toute façon devant. */
  z-index: 2147483000;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  overflow-y: auto;
  padding: 2em 1.25em;
  background-color: var(--mws-agegate-bg);
  color: var(--mws-agegate-text);
  font-family: var(--mws-agegate-font);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

/* `display: flex` ci-dessus l'emporte sur la feuille du navigateur : sans
   cette règle, une boîte fermée resterait affichée. */
.mws-agegate:not([open]) {
  display: none;
}

/* Verrou de défilement. La classe est posée par le script ; le sélecteur
   :has() prend le relais quand JavaScript est absent. */
.mws-agegate--open,
html:has(#mws-agegate) {
  overflow: hidden;
}

.mws-agegate__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25em;
  width: 100%;
  max-width: 34em;
  margin: auto;
}

.mws-agegate__logo {
  width: auto;
  max-width: min(16em, 80%);
  height: auto;
  margin-bottom: .5em;
}

.mws-agegate__eyebrow {
  margin: 0;
  color: var(--mws-agegate-accent);
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.mws-agegate__title {
  margin: 0;
  color: var(--mws-agegate-text);
  font-family: var(--mws-agegate-font-title);
  font-size: clamp(1.75em, 6vw, 2.75em);
  font-weight: var(--mws-agegate-title-weight);
  line-height: 1.15;
}

.mws-agegate__text {
  margin: 0;
  color: var(--mws-agegate-text);
  font-size: 1em;
  line-height: 1.7;
}

/* ── Réponses ─────────────────────────────────────────────────────────── */

.mws-agegate__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .75em;
  width: 100%;
  margin: .5em 0 0;
}

.mws-agegate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3em;
  margin: 0;
  padding: .9em 1.75em;
  border: 1px solid var(--mws-agegate-accent);
  border-radius: var(--mws-agegate-radius);
  background-color: var(--mws-agegate-accent);
  color: var(--mws-agegate-on-accent);
  font-family: inherit;
  font-size: .8125em;
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.3;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.mws-agegate__btn:hover,
.mws-agegate__btn:focus-visible {
  border-color: var(--mws-agegate-accent-hover);
  background-color: var(--mws-agegate-accent-hover);
  color: var(--mws-agegate-on-accent);
}

.mws-agegate__btn:focus-visible {
  outline: 2px solid var(--mws-agegate-accent);
  outline-offset: 3px;
}

/* Le « non » est une sortie, pas une proposition : en filet. Mais il reste
   un vrai bouton, lisible et de même taille. */
.mws-agegate__btn--ghost {
  border-color: var(--mws-agegate-line);
  background-color: transparent;
  color: var(--mws-agegate-muted);
}

.mws-agegate__btn--ghost:hover,
.mws-agegate__btn--ghost:focus-visible {
  border-color: var(--mws-agegate-text);
  background-color: transparent;
  color: var(--mws-agegate-text);
}

.mws-agegate__disclaimer {
  margin: 1.5em 0 0;
  color: var(--mws-agegate-muted);
  font-size: .8125em;
  line-height: 1.6;
}

/* ── Refus ────────────────────────────────────────────────────────────── */

.mws-agegate[data-state="blocked"] .mws-agegate__eyebrow {
  color: var(--mws-agegate-muted);
}

@media (min-width: 48em) {
  .mws-agegate__actions {
    flex-direction: row;
    justify-content: center;
  }

  .mws-agegate__btn {
    flex: 0 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mws-agegate__btn {
    transition: none;
  }
}
