/* ═══════════════════════════════════════════
   ANIMACIONES — base común
   Los valores reales (--lfa-*) y los efectos que se apagan/encienden
   los genera includes/animaciones.php según el perfil Móvil / PC.
═══════════════════════════════════════════ */

/* Reveal de secciones: ahora usa duración, distancia y curva del perfil */
.reveal       { transform: translateY(var(--lfa-dist, 24px)); transition: opacity var(--lfa-dur, .7s) var(--lfa-ease, ease), transform var(--lfa-dur, .7s) var(--lfa-ease, ease); }
.reveal-left  { transform: translateX(calc(var(--lfa-dist, 24px) * -1)); transition: opacity var(--lfa-dur, .7s) var(--lfa-ease, ease), transform var(--lfa-dur, .7s) var(--lfa-ease, ease); }
.reveal-right { transform: translateX(var(--lfa-dist, 24px)); transition: opacity var(--lfa-dur, .7s) var(--lfa-ease, ease), transform var(--lfa-dur, .7s) var(--lfa-ease, ease); }

/* Secciones con tarjetas: la sección solo se desvanece y cada tarjeta entra por turno */
.reveal.lfa-has-items { transform: none; transition: opacity var(--lfa-dur, .7s) ease; }
.reveal.lfa-has-items:not(.visible) .lfa-item { opacity: 0; }
.reveal.lfa-has-items.visible .lfa-item {
  animation: lfa-item var(--lfa-dur, .7s) var(--lfa-ease, ease) backwards;
  animation-delay: calc(var(--i, 0) * var(--lfa-delay, 80ms));
}

@keyframes lfa-item   { from { opacity: 0; transform: translateY(var(--lfa-dist, 24px)) scale(var(--lfa-scale, 1)); } }
@keyframes lfa-pagein { from { opacity: 0; } }

/* Vuelo del producto al carrito (lo crea js/animaciones.js) */
.lfa-fly {
  position: fixed; z-index: 100000; margin: 0; pointer-events: none;
  object-fit: cover; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  will-change: transform, opacity;
}

/* Preferencia del sistema: tiene prioridad sobre todo lo anterior */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-left, .reveal-right { opacity: 1 !important; transform: none !important; }
  .lfa-item { opacity: 1 !important; }
  .lf-hero__bg, .hero-bg, .lf-zoom-in, .lf-zoom-inout { animation: none !important; }
  .lf-hero__bg, .lf-paralax-wrap, .lf-paralax-wrap * { background-attachment: scroll !important; }
}
