/* ====================================================================
   LANDING FRANQUICIA (educativa, primer filtro) — overlay
   Se carga tras style.css y emprendedor.css. Reutiliza sus componentes
   (header neutro, discover, incluye, footer) y añade lo propio:
   hero con imagen nueva, sección de razones, comparativa y CTA final.
==================================================================== */

/* ---------- Hero: imagen de la franquicia ---------- */
@media (min-width: 900px) {
  .hero--franquicia {
    background:
      linear-gradient(90deg,
        var(--navy-900) 0%,
        rgba(10, 28, 51, 0.96) 34%,
        rgba(10, 28, 51, 0.6) 54%,
        rgba(10, 28, 51, 0) 78%),
      url("../assets/images/hero-franquicia.webp") right center / auto 100% no-repeat var(--navy-900);
  }
}
@media (min-width: 1250px) {
  .hero--franquicia {
    background:
      linear-gradient(90deg,
        var(--navy-900) 0%,
        rgba(10, 28, 51, 0.55) 22%,
        rgba(10, 28, 51, 0) 42%),
      url("../assets/images/hero-franquicia.webp") right center / auto 100% no-repeat var(--navy-900);
  }
}
/* Móvil: el CTA del hero a ancho completo y en UNA línea (antes "Sí, quiero ver
   cómo funciona" se partía en dos y la flecha quedaba descolgada) */
@media (max-width: 560px) {
  .hero--franquicia .hero__content .btn--lg {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
    padding: 16px 16px;
    letter-spacing: 0.02em;
  }
}

/* Móvil/tablet: imagen de fondo con degradado (texto siempre legible) */
@media (max-width: 899px) {
  .hero--franquicia {
    background:
      linear-gradient(180deg,
        var(--navy-900) 0%,
        rgba(10, 28, 51, 0.97) 30%,
        rgba(10, 28, 51, 0.90) 52%,
        rgba(10, 28, 51, 0.82) 76%,
        rgba(10, 28, 51, 0.86) 100%),
      url("../assets/images/hero-franquicia-m.webp") 75% bottom / cover no-repeat var(--navy-900);
  }
  .hero--franquicia .hero__blob { display: none; }
}

