/* =============================================================
   ANIMATIONS.CSS — Keyframes, scroll reveal, transitions
   ============================================================= */

/* ===== SCROLL REVEAL CLASSES ===== */

.reveal-fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-fade-right {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-fade-left {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.93) translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Revealed state */
.reveal-fade-up.revealed,
.reveal-fade-right.revealed,
.reveal-fade-left.revealed {
  opacity: 1;
  transform: translate(0, 0);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Stagger delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* ===== REDUCED MOTION OVERRIDE ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-fade-up,
  .reveal-fade-right,
  .reveal-fade-left,
  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero { background-attachment: scroll; }

  /* Show form feedback immediately without transition */
  .form-feedback { transition: none; }
}

/* ===== HERO ENTRANCE ===== */

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-text {
  animation: heroFadeUp 1s cubic-bezier(0.2, 0.8, 0.4, 1) 0.4s both;
}

.trust-strip {
  animation: heroFadeUp 1s cubic-bezier(0.2, 0.8, 0.4, 1) 0.7s both;
}

/* ===== SCROLL LINE (hero) ===== */

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

.scroll-line {
  animation: scrollLine 2s ease-in-out 1.5s infinite;
}

/* ===== HAMBURGER ANIMATION ===== */

.hamburger span {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== LOGO FLOAT ===== */

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== FLOATING WHATSAPP PULSE ===== */

@keyframes waPulse {
  0%   { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0.4); }
  70%  { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4), 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0); }
}

.wa-float {
  animation: waPulse 3s ease 3s infinite;
}

.wa-float:hover {
  animation: none;
}

/* ===== LIGHTBOX ANIMATION ===== */

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lbSlideUp {
  from { transform: scale(0.93) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.lightbox.active {
  animation: lbFadeIn 0.25s ease forwards;
}

.lightbox.active .lb-content {
  animation: lbSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.4, 1) 0.1s both;
}

/* ===== GALLERY HOVER RIPPLE ===== */

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base);
}

.gallery-item:hover::after {
  border-color: var(--color-dorado);
}

/* ===== CARD HOVER GLOW ===== */

.product-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  background: linear-gradient(135deg, var(--color-verde), var(--color-rojo));
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-base);
}

.product-card:hover::before {
  opacity: 0.08;
}

/* ===== SCHEDULE TODAY ANIMATION ===== */

@keyframes todayPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.schedule-row.today .today-tag {
  animation: todayPulse 2s ease infinite;
}

/* ===== THEME TRANSITION ===== */

html {
  transition: background-color 0.3s ease;
}

/* ===== HEADER SCROLL TRANSITION ===== */

.site-header {
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

/* ===== STAT COUNTER ===== */

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-number {
  animation: countUp 0.6s ease both;
}

/* ===== FAQ ICON ===== */

.faq-icon {
  transition: background 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== SOCIAL CARD ===== */

.social-card .social-icon {
  transition: transform 0.3s ease;
}

.social-card:hover .social-icon {
  transform: scale(1.1) rotate(-4deg);
}

/* ===== PAGE LOAD ===== */

@keyframes pageReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  animation: pageReveal 0.4s ease both;
}
