/* Scroll-reveal, driven by IntersectionObserver in js/animations.js */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }

/* Staggered grid reveal. Cards fan in one after another instead of all
   popping in at once, which is what makes a scroll-triggered grid feel
   choreographed rather than templated. Capped at 8 explicit steps; beyond
   that every card shares the last delay (still reads fine in practice). */
.product-grid .product-card.reveal:nth-child(1) { transition-delay: 0ms; }
.product-grid .product-card.reveal:nth-child(2) { transition-delay: 60ms; }
.product-grid .product-card.reveal:nth-child(3) { transition-delay: 120ms; }
.product-grid .product-card.reveal:nth-child(4) { transition-delay: 180ms; }
.product-grid .product-card.reveal:nth-child(5) { transition-delay: 240ms; }
.product-grid .product-card.reveal:nth-child(6) { transition-delay: 300ms; }
.product-grid .product-card.reveal:nth-child(7) { transition-delay: 360ms; }
.product-grid .product-card.reveal:nth-child(n+8) { transition-delay: 420ms; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.cart-badge.bump {
  animation: pop 0.35s ease;
}

.cookie-banner {
  animation: fade-in 0.4s ease;
}

/* "Pour" ripple micro-animation (item 10) on "Lägg i varukorg" click
   feedback - a soft splash of color expanding from the button center and
   fading out, echoing the milk/kolostrum-splash imagery used elsewhere on
   the site. Triggered/removed by PourEffect.trigger() in js/animations.js.
   overflow:hidden on the button (set inline by the trigger call sites'
   .btn class already clips via border-radius) keeps the ripple contained. */
@keyframes pour-ripple {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.45; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}
.pour-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--color-bg) 85%, transparent) 0%, transparent 70%);
  pointer-events: none;
  animation: pour-ripple 0.6s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cart-badge.bump, .cookie-banner { animation: none; }
  .pour-ripple { display: none; }
}
