/* ==========================================================================
   animations.css — The Fashion Plug
   Keyframes, scroll-reveal helpers and micro-interactions.
   Only transform + opacity are animated (GPU friendly).
   ========================================================================== */

@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fadeInLeft  { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn     { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer     { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes goldPulse   { 0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,.45); } 50% { box-shadow: 0 0 22px 4px rgba(212,175,55,.35); } }
@keyframes heartPop    { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes badgePop    { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes marquee     { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes slideInRight{ from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInUp   { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ripple      { from { transform: scale(0); opacity: .6; } to { transform: scale(3); opacity: 0; } }
@keyframes float       { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes dotPulse    { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .6; } }
@keyframes scrollBounce{ 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* Utility classes */
.animate-fadeIn      { animation: fadeIn .6s ease both; }
.animate-fadeInUp    { animation: fadeInUp .7s ease both; }
.animate-fadeInLeft  { animation: fadeInLeft .7s ease both; }
.animate-fadeInRight { animation: fadeInRight .7s ease both; }
.animate-scaleIn     { animation: scaleIn .5s ease both; }
.animate-float       { animation: float 4s ease-in-out infinite; }
.delay-100 { animation-delay: .1s; } .delay-200 { animation-delay: .2s; } .delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; } .delay-500 { animation-delay: .5s; }
.duration-fast { animation-duration: .2s; } .duration-normal { animation-duration: .4s; } .duration-slow { animation-duration: .8s; }
.transition-fast { transition: all .15s ease; } .transition-normal { transition: all .3s ease; } .transition-slow { transition: all .5s ease; }

/* Scroll reveal (toggled by IntersectionObserver in main.js) */
.reveal       { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s ease; }
.reveal-left  { opacity: 0; transform: translateX(-40px); transition: opacity .7s ease, transform .7s ease; }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible, .reveal-left.visible, .reveal-right.visible { opacity: 1; transform: none; }

.stagger-children > * { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s ease; }
.stagger-children.visible > * { opacity: 1; transform: none; }
.stagger-children.visible > *:nth-child(1) { transition-delay: .05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: .13s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: .21s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: .29s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: .37s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: .45s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: .53s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: .61s; }
/* children that also carry .reveal inside a stagger parent must not double-hide */
.stagger-children > .reveal { opacity: 1; transform: none; }
.stagger-children > .product-card.reveal, .stagger-children > .category-card.reveal { opacity: 0; transform: translateY(30px); }
.stagger-children.visible > .product-card.reveal, .stagger-children.visible > .category-card.reveal { opacity: 1; transform: none; }

/* Gold shimmer text */
.shimmer-text {
  background: linear-gradient(90deg, #9A7B2F 0%, #F5C518 40%, #D4AF37 60%, #9A7B2F 100%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: shimmer 3.5s linear infinite;
}

/* Hover micro-interactions */
.hover-lift { transition: transform .3s ease, box-shadow .3s ease; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.hover-scale { transition: transform .3s ease; } .hover-scale:hover { transform: scale(1.02); }
.hover-glow { transition: box-shadow .3s ease; } .hover-glow:hover { box-shadow: 0 0 24px rgba(212,175,55,.35); }

.skeleton { background: linear-gradient(90deg,#1a1a1a 25%,#2a2a1a 50%,#1a1a1a 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }

/* Interaction details */
.hero-scroll-arrow { animation: scrollBounce 1.8s ease-in-out infinite; }
.cart-badge.bump { animation: badgePop .4s ease; }
.wishlist-btn.active svg, .product-wishlist.active svg { animation: heartPop .4s ease; fill: var(--color-crimson); stroke: var(--color-crimson); }
.avail-badge.available::before, .avail-dot { animation: dotPulse 1.8s ease-in-out infinite; }
.btn { position: relative; overflow: hidden; }
.btn .ripple, .ripple-effect { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none; animation: ripple .6s ease-out forwards; }
.btn-primary:hover { animation: goldPulse 1.6s infinite; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ''; width: 16px; height: 16px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; }

body { opacity: 0; transition: opacity .5s ease; }
body.page-loaded { opacity: 1; }
html.no-js body, body.no-js-fallback { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-left, .reveal-right, .stagger-children > * { opacity: 1 !important; transform: none !important; }
  body { opacity: 1; }
}
