/* LOWIZ STORE — Motion System v1
   CSS-first, low-cost motion. Functional states never depend on animation. */
:root {
  --lw-motion-fast: 150ms;
  --lw-motion-base: 220ms;
  --lw-motion-slow: 420ms;
  --lw-motion-ease: cubic-bezier(.2,.75,.25,1);
}
html { scroll-behavior: smooth; }
body { isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -18% -12%;
  pointer-events: none;
  opacity: .26;
  background:
    radial-gradient(42rem 30rem at 12% 14%, rgba(113,72,220,.13), transparent 70%),
    radial-gradient(36rem 28rem at 88% 24%, rgba(44,115,224,.12), transparent 72%),
    radial-gradient(32rem 24rem at 54% 92%, rgba(105,63,191,.08), transparent 70%);
  transform: translate3d(0,0,0);
  animation: lwAmbientDrift 24s ease-in-out infinite alternate;
}
@keyframes lwAmbientDrift {
  from { transform: translate3d(-.6%, -.3%, 0) scale(1); }
  to { transform: translate3d(.6%, .4%, 0) scale(1.025); }
}
/* Hero reveals in a short sequence; no layout shifts. */
#home .hero-copy > *,
#home .hero-books > * { animation: lwHeroEnter 560ms var(--lw-motion-ease) both; }
#home .hero-copy > *:nth-child(1) { animation-delay: 40ms; }
#home .hero-copy > *:nth-child(2) { animation-delay: 100ms; }
#home .hero-copy > *:nth-child(3) { animation-delay: 160ms; }
#home .hero-copy > *:nth-child(4) { animation-delay: 220ms; }
#home .hero-copy > *:nth-child(5) { animation-delay: 280ms; }
#home .hero-books > *:nth-child(1) { animation-delay: 140ms; }
#home .hero-books > *:nth-child(2) { animation-delay: 230ms; }
@keyframes lwHeroEnter {
  from { opacity: 0; transform: translate3d(0,10px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}
#home h1 span,
.hero-copy h1 span {
  background: linear-gradient(105deg,#f6f4ff 5%,#bba6ff 42%,#83c7ff 82%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lwTitleSheen 8s ease-in-out infinite alternate;
}
@keyframes lwTitleSheen { to { background-position: 100% 0; } }
/* Reusable scroll reveal: JS only adds the class when IntersectionObserver is supported. */
.reveal.lw-motion-ready:not(.lw-in-view) {
  opacity: 0;
  transform: translate3d(0,12px,0);
}
.reveal.lw-in-view {
  opacity: 1;
  transform: translate3d(0,0,0);
  transition: opacity 380ms var(--lw-motion-ease), transform 380ms var(--lw-motion-ease);
}
.lw-stagger-ready > .lw-stagger-item { opacity: 0; transform: translate3d(0,9px,0); }
.lw-stagger-ready.lw-in-view > .lw-stagger-item {
  opacity: 1; transform: translate3d(0,0,0);
  transition: opacity 300ms var(--lw-motion-ease), transform 300ms var(--lw-motion-ease);
}
.lw-stagger-ready.lw-in-view > .lw-stagger-item:nth-child(4n+2) { transition-delay: 45ms; }
.lw-stagger-ready.lw-in-view > .lw-stagger-item:nth-child(4n+3) { transition-delay: 85ms; }
.lw-stagger-ready.lw-in-view > .lw-stagger-item:nth-child(4n+4) { transition-delay: 125ms; }
/* Cards use only transform, border-color and restrained shadow changes. */
html body .product-card,
html body #lowizHomeCategories .lhc-card,
html body #lowizHomeCategories a,
html body .lowiz-drop-card,
html body .lowiz-mosaic-main,
html body .lowiz-mosaic-card {
  transition: transform 190ms var(--lw-motion-ease), border-color 190ms ease, box-shadow 190ms ease;
  backface-visibility: hidden;
}
html body .product-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(164,174,196,.15);
}
html body .product-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 180ms ease, opacity 180ms ease;
  opacity: .7;
}
html body .product-card .product-cover img,
html body .product-card .product-cover > img,
html body .product-card img.product-image {
  transition: transform 280ms var(--lw-motion-ease);
}
@media (hover:hover) and (pointer:fine) {
  html body .product-card:hover {
    transform: translate3d(0,-3px,0);
    border-color: rgba(139,92,246,.52);
    box-shadow: 0 12px 28px rgba(4,6,14,.24), 0 0 0 1px rgba(59,130,246,.08);
  }
  html body .product-card:hover::before { border-color: rgba(139,92,246,.22); }
  html body .product-card:hover .product-cover img,
  html body .product-card:hover img.product-image { transform: scale(1.025); }
  html body button:hover,
  html body .button:hover,
  html body [role="button"]:hover { filter: brightness(1.06); }
}
html body .product-card:active,
html body button:active,
html body .button:active,
html body .filter-button:active,
html body #lowizMobileDock button:active {
  transform: scale(.985);
  transition-duration: 90ms;
}
html body .product-card .buy-button,
html body .product-card .card-btn-primary,
html body .balance-topup,
html body .wallet-topup-button,
html body .purchase-choice-option {
  transition: transform 150ms var(--lw-motion-ease), filter 150ms ease, box-shadow 180ms ease;
}
html body .product-card .buy-button:hover,
html body .product-card .card-btn-primary:hover,
html body .balance-topup:hover,
html body .wallet-topup-button:hover {
  box-shadow: 0 7px 22px rgba(110,80,235,.28);
}
html body .wishlist-button.is-favorite { animation: lwHeartPop 240ms var(--lw-motion-ease); }
@keyframes lwHeartPop {
  0% { transform: scale(.82); }
  65% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
html body .cart-badge.lw-cart-bump,
html body .dock-cart-badge.lw-cart-bump { animation: lwCartBump 320ms var(--lw-motion-ease); }
@keyframes lwCartBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
/* Search and form focus states. */
html body .search-input-wrap,
html body .search-modal input,
html body input[type="search"],
html body input[type="text"],
html body input[type="email"],
html body input[type="password"] {
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
html body .search-input-wrap:focus-within,
html body .search-modal input:focus,
html body input:focus-visible {
  border-color: rgba(139,92,246,.7);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}
/* Dialog and drawer motion: no delayed display or interaction blocking. */
html body .search-overlay,
html body .product-overlay,
html body .auth-overlay,
html body .tiktok-order-overlay,
html body .purchase-choice-overlay,
html body .wallet-overlay,
html body .overlay {
  animation: lwOverlayIn 180ms ease both;
}
html body .search-modal,
html body .product-modal,
html body .auth-modal,
html body .tiktok-order-modal,
html body .purchase-choice-modal,
html body .wallet-modal,
html body .cart-drawer {
  animation: lwPanelIn 230ms var(--lw-motion-ease) both;
}
@keyframes lwOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lwPanelIn { from { opacity: 0; transform: translate3d(0,7px,0) scale(.99); } to { opacity: 1; transform: translate3d(0,0,0) scale(1); } }
/* Search focus, nav active and toast feedback. */
html body #lowizMobileDock button,
html body .desktop-nav a,
html body .filter-button,
html body .icon-button,
html body .close-button {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms var(--lw-motion-ease);
}
html body #lowizMobileDock button.is-active,
html body #lowizMobileDock button[aria-current="page"] {
  animation: lwNavSettle 220ms var(--lw-motion-ease);
}
@keyframes lwNavSettle { from { transform: translateY(2px); } to { transform: translateY(0); } }
.lw-motion-toast {
  position: fixed; z-index: 7000; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom,0px));
  max-width: min(360px,calc(100vw - 32px)); padding: 12px 15px;
  border: 1px solid rgba(139,92,246,.34); border-radius: 13px;
  color: #f5f7ff; background: rgba(16,22,38,.96);
  box-shadow: 0 12px 36px rgba(0,0,0,.28); font: 650 13px/1.4 system-ui,sans-serif;
  opacity: 0; transform: translate3d(0,8px,0); pointer-events: none;
  transition: opacity 180ms ease, transform 180ms var(--lw-motion-ease);
}
.lw-motion-toast.is-visible { opacity: 1; transform: translate3d(0,0,0); }
@media (min-width:761px) { .lw-motion-toast { bottom: 22px; } }
/* Back-to-top is created only when the page is long enough and stays unobtrusive. */
#lwBackToTop {
  position: fixed; z-index: 1100; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom,0px));
  width: 42px; height: 42px; border: 1px solid rgba(139,92,246,.4); border-radius: 13px;
  color: #fff; background: rgba(16,22,38,.94); box-shadow: 0 8px 22px rgba(0,0,0,.22);
  opacity: 0; visibility: hidden; transform: translate3d(0,7px,0);
  transition: opacity 180ms ease, transform 180ms var(--lw-motion-ease), visibility 180ms;
}
#lwBackToTop.is-visible { opacity: 1; visibility: visible; transform: translate3d(0,0,0); }
@media (min-width:761px) { #lwBackToTop { bottom: 22px; } }
@media (max-width:390px) { #lwBackToTop { right: 10px; bottom: calc(78px + env(safe-area-inset-bottom,0px)); } }
/* Mobile gets shorter, quieter motion; touch never requires hover. */
@media (max-width:760px) {
  body::before { opacity: .18; animation-duration: 32s; }
  #home .hero-copy > *,
  #home .hero-books > * { animation-duration: 420ms; }
  html body .product-card { transition-duration: 140ms; }
  html body .product-card:hover { transform: none; }
  html body .product-card:active { transform: scale(.99); }
  .lw-motion-toast { left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom,0px)); max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  body::before { animation: none !important; }
  .reveal.lw-motion-ready:not(.lw-in-view),
  .lw-stagger-ready > .lw-stagger-item { opacity: 1 !important; transform: none !important; }
}

/* Dynamic catalog cards: only animate when they first enter the viewport. */
html body .product-card.lw-motion-ready:not(.lw-in-view) {
  opacity: 0;
  transform: translate3d(0,10px,0);
}
html body .product-card.lw-in-view { opacity: 1; transform: translate3d(0,0,0); }
html body .product-card.lw-in-view { transition: opacity 300ms var(--lw-motion-ease), transform 190ms var(--lw-motion-ease), border-color 190ms ease, box-shadow 190ms ease; }
@media (prefers-reduced-motion: reduce) {
  html body .product-card.lw-motion-ready:not(.lw-in-view) { opacity: 1 !important; transform: none !important; }
}

/* Preserve hover/press feedback after a catalog card has revealed. */
@media (hover:hover) and (pointer:fine) {
  html body .product-card.lw-in-view:hover { transform: translate3d(0,-3px,0); }
}
html body .product-card.lw-in-view:active { transform: scale(.985); }
