/* ================================================================
   Organic Heritage – Animations CSS
   animations.css
   ================================================================ */

/* ─── Page Load Reveal ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes maskReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* ─── Image Mask Reveal ──────────────────────────────────────────── */
.img-reveal {
  overflow: hidden;
}
.img-reveal img {
  transform: scale(1.08);
  transition: transform 1.2s cubic-bezier(0.4,0,0.2,1);
}
.img-reveal.revealed img { transform: scale(1); }

/* ─── Counter animation ──────────────────────────────────────────── */
.counter { display: inline-block; }

/* ─── Pulse ring on CTA hover ────────────────────────────────────── */
@keyframes pulseRing {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--terracotta);
  opacity: 0;
}
.btn--primary:hover::before {
  animation: pulseRing 0.6s ease forwards;
}
.btn--primary { position: relative; overflow: hidden; }

/* ─── Button shimmer ─────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
}
.btn--primary:hover::after {
  animation: shimmer 0.6s ease;
}

/* ─── Card hover glow ────────────────────────────────────────────── */
.product-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(18,61,50,0);
  transition: box-shadow var(--transition);
  pointer-events: none;
}
.product-card:hover::after {
  box-shadow: 0 0 0 3px rgba(18,61,50,0.15);
}

/* ─── Category card reveal ───────────────────────────────────────── */
.cat-card__body {
  transform: translateY(8px);
  transition: transform var(--transition);
}
.cat-card:hover .cat-card__body { transform: translateY(0); }

/* ─── Nav underline slide ────────────────────────────────────────── */
/* (handled in style.css via ::after) */

/* ─── Hero slide progress bar ────────────────────────────────────── */
.hero__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--green-lime);
  width: 0;
  z-index: 10;
  transition: none;
}
.hero__progress.animating {
  transition: width linear;
}

/* ─── Testimonial slide ──────────────────────────────────────────── */
/* (handled via JS transform) */

/* ─── Loading skeleton ───────────────────────────────────────────── */
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.skeleton {
  background: var(--beige);
  border-radius: var(--radius-sm);
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* ─── Add-to-cart success ripple ─────────────────────────────────── */
@keyframes cartRipple {
  0%   { transform: scale(0); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.cart-ripple {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18,61,50,0.25);
  pointer-events: none;
  animation: cartRipple 0.5s ease-out forwards;
}

/* ─── Wishlist pop ───────────────────────────────────────────────── */
@keyframes wishlistPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.product-card__wishlist.popping svg { animation: wishlistPop 0.4s ease; }

/* ─── Number counter ─────────────────────────────────────────────── */
.stat-number {
  display: inline-block;
}

/* ─── Sticky nav logo scale ──────────────────────────────────────── */
.nav.nav--solid .nav__logo-mark {
  transform: scale(0.9);
}

/* ─── Gallery item stagger ───────────────────────────────────────── */
.gallery-item {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.gallery-item.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery-item:nth-child(1) { transition-delay: 0.05s; }
.gallery-item:nth-child(2) { transition-delay: 0.10s; }
.gallery-item:nth-child(3) { transition-delay: 0.15s; }
.gallery-item:nth-child(4) { transition-delay: 0.20s; }
.gallery-item:nth-child(5) { transition-delay: 0.25s; }
.gallery-item:nth-child(6) { transition-delay: 0.30s; }
.gallery-item:nth-child(7) { transition-delay: 0.35s; }
.gallery-item:nth-child(8) { transition-delay: 0.40s; }

/* ─── Why card number ────────────────────────────────────────────── */
.why-card::before {
  content: attr(data-num);
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 700;
  opacity: 0.08;
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  line-height: 1;
  color: currentColor;
}
.why-card { position: relative; overflow: hidden; }

/* ─── Floating WhatsApp pulse ────────────────────────────────────── */
@keyframes whatsappPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.fab--whatsapp {
  animation: whatsappPulse 2.5s ease-out infinite;
}

/* ─── Page transition ────────────────────────────────────────────── */
.page-loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 249, 237, 0.96);
  z-index: 9999;
  pointer-events: none;
  display: grid;
  place-items: center;
  animation: pageFadeOut 0.45s ease 0.18s both;
}
.page-loading::before {
  content: '';
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(18,61,50,0.14);
  border-top-color: var(--terracotta);
  box-shadow: 0 12px 32px rgba(18,61,50,0.12);
  animation: loadingSpin 0.75s linear infinite;
}

@keyframes pageFadeOut {
  from { opacity: 1; visibility: visible; }
  to   { opacity: 0; visibility: hidden; }
}
@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}

/* ─── Ingredient image crossfade ─────────────────────────────────── */
.ingredient-story__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.ingredient-story__img.active { opacity: 1; }
.ingredient-story__img-wrap { position: relative; }

/* ─── Filter tag fade ────────────────────────────────────────────── */
.filter-chip {
  animation: fadeIn 0.25s ease;
}

/* ─── Mobile menu link stagger ───────────────────────────────────── */
.mobile-nav--open .mobile-nav__link:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav--open .mobile-nav__link:nth-child(2) { transition-delay: 0.10s; }
.mobile-nav--open .mobile-nav__link:nth-child(3) { transition-delay: 0.15s; }
.mobile-nav--open .mobile-nav__link:nth-child(4) { transition-delay: 0.20s; }
.mobile-nav--open .mobile-nav__link:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav--open .mobile-nav__link:nth-child(6) { transition-delay: 0.30s; }
.mobile-nav--open .mobile-nav__link:nth-child(7) { transition-delay: 0.35s; }

/* ─── Popup botanical rotate ─────────────────────────────────────── */
@keyframes botanicalSpin {
  from { transform: rotate(30deg); }
  to   { transform: rotate(390deg); }
}
.popup-overlay--open .popup__botanical-1 {
  animation: botanicalSpin 25s linear infinite;
}
