/* =========================================================================
   BOTRIX -- Animation System v2 (light theme)
   Every interaction has a purposeful, task-matched animation.
   ========================================================================= */

/* ── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes fly-to-cart {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  60%  { transform: translate(var(--fly-x,200px), var(--fly-y,-200px)) scale(0.4); opacity: 0.7; }
  100% { transform: translate(var(--fly-x,200px), var(--fly-y,-200px)) scale(0); opacity: 0; }
}
@keyframes badge-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.7); }
  65%  { transform: scale(0.85); }
  85%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes heart-pulse {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.32); }
  30%  { transform: scale(0.9); }
  45%  { transform: scale(1.18); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes heart-break {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  30%  { transform: scale(1.08) rotate(-5deg); opacity: 0.8; }
  70%  { transform: scale(0.72) rotate(5deg); opacity: 0.45; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes slide-out-left {
  0%   { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-110%); opacity: 0; }
}
@keyframes qty-bounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); color: var(--primary); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.45; }
  100% { transform: scale(4); opacity: 0; }
}
@keyframes star-scatter {
  0%   { transform: translate(0,0) scale(0) rotate(0deg); opacity: 1; }
  60%  { opacity: 0.85; }
  100% { transform: translate(var(--sx,0px), var(--sy,-60px)) scale(1) rotate(var(--sr,45deg)); opacity: 0; }
}
@keyframes chip-spring {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.9); }
  65%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes card-cascade-in {
  0%   { opacity: 0; transform: translateY(18px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes alert-slide-in {
  0%   { transform: translateY(-18px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-7px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes notif-drop {
  0%   { transform: translateY(-100%) scale(0.94); opacity: 0; }
  60%  { transform: translateY(4px) scale(1.01); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Fly-to-cart ghost ── */
.cart-fly-item {
  position: fixed; pointer-events: none; z-index: 9999;
  width: 54px; height: 54px; border-radius: var(--radius-m);
  object-fit: cover; background: var(--surface);
  border: 2px solid var(--primary);
  /* Was `0 8px 24px rgba(200,155,60,0.28)` -- a 24px gold halo trailing the ghost
     across the viewport. scripts/deglow.mjs never saw it: that script reads
     design-system.css, style.css and emods.css, and this is the fourth sheet,
     loaded alongside them at includes/header.php:63. The gold 2px border above is
     what identifies the ghost; the shadow only has to lift it off the page, so it
     is the same neutral --shadow-md every card uses. */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  animation: fly-to-cart 0.6s cubic-bezier(.4,0,.2,1) forwards;
}
.star-particle { position: fixed; pointer-events: none; z-index: 9999; font-size: 1rem; animation: star-scatter 0.65s ease forwards; }
.ripple-circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.35); width: 60px; height: 60px; margin-top: -30px; margin-left: -30px; pointer-events: none; animation: ripple 0.5s ease-out forwards; }
.ripple-circle.dark { background: rgba(30,27,24,0.18); }

/* ── Applied states ── */
.cart-badge.popping,.wishlist-badge.popping { animation: badge-pop 0.45s cubic-bezier(.2,.8,.2,1); }
.wishlist-btn.heart-adding,.wishlist-form.heart-adding .wishlist-btn { animation: heart-pulse 0.5s cubic-bezier(.2,.8,.2,1); }
.wishlist-btn.heart-removing,.wishlist-form.heart-removing .wishlist-btn { animation: heart-break 0.4s ease; }
.cart-row-removing { animation: slide-out-left 0.35s ease forwards; overflow: hidden; }
.qty-bouncing input { animation: qty-bounce 0.32s cubic-bezier(.2,.8,.2,1); }
.filter-chip.springing { animation: chip-spring 0.32s cubic-bezier(.2,.8,.2,1); }
.card-cascade-in { animation: card-cascade-in 0.4s cubic-bezier(.2,.8,.2,1) both; }
.alert { animation: alert-slide-in 0.3s cubic-bezier(.2,.8,.2,1); position: relative; }
.form-shake { animation: shake 0.42s cubic-bezier(.4,0,.2,1); }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.btn-secondary.btn-loading::after,.btn-cart.btn-loading::after { border-color: rgba(30,27,24,0.25); border-top-color: var(--ink); }

/* =========================================================================
   GSAP / LENIS -- Smooth Scroll & Cinematic Animation Support
   zero.university-style scroll effects
   ========================================================================= */

/* Lenis smooth scroll baseline */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* GSAP character reveal defaults */
.gsap-char {
  display: inline-block;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}

/* GSAP text reveal containers */
.gsap-text-reveal,
.gsap-line-reveal {
  overflow: hidden;
}

/* Horizontal scroll section */
.gsap-horizontal-scroll {
  overflow: hidden;
  position: relative;
}
.gsap-horizontal-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 40px;
  will-change: transform;
}

/* Scroll progress bar (top of page) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary, #E43D12);
  z-index: 10000;
  transition: none;
  pointer-events: none;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .gsap-fade-up,
  .gsap-fade-left,
  .gsap-fade-right,
  .gsap-scale-in,
  .gsap-text-reveal,
  .gsap-line-reveal,
  .gsap-clip-reveal,
  .gsap-stagger,
  .gsap-parallax {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
