/* ============================================================
   GALLETAS PITUCA — Motion System v2
   Reveals con fill backwards (no bloquean hover)
   Ken Burns · float · scrollPulse · mask-reveal · stagger
============================================================ */

/* ---------- REVEAL GENÉRICO ---------- */
.reveal {
  opacity: 0;
}

.reveal.is-visible {
  opacity: 1;
}

.reveal.is-visible:not(.hero-panel) {
  animation: revealIn 0.8s var(--ease-smooth) backwards;
  animation-delay: var(--d, 0s);
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger cascade en grids: +80ms por hijo */
.grid > .reveal:nth-child(2) { --d: 0.08s; }
.grid > .reveal:nth-child(3) { --d: 0.16s; }
.grid > .reveal:nth-child(4) { --d: 0.24s; }
.grid > .reveal:nth-child(5) { --d: 0.32s; }
.grid > .reveal:nth-child(6) { --d: 0.40s; }
.grid > .reveal:nth-child(7) { --d: 0.48s; }
.grid > .reveal:nth-child(8) { --d: 0.56s; }
.grid > .reveal:nth-child(9) { --d: 0.64s; }

/* ---------- HERO HOME: panel de vidrio ---------- */
.hero--home .hero-panel.is-visible {
  animation: panelIn 1s var(--ease-smooth) 0.1s backwards;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Contenido escalonado (delays .35 / .5 / .68 / .85) */
.hero--home .hero-eyebrow,
.hero--home .hero-title,
.hero--home .hero-lead,
.hero--home .hero-actions {
  opacity: 0;
  transform: translateY(22px);
  animation: heroUp 0.9s var(--ease-smooth) both;
}

.hero--home .hero-eyebrow  { animation-delay: 0.35s; }
.hero--home .hero-title    { animation-delay: 0.50s; }
.hero--home .hero-lead     { animation-delay: 0.68s; }
.hero--home .hero-actions  { animation-delay: 0.85s; }

@keyframes heroUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Span naranja con mask-reveal (derecha → izquierda) */
.hero--home .hero-title span {
  clip-path: inset(0 0 0 100%);
  animation: maskReveal 0.9s var(--ease-smooth) 0.8s both;
}

@keyframes maskReveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ---------- HÉROES SIN PANEL ---------- */
.hero:not(.hero--home) .hero-eyebrow,
.hero:not(.hero--home) .hero-title,
.hero:not(.hero--home) .hero-lead {
  opacity: 0;
  transform: translateY(22px);
  animation: heroUp 0.9s var(--ease-smooth) both;
}

.hero:not(.hero--home) .hero-eyebrow { animation-delay: 0.20s; }
.hero:not(.hero--home) .hero-title   { animation-delay: 0.35s; }
.hero:not(.hero--home) .hero-lead    { animation-delay: 0.55s; }

/* ---------- KEN BURNS (capa de imagen del hero) ---------- */
@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

/* ---------- BADGE 1969 FLOTANTE ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ---------- INDICADOR DE SCROLL (pulso) ---------- */
@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.35;
    transform: scaleY(0.7);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ---------- ZOOM CINEMATOGRÁFICO DE IMÁGENES ---------- */
.product-card .product-media img,
.card-mini .card-media img {
  opacity: 0;
  transform: scale(1.14);
}

.product-card.is-visible .product-media img,
.card-mini.is-visible .card-media img {
  opacity: 1;
  transform: scale(1);
  animation: imgZoom 1.2s var(--ease-smooth) backwards;
}

@keyframes imgZoom {
  from {
    opacity: 0;
    transform: scale(1.14);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- TIMELINE: entrada lateral cruzada ---------- */
.timeline-item .timeline-year,
.timeline-item .timeline-body {
  opacity: 0;
}

.timeline-item.is-visible .timeline-year {
  opacity: 1;
  animation: slideFromLeft 0.7s var(--ease-smooth) backwards;
}

.timeline-item.is-visible .timeline-body {
  opacity: 1;
  animation: slideFromRight 0.7s var(--ease-smooth) 0.12s backwards;
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- FOTO HISTORIA: scale-in ---------- */
.historia-photo {
  opacity: 0;
}

.historia-photo.is-visible {
  opacity: 1;
  animation: photoIn 0.8s var(--ease-lift) backwards;
}

@keyframes photoIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- STATS: fade de contadores ---------- */
.stats strong[data-count] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease-smooth),
              transform 0.6s var(--ease-smooth);
}

.stats.is-visible strong[data-count] {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- ESTADOS DEL FORMULARIO ---------- */
.btn-submit.is-loading::before {
  content: '';
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--c-white);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-submit.is-success {
  background: linear-gradient(180deg, #43a047, #2e7d32);
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.35);
}

/* ---------- REDUCED MOTION: todo visible, sin animar ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal,
  .hero--home .hero-panel,
  .hero--home .hero-eyebrow,
  .hero--home .hero-title,
  .hero--home .hero-lead,
  .hero--home .hero-actions,
  .hero:not(.hero--home) .hero-eyebrow,
  .hero:not(.hero--home) .hero-title,
  .hero:not(.hero--home) .hero-lead,
  .product-card .product-media img,
  .card-mini .card-media img,
  .timeline-item .timeline-year,
  .timeline-item .timeline-body,
  .historia-photo,
  .stats strong[data-count] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}