/* LlévaloYaa · versión con movimiento: escena 3D de entrada y transiciones en toda la página.
   Todo lo que esconde algo depende de la clase html.mov, que solo se pone si hay movimiento. */

/* ---------------------------------------------------------------- Pantalla de carga */
.cargador { display: none; }
html.mov .cargador {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; align-content: center; gap: 22px;
  background: radial-gradient(120% 80% at 50% 40%, #ffffff 0%, #eef4ff 60%, #e3ecff 100%);
  transition: clip-path 1s cubic-bezier(.76, 0, .24, 1), visibility 0s 1s;
  clip-path: inset(0 0 0 0);
}
html.mov .cargador img { width: 120px; height: auto; animation: latir 1.4s ease-in-out infinite; }
.cargador-barra { width: 180px; height: 4px; border-radius: 4px; background: #dbe4f4; overflow: hidden; }
.cargador-barra span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--cian), var(--azul)); transform-origin: left; transform: scaleX(var(--carga, .08)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
html.mov.listo .cargador { clip-path: inset(0 0 100% 0); visibility: hidden; }
@keyframes latir { 50% { transform: translateY(-8px) scale(1.04); } }

/* ---------------------------------------------------------------- Barra de avance y barra de arriba */
.avance-pagina { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--cian), var(--azul)); transform-origin: left; transform: scaleX(0); pointer-events: none; }
html.mov .barra { position: sticky; top: 0; z-index: 50; transition: transform .45s cubic-bezier(.2, .7, .2, 1), background-color .3s, box-shadow .3s, backdrop-filter .3s; }
html.mov .barra.flotando { background: rgba(255, 255, 255, .78); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px -18px rgba(8, 23, 66, .35); }
html.mov .barra.escondida { transform: translateY(-110%); }

