/* ========================================
   Animations — Scroll & Hover
   ======================================== */

/* ---------- Page Load ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: fadeIn 0.5s ease-out;
}

/* ---------- Scroll Reveal ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--easing),
              transform var(--duration-slow) var(--easing);
}

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

/* Stagger delay for grid children */
.animate-on-scroll[data-delay="1"] { transition-delay: 0.1s; }
.animate-on-scroll[data-delay="2"] { transition-delay: 0.2s; }
.animate-on-scroll[data-delay="3"] { transition-delay: 0.3s; }
.animate-on-scroll[data-delay="4"] { transition-delay: 0.4s; }

/* ---------- Slide Variants ---------- */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slow) var(--easing),
              transform var(--duration-slow) var(--easing);
}

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

.animate-slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slow) var(--easing),
              transform var(--duration-slow) var(--easing);
}

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

/* ---------- Scale In ---------- */
.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--duration-slow) var(--easing),
              transform var(--duration-slow) var(--easing);
}

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

/* ---------- Hero Animations ---------- */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ornamentExpand {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes diamondSpin {
  from {
    opacity: 0;
    transform: rotate(0deg);
  }
  to {
    opacity: 1;
    transform: rotate(45deg);
  }
}

.hero__ornament {
  animation: ornamentExpand 0.8s ease-out 0.2s both;
}

.hero__ornament-diamond {
  animation: diamondSpin 0.6s ease-out 0.5s both;
}

.hero__label {
  animation: heroFadeUp 0.8s ease-out 0.2s both;
}

.hero__title {
  animation: heroFadeUp 0.8s ease-out 0.4s both;
}

.hero__divider {
  animation: ornamentExpand 0.6s ease-out 0.6s both;
}

.hero__subtitle {
  animation: heroFadeUp 0.8s ease-out 0.6s both;
}

.hero__tags {
  animation: heroFadeUp 0.8s ease-out 0.8s both;
}

.hero__cta {
  animation: heroFadeUp 0.8s ease-out 1s both;
}

/* ---------- Floating blob animation ---------- */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

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

/* ---------- Pulse for badges ---------- */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ---------- Gold shimmer for dividers ---------- */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.divider-gold {
  background: linear-gradient(
    90deg,
    var(--clr-gold) 0%,
    var(--clr-gold-light) 50%,
    var(--clr-gold) 100%
  );
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
}

/* ---------- 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-out;
}

/* ---------- Toast notification ---------- */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100%) translateX(-50%);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
  }
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
  }
  to {
    opacity: 0;
    transform: translateY(100%) translateX(-50%);
  }
}

/* Toast styles */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--sp-md));
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-text);
  color: white;
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  z-index: var(--z-toast);
  animation: slideInUp 0.3s ease-out;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast--hiding {
  animation: slideOutDown 0.3s ease-in forwards;
}

@media (min-width: 768px) {
  .toast {
    bottom: var(--sp-2xl);
  }
}
