/* ============================================================
   animations.css — Scroll Reveals, Micro-animations, Keyframes
   ============================================================ */

/* ── Scroll Reveal ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.54s; }

/* Reveal variants */
.reveal--left  { transform: translateX(-28px); }
.reveal--right { transform: translateX(28px); }
.reveal--up    { transform: translateY(-28px); }
.reveal--scale { transform: scale(0.92); }

.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--up.is-visible,
.reveal--scale.is-visible {
  transform: none;
  opacity: 1;
}

/* ── Floating Animation ────────────────────────────────────── */
@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}
.float { animation: float 4s ease-in-out infinite; }
.float-slow { animation: float 6s ease-in-out infinite; }
.float-fast { animation: float 2.5s ease-in-out infinite; }

/* ── Bounce ────────────────────────────────────────────────── */
@keyframes bounce {
  0%, 100% { transform: translateY(0) translateX(-50%); }
  50% { transform: translateY(-8px) translateX(-50%); }
}

/* ── Fade In Keyframes ─────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

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

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

/* ── Shimmer (loading skeleton) ────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 0%,
    var(--color-gray-200) 50%,
    var(--color-gray-100) 100%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ── Pulse ─────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ── Spin ──────────────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Blob ──────────────────────────────────────────────────── */
@keyframes blob {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}
.blob { animation: blob 8s ease-in-out infinite; }

/* ── Slide Up (for modals/drawers) ────────────────────────── */
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ── Ripple (button click) ─────────────────────────────────── */
@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}
.btn:active .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: ripple 0.6s ease;
}

/* ── Loading Dots ──────────────────────────────────────────── */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ── Attention Shake ───────────────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-5px); }
  30%, 70% { transform: translateX(5px); }
}
.shake { animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* ── Gradient Shift ────────────────────────────────────────── */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* ── Number Counter ────────────────────────────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero entrance sequence ────────────────────────────────── */
.hero__eyebrow  { animation: fadeInDown 0.8s ease 0.2s both; }
.hero__title    { animation: fadeInUp   0.9s ease 0.4s both; }
.hero__subtitle { animation: fadeInUp   0.9s ease 0.6s both; }
.hero__actions  { animation: fadeInUp   0.9s ease 0.8s both; }

/* ── Product card entrance ─────────────────────────────────── */
.product-card.reveal {
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); /* spring */
}

/* ── Image lazy-load fade in ───────────────────────────────── */
img {
  transition: opacity 0.4s ease;
}
img:not(.loaded) {
  opacity: 0;
}
img.loaded, img[src] {
  opacity: 1;
}

/* ── Hover lift ────────────────────────────────────────────── */
.hover-lift {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* ── Progress Bar (for checkout) ───────────────────────────── */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-8);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Plant particle float ──────────────────────────────────── */
.leaf-particle {
  position: fixed;
  pointer-events: none;
  font-size: 1.2rem;
  animation: leafFall 4s ease-in forwards;
  z-index: 9999;
  opacity: 0;
}
@keyframes leafFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* ── Checkmark Animation ───────────────────────────────────── */
@keyframes checkmark {
  0%   { stroke-dashoffset: 50; opacity: 0; }
  100% { stroke-dashoffset: 0;  opacity: 1; }
}

/* ── Responsive: Reduce motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .reveal { opacity: 1; transform: none; }
}
