/* ═══════════════════════════════════════════════════════════
   ANIMATIONS — keyframes, scroll-reveal, hovers, transiciones
   alfyma/css/animations.css
   ═══════════════════════════════════════════════════════════ */

/* ─── Scroll Reveal ─── */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger para items dentro de un .reveal padre */
.reveal .card:nth-child(1),
.reveal .process-step:nth-child(1),
.reveal .testimonial:nth-child(1) { transition-delay: 0s; }

.reveal .card:nth-child(2),
.reveal .process-step:nth-child(3),
.reveal .testimonial:nth-child(2) { transition-delay: 0.08s; }

.reveal .card:nth-child(3),
.reveal .process-step:nth-child(5),
.reveal .testimonial:nth-child(3) { transition-delay: 0.16s; }

.reveal .card:nth-child(4) { transition-delay: 0.24s; }
.reveal .card:nth-child(5) { transition-delay: 0.32s; }
.reveal .card:nth-child(6) { transition-delay: 0.40s; }

/* ─── Hero specific entry ─── */

.hero__content .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero__content .reveal:nth-child(2) { transition-delay: 0.12s; }
.hero__content .reveal:nth-child(3) { transition-delay: 0.19s; }
.hero__content .reveal:nth-child(4) { transition-delay: 0.26s; }
.hero__content .reveal:nth-child(5) { transition-delay: 0.33s; }

/* ─── Keyframes ─── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(213, 106, 43, 0.15); }
  50%       { box-shadow: 0 0 32px rgba(213, 106, 43, 0.35); }
}

@keyframes line-grow {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Nav hover underline ─── */

.nav__link {
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ─── Section divider line ─── */

.section__header::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin: 1.5rem auto 0;
  transform: scaleX(0);
  transform-origin: left center;
}

.section__header.visible::after {
  animation: line-grow 0.6s var(--ease) 0.4s both;
}

/* ─── Card hover lift ─── */

.card,
.testimonial,
.product-card {
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

/* ─── Stat value accent pulse ─── */

.stat__value {
  animation: none;
}

.stat:hover .stat__value {
  animation: glow-pulse 1.5s ease-in-out infinite;
  color: var(--accent-light);
}

/* ─── Process icon rotate ─── */

.process-step:hover .process-step__icon {
  animation: spin-slow 4s linear infinite;
  display: inline-block;
}

/* ─── Tab indicator active ─── */

.tabs button[role="tab"][aria-selected="true"] {
  position: relative;
}

.tabs button[role="tab"][aria-selected="true"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}

/* ─── FAQ icon animation ─── */

.faq-icon {
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

/* ─── Catalog preview hover ─── */

.catalog-preview__cover {
  transition: transform var(--transition), box-shadow var(--transition);
}

.lead-magnet:hover .catalog-preview__cover {
  transform: translateY(-6px) rotate(-1.5deg);
  box-shadow: 18px 18px 0 rgba(213, 106, 43, 0.18), 0 0 48px rgba(0, 0, 0, 0.7);
}

/* ─── Btn active state ─── */

.btn:active {
  transform: translateY(0) !important;
  transition-duration: 0.08s;
}

/* ─── Scroll hint vertical bounce ─── */

@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

.scroll-hint {
  animation: fade-up 1s var(--ease) 1.2s both;
}

/* ─── Badge shimmer ─── */

@keyframes badge-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.badge {
  background-size: 200% auto;
  position: relative;
  overflow: hidden;
}

.badge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(184, 149, 106, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: badge-shimmer 3.5s linear infinite;
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
