/* =====================================================================
   Promo modal — "Inscripción GRATIS todo septiembre"
   Auto-opens on load (app.js §1). Recreates the flyer in HTML/CSS over the
   underwater hero photo so it stays crisp + responsive at any size, and
   closes into a WhatsApp CTA.
   ===================================================================== */

/* ---------- Shell ---------- */
.promo-modal {
  position: fixed;
  inset: 0;
  z-index: 210; /* above the verano modal */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}
.promo-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.promo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 36, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.promo-modal__dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--ink-navy);
  box-shadow: var(--sh-lg);
  transform: translateY(18px) scale(0.985);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.promo-modal.is-open .promo-modal__dialog {
  transform: none;
}
.promo-modal__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.promo-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition:
    transform 0.2s,
    background 0.2s;
}
.promo-modal__close:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.3);
}
.promo-modal__close svg {
  width: 18px;
  height: 18px;
}
/* the modal is outside the page scroll — never let the scroll-reveal hide it */
.promo-modal .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- The flyer ---------- */
.pmodal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(30px, 7vw, 44px) clamp(20px, 6vw, 34px) clamp(22px, 5vw, 30px);
  text-align: center;
  color: #fff;
  background: var(--ink-navy);
}
/* Foto submarina de fondo.
   PARA USAR EL FONDO VERTICAL DEL FLYER: guárdalo como
   dist/fotos/promo-fondo.jpg, pásalo por `python tools/optimize-images.py`
   y cambia la URL de abajo por dist/fotos/promo-fondo-opt.webp.
   (Se dejó una sola URL a propósito: apilar capas de reserva hacía que el
   navegador pidiera archivos inexistentes en cada carga.) */
.pmodal__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("dist/fotos/hero.webp") 22% 50% / cover no-repeat var(--ink-navy);
  filter: saturate(1.08) brightness(0.88);
}
/* navy wash so the type reads like the flyer: dark under the lockup, lighter
   through the middle (the light rays show), deep again under the CTA + note */
.pmodal__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(8, 22, 45, 0.74) 0%,
      rgba(9, 26, 54, 0.5) 30%,
      rgba(8, 26, 56, 0.42) 58%,
      rgba(7, 18, 40, 0.82) 88%,
      rgba(7, 18, 40, 0.92) 100%
    ),
    radial-gradient(
      120% 60% at 50% 0%,
      rgba(77, 150, 255, 0.18) 0%,
      transparent 70%
    );
}

/* rising bubbles — decorative, motion-gated */
.pmodal__bubbles {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.pmodal__bubbles i {
  position: absolute;
  bottom: -12%;
  left: var(--x, 50%);
  width: var(--s, 8px);
  height: var(--s, 8px);
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 30%,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.12) 62%,
    rgba(255, 255, 255, 0.03)
  );
  opacity: 0;
  animation: pmodal-bubble var(--d, 9s) linear var(--delay, 0s) infinite;
}
@keyframes pmodal-bubble {
  0% {
    transform: translate3d(0, 0, 0) scale(0.7);
    opacity: 0;
  }
  12% {
    opacity: 0.55;
  }
  80% {
    opacity: 0.35;
  }
  100% {
    transform: translate3d(14px, -120vh, 0) scale(1.1);
    opacity: 0;
  }
}

/* ---------- Type ---------- */
.pmodal__eyebrow {
  margin: 0 0 clamp(16px, 4vw, 26px);
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-cyan) 45%, #fff);
}
.pmodal__title {
  margin: 0;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
  font-family: var(--body-font); /* the flyer's voice: heavy geometric sans */
}
.pmodal__title span {
  display: block;
}
.pmodal__t1 {
  font-size: clamp(26px, 7.4vw, 36px);
  font-weight: 500;
  letter-spacing: 0.11em;
  text-indent: 0.11em; /* offset the trailing track so it stays centred */
}
.pmodal__t2 {
  margin: 0.02em 0 0.04em;
  font-size: clamp(58px, 16.5vw, 82px);
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--accent-cyan);
  color: color-mix(in srgb, var(--accent-cyan) 58%, #fff);
  text-shadow: 0 10px 30px rgba(7, 18, 40, 0.55);
}
.pmodal__t3 {
  font-size: clamp(17px, 4.9vw, 24px);
  font-weight: 500;
  letter-spacing: 0.17em;
  text-indent: 0.17em;
}

/* ---------- Four benefits (flyer's icon row) ---------- */
.pmodal__feats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 4vw, 22px) 0;
  margin: clamp(26px, 7vw, 38px) 0 clamp(18px, 4.5vw, 24px);
}
.pmodal__feats li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(6px, 2.5vw, 12px);
}
/* hairline dividers between columns, like the flyer */
.pmodal__feats li:nth-child(odd)::after {
  content: "";
  position: absolute;
  top: 6%;
  bottom: 6%;
  right: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--accent-cyan) 55%, #fff) 22%,
    color-mix(in srgb, var(--accent-cyan) 55%, #fff) 78%,
    transparent
  );
  opacity: 0.5;
}
.pmodal__feats svg {
  width: 30px;
  height: 30px;
  color: color-mix(in srgb, var(--accent-cyan) 50%, #fff);
}
.pmodal__feats span {
  font-size: clamp(9.5px, 2.5vw, 11px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- Tagline + CTA ---------- */
.pmodal__tag {
  margin: 0 auto clamp(20px, 5vw, 26px);
  max-width: 22ch;
  font-family: var(--display-font), Georgia, serif;
  font-style: italic;
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.4;
  color: color-mix(in srgb, var(--accent-cyan) 40%, #fff);
}
.pmodal__tag::after {
  content: "";
  display: block;
  width: 74px;
  height: 3px;
  margin: clamp(14px, 3.5vw, 18px) auto 0;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent-cyan) 55%, #fff);
}
.pmodal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: clamp(14px, 3.6vw, 15.5px);
  color: #fff;
  background: var(--action-cornflower);
  box-shadow: 0 14px 30px rgba(7, 18, 40, 0.45);
  transition:
    transform 0.2s,
    background 0.2s;
}
.pmodal__cta:hover {
  transform: translateY(-2px);
  background: var(--action-cornflower-deep);
}
.pmodal__cta svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.pmodal__note {
  margin: 14px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.62);
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  .promo-modal,
  .promo-modal__dialog {
    transition: none;
  }
  .promo-modal__dialog {
    transform: none;
  }
  .pmodal__bubbles {
    display: none;
  }
}
