/* =========================================================
   FAST MARKET — ANIMACIONES DE TEXTO Y EFECTOS
   ---------------------------------------------------------
   Portada y catálogo (lo activa initAnimaciones en script.js
   poniendo html.fx-on; con "Modo ligero" o movimiento
   reducido queda html.fx-quieto y todo se ve quieto).
   ========================================================= */

@keyframes fxCae {
  from {
    opacity: 0;
    transform: translateY(-60%) rotate(-10deg) scale(1.15);
    filter: blur(8px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fxPop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.18);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
@keyframes fxCambia {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fxBaja {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fxBrillo {
  to {
    background-position: -220% 0;
  }
}
@keyframes fxNeon {
  0%,
  88%,
  92%,
  96%,
  100% {
    opacity: 1;
  }
  90%,
  94% {
    opacity: 0.45;
  }
}
@keyframes fxSacude {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-12deg) translateX(-1px);
  }
  50% {
    transform: rotate(10deg) translateX(1px);
  }
  75% {
    transform: rotate(-6deg);
  }
}

/* ---------- títulos que suben palabra por palabra (desde una ranura) ---------- */
.fx-partido .pal {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.03em 0.16em;
  margin: 0 -0.03em -0.16em;
}
.fx-partido .pal-in {
  display: inline-block;
  transform: translateY(115%) rotate(5deg);
  transform-origin: 0 100%;
  transition: transform 0.95s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i, 0) * 70ms);
}
.fx-partido.fx-vis .pal-in {
  transform: none;
}
/* la parte de color: cada palabra lleva el degradado y un brillo que la recorre */
.fx-partido .hx-acento {
  background: none;
  color: inherit;
}
.fx-partido .hx-acento .pal-in {
  background: linear-gradient(100deg, var(--neon) 0%, var(--neon-2) 28%, #f7ffd8 42%, #b6fa86 58%, var(--neon) 82%, var(--neon-2) 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 2 pasadas al aparecer (las zonas fuera de pantalla quedan en pausa): un
     brillo infinito en un fondo obliga al procesador a armar cada cuadro */
  animation: fxBrillo 7s linear 2;
}

/* ---------- bloques que aparecen en cascada al bajar ---------- */
.fx-rev {
  opacity: 0;
  transform: translateY(38px) scale(0.98);
  transition:
    opacity 0.8s ease calc(var(--i, 0) * 85ms),
    transform 0.95s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i, 0) * 85ms);
}
.fx-rev.fx-vis {
  opacity: 1;
  transform: none;
}

/* ---------- letras del título del catálogo ---------- */
.fx-letra {
  display: inline-block;
  animation: fxCae 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i, 0) * 45ms) backwards;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    color 0.2s ease;
}
.fx-letra:hover {
  transform: translateY(-10px) rotate(-4deg);
  color: var(--neon);
}
#cxNum.fx-cambia {
  animation: fxPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s backwards;
}
#cxDesc.fx-cambia {
  animation: fxCambia 0.6s ease 0.3s backwards;
}
#cxDatos.fx-cambia {
  animation: fxCambia 0.6s ease 0.42s backwards;
}

/* ---------- tarjetas: luz que sigue al mouse (la inclinación la pone el JS) ---------- */
.hx-top-card,
.hx-oferta,
.hx-dato,
.hx-top-panel,
.hx-resena {
  position: relative;
}
.hx-dato,
.hx-top-panel,
.hx-resena {
  transition:
    transform 0.3s ease-out,
    border-color 0.3s ease;
}
.fx-luz {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(170px circle at var(--fx-x, 50%) var(--fx-y, 50%), rgba(228, 255, 100, 0.2), rgba(152, 247, 85, 0.06) 45%, transparent 65%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fx-sobre > .fx-luz {
  opacity: 1;
}
.fx-sobre {
  border-color: rgba(221, 255, 40, 0.55) !important;
}

/* ---------- catálogo: brillo que cruza la foto, carrito que se sacude ---------- */
.fx-on:not(.fx-quieto) .cx-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.2) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.85s ease;
}
.fx-on:not(.fx-quieto) .cx-card.available:hover .cx-media::before {
  transform: translateX(130%);
}
.fx-on:not(.fx-quieto) .cx-card.available:hover .cx-cta .pix {
  animation: fxSacude 0.6s ease;
}
.fx-on:not(.fx-quieto) .cx .cat-pill:not(.active):hover {
  transform: translateY(-2px);
}
.fx-on:not(.fx-quieto) .cat-results b {
  display: inline-block;
  animation: fxPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* la barra y los filtros bajan al cargar */
.fx-on:not(.fx-quieto) .cx-migas {
  animation: fxBaja 0.7s ease 0.05s backwards;
}
.fx-on:not(.fx-quieto) .cx-barra {
  animation: fxBaja 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s backwards;
}
.fx-on:not(.fx-quieto) .cx-fila {
  animation: fxBaja 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.65s backwards;
}

/* ---------- etiquetas tipo neón que titilan de vez en cuando ---------- */
.fx-on:not(.fx-quieto) .hx-cierre .eyebrow,
.fx-on:not(.fx-quieto) .hx-chip b {
  /* solo opacidad: la anima la tarjeta gráfica (animar la sombra del texto
     repintaba en cada cuadro). El resplandor queda fijo. */
  text-shadow: 0 0 10px rgba(221, 255, 40, 0.55);
  animation: fxNeon 7s linear infinite;
}

/* ---------- botones magnéticos (el JS los acerca al cursor) ---------- */
.fx-on:not(.fx-quieto) .hx .btn,
.fx-on:not(.fx-quieto) .hx-cierre .btn,
.fx-on:not(.fx-quieto) .hx-club .btn,
.fx-on:not(.fx-quieto) .cx-cta {
  transition:
    translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.2s ease;
}
.fx-iman {
  transition-duration: 0.12s !important;
}

/* ---------- resplandor que sigue al cursor ---------- */
.fx-aura {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(225, 255, 60, 0.14), rgba(152, 247, 85, 0.06) 55%, transparent);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}
.fx-aura.on {
  opacity: 1;
}

/* ---------- movimiento reducido: todo a la vista y quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-partido .pal-in,
  .fx-rev {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .fx-letra,
  .fx-partido .hx-acento .pal-in,
  #cxNum.fx-cambia,
  #cxDesc.fx-cambia,
  #cxDatos.fx-cambia {
    animation: none !important;
  }
  .fx-aura {
    display: none;
  }
}

/* al imprimir o guardar en PDF, todo a la vista (aunque no haya aparecido aún) */
@media print {
  .fx-rev,
  .fx-partido .pal-in {
    opacity: 1 !important;
    transform: none !important;
  }
  .fx-aura {
    display: none !important;
  }
}