/* ---------- Razones (¿por qué una franquicia?) ---------- */
.razones__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 8px;
}
@media (min-width: 760px) {
  .razones__grid { grid-template-columns: repeat(3, 1fr); gap: 28px; }
}
.razon-card { text-align: center; }
.razon-card .incluye-card__icon { margin-bottom: 14px; }
.razon-card h3 { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.razon-card p { font-size: 0.92rem; color: var(--ink-soft); max-width: 260px; margin-inline: auto; }

/* ---------- Comparativa tradicional vs digital ---------- */
.compara {
  max-width: 720px;
  margin: 40px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #e1e8f2;
  background: #fff;
  box-shadow: var(--shadow-light);
}
.compara__head,
.compara__row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.05fr;
  align-items: stretch;
}
.compara__row { transition: background 0.2s ease; }
.compara__row + .compara__row { border-top: 1px solid #eef2f8; }
.compara__row:hover { background: #f7f9fc; }
.compara__row > span,
.compara__head > span {
  padding: 14px 14px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
}

.compara__label { font-weight: 700; color: var(--ink); }
/* Icono a la izquierda (alineado en columna) y la frase a continuación */
.compara__trad,
.compara__digi { justify-content: flex-start; padding-left: 22px; }
/* Columna "tradicional": bloque gris definido (con principio y final) */
.compara__trad { color: var(--ink-muted); background: #f1f4f9; }
.compara__row:last-child .compara__trad { border-radius: 0 0 12px 12px; }
.compara__digi {
  color: var(--ink);
  font-weight: 700;
  background: rgba(245, 184, 32, 0.10);
  border-left: 1px solid rgba(245, 184, 32, 0.4);
}

/* Cabecera */
.compara__head { background: var(--navy-900); color: var(--text); }
.compara__hcell { justify-content: center; }
.compara__hcell--trad,
.compara__hcell--digi {
  text-align: center;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Cabecera de la columna tradicional: gris (define el "principio" del bloque) */
.compara__hcell--trad { background: #d6dde9; color: var(--ink); }
.compara__hcell--digi {
  flex-direction: column;
  gap: 5px;
  padding-top: 11px;
  padding-bottom: 13px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1d2433;
  box-shadow: 0 6px 18px rgba(245, 184, 32, 0.28);
  position: relative;
  z-index: 1;
}
.compara__badge {
  background: var(--navy-900);
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 11px;
  border-radius: 999px;
}
.compara__hname { font-size: 0.8rem; }

/* Encabezado de la columna de características (antes vacío) */
.compara__hcell--label { justify-content: center; gap: 10px; text-transform: none; letter-spacing: 0; }
.compara__scale { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.compara__ltxt {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: var(--text-soft);
  text-align: center;
}

/* Iconos ✓ / ✕ en círculo */
.compara .ic {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.compara .ic svg { width: 12px; height: 12px; }
.compara .ic--v { background: #2ea358; color: #fff; }
.compara .ic--x { background: #e7d2cd; color: #b5503c; }

@media (max-width: 560px) {
  .compara__head,
  .compara__row { grid-template-columns: 1fr 0.9fr 1fr; }
  .compara__row > span,
  .compara__head > span { padding: 11px 8px; font-size: 0.8rem; }
  .compara__hcell--trad,
  .compara__hcell--digi,
  .compara__hname,
  .compara__ltxt { font-size: 0.62rem; }
  .compara__badge { font-size: 0.52rem; padding: 2px 8px; }
  .compara .ic { width: 16px; height: 16px; margin-right: 5px; }
  .compara .ic svg { width: 10px; height: 10px; }
  .compara__hcell--label { gap: 6px; }
  .compara__scale { width: 15px; height: 15px; }
  .compara__trad,
  .compara__digi { padding-left: 12px; }
}

/* ---------- CTA final (navy) ---------- */
.cta-final {
  background:
    radial-gradient(700px 320px at 50% -10%, rgba(47, 126, 227, 0.18), transparent 60%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 75%);
  color: var(--text);
  padding: clamp(54px, 8vw, 80px) 0;
  text-align: center;
}
.cta-final__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.cta-final__text {
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto 26px;
}

/* ====================================================================
   PÁGINA VSL — vídeo + CTA a WhatsApp
==================================================================== */
.vsl {
  background:
    radial-gradient(800px 380px at 50% -8%, rgba(47, 126, 227, 0.18), transparent 60%),
    linear-gradient(160deg, var(--navy-700) 0%, var(--navy-900) 80%);
  color: var(--text);
  padding: clamp(18px, 3.2vw, 32px) 0 clamp(44px, 7vw, 70px);
}
.vsl__inner { max-width: 880px; margin-inline: auto; text-align: center; }
.vsl__head { margin-bottom: 16px; }
.vsl__head .eyebrow-live { justify-content: center; margin-bottom: 10px; }
.vsl__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.6vw, 2.4rem); /* cabe en 1 línea en escritorio */
  font-weight: 800;
  line-height: 1.18;
  text-wrap: balance;
  margin-bottom: 12px;
}
.vsl__sub { color: var(--text-soft); max-width: 560px; margin: 0 auto; }

/* Reproductor (placeholder hasta tener el vídeo) */
.vsl-video {
  position: relative; /* ancla de la lámina final */
  margin: 26px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-dark);
}

/* Lámina final: tapa el reproductor cuando el vídeo termina */
.vsl-endcard[hidden] { display: none; }
.vsl-endcard {
  position: absolute; inset: 0; z-index: 5;
  background-color: #0d2440;
  background-image: url('../assets/images/vsl-endcard-franquicia.webp');
  background-size: cover;
  background-position: center;
  display: flex; align-items: flex-end; justify-content: center;
  animation: vslEndcardIn 0.45s ease both;
}
@keyframes vslEndcardIn { from { opacity: 0; } to { opacity: 1; } }
.vsl-endcard__cue {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-bottom: 4%;
  color: var(--gold-light);
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.vsl-endcard__text {
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.vsl-endcard__arrow {
  width: clamp(28px, 5vw, 44px); height: clamp(28px, 5vw, 44px);
  animation: vslArrowBounce 1.1s ease-in-out infinite;
}
@keyframes vslArrowBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
@media (prefers-reduced-motion: reduce) { .vsl-endcard__arrow { animation: none; } }
/* Botón "Volver a ver" en la lámina (arriba-centro) */
.vsl-endcard__replay {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(9, 18, 33, 0.5); color: #fff;
  font-family: inherit; font-weight: 700; font-size: 0.84rem;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}
.vsl-endcard__replay:hover { background: rgba(9, 18, 33, 0.75); }
.vsl-endcard__replay svg { width: 16px; height: 16px; }

/* FAQ de la presentación: aparece con el botón (a los 14:42), tema oscuro */
.pres-faq { display: none; margin-top: 34px; text-align: left; }
html.cta-ok .pres-faq { display: block; }
.pres-faq__title {
  text-align: center; font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.55rem); font-weight: 800;
  color: var(--text); margin: 0;
}
/* Dos columnas independientes (flex): al abrir un item de una columna, la otra
   no se desalinea (evita el hueco del CSS grid). */
.pres-faq .faq__grid { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.pres-faq__col { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 760px) {
  .pres-faq .faq__grid { flex-direction: row; align-items: flex-start; }
  .pres-faq__col { flex: 1; min-width: 0; }
  /* Misma altura de cabeceras → las dos columnas quedan simétricas aunque una
     pregunta ocupe dos líneas */
  .pres-faq .faq-item summary { min-height: 82px; box-sizing: border-box; }
}
.faq--dark .faq-item { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); }
.faq--dark .faq-item summary { color: var(--text); }
.faq--dark .faq-item p { color: var(--text-soft); text-align: left; }
.faq--dark .faq-item__chevron { border-color: var(--blue-light); }
.vsl-video__ph {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  gap: 14px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.02) 0 14px, rgba(255,255,255,0.04) 14px 28px),
    var(--navy-800);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.vsl-video__play {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1d2433;
  box-shadow: 0 10px 30px rgba(245, 184, 32, 0.35);
}
.vsl-video__play svg { width: 26px; height: 26px; margin-left: 3px; }

/* CTA apilado y centrado: nota + contador arriba, botón abajo */
.vsl__cta { margin-top: 6px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* Botones finales de la presentación: misma anchura y alto, coherentes entre sí */
#pres-cta .btn--stack { width: 100%; max-width: 440px; justify-content: center; text-align: center; padding: 16px 28px; }
/* El atributo hidden debe ganar al display:flex de arriba (si no, el CTA se ve siempre) */
.vsl__cta[hidden] { display: none; }
.vsl__cta-note { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
/* Nota con check (ya tiene acceso, no lleva candado) */
.vsl__cta-note--ok { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); }
.vsl__cta-check { width: 16px; height: 16px; color: #2ee06f; flex: none; }

/* Contador de 60 s que sale junto al botón (al entrar el cierre del vídeo) */
.vsl-counter {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(245, 184, 32, 0.12);
  border: 1px solid rgba(245, 184, 32, 0.45);
  color: var(--text);
  font-weight: 700; font-size: 0.95rem;
}
.vsl-counter__icon { width: 18px; height: 18px; color: var(--gold-light); flex: none; }
.vsl-counter__label { color: var(--text-soft); font-weight: 600; }
.vsl-counter__time {
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  min-width: 44px; text-align: left;
}
/* Al llegar a 00:00: se apaga el acento */
.vsl-counter--done {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
.vsl-counter--done .vsl-counter__icon,
.vsl-counter--done .vsl-counter__time { color: var(--text-muted); }
@media (max-width: 560px) {
  .vsl-counter { font-size: 0.88rem; padding: 8px 14px; gap: 7px; }
}

/* Estados del CTA: vivo (dentro del minuto) / agotado (WhatsApp de rescate) */
.vsl-cta-live[hidden], .vsl-cta-expired[hidden] { display: none; }
.vsl-cta-live, .vsl-cta-expired {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.vsl-expired__head {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(1.45rem, 4.5vw, 1.95rem);
  line-height: 1.1; color: var(--text);
}
.vsl-expired__icon { width: clamp(24px, 5vw, 30px); height: clamp(24px, 5vw, 30px); color: #ff8f6b; flex: none; }
.vsl-expired__sub { margin: 2px 0 0; font-size: 0.9rem; color: var(--text-soft); }
/* Los botones del VSL pueden llevar texto largo: en móvil que puedan ir a 2 líneas
   (anula el white-space:nowrap heredado del botón de la página de gracias) */
@media (max-width: 560px) {
  .vsl__cta .btn--stack .btn__main { white-space: normal; }
}
/* Aparición del botón al entrar el cierre del vídeo (~2:33) */
@keyframes vslCtaIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.vsl__cta--in { animation: vslCtaIn 0.5s ease both; }
@media (prefers-reduced-motion: reduce) { .vsl__cta--in { animation: none; } }

/* Visitante que ya dejó sus datos: saltar el candado al cargar, sin parpadeo */
html.lead-ok #vsl-gate { display: none; }
html.lead-ok #vsl-reveal[hidden] { display: block; }
html.lead-ok #testimonios,
html.lead-ok #faq,
html.lead-ok .vsl__sub--gate { display: none; }
html.lead-ok .vsl__sub--vsl[hidden] { display: block; }

/* Visitante SIN registrar: candado visible y vídeo oculto desde el primer
   frame, sin esperar al JS (anti-flash). Al registrarse sin recargar,
   lead-franquicia.js añade .lead-ok y estas reglas dejan de aplicar. */
html:not(.lead-ok) #vsl-gate[hidden] { display: block; }
html:not(.lead-ok) #vsl-reveal { display: none; }
html:not(.lead-ok) .vsl__sub--gate[hidden] { display: block; }
html:not(.lead-ok) .vsl__sub--vsl { display: none; }

/* Candado: formulario que capta el lead antes del vídeo */
.vsl-gate { max-width: 460px; margin: 26px auto 0; }
.vsl-gate__card { text-align: center; }
.vsl-gate__lock {
  position: relative;
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--navy-700), var(--navy-900));
  color: var(--blue-light);
}
.vsl-gate__lock > svg { width: 28px; height: 28px; }
.vsl-gate__play {
  position: absolute; right: -3px; bottom: -3px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1d2433;
  border: 2px solid #fff;
}
.vsl-gate__play svg { width: 12px; height: 12px; margin-left: 1px; }

/* Móvil: compactar el VSL para que el formulario (y su botón) entren en la
   primera pantalla al llegar a la página. */
@media (max-width: 560px) {
  /* Cabecera más arriba y vídeo más compacto → aire abajo para el botón/CTA */
  .vsl { padding-top: 8px; padding-bottom: 30px; }
  .vsl__head { margin-bottom: 8px; }
  .vsl__head .eyebrow-live { margin-bottom: 5px; }
  .vsl__title { font-size: 1.34rem; margin-bottom: 5px; }
  .vsl__sub { font-size: 0.82rem; }
  .vsl-video { margin: 14px 0; }

  .vsl-gate { margin-top: 14px; }
  .vsl-gate .form-card { padding: 18px 16px; }
  .vsl-gate__lock { width: 46px; height: 46px; margin-bottom: 8px; }
  .vsl-gate__lock > svg { width: 22px; height: 22px; }
  .vsl-gate .form-card__title { font-size: 1.12rem; }
  .vsl-gate .form-card__subtitle { margin: 4px 0 14px; font-size: 0.84rem; }
  .vsl-gate .form-field { margin-bottom: 10px; }
  .vsl-gate .form-field input { padding: 12px 14px; }
  .vsl-gate .form-acepto { margin: 2px 2px 10px; }
  .vsl-gate .form-card__privacy { margin-top: 8px; }
}

/* Testimonios en variante clara (sobre fondo gris) */
.testimonios--light { background: none; color: var(--ink); }
.testimonios--light .section-title { color: var(--ink); }
.testimonios--light .testi__name { color: var(--ink); }
.testimonios--light .testi__quote { color: var(--ink-soft); }
.testimonios--light .testi__photo {
  border-color: #fff;
  box-shadow: var(--shadow-light);
}

/* ================================================================
   MODAL DE REGISTRO (pop-up) — reusa la tarjeta .form-card
================================================================= */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 20px;
}
.modal__overlay {
  position: absolute; inset: 0;
  background: rgba(9, 18, 33, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: modal-fade 0.2s ease;
}
.modal__dialog {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  animation: modal-pop 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.modal__close {
  position: absolute; top: -14px; right: -14px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: none; cursor: pointer;
  border-radius: 50%;
  background: #fff; color: var(--navy-700);
  box-shadow: var(--shadow-dark);
}
.modal__close svg { width: 18px; height: 18px; }
/* La tarjeta nunca supera el alto de la pantalla; si su contenido no cabe,
   hace scroll interno (dvh = alto real del móvil, sin contar la barra del navegador) */
.modal .form-card {
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.modal-open { overflow: hidden; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---- Móvil: el modal queda justo dentro de la pantalla ---- */
@media (max-width: 560px) {
  .modal { padding: 12px; }
  .modal__dialog { max-width: 100%; }
  /* Botón de cerrar DENTRO de la tarjeta (si no, se corta por arriba) */
  .modal__close {
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(9, 18, 33, 0.18);
  }
  .modal__close svg { width: 16px; height: 16px; }
  .modal .form-card {
    padding: 22px 16px 18px;
    max-height: calc(100dvh - 24px);
  }
  /* Compactar para que todo entre en una pantalla de móvil */
  .modal .vsl-gate__lock { width: 46px; height: 46px; margin-bottom: 10px; }
  .modal .vsl-gate__lock > svg { width: 20px; height: 20px; }
  .modal .form-card__title { font-size: 1.15rem; }
  .modal .form-card__subtitle { margin: 4px 0 14px; font-size: 0.84rem; }
  .modal .form-field { margin-bottom: 10px; }
  .modal .form-field input { padding: 12px 14px; }
  .modal .form-acepto { margin: 2px 2px 10px; }
  .modal .form-card__privacy { margin-top: 8px; }
}

/* Pantallas muy bajas (móvil apaisado): asegurar scroll interno */
@media (max-height: 640px) {
  .modal .form-card { max-height: calc(100dvh - 16px); }
}