/* ---------------------------------------------------------------- Escena 3D de entrada */
.escena { position: relative; background: radial-gradient(90% 70% at 72% 45%, #e6f0ff 0%, #f5f8fd 45%, #ffffff 100%); overflow: clip; }
.escena-fija { position: relative; min-height: min(100svh, 920px); display: grid; align-items: center; }
.escena-fija::before, .escena-fija::after { content: ''; position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.escena-fija::before { width: 520px; height: 520px; right: 8%; top: 12%; background: rgba(43, 208, 255, .28); animation: flotarSuave 12s ease-in-out infinite; }
.escena-fija::after { width: 420px; height: 420px; right: 26%; bottom: 4%; background: rgba(10, 92, 245, .18); animation: flotarSuave 14s ease-in-out infinite reverse; }
@keyframes flotarSuave { 50% { transform: translate(-30px, 24px) scale(1.08); } }
.escena-lienzo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity .8s; }
html.escena-viva .escena-lienzo { opacity: 1; }

/* Versión fija (teléfono, sin 3D): la bolsa y los productos como fotos que flotan. */
.escena-fija-fotos { position: absolute; z-index: 1; right: 4%; top: 50%; width: min(46vw, 640px); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
html.escena-viva .escena-fija-fotos { display: none; }
.escena-fija-fotos img { position: absolute; height: auto; filter: drop-shadow(0 18px 24px rgba(8, 23, 66, .22)); }
.escena-fija-fotos .f-bolsa { width: 52%; left: 24%; top: 24%; animation: flotar 6s ease-in-out infinite; }
.escena-fija-fotos .f-prod { width: 24%; animation: flotar 7s ease-in-out infinite; }
.f-prod:nth-of-type(2) { left: 2%; top: 8%; animation-delay: -1s; }
.f-prod:nth-of-type(3) { left: 72%; top: 4%; animation-delay: -2s; }
.f-prod:nth-of-type(4) { left: 78%; top: 62%; animation-delay: -3s; }
.f-prod:nth-of-type(5) { left: 0%; top: 66%; animation-delay: -4s; }
.f-prod:nth-of-type(6) { left: 40%; top: 80%; width: 20%; animation-delay: -5s; }
.f-prod:nth-of-type(7) { left: 36%; top: 0%; width: 20%; animation-delay: -2.5s; }

.escena-texto { position: relative; z-index: 2; width: min(1440px, 100%); margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.escena-texto > div { max-width: 720px; }
.ceja-escena { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 8px 16px 8px 10px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid var(--linea); font-size: 14px; font-weight: 600; color: var(--tinta-2); backdrop-filter: blur(8px); }
.ceja-escena b { flex: none; white-space: nowrap; display: inline-grid; place-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--azul); color: #fff; font-size: 12px; letter-spacing: .04em; }
.escena h1 { margin: 0; font-size: clamp(44px, 5.4vw, 92px); line-height: .98; letter-spacing: -0.045em; font-weight: 800; color: var(--tinta); }
.escena h1 .azul { display: block; color: var(--azul); }
html.mov { scroll-behavior: auto; } /* el desplazamiento suave lo hace Lenis */

/* La antigua portada pasa a ser "Así se ve en la tienda". */
.escena + .portada { margin-top: clamp(56px, 7vw, 120px); }
.portada h2 { margin: 0; padding-top: calc(22 * var(--u)); font-size: calc(56.5 * var(--u)); font-weight: 800; line-height: 1.03; letter-spacing: -0.035em; color: var(--tinta); }
.portada h2 .azul { color: var(--azul); }
@media (max-width: 820px) { .portada h2 { font-size: clamp(32px, 9vw, 48px); } }
.escena .bajada { margin-top: 22px; font-size: clamp(18px, 1.5vw, 22px); color: var(--tinta-2); max-width: 36ch; }
.escena .acciones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.escena .acciones .boton { height: 58px; padding: 0 28px; font-size: 18px; }

/* Descargar la app */
.escena-app { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; }
.escena-app a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--linea); background: rgba(255, 255, 255, .85); font-size: 14px; font-weight: 600; color: var(--tinta); text-decoration: none; backdrop-filter: blur(8px); transition: border-color .2s, color .2s, background-color .2s; }
.escena-app a:hover { border-color: var(--azul); color: var(--azul); }
.escena-app li:first-child a { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.escena-app li:first-child a:hover { background: var(--azul); border-color: var(--azul); color: #fff; }
.escena-app small { font-size: 11px; font-weight: 700; letter-spacing: .06em; opacity: .7; }
.escena-app .ico { width: 18px; height: 18px; }

/* Segunda parte de la historia: aparece al bajar (solo en computadora). */
.escena-cuotas { display: none; }
.escena-bajar { position: absolute; z-index: 2; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gris); }
.escena-bajar span { width: 24px; height: 38px; border: 2px solid currentColor; border-radius: 14px; position: relative; }
.escena-bajar span::after { content: ''; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: currentColor; animation: rueda 1.6s ease-in-out infinite; }
@keyframes rueda { 0% { opacity: 0; transform: translateY(-4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

@media (min-width: 821px) {
  html.mov .escena { height: 260vh; }
  html.mov .escena-fija { position: sticky; top: 0; height: 100vh; min-height: 0; }
  /* --p va de 0 a 1 mientras la escena está fija. */
  html.mov .escena-texto.fase-a { opacity: calc(1 - (var(--p, 0) - .5) * 6); transform: translateY(calc(max(0, var(--p, 0) - .5) * -260px)); }
  html.mov .escena-cuotas { display: block; position: absolute; inset: 0; z-index: 2; display: grid; align-items: center; pointer-events: none; opacity: clamp(0, (var(--p, 0) - .62) * 6, 1); transform: translateY(calc(max(0, .78 - var(--p, 0)) * 220px)); }
  html.mov .escena-cuotas .escena-texto > div { pointer-events: auto; }
  html.mov .escena-bajar { opacity: calc(1 - var(--p, 0) * 8); }
}
.escena-cuotas h2 { margin: 0; font-size: clamp(40px, 5vw, 84px); line-height: 1; letter-spacing: -0.04em; font-weight: 800; }
.escena-cuotas h2 .azul { display: block; color: var(--azul); }
.pildoras { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 600px; }
.pildoras li { padding: 16px 14px; border-radius: 20px; background: rgba(255, 255, 255, .86); border: 1px solid var(--linea); box-shadow: var(--sombra); backdrop-filter: blur(10px); display: grid; gap: 2px; }
.pildoras li:first-child { background: var(--azul); border-color: var(--azul); color: #fff; }
.pildoras small { font-size: 13px; font-weight: 600; opacity: .8; }
.pildoras strong { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.escena-cuotas p { margin: 20px 0 0; font-size: 18px; color: var(--tinta-2); }

@media (max-width: 820px) {
  .escena-fija { min-height: auto; padding: 28px 0 0; display: flex; flex-direction: column; }
  .escena-fija-fotos { position: relative; right: auto; top: auto; transform: none; width: min(92vw, 420px); margin: 8px auto 0; order: 2; }
  .escena-texto { padding: 0 20px; }
  .escena .acciones { flex-direction: column; }
  .escena .acciones .boton { width: 100%; }
  .escena-bajar { display: none; }
}

/* ---------------------------------------------------------------- Palabras que suben (títulos) */
.palabra { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.palabra > span { display: inline-block; will-change: transform; }

/* ---------------------------------------------------------------- Tarjetas que se inclinan */
/* GSAP mueve estas piezas: sin transición CSS de "transform", que la frenaría a medio camino. */
html.mov .chips li, html.mov .pasos li, html.mov .beneficios li, html.mov .calculadora, html.mov .preguntas details, html.mov .cierre-tarjeta { transition-property: background-color, box-shadow, border-color, color; }
html.mov .chips li { transform-style: preserve-3d; position: relative; overflow: hidden; }
html.mov .chips li::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .7), transparent 60%); opacity: 0; transition: opacity .3s; }
html.mov .chips li:hover::after { opacity: 1; }
html.mov .chips li:hover { box-shadow: 0 24px 40px -24px rgba(10, 92, 245, .45); }
html.mov .chips li img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
html.mov .chips li:hover img { transform: translateZ(30px) scale(1.08) rotate(-3deg); }

/* ---------------------------------------------------------------- Botones: se acercan al puntero y brillan */
html.mov .boton-grande { translate: var(--mx, 0px) var(--my, 0px); transition: translate .45s cubic-bezier(.2, .7, .2, 1), background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
html.mov .boton { position: relative; overflow: hidden; isolation: isolate; }
html.mov .boton::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
html.mov .boton:hover::before { transform: translateX(120%); }
html.mov .boton-borde::before { background: linear-gradient(110deg, transparent 30%, rgba(10, 92, 245, .12) 50%, transparent 70%); }

/* ---------------------------------------------------------------- Preguntas: se abren suave */
html.mov .preguntas details p { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .escena-fija::before, .escena-fija::after, .escena-fija-fotos img, .escena-bajar span::after { animation: none; }
}
