/* ============================================
   ZAYRÉ — Animations CSS
============================================ */

/* ── Keyframes ───────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

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

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

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

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

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-6deg) scale(0.9); }
  to   { opacity: 1; transform: rotate(0deg) scale(1); }
}

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

@keyframes particleFloat {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0.6; }
  33%  { transform: translateY(-40px) translateX(20px) scale(1.1); opacity: 0.8; }
  66%  { transform: translateY(-20px) translateX(-15px) scale(0.9); opacity: 0.4; }
  100% { transform: translateY(-80px) translateX(10px) scale(0.7); opacity: 0; }
}

@keyframes pathDraw {
  from { stroke-dashoffset: 2000; opacity: 0.2; }
  to   { stroke-dashoffset: 0; opacity: 0.6; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(201,163,81,0.2); }
  50%       { box-shadow: 0 0 50px rgba(201,163,81,0.5), 0 0 100px rgba(201,163,81,0.1); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(201,168,124,0.2); }
  50%       { border-color: rgba(201,168,124,0.6); }
}

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

/* ── Reveal Animations (JS-triggered) ─────── */
.reveal-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* Stagger delays for grid children */
.product-grid .product-card:nth-child(1) { transition-delay: 0s; }
.product-grid .product-card:nth-child(2) { transition-delay: 0.07s; }
.product-grid .product-card:nth-child(3) { transition-delay: 0.14s; }
.product-grid .product-card:nth-child(4) { transition-delay: 0.21s; }
.product-grid .product-card:nth-child(5) { transition-delay: 0.28s; }
.product-grid .product-card:nth-child(6) { transition-delay: 0.35s; }
.product-grid .product-card:nth-child(7) { transition-delay: 0.42s; }
.product-grid .product-card:nth-child(8) { transition-delay: 0.49s; }

.ingredients-grid .ingredient-card { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.ingredients-grid .ingredient-card.revealed { opacity: 1; transform: none; }
.ingredients-grid .ingredient-card:nth-child(1) { transition-delay: 0s; }
.ingredients-grid .ingredient-card:nth-child(2) { transition-delay: 0.08s; }
.ingredients-grid .ingredient-card:nth-child(3) { transition-delay: 0.16s; }
.ingredients-grid .ingredient-card:nth-child(4) { transition-delay: 0.24s; }
.ingredients-grid .ingredient-card:nth-child(5) { transition-delay: 0.32s; }
.ingredients-grid .ingredient-card:nth-child(6) { transition-delay: 0.4s; }

.testimonials-grid .testimonial-card { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.testimonials-grid .testimonial-card.revealed { opacity: 1; transform: none; }
.testimonials-grid .testimonial-card:nth-child(1) { transition-delay: 0s; }
.testimonials-grid .testimonial-card:nth-child(2) { transition-delay: 0.1s; }
.testimonials-grid .testimonial-card:nth-child(3) { transition-delay: 0.2s; }

/* ── Cursor ──────────────────────────────── */
.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease, background 0.3s ease;
  mix-blend-mode: screen;
}
.cursor-follower {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(201,163,81,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1),
              width 0.3s ease, height 0.3s ease,
              border-color 0.3s ease, opacity 0.3s ease;
  backdrop-filter: blur(2px);
}
.cursor.hovering {
  width: 6px;
  height: 6px;
  background: var(--gold);
}
.cursor-follower.hovering {
  width: 54px;
  height: 54px;
  border-color: rgba(201,163,81,0.8);
  background: rgba(201,163,81,0.06);
}
.cursor.clicking {
  width: 14px;
  height: 14px;
  background: var(--brown-light);
}
.cursor-follower.clicking {
  width: 28px;
  height: 28px;
  border-color: var(--gold);
}

/* Cursor magnetic buttons */
.btn-primary, .btn-ghost, .btn-outline,
.filter-tab, .product-card, .fnav-link {
  cursor: none;
}

/* ── Particle System ─────────────────────── */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat linear infinite;
}

/* ── Floating Paths ──────────────────────── */
.floating-paths-svg path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: pathDraw 6s ease-in-out forwards;
}

/* ── Background Paths ──────────────────────*/
.hero-bg-paths {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.3;
}
.hero-bg-paths path {
  stroke-dasharray: 2000;
  animation: pathFlow 20s linear infinite;
}
@keyframes pathFlow {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -2000; }
}

/* ── Slow scroll effect ──────────────────── */
.parallax-slow { will-change: transform; }

/* ── Image hover tilt ────────────────────── */
.tilt-card { transform-style: preserve-3d; }

/* ── Gradient text ───────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--brown-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Shimmer skeleton ─────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(201,168,124,0.06) 25%, rgba(201,168,124,0.12) 50%, rgba(201,168,124,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ── Smooth image load ────────────────────── */
img { transition: opacity 0.4s ease; }
img.loading { opacity: 0; }
img.loaded { opacity: 1; }

/* ── Blur transition ─────────────────────── */
.blur-in {
  animation: blurIn 0.6s ease forwards;
}
@keyframes blurIn {
  from { filter: blur(8px); opacity: 0; }
  to   { filter: blur(0px); opacity: 1; }
}

/* ── Stagger word reveal ─────────────────── */
.word-reveal span {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  overflow: hidden;
}
.word-reveal.go span {
  animation: wordReveal 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes wordReveal {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Motion blur on scroll ───────────────── */
@media (prefers-reduced-motion: no-preference) {
  .motion-blur-scroll {
    transition: filter 0.3s ease;
  }
  .motion-blur-scroll.scrolling {
    filter: blur(1px);
  }
}

/* ── Lenis smooth scroll override ─────────── */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
