/* ==========================================================================
   Freshly — Animations
   Keep it elegant, not excessive
   ========================================================================== */

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes ripple {
  to { transform: scale(2.6); opacity: 0; }
}

@keyframes cartBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Scroll reveal — toggled by app.js via IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.in-view > * {
  animation: slideUp 500ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
.reveal-stagger.in-view > *:nth-child(1) { animation-delay: 0ms; }
.reveal-stagger.in-view > *:nth-child(2) { animation-delay: 60ms; }
.reveal-stagger.in-view > *:nth-child(3) { animation-delay: 120ms; }
.reveal-stagger.in-view > *:nth-child(4) { animation-delay: 180ms; }
.reveal-stagger.in-view > *:nth-child(5) { animation-delay: 240ms; }
.reveal-stagger.in-view > *:nth-child(6) { animation-delay: 300ms; }
.reveal-stagger.in-view > *:nth-child(7) { animation-delay: 360ms; }
.reveal-stagger.in-view > *:nth-child(8) { animation-delay: 420ms; }

.floating-card.delivery-time { animation: floatY 4.5s ease-in-out infinite; }
.floating-card.discount-badge { animation: floatY 5.5s ease-in-out infinite 0.4s; }

.icon-badge .count.bump { animation: cartBounce 400ms ease; }

/* Ripple button effect */
.btn, .add-to-cart-btn, .btn-icon {
  position: relative;
  overflow: hidden;
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 550ms ease-out;
  pointer-events: none;
}
.btn-outline .ripple-effect,
.add-to-cart-btn .ripple-effect,
.btn-icon .ripple-effect { background: rgba(34, 197, 94, 0.25); }

/* Toast */
.toast { animation: none; }

/* Loading skeleton block */
.skeleton { animation: fadeIn 200ms ease; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .floating-card { animation: none !important; }
}
