/* Animación TAP NFC · Close Connect · v2 (optimizada)
   Escena de 800 × 600 que se escala al ancho de su contenedor. Fondo transparente. Ciclo de 8 s.
   Solo se animan transform y opacity.
   v2 (misma idea que el motor 3D optimizado v3):
   - Fuera de pantalla las piezas salen del render (display:none): 0 capas y 0 pintado. Al volver, el ciclo arranca desde el inicio.
   - No arranca hasta que la imagen del módulo está lista (no se ve el celular tocando un hueco).
   - Sin fuente propia: usa la de la página. Sin estilos en línea (retrasos y anchos aquí). Íconos del sprite de la página (#i-*). */
.tap-nfc {
  --dur: 8s;
  --morado: #6542f0; --lila: #8b6bff; --tinta: #15112b; --gris: #8a879c; --linea: #ecebf2;
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: transparent;
  font-family: inherit; contain: layout paint; text-align: left;
}
.tap-nfc__escena { position: absolute; left: 0; top: 0; width: 800px; height: 600px; transform: scale(var(--s, 1)); transform-origin: 0 0; }
.tap-nfc *, .tap-nfc *::before, .tap-nfc *::after { box-sizing: border-box; }
.tap-nfc--pausada * { animation-play-state: paused !important; }
.tap-nfc--fuera .tap-nfc__escena > * { display: none !important; }
.tap-nfc img { max-width: none; }

