/* ==========================================================================
   NEXR Motion — sitewide premium interactions (v2.6.0).
   Layout, spacing, colors, typography untouched: this file only adds
   transform/opacity-level interaction states on top of the existing design.
   Everything is GPU-composited (transform/opacity), hover states are gated
   to real pointers, and prefers-reduced-motion turns the whole file off.
   ========================================================================== */

/* ---- Product cards: lift, shadow, image zoom, light reflection ---------- */
@media (hover: hover) and (pointer: fine) {
  .product-card {
    transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
    will-change: transform;
  }
  .product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-2);
  }
  .product-card__imgwrap img { transition: transform 1.2s var(--ease-out); }
  .product-card:hover .product-card__imgwrap img { transform: scale(1.05); }

  .cat-tile img, .lux-ig img { transition: transform 1.2s var(--ease-out); }
  .cat-tile:hover img { transform: scale(1.05); }
}

/* Mouse-follow light reflection (span injected by motion.js, pointer:fine) */
.nexr-card-light {
  position: absolute; inset: 0; z-index: 2;
  opacity: 0;
  transition: opacity .5s var(--ease-out);
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, .16), transparent 65%);
  mix-blend-mode: screen;
}
.product-card:hover .nexr-card-light { opacity: 1; }

/* ---- Buttons: sheen sweep + press scale ---------------------------------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-140%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.26), transparent);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover::after { transform: translateX(140%); transition: transform .9s var(--ease-out); }
}
.btn:active { transform: scale(.97); transition: transform .12s var(--ease-out); }

/* ---- Add-to-cart states: spinner → success check -------------------------- */
.btn.is-loading,
.single_add_to_cart_button.is-loading,
.add_to_cart_button.loading {
  color: transparent !important;
  pointer-events: none;
  opacity: 1;
}
.btn.is-loading::before,
.single_add_to_cart_button.is-loading::before,
.add_to_cart_button.loading::before {
  content: "";
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid currentColor;
  border-color: rgba(255,255,255,.35);
  border-block-start-color: #fff;
  border-radius: 50%;
  animation: nexr-spin .7s linear infinite;
}
.btn--ghost.is-loading::before {
  border-color: rgba(17,17,17,.25);
  border-block-start-color: var(--c-ink);
}
.btn.is-added,
.single_add_to_cart_button.is-added,
.add_to_cart_button.added-nexr {
  color: transparent !important;
}
.btn.is-added::before,
.single_add_to_cart_button.is-added::before,
.add_to_cart_button.added-nexr::before {
  content: "";
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  width: 14px; height: 8px;
  margin: -6px 0 0 -7px;
  border-inline-start: 2px solid #fff;
  border-block-end: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  animation: nexr-check .5s var(--ease-spring) forwards;
}
@keyframes nexr-spin { to { transform: rotate(360deg); } }
@keyframes nexr-check {
  from { transform: rotate(-45deg) scale(0); }
  to   { transform: rotate(-45deg) scale(1); }
}

/* Woo's native loop "View cart" link that appears after an archive add */
.added_to_cart { display: none; }

/* ---- Wishlist heart pop ---------------------------------------------------- */
.nexr-wishlist.is-active svg { animation: nexr-heart .45s var(--ease-spring); }
@keyframes nexr-heart {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ---- Cart count pop --------------------------------------------------------- */
.cart-count.pop { animation: nexr-pop .5s var(--ease-spring); }
@keyframes nexr-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ---- Cart drawer: staggered item entrance ----------------------------------- */
.cart-drawer.is-open .cart-drawer__item {
  animation: nexr-item-in .55s var(--ease-out) both;
}
.cart-drawer.is-open .cart-drawer__item:nth-child(1) { animation-delay: .10s; }
.cart-drawer.is-open .cart-drawer__item:nth-child(2) { animation-delay: .16s; }
.cart-drawer.is-open .cart-drawer__item:nth-child(3) { animation-delay: .22s; }
.cart-drawer.is-open .cart-drawer__item:nth-child(4) { animation-delay: .28s; }
.cart-drawer.is-open .cart-drawer__item:nth-child(n+5) { animation-delay: .34s; }
@keyframes nexr-item-in {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}
[dir="rtl"] .cart-drawer.is-open .cart-drawer__item { animation-name: nexr-item-in-rtl; }
@keyframes nexr-item-in-rtl {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Custom cursor ring (desktop pointer only; native cursor stays) --------- */
.nexr-cursor {
  position: fixed; inset-block-start: 0; inset-inline-start: 0;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2147483000;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .35s, width .3s var(--ease-out), height .3s var(--ease-out),
              margin .3s var(--ease-out);
  will-change: transform;
}
html.nexr-cursor-on .nexr-cursor { opacity: .85; }
.nexr-cursor.is-active { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.nexr-cursor.is-down  { width: 20px; height: 20px; margin: -10px 0 0 -10px; }

/* ---- Reduced motion: this entire layer switches off -------------------------- */
@media (prefers-reduced-motion: reduce) {
  .product-card, .product-card:hover,
  .product-card__imgwrap img, .cat-tile img, .lux-ig img,
  .btn, .btn::after, .btn:active { transition: none !important; transform: none !important; }
  .nexr-card-light, .nexr-cursor { display: none !important; }
  .cart-drawer.is-open .cart-drawer__item,
  .cart-count.pop, .nexr-wishlist.is-active svg { animation: none !important; }
}
