/* ============================================================
   BEETBUL — ASESORÍAS AMAZON
   animations.css — Keyframes y clases de animación
   ============================================================ */

/* ---- Base state — oculto antes de animarse ---- */
[data-animate] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.7s;
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: var(--delay, 0s);
}

[data-animate="fade-in"] {
  transform: translateY(0);
}

[data-animate="slide-up"] {
  transform: translateY(40px);
}

[data-animate="slide-right"] {
  transform: translateX(-40px);
}

[data-animate="slide-left"] {
  transform: translateX(40px);
}

/* ---- Animated state ---- */
[data-animate].animated {
  opacity: 1;
  transform: translate(0, 0);
}

/* ---- Hero animaciones (se aplican directamente con delay) ---- */
.hero-badge[data-animate],
.hero-headline[data-animate],
.hero-subtitle[data-animate],
.hero-ctas[data-animate] {
  /* Se manejan via IntersectionObserver en main.js,
     pero el hero se anima al cargar la página */
}

/* ---- Scroll arrow pulse ---- */
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

.scroll-arrow {
  animation: scrollBounce 1.8s ease-in-out infinite;
}

/* ---- WhatsApp pulse ---- */
@keyframes whatsappPulse {
  0%   { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
  50%  { box-shadow: 0 4px 36px rgba(37, 211, 102, 0.7), 0 0 0 12px rgba(37, 211, 102, 0.08); }
  100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
}

.whatsapp-float {
  animation: whatsappPulse 3s ease-in-out infinite;
}

/* ---- Stagger list items (pain list) ---- */
.pain-item[data-animate] {
  transform: translateX(-24px);
}

.pain-item[data-animate].animated {
  transform: translateX(0);
}

/* ---- Pillar cards hover ---- */
.pillar-card {
  will-change: transform;
}

/* ---- Profile tab active indicator ---- */
.profile-tab {
  position: relative;
  overflow: hidden;
}

.profile-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease, left 0.3s ease;
}

.profile-tab.active::after {
  width: 100%;
  left: 0;
}

/* ---- Counter number odometer animation ---- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.counter-value.counting {
  animation: countUp 0.4s ease forwards;
}

/* ---- FAQ accordion icon rotation ---- */
.faq-icon {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Smooth fade-in for form success ---- */
@keyframes successFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.form-success {
  animation: successFadeIn 0.45s ease forwards;
}

/* ---- Focus ring visible ---- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Button interaction ---- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s ease;
}

.btn:active::after {
  background: rgba(255,255,255,0.15);
}

/* ---- Slot button micro-animation ---- */
.slot-btn {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot-btn:active {
  transform: scale(0.95);
}

/* ---- Eco card entrance ---- */
.eco-card[data-animate] {
  transform: translateY(24px);
}

/* ---- Profile cards entrance ---- */
.profile-card[data-animate] {
  transform: translateY(20px);
}

/* ---- Navbar CTA pulse on mobile scroll ---- */
@keyframes navCtaBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* ---- Image loading skeleton ---- */
img[loading="lazy"] {
  background: linear-gradient(
    90deg,
    var(--color-light) 25%,
    #e8eef5 50%,
    var(--color-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

img.loaded {
  background: none;
  animation: none;
}

/* ---- Section enter transitions ---- */
.section-problema,
.section-porque,
.section-servicios,
.section-resultados,
.section-para-quien,
.section-faq,
.section-agenda,
.section-cta-final {
  overflow: hidden;
}

/* ---- Reduce 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;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