/* ---------- Módulo Pro (render fijo) ---------- */
.tn-modulo { position: absolute; left: 70px; top: 168px; width: 340px; height: auto; display: block; }
.tn-brillo {
  position: absolute; left: 152px; top: 210px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,107,255,.75) 0%, rgba(101,66,240,.28) 38%, rgba(101,66,240,0) 70%);
  opacity: 0; animation: tn-brillo var(--dur) linear infinite both;
}
/* ---------- Ondas del TAP ---------- */
.tn-onda {
  position: absolute; left: 207px; top: 265px; width: 50px; height: 50px; border-radius: 50%;
  border: 3px solid var(--lila); box-shadow: 0 0 14px rgba(139,107,255,.55), inset 0 0 10px rgba(139,107,255,.35);
  opacity: 0; animation: tn-onda var(--dur) cubic-bezier(.2,.7,.3,1) infinite both;
}
.tn-onda:nth-of-type(2) { animation-delay: .22s; }
.tn-onda:nth-of-type(3) { animation-delay: .44s; }
/* ---------- Texto TAP ---------- */
.tn-tap {
  position: absolute; left: 112px; top: 46px; width: 240px; text-align: center; margin: 0;
  font-size: 92px; font-weight: 800; line-height: 1; letter-spacing: .06em;
  background: linear-gradient(180deg, #b49bff 0%, #8b6bff 45%, #6542f0 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(101,66,240,.45));
  opacity: 0; animation: tn-tap var(--dur) linear infinite both;
}

/* ---------- iPhone (copia del catálogo) ---------- */
.tn-tel { position: absolute; left: 0; top: 0; width: 268px; height: 575px; transform-origin: 50% 50%; will-change: transform, opacity; animation: tn-tel var(--dur) linear infinite both; }
.tn-iphone {
  position: relative; width: 268px; height: 575px; border-radius: 46px; padding: 11px;
  background: linear-gradient(145deg, #2a2834, #0e0d14 55%, #2a2834);
  box-shadow: 0 0 0 1.5px #3a3846, 0 40px 70px -30px rgba(21,17,43,.55), 0 18px 30px -18px rgba(21,17,43,.35), inset 0 0 2px rgba(255,255,255,.4);
}
.tn-iphone::before { content: ""; position: absolute; right: -3px; top: 150px; width: 3px; height: 62px; border-radius: 0 3px 3px 0; background: #26242e; }
.tn-pantalla { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: linear-gradient(160deg, #1d1450 0%, #4a2fc4 52%, #a58cff 100%); }
.tn-isla { position: absolute; top: 9px; left: 50%; margin-left: -43px; width: 86px; height: 25px; border-radius: 20px; background: #000; z-index: 6; }
.tn-fondo-brillo { position: absolute; inset: -20%; background: radial-gradient(60% 40% at 30% 70%, rgba(255,255,255,.22), transparent 70%); }

/* Notificación (sin texto: ícono de la app + líneas) */
.tn-notif {
  position: absolute; left: 10px; right: 10px; top: 44px; height: 66px; border-radius: 20px; z-index: 5;
  display: flex; align-items: center; gap: 11px; padding: 0 13px;
  background: rgba(255,255,255,.94); box-shadow: 0 10px 24px -10px rgba(10,6,40,.55);
  opacity: 0; animation: tn-notif var(--dur) linear infinite both;
}
.tn-app { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, #8b6bff, #4a2fc4); color: #fff; }
.tn-app svg { width: 24px; height: 24px; }
.tn-lineas { flex: 1; display: grid; gap: 7px; }
.tn-lineas i { display: block; height: 8px; border-radius: 4px; background: #d9d6e6; }
.tn-lineas i:first-child { width: 58%; background: #15112b; opacity: .85; }
.tn-lineas i:last-child { width: 88%; }
/* Toque del dedo sobre la notificación */
.tn-toque {
  position: absolute; left: 101px; top: 55px; width: 44px; height: 44px; border-radius: 50%; z-index: 7;
  background: rgba(255,255,255,.55); box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; animation: tn-toque var(--dur) linear infinite both;
}

/* Landing de Close Connect (copia de la "completa" del catálogo, íconos a color) */
.tn-landing { position: absolute; inset: 0; background: #fff; z-index: 4; padding: 48px 16px 20px; opacity: 0; animation: tn-landing var(--dur) linear infinite both; }
.tn-rollo { display: flex; flex-direction: column; gap: 9px; }
.tn-cab { text-align: center; padding: 6px 0 2px; }
.tn-cab img { width: 132px; height: auto; display: block; margin: 0 auto 8px; }
.tn-barra { display: block; height: 7px; border-radius: 4px; background: #e6e3f0; }
.tn-cab .tn-barra { width: 56%; margin: 0 auto; }
.tn-btn { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 14px; background: #fff; border: 1px solid var(--linea); box-shadow: 0 2px 6px -3px rgba(21,17,43,.14); }
.tn-btn .tn-barra { flex: 1; max-width: 62%; }
.tn-btn.dest { background: var(--tinta); border-color: var(--tinta); }
.tn-btn.dest .tn-barra { background: rgba(255,255,255,.28); max-width: 34%; }
.tn-estrellas { margin-left: auto; color: #fbbf24; letter-spacing: 2px; font-size: 13px; line-height: 1; }
.tn-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.tn-ic svg { width: 18px; height: 18px; }
.tn-redes { display: flex; justify-content: center; gap: 12px; padding: 4px 0; }
.tn-redes .tn-ic { width: 44px; height: 44px; border-radius: 50%; }
.tn-redes .tn-ic svg { width: 22px; height: 22px; }
.c-estrella { background: transparent; color: #fbbf24; }
.c-wa { background: #25d366; }
.c-ig { background: radial-gradient(circle at 30% 110%, #fdc468 0%, #fa7e1e 28%, #d62976 55%, #962fbf 78%, #4f5bd5 100%); }
.c-tt { background: #111; color: #fff; filter: drop-shadow(1.5px 0 0 #25f4ee) drop-shadow(-1.5px 0 0 #fe2c55); }
.c-tt svg { filter: drop-shadow(1px 1px 0 #fe2c55) drop-shadow(-1px -1px 0 #25f4ee); }
.c-fb { background: #1877f2; }
.c-menu { background: #ff9f0a; }
.c-wifi { background: #0a84ff; }
.c-banco { background: #5e5ce6; }
.c-contacto { background: #30b0c7; }
.c-pin { background: #ff3b30; }
.tn-pop { animation: tn-pop var(--dur) linear infinite both; }
.tn-rollo > .tn-pop:nth-child(2) { animation-delay: .06s; }
.tn-rollo > .tn-pop:nth-child(3) { animation-delay: .12s; }
.tn-rollo > .tn-pop:nth-child(4) { animation-delay: .30s; }
.tn-rollo > .tn-pop:nth-child(5) { animation-delay: .36s; }
.tn-rollo > .tn-pop:nth-child(6) { animation-delay: .42s; }
.tn-rollo > .tn-pop:nth-child(7) { animation-delay: .48s; }
.tn-rollo > .tn-pop:nth-child(8) { animation-delay: .54s; }
.tn-rollo > .tn-pop:nth-child(4) .tn-barra { max-width: 58%; }
.tn-rollo > .tn-pop:nth-child(5) .tn-barra { max-width: 44%; }
.tn-rollo > .tn-pop:nth-child(6) .tn-barra { max-width: 66%; }
.tn-rollo > .tn-pop:nth-child(7) .tn-barra { max-width: 50%; }
.tn-rollo > .tn-pop:nth-child(8) .tn-barra { max-width: 40%; }

/* ---------- Línea de tiempo (8 s; 1 % = 80 ms) ---------- */
@keyframes tn-tel {
  0%    { transform: translate(846px, 60px) rotate(16deg) scale(.58); opacity: 0; animation-timing-function: cubic-bezier(.33,.0,.15,1); }
  5%    { opacity: 1; }
  21%   { transform: translate(196px, 72px) rotate(-14deg) scale(.58); animation-timing-function: ease-in; }
  22.5% { transform: translate(188px, 68px) rotate(-14deg) scale(.57); animation-timing-function: ease-out; }
  25%   { transform: translate(196px, 72px) rotate(-14deg) scale(.58); }
  28%   { transform: translate(196px, 72px) rotate(-14deg) scale(.58); }
  28.6% { transform: translate(192px, 72px) rotate(-15deg) scale(.58); }
  29.2% { transform: translate(200px, 72px) rotate(-13deg) scale(.58); }
  29.8% { transform: translate(193px, 72px) rotate(-14.6deg) scale(.58); }
  30.4% { transform: translate(199px, 72px) rotate(-13.4deg) scale(.58); }
  31%   { transform: translate(196px, 72px) rotate(-14deg) scale(.58); }
  43%   { transform: translate(196px, 72px) rotate(-14deg) scale(.58); animation-timing-function: cubic-bezier(.65,0,.35,1); }
  55%   { transform: translate(456px, 12px) rotate(0deg) scale(.78); }
  90%   { transform: translate(456px, 12px) rotate(0deg) scale(.78); opacity: 1; animation-timing-function: cubic-bezier(.55,0,1,.45); }
  98%   { transform: translate(930px, 30px) rotate(10deg) scale(.78); opacity: 0; }
  100%  { transform: translate(930px, 30px) rotate(10deg) scale(.78); opacity: 0; }
}
@keyframes tn-brillo { 0%, 21.5% { opacity: 0; } 24% { opacity: 1; } 40%, 100% { opacity: 0; } }
@keyframes tn-onda {
  0%, 22% { transform: scale(.4); opacity: 0; }
  23%     { transform: scale(.6); opacity: .95; }
  37%     { transform: scale(6.2); opacity: 0; }
  100%    { transform: scale(6.2); opacity: 0; }
}
@keyframes tn-tap {
  0%, 22% { transform: translateY(14px) scale(.6); opacity: 0; }
  25%     { transform: translateY(0) scale(1.08); opacity: 1; }
  27.5%   { transform: translateY(0) scale(1); opacity: 1; }
  41%     { transform: translateY(0) scale(1); opacity: 1; }
  46%     { transform: translateY(-8px) scale(.96); opacity: 0; }
  100%    { transform: translateY(-8px) scale(.96); opacity: 0; }
}
@keyframes tn-notif {
  0%, 28.5% { transform: translateY(-92px) scale(.96); opacity: 0; animation-timing-function: cubic-bezier(.34,1.56,.64,1); }
  32%       { transform: translateY(0) scale(1); opacity: 1; }
  42%       { transform: translateY(0) scale(1); opacity: 1; }
  43%       { transform: translateY(0) scale(.97); opacity: 1; }
  47%       { transform: translateY(-4px) scale(1.02); opacity: 0; }
  100%      { transform: translateY(-4px) scale(1.02); opacity: 0; }
}
@keyframes tn-toque {
  0%, 38% { transform: scale(1.5); opacity: 0; }
  40%     { transform: scale(1); opacity: .95; }
  42.5%   { transform: scale(.78); opacity: .95; }
  45.5%   { transform: scale(1.7); opacity: 0; }
  100%    { transform: scale(1.7); opacity: 0; }
}
@keyframes tn-landing {
  0%, 44% { transform: translateY(36px); opacity: 0; animation-timing-function: cubic-bezier(.16,1,.3,1); }
  50%     { transform: translateY(0); opacity: 1; }
  100%    { transform: translateY(0); opacity: 1; }
}
@keyframes tn-pop {
  0%, 46% { transform: translateY(12px) scale(.92); opacity: 0; animation-timing-function: cubic-bezier(.34,1.56,.64,1); }
  51.5%   { transform: translateY(0) scale(1); opacity: 1; }
  100%    { transform: translateY(0) scale(1); opacity: 1; }
}
