/* ============================================================
   animations.css — Casita de Aventuras
   Keyframes and motion. All values via CSS variables from reset.css.
   ============================================================ */

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

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

@keyframes float-badge {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-8px) rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

@keyframes pulse-ring {
  0%   { transform: scale(0.88); opacity: 0.7; }
  70%  { transform: scale(1.3);  opacity: 0; }
  100% { transform: scale(1.3);  opacity: 0; }
}

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

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

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

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

@keyframes blob-morph {
  0%, 100% { border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; }
  25%       { border-radius: 45% 55% 40% 60% / 60% 40% 55% 45%; }
  50%       { border-radius: 55% 45% 60% 40% / 45% 55% 45% 55%; }
  75%       { border-radius: 40% 60% 45% 55% / 55% 45% 60% 40%; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-2rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce-gentle {
  0%, 100% { transform: translateY(0); }
  40%       { transform: translateY(-8px); }
  60%       { transform: translateY(-4px); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 155, 143, 0); }
  50%       { box-shadow: 0 0 20px 6px rgba(242, 155, 143, 0.28); }
}

/* ============================================================
   NAV ENTRANCE
   ============================================================ */

.nav {
  animation: fadeInDown 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 0.1s both;
}

/* ============================================================
   HERO ENTRANCE ANIMATIONS
   ============================================================ */

.hero__badge {
  animation: fadeInDown 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) 0.2s both;
}

.hero__title {
  animation: fadeInUp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.3s both;
}

.hero__subtitle {
  animation: fadeInUp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.4s both;
}

.hero__ctas {
  animation: fadeInUp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.5s both;
}

.hero__stats {
  animation: fadeInUp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.6s both;
}

.hero__visual {
  animation: scaleIn 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) 0.3s both;
}

/* ============================================================
   REUSABLE FLOAT CLASSES
   ============================================================ */

.float-animation {
  animation: float 4s ease-in-out infinite;
}

.float-animation-slow {
  animation: float-slow 6s ease-in-out infinite;
}

.float-animation-delayed {
  animation: float 4.5s ease-in-out 1.5s infinite;
}

/* ============================================================
   DECORATIVE STARS
   ============================================================ */

.deco-star {
  display: inline-block;
  animation: spin-slow 12s linear infinite;
  transform-origin: center;
}

.deco-star--reverse {
  display: inline-block;
  animation: spin-slow-reverse 10s linear infinite;
  transform-origin: center;
}

/* ============================================================
   COLLECTION CARD HOVER GLOWS
   (colour-specific, overrides base shadow)
   ============================================================ */

.collection-card--coral:hover {
  box-shadow: 0 20px 40px rgba(242, 155, 143, 0.3),
              0 0 0 1px rgba(242, 155, 143, 0.25);
}

.collection-card--yellow:hover {
  box-shadow: 0 20px 40px rgba(246, 215, 122, 0.32),
              0 0 0 1px rgba(246, 215, 122, 0.28);
}

.collection-card--mint:hover {
  box-shadow: 0 20px 40px rgba(184, 223, 208, 0.35),
              0 0 0 1px rgba(184, 223, 208, 0.3);
}

.collection-card--sky:hover {
  box-shadow: 0 20px 40px rgba(183, 215, 245, 0.35),
              0 0 0 1px rgba(183, 215, 245, 0.3);
}

.collection-card--lavender:hover {
  box-shadow: 0 20px 40px rgba(216, 199, 240, 0.32),
              0 0 0 1px rgba(216, 199, 240, 0.28);
}

.collection-card--peach:hover {
  box-shadow: 0 20px 40px rgba(242, 195, 165, 0.32),
              0 0 0 1px rgba(242, 195, 165, 0.28);
}

/* ============================================================
   PRODUCT CARD IMAGE SHIMMER ON PARENT HOVER
   ============================================================ */

.product-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 65%
  );
  background-size: 200% 100%;
  background-position: -200% center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card:hover .product-card__image::after {
  opacity: 1;
  animation: shimmer 0.7s ease forwards;
}

/* ============================================================
   TESTIMONIAL CARD — MIDDLE CARD ELEVATED
   ============================================================ */

.testimonial-card:nth-child(2) {
  transform: translateY(-8px);
}

.testimonial-card:nth-child(2):hover {
  transform: translateY(-14px);
}

/* ============================================================
   CTA FINAL DECORATIONS
   ============================================================ */

.cta-final__deco-1 {
  position: absolute;
  animation: float 5s ease-in-out infinite;
}

.cta-final__deco-2 {
  position: absolute;
  animation: float-slow 7s ease-in-out 1s infinite;
}

.cta-final__deco-3 {
  position: absolute;
  animation: spin-slow 18s linear infinite;
}

.cta-final__deco-4 {
  position: absolute;
  animation: spin-slow-reverse 14s linear 0.5s infinite;
}

/* ============================================================
   MOBILE — reduce motion weight at 500px
   ============================================================ */

@media (max-width: 500px) {
  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__ctas,
  .hero__stats,
  .hero__visual,
  .nav {
    animation-duration: 0.4s;
    animation-delay: 0s;
  }

  .float-animation,
  .float-animation-slow,
  .float-animation-delayed,
  .cta-final__deco-1,
  .cta-final__deco-2,
  .cta-final__deco-3,
  .cta-final__deco-4 {
    animation: none;
  }
}

/* ============================================================
   PREFERS-REDUCED-MOTION — disable everything
   ============================================================ */

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