/* ═══════════════════════════════════════════════════════════════════
   animations.css — GPU-accelerated, non-blocking animations
   All use transform/opacity only (no layout-triggering properties)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page transitions ──────────────────────────────────────────── */
.page-enter {
  animation: pageEnter .32s cubic-bezier(.4,0,.2,1) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ── Card stagger fade-in ──────────────────────────────────────── */
.product-card {
  opacity: 0;
  animation: cardReveal .35s cubic-bezier(.4,0,.2,1) both;
}
/* Stagger delays — assigned via JS data-index */
.product-card[data-index="0"]  { animation-delay: .04s; }
.product-card[data-index="1"]  { animation-delay: .07s; }
.product-card[data-index="2"]  { animation-delay: .10s; }
.product-card[data-index="3"]  { animation-delay: .13s; }
.product-card[data-index="4"]  { animation-delay: .16s; }
.product-card[data-index="5"]  { animation-delay: .19s; }
.product-card[data-index="6"]  { animation-delay: .22s; }
.product-card[data-index="7"]  { animation-delay: .25s; }
.product-card[data-index="8"]  { animation-delay: .28s; }
.product-card[data-index="9"]  { animation-delay: .31s; }
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Load more — new cards already appended */
.card-new {
  animation: cardNew .3s cubic-bezier(.4,0,.2,1) both;
}
@keyframes cardNew {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── Spin loader ───────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,213,31,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg {
  width: 40px; height: 40px;
  border-width: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Full-page loader ──────────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity .4s;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }
.page-loader-logo { font-size: 2.4rem; font-weight: 900; color: var(--gold); letter-spacing: -.04em; }
.page-loader p { font-size: .82rem; color: var(--text2); font-weight: 600; }

/* ── Button loading state ──────────────────────────────────────── */
.btn.loading {
  pointer-events: none;
}
.btn.loading .btn-text { visibility: hidden; }
.btn.loading::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Slide-up drawer ───────────────────────────────────────────── */
.slide-up {
  animation: slideUp .3s cubic-bezier(.4,0,.2,1) both;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

/* ── Fade scale (modals) ───────────────────────────────────────── */
.fade-scale {
  animation: fadeScale .25s cubic-bezier(.4,0,.2,1) both;
}
@keyframes fadeScale {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* ── Add to cart bounce ────────────────────────────────────────── */
.cart-bounce {
  animation: cartBounce .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes cartBounce {
  from { transform: scale(.85); }
  50%  { transform: scale(1.2); }
  to   { transform: scale(1); }
}

/* ── Pulse dot ─────────────────────────────────────────────────── */
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%  { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100%{ box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Success checkmark ─────────────────────────────────────────── */
.check-anim {
  animation: checkPop .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes checkPop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── Shimmer loading strips ────────────────────────────────────── */
.shimmer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.shimmer-img  { height: 140px; }
.shimmer-line { height: 14px; margin: 10px; border-radius: 7px; }
.shimmer-line.short { width: 60%; }
.shimmer-btn  { height: 36px; margin: 10px; border-radius: var(--r-sm); }

/* ── Search wrap ───────────────────────────────────────────────── */
.search-wrap {
  position: relative;
}

/* skeleton-wave alias — defined in app.css */
.shimmer-card .skeleton { animation-name: skeleton-wave; }
