/* ============================================================
   SONDRUMS PIZZERIA — animations.css
   ============================================================ */

/* ── Keyframes ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.15); opacity: 0.7; }
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}
@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Utility Animation Classes ── */
.anim-fade-up      { animation: fadeInUp 0.6s ease both; }
.anim-fade-down    { animation: fadeInDown 0.6s ease both; }
.anim-fade-left    { animation: fadeInLeft 0.6s ease both; }
.anim-fade-right   { animation: fadeInRight 0.6s ease both; }
.anim-scale-in     { animation: scaleIn 0.5s ease both; }
.anim-bounce-in    { animation: bounceIn 0.7s ease both; }
.anim-float        { animation: float 3s ease-in-out infinite; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--grey-2) 25%, #f0f0f0 50%, var(--grey-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Hover Effects ── */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(0,0,0,0.15); }

.hover-scale { transition: transform 0.3s ease; }
.hover-scale:hover { transform: scale(1.03); }

/* ── Ripple Effect ── */
.btn-ripple {
  position: relative; overflow: hidden;
}
.btn-ripple::after {
  content: ''; position: absolute;
  border-radius: 50%; width: 100%; padding-bottom: 100%;
  top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
  background: rgba(255,255,255,0.3);
  animation: none;
}
.btn-ripple:active::after {
  animation: ripple 0.5s ease-out;
}

/* ── Page Transition ── */
.page-enter {
  animation: fadeInUp 0.5s ease both;
}

/* ── Counter Animation (JS triggered) ── */
.counter { display: inline-block; }

/* ── Loading Spinner ── */
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--grey-2); border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}

/* ── Scroll-triggered Reveal ── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-left.visible { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-right.visible { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(0.9); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* Stagger children */
.stagger-children > * { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.stagger-children.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { opacity:1; transform:none; transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { opacity:1; transform:none; transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { opacity:1; transform:none; transition-delay: 0.4s; }

/* ── Hero Parallax ── */
.hero-bg img {
  will-change: transform;
}

/* ── Button focus states (accessibility) ── */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Confetti burst on add to cart ── */
@keyframes cartBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.3) rotate(-5deg); }
  60%  { transform: scale(0.9) rotate(3deg); }
  100% { transform: scale(1); }
}
.cart-added { animation: cartBounce 0.4s ease; }

/* ── Notification badge pulse ── */
@keyframes badgePulse {
  0%   { box-shadow: 0 0 0 0 rgba(211,47,47,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(211,47,47,0); }
  100% { box-shadow: 0 0 0 0 rgba(211,47,47,0); }
}
.cart-count.has-items {
  animation: badgePulse 1.5s ease infinite;
}
