/* ── Pizza Club sign-up popup ────────────────────────────────────────────
   Shown N seconds after cookie consent is given (delay configurable via
   Appearance → Customise → Pizza Club Popup).
   Suppressed for 30 days after dismissal; permanently after sign-up.
   ──────────────────────────────────────────────────────────────────────── */

.wfs-popup {
  position: fixed;
  inset: 0;
  z-index: 9500; /* below Complianz (9999) but above everything else */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.wfs-popup.is-visible { opacity: 1; }

.wfs-popup[hidden] { display: none !important; }

/* ── Backdrop ── */

.wfs-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

/* ── Dialog ── */

.wfs-popup__dialog {
  position: relative;
  z-index: 1;
  background: var(--color-dark);
  color: var(--color-light);
  border-top: 3px solid #ff4d00;
  max-width: 560px;
  width: 100%;
  max-height: 92svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
  gap: 0.5rem;
}

/* Prevent flex from compressing children — dialog must scroll instead */
.wfs-popup__dialog > * { flex-shrink: 0; }

/* ── Close button ── */

.wfs-popup__close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--color-light);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  padding: 0.2rem 0.4rem;
  transition: opacity 0.2s;
}

.wfs-popup__close:hover,
.wfs-popup__close:focus-visible { opacity: 1; outline: none; }

/* ── Eyebrow label ── */

.wfs-popup__eyebrow {
  color: #ff4d00;
  font-family: var(--font-std, sans-serif);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  padding-top: clamp(1.75rem, 5vw, 2.25rem);
}

/* ── Orange decorative rule ── */

.wfs-popup__rule {
  border: none;
  border-bottom: 3px solid #ff4d00;
  width: 3rem;
  margin: 0.35rem auto 0;
  flex-shrink: 0;
}

/* ── Headline ── */

.wfs-popup__headline {
  font-family: var(--font-headline, 'WFS Heading Fixed', sans-serif);
  font-size: 6rem;
  text-transform: uppercase;
  line-height: 0.75;
  color: var(--color-light);
  margin: 0.5rem 0 0;
  letter-spacing: 0.01em;
  padding: 0 clamp(1rem, 5vw, 2rem);
  text-wrap: pretty;
}

/* ── Call to action (below headline, 1rem) ── */

.wfs-popup__cta {
  font-size: 1rem;
  color: var(--color-light);
  line-height: 1.4;
  margin: 0;
  max-width: 48ch;
  padding: 0 clamp(1rem, 5vw, 2rem);
}

/* ── Secondary message (smaller, below divider) ── */

.wfs-popup__sub {
  font-size: 0.8rem;
  color: var(--color-light);
  opacity: 0.7;
  line-height: 1.4;
  margin: 0;
  max-width: 60ch;
  padding: 0 clamp(1rem, 5vw, 2rem);
}

/* ── Slim rule variant (between CTA and message) — same size as main rule ── */

.wfs-popup__rule--slim {
  width: 3rem;
  border-bottom-width: 3px;
}

/* ── Form iframe ── */

.wfs-popup__form {
  width: 100%;
  /* Bumped +80px from 700→780 to absorb the Cloudflare Turnstile widget height */
  height: 780px;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.wfs-popup__form iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (min-width: 768px) {
  .wfs-popup__form {
    /* Bumped +80px from 650→730 */
    height: 730px;
  }
}

/* ── "No, thanks" dismiss link ── */

.wfs-popup__already-member {
  background: none;
  border: none;
  color: var(--color-light);
  opacity: 0.5;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  padding: 0.25rem 0 clamp(1.25rem, 4vw, 1.75rem);
  transition: opacity 0.2s;
  font-family: var(--font-std, inherit);
}

.wfs-popup__already-member:hover,
.wfs-popup__already-member:focus-visible { opacity: 0.8; outline: none; }

/* ── Mobile — bottom sheet ── */

@media (max-width: 480px) {
  .wfs-popup {
    align-items: flex-end;
    padding: 0;
  }

  .wfs-popup__dialog {
    /* dvh tracks the actual visible viewport, so it shrinks when the
       keyboard opens — keeping the SIGN UP button above the keyboard. */
    max-height: 92dvh;
    max-width: 100%;
    border-radius: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    /* Prevent content sitting behind iOS home indicator / Android nav bar */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Keep the full 780px iframe height on mobile — the dialog scrolls */
}
