/* ═══════════════════════════════════════
   AL TURAB STORE — Animations
   Transitions, Entrance Effects, Keyframes
   ═══════════════════════════════════════ */

/* ── Animate on Scroll ── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.animate-delay-1 { transition-delay: 100ms; }
.animate-delay-2 { transition-delay: 200ms; }
.animate-delay-3 { transition-delay: 300ms; }
.animate-delay-4 { transition-delay: 400ms; }
.animate-delay-5 { transition-delay: 500ms; }
.animate-delay-6 { transition-delay: 600ms; }
.animate-delay-7 { transition-delay: 700ms; }
.animate-delay-8 { transition-delay: 800ms; }

/* ── Slide Variants ── */
.animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
}

.animate-slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-left {
  opacity: 0;
  transform: translateX(-30px);
}

.animate-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-right {
  opacity: 0;
  transform: translateX(30px);
}

.animate-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale-in {
  opacity: 0;
  transform: scale(0.9);
}

.animate-scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Hero Specific ── */
.hero-animate {
  opacity: 0;
  transform: translateY(24px);
  animation: heroFadeUp 0.7s ease forwards;
}

.hero-animate--1 { animation-delay: 0ms; }
.hero-animate--2 { animation-delay: 150ms; }
.hero-animate--3 { animation-delay: 300ms; }
.hero-animate--4 { animation-delay: 400ms; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Pop In ── */
.pop-in {
  opacity: 0;
  transform: scale(0.8) translateY(10px);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pop-in--1 { animation-delay: 400ms; }
.pop-in--2 { animation-delay: 500ms; }
.pop-in--3 { animation-delay: 600ms; }
.pop-in--4 { animation-delay: 700ms; }

@keyframes popIn {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Floating / Bobbing ── */
.float-animation {
  animation: float 3s ease-in-out infinite;
}

.float-animation--slow {
  animation: float 4s ease-in-out infinite;
}

.float-animation--delay {
  animation: float 3s ease-in-out infinite 1.5s;
}

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

/* ── WhatsApp Pulse ── */
@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

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

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

/* ── Spin ── */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Countdown Pulse ── */
.countdown-pulse {
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ── Fade In ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* ── Slide Down (mobile menu) ── */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Bounce Subtle ── */
@keyframes bounceSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.bounce-subtle {
  animation: bounceSubtle 2s ease-in-out infinite;
}

/* ── Decorative Shape Animations ── */
.deco-rotate {
  animation: decoRotate 20s linear infinite;
}

@keyframes decoRotate {
  to { transform: rotate(360deg); }
}

.deco-float {
  animation: decoFloat 6s ease-in-out infinite;
}

@keyframes decoFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -10px) rotate(5deg); }
  66% { transform: translate(-5px, 5px) rotate(-3deg); }
}

/* ── Cart Add Animation ── */
@keyframes cartBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.cart-bounce {
  animation: cartBounce 0.5s ease;
}

/* ── Success Check ── */
@keyframes checkmark {
  0% { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .hero-animate {
    opacity: 1;
    transform: none;
  }

  .pop-in {
    opacity: 1;
    transform: none;
  }
}
