/* motion.css — Luxury animations & motion for Crosté Pizzaria */

/* ── KEYFRAMES ──────────────────────────────────────────────────────────────── */

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

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

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

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

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
  50%       { box-shadow: 0 0 24px 6px rgba(201,168,76,0.25); }
}

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

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes cartBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35) rotate(-8deg); }
  60%  { transform: scale(0.9) rotate(4deg); }
  80%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes flyToCart {
  0%   { opacity: 1; transform: scale(1) translate(0, 0); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: scale(0.2) translate(var(--fly-x, 300px), var(--fly-y, -400px)); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}

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

@keyframes goldGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(201,168,76,0); }
  50%       { text-shadow: 0 0 20px rgba(201,168,76,0.6), 0 0 40px rgba(201,168,76,0.3); }
}

/* ── SCROLL-REVEAL (Intersection Observer via JS) ───────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ── HERO ENTRANCE ──────────────────────────────────────────────────────────── */

.hero-label  { animation: fadeUp 0.6s var(--ease-out) 0.1s both; }
.hero h1     { animation: fadeUp 0.7s var(--ease-out) 0.25s both; }
.hero-desc   { animation: fadeUp 0.7s var(--ease-out) 0.4s both; }
.hero-actions { animation: fadeUp 0.7s var(--ease-out) 0.55s both; }

/* ── BANNER ─────────────────────────────────────────────────────────────────── */

.banner-content { animation: fadeUp 0.8s var(--ease-out) 0.2s both; }
.banner-title   { animation: goldGlow 4s ease-in-out 1.5s infinite; }

/* ── FEATURE CARDS ──────────────────────────────────────────────────────────── */

.feature-card {
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 20px rgba(201,168,76,0.1);
}
.feature-icon {
  animation: float 4s ease-in-out infinite;
}
.feature-card:nth-child(2) .feature-icon { animation-delay: 0.5s; }
.feature-card:nth-child(3) .feature-icon { animation-delay: 1s; }
.feature-card:nth-child(4) .feature-icon { animation-delay: 1.5s; }

/* ── PRODUCT CARDS — handled entirely in app.css ────────────────────────────── */
/* (transitions, hover states, image zoom all defined in app.css luxury edition) */

/* ── GOLD SHIMMER on btn-primary ────────────────────────────────────────────── */

.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
  background-size: 300% 100%;
  background-position: 200% 0;
  transition: background-position 0.5s ease;
  pointer-events: none;
}
.btn-primary:hover::after {
  background-position: -50% 0;
}

/* ── CART BUTTON ANIMATION ──────────────────────────────────────────────────── */

.cart-toggle.bounce {
  animation: cartBounce 0.5s var(--ease-out) forwards;
}

/* ── FLY-TO-CART PARTICLE ───────────────────────────────────────────────────── */

.fly-particle {
  position: fixed;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
  animation: flyToCart 0.7s var(--ease-in) forwards;
  color: #000;
  font-size: 20px;
}

/* ── RIPPLE ON BUTTONS ──────────────────────────────────────────────────────── */

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  width: 10px;
  height: 10px;
  animation: ripple 0.6s linear forwards;
  pointer-events: none;
}

/* ── PROMO CARDS ────────────────────────────────────────────────────────────── */

.promo-card {
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.promo-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 20px rgba(201,168,76,0.15);
}

/* ── CATEGORY FILTER BUTTONS ────────────────────────────────────────────────── */

.category-filter-btn {
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.category-filter-btn:hover {
  transform: translateY(-2px);
}
.category-filter-btn.active {
  animation: goldPulse 2s ease-in-out infinite;
}

/* ── PARALLAX HERO (CSS only, enhanced by JS) ───────────────────────────────── */

.banner-slide {
  will-change: background-position;
}

/* ── NAVBAR SCROLL EFFECT ───────────────────────────────────────────────────── */

.navbar {
  transition: background var(--duration-base) var(--ease-base),
              box-shadow var(--duration-base) var(--ease-base),
              backdrop-filter var(--duration-base) var(--ease-base);
}
.navbar.scrolled {
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0,0,0,0.6), 0 1px 0 rgba(201,168,76,0.1);
}

/* ── FEAT-CARD STAT NUMBER COUNTER REVEAL ───────────────────────────────────── */

@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feat-stat-num.counting {
  animation: countUp 0.5s var(--ease-out) forwards;
}

/* ── GOLD SEPARATOR LINE ────────────────────────────────────────────────────── */

.gold-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  margin: var(--space-4) auto;
  border: none;
}

/* ── TOAST / NOTIFICATION ANIMATION ────────────────────────────────────────── */

.toast-enter {
  animation: slideInRight 0.4s var(--ease-out) forwards;
}

/* ── PRODUCT MODAL ENTRANCE ─────────────────────────────────────────────────── */

#productModal > div {
  animation: scaleIn 0.3s var(--ease-out) forwards;
}

/* ── REDUCED MOTION OVERRIDES ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-scale { transition: none !important; opacity: 1 !important; transform: none !important; }
  .hero-label, .hero h1, .hero-desc, .hero-actions, .banner-content { animation: none !important; }
  .feature-icon { animation: none !important; }
  .fly-particle { animation: none !important; }
  .banner-title { animation: none !important; }
}
