/*!
 * web-cine.css — MECÁNICA del motor web-cine v2.0 (19-nov-2026). No es el diseño: colores, letras y
 * espacios van en el <style> de cada web. No borrar estas reglas: de ellas dependen el modo accesible
 * ("reducir movimiento"), el modo ahorro, el modo sin JavaScript y que el scroll no se descuadre.
 *
 * Clases que pone el motor en <html>:
 *   .anim         animación activa (la pone el <head> si el visitante NO pidió reducir movimiento)
 *   .sin-anim     modo estático: sin JS, sin GSAP, sin cuadros, modo ahorro o "reducir movimiento"
 *   .wg-cargando  SOLO si la pantalla de carga bloquea (data-bloquear="si"); por defecto no se usa
 */

/* ---------- Base obligatoria ---------- */
html { scroll-behavior: auto !important; }   /* NUNCA "smooth" con ScrollTrigger: descuadra el scroll */
body { overflow-x: clip; background: var(--wg-fondo, #0b0b0b); color: var(--wg-tinta, #f5f0e6); }  /* clip: sin barra horizontal fantasma y sin romper sticky */
img, video, canvas { max-width: 100%; }
html.wg-cargando { overflow: hidden; }
/* Al saltar a una sección (botón «Pide tu cotización», enlaces del menú), que la barra fija de arriba NO tape su título.
   Cada web puede ajustar --wg-alto-barra a la altura real de su barra (19-nov-2026: visto en las capturas del iPhone). */
[id] { scroll-margin-top: var(--wg-alto-barra, 84px); }

/* ---------- Película de cuadros (tipos A, B, C) ---------- */
.wg-secuencia { position: relative; background: var(--wg-fondo-secuencia, #0b0b0b); }
.wg-escena { position: relative; height: 100vh; overflow: hidden; }
.wg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wg-poster { position: absolute; inset: 0; display: block; z-index: 1; }
.wg-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wg-capas { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.wg-cap { position: absolute; }                 /* posición con top/left/right/bottom, NUNCA con transform (lo usa GSAP) */
.wg-cap a, .wg-cap button { pointer-events: auto; }

/* El póster se ve AL INSTANTE (encima del lienzo) y se funde cuando llega el primer cuadro. */
.anim .wg-poster { transition: opacity .5s ease, visibility 0s linear .5s; }
.anim .wg-pintado .wg-poster { opacity: 0; visibility: hidden; }
.anim .wg-sin-fotogramas .wg-poster { opacity: 1; visibility: visible; }   /* si no carga ni un cuadro, se queda el póster */
.anim .wg-cap,
.anim [data-wg-revelar],
.anim [data-wg-dividir],
.anim [data-wg-marca-gigante],
.anim [data-wg-entrada] { visibility: hidden; }          /* GSAP los muestra con autoAlpha: sin parpadeo */

/* ---------- Barra lateral de capítulos (data-wg-indice) ---------- */
.wg-indice { position: absolute; z-index: 3; right: clamp(.4rem, 1.6vw, 1.4rem); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .35rem; color: var(--wg-tinta, #f5f0e6); }
.wg-indice::before, .wg-indice::after { content: ""; position: absolute; left: 50%; top: 14px; width: 1px; margin-left: -.5px; pointer-events: none; }
.wg-indice::before { bottom: 14px; background: currentColor; opacity: .25; }
.wg-indice::after { height: calc((100% - 28px) * var(--wg-indice-progreso, 0)); background: var(--wg-acento, #d4af37); }
.wg-indice__punto { position: relative; z-index: 1; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.wg-indice__punto::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  border: 1px solid currentColor; background: var(--wg-fondo-secuencia, #0b0b0b); transition: transform .3s, background-color .3s; }
.wg-indice__punto.activo::after { background: var(--wg-acento, #d4af37); border-color: var(--wg-acento, #d4af37); transform: scale(1.35); }
.wg-indice__punto:focus-visible { outline: 2px solid var(--wg-acento, #d4af37); outline-offset: 2px; border-radius: 50%; }
/* Teléfono angosto: pegada al borde y más chica, para no pisar el texto alineado a la derecha */
@media (max-width: 599px) {
  .wg-indice { right: 0; gap: .2rem; }
  .wg-indice::before, .wg-indice::after { top: 11px; }
  .wg-indice::before { bottom: 11px; }
  .wg-indice::after { height: calc((100% - 22px) * var(--wg-indice-progreso, 0)); }
  .wg-indice__punto { width: 22px; height: 22px; }
  .wg-indice__punto::after { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
}

/* ---------- Modo estático / accesible / ahorro: todo visible y apilado ---------- */
html:not(.anim) .wg-canvas,
html:not(.anim) .solo-anim { display: none !important; }
html:not(.anim) .wg-escena { height: auto; overflow: visible; }
html:not(.anim) .wg-poster { position: relative; inset: auto; }
html:not(.anim) .wg-poster img { height: auto; max-height: 100vh; }
html:not(.anim) .wg-capas { position: relative; inset: auto; pointer-events: auto; display: grid;
  gap: clamp(2rem, 6vw, 4rem); padding: clamp(2.5rem, 8vw, 6rem) clamp(1rem, 6vw, 6rem); }
html:not(.anim) .wg-cap { position: static !important; transform: none !important; opacity: 1 !important;
  visibility: visible !important; filter: none !important; max-width: 62ch; }
html:not(.anim) [data-wg-revelar], html:not(.anim) [data-wg-revelar] > *,
html:not(.anim) [data-wg-dividir], html:not(.anim) [data-wg-marca-gigante],
html:not(.anim) [data-wg-entrada] { opacity: 1 !important; visibility: visible !important; transform: none !important; }
/* Una imagen por capítulo (la pone el motor con los mismos cuadros de la película). Con ellas, el póster sobra. */
html:not(.anim) .wg-con-fotos .wg-poster { display: none; }
html:not(.anim) .wg-con-fotos .wg-cap { max-width: min(980px, 100%); }
.wg-cap__foto { display: block; margin: 0 0 1.2rem; }
.wg-cap__foto img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: cover; }
.anim .wg-cap__foto { display: none !important; }

/* ---------- Carga: por defecto es DISCRETA (una píldora con el % real, no tapa ni bloquea nada) ---------- */
.wg-carga, .wg-progreso { display: none; }
.anim .wg-carga { position: fixed; z-index: 1000; left: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .6rem;
  padding: .45rem .8rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: var(--wg-carga-tinta, #f5f0e6);
  font: 500 12px/1 system-ui, sans-serif; pointer-events: none; }
.anim .wg-carga > * { margin: 0; }
.anim .wg-carga .wg-solo-bloqueo { display: none; }
.wg-carga__pista { width: 64px; height: 2px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.wg-carga__barra { height: 100%; background: var(--wg-acento, #d4af37); transform-origin: 0 50%; transform: scaleX(0); }
/* Pantalla de carga completa SOLO si se pide: <div class="wg-carga" data-bloquear="si"> (tapa y bloquea el scroll) */
.anim .wg-carga[data-bloquear="si"] { inset: 0; left: 0; bottom: 0; display: grid; place-items: center; align-content: center; gap: 1rem;
  padding: 0; border-radius: 0; background: var(--wg-carga-fondo, #0b0b0b); font: inherit; pointer-events: auto; }
.anim .wg-carga[data-bloquear="si"] .wg-solo-bloqueo { display: block; }
.anim .wg-carga[data-bloquear="si"] .wg-carga__pista { width: min(260px, 60vw); }
.anim .wg-progreso { display: block; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 999;
  background: var(--wg-acento, #d4af37); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ---------- Portada que corre una vez y se congela (tipo D) ---------- */
.wg-portada { position: relative; min-height: 100vh; overflow: hidden; background: var(--wg-fondo-secuencia, #0b0b0b); }
.wg-portada__medios { position: absolute; inset: 0; overflow: hidden; }
.wg-portada__video, .wg-portada__final, .wg-portada__final img, .wg-portada__sujeto, .wg-linterna, .wg-linterna img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wg-portada__video, .wg-portada__final { z-index: 1; }
.wg-portada__palabra { position: absolute; z-index: 2; pointer-events: none; }
.wg-portada__sujeto { z-index: 3; pointer-events: none; }
.wg-linterna { z-index: 4; pointer-events: none; visibility: hidden; opacity: 0;
  -webkit-mask-image: radial-gradient(circle var(--lr, clamp(90px, 14vw, 220px)) at var(--lx, 50%) var(--ly, 45%), #000 55%, transparent 100%);
          mask-image: radial-gradient(circle var(--lr, clamp(90px, 14vw, 220px)) at var(--lx, 50%) var(--ly, 45%), #000 55%, transparent 100%); }
.wg-portada__velo { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.wg-portada__ui { position: relative; z-index: 6; }
.anim .wg-portada__final,
.anim .wg-portada__sujeto { visibility: hidden; opacity: 0; }   /* aparecen al congelarse (mismo cuadro: no se nota el cambio) */
html:not(.anim) .wg-portada__video, html:not(.anim) .wg-linterna { display: none; }

/* ---------- Galería horizontal (solo escritorio; en teléfono y en modo estático se apila) ---------- */
.wg-horizontal { overflow: hidden; }
.wg-pista { display: flex; width: max-content; }
.wg-panel { flex: 0 0 auto; }
@media (max-width: 819px), (max-width: 1099px) and (orientation: portrait) { .wg-pista { flex-direction: column; width: 100%; } }
html:not(.anim) .wg-pista { width: 100%; flex-wrap: wrap; }

/* ---------- Secciones con color propio ---------- */
[data-wg-fondo] { background: var(--sec-fondo, transparent); color: var(--sec-tinta, inherit); }
.anim [data-wg-fondo] { background: transparent; color: inherit; }   /* con animación, cambia la página entera, suave */

/* ---------- Formulario de WhatsApp (estados; el diseño va en la web) ---------- */
.wg-form__estado { margin: 0 0 1rem; }
.wg-form__estado a { font-weight: 600; }
.wg-form[data-estado="error"] .wg-form__estado,
.wg-form[data-estado="sin-numero"] .wg-form__estado,
.wg-form[data-estado="falla"] .wg-form__estado { color: var(--wg-form-alerta, #ff8a80); }
.wg-form [aria-invalid="true"] { outline: 2px solid var(--wg-form-alerta, #ff8a80); outline-offset: 1px; }
.wg-form__error { display: block; margin-top: .3rem; font-size: .85em; color: var(--wg-form-alerta, #ff8a80); }

/* ---------- Detalles ---------- */
.wg-marca-gigante { white-space: nowrap; line-height: .82; }
.wg-cursor { position: fixed; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  mix-blend-mode: difference; pointer-events: none; z-index: 9999; visibility: hidden; }
/* Logo en JPG negro sobre blanco puesto sobre fondo oscuro: lo negro pasa a blanco (o al acento) y lo blanco a
   transparente; la FORMA es la del archivo original (nunca se redibuja). Necesita el <svg> con los filtros
   #wg-tinta-blanca y #wg-tinta-oro dentro del HTML (está en la plantilla D).
   (No usar invert + mix-blend-mode: dentro de una barra fija deja un recuadro negro.) */
.logo-tinta-blanca { filter: url(#wg-tinta-blanca); }
.logo-tinta-oro { filter: url(#wg-tinta-oro); }
/* Aviso visible cuando falta material (regla: nada se rellena con algo inventado) */
.wg-aviso { position: relative; z-index: 50; margin: 1rem; padding: .8rem 1rem; border: 2px dashed #ff6b6b;
  color: #ffd2d2; background: #2a0d0d; font: 600 14px/1.4 system-ui, sans-serif; }
