/* ==========================================================================
   BTS SHOP — Progressive Enhancements (animations, motion, polish)
   Additive layer. Does NOT modify existing styles/logic. Respects
   prefers-reduced-motion. Preserves the Weverse-inspired clean aesthetic.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. REDUCED MOTION — disable all decorative animation for those who ask
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   2. PRODUCT CARD ENTRANCE (subtle, staggered)
   -------------------------------------------------------------------------- */
@keyframes btsCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

#products-grid .wv-product-card {
  animation: btsCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#products-grid .wv-product-card:nth-child(1) { animation-delay: 0.02s; }
#products-grid .wv-product-card:nth-child(2) { animation-delay: 0.05s; }
#products-grid .wv-product-card:nth-child(3) { animation-delay: 0.08s; }
#products-grid .wv-product-card:nth-child(4) { animation-delay: 0.11s; }
#products-grid .wv-product-card:nth-child(5) { animation-delay: 0.14s; }
#products-grid .wv-product-card:nth-child(6) { animation-delay: 0.17s; }
#products-grid .wv-product-card:nth-child(7) { animation-delay: 0.20s; }
#products-grid .wv-product-card:nth-child(8) { animation-delay: 0.23s; }
#products-grid .wv-product-card:nth-child(9) { animation-delay: 0.26s; }
#products-grid .wv-product-card:nth-child(10) { animation-delay: 0.29s; }

/* --------------------------------------------------------------------------
   3. PRODUCT CARD HOVER — lift + soft shadow + image zoom
   -------------------------------------------------------------------------- */
#products-grid .wv-product-card {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease;
  will-change: transform;
}
#products-grid .wv-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
  z-index: 2;
}
#products-grid .wv-product-card .wv-card-img,
#products-grid .wv-product-card img {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
#products-grid .wv-product-card:hover .wv-card-img,
#products-grid .wv-product-card:hover img {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   4. BUTTON MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
.hero-btn-primary, .hero-btn-secondary, .btn-weverse, .btn-checkout,
.btn-continue, .btn-header-signup, .header-link-btn, .btn-pay-now,
.btn-gate-login, .btn-auth-pill {
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.hero-btn-primary:active, .hero-btn-secondary:active, .btn-weverse:active,
.btn-checkout:active, .btn-continue:active, .btn-header-signup:active,
.btn-pay-now:active, .btn-gate-login:active, .btn-auth-pill:active {
  transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   5. TOAST — slide-in + fade
   -------------------------------------------------------------------------- */
@keyframes btsToastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#toast-container .toast,
.toast-container .toast {
  animation: btsToastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --------------------------------------------------------------------------
   6. CART BADGE POP (class added by JS on change)
   -------------------------------------------------------------------------- */
@keyframes btsBadgePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.cart-pill-count.badge-pop {
  animation: btsBadgePop 0.35s ease;
}

/* --------------------------------------------------------------------------
   7. HERO — gentle floating visual (ambient motion)
   -------------------------------------------------------------------------- */
@keyframes btsHeroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.bts-hero-showcase .hero-visual {
  animation: btsHeroFloat 6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   8. SCROLL REVEAL (class added by JS)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   9. SKELETON LOADING (class added by JS while products load)
   -------------------------------------------------------------------------- */
@keyframes btsShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.skeleton-card {
  height: 300px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
  background-size: 800px 100%;
  animation: btsShimmer 1.4s infinite linear;
}

/* --------------------------------------------------------------------------
   10. BACK-TO-TOP BUTTON
   -------------------------------------------------------------------------- */
#bts-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #7952de;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(121, 82, 222, 0.35);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#bts-back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#bts-back-to-top:active {
  transform: scale(0.94);
}

/* --------------------------------------------------------------------------
   11. SMOOTH SCROLL
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}
