/* ============================================================
   XEROUR — DIGITAL PRODUCTS STORE
============================================================ */

/* Reveal-on-scroll (lightweight — no GSAP on this page).
   Safe-by-default: content is visible unless JS confirms it's running
   and actively managing the reveal — so if store.js ever fails to load,
   the page still shows everything instead of staying blank. */
[data-reveal]{
  opacity: 1;
  transform: none;
}
body.js-reveal-ready [data-reveal]{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
body.js-reveal-ready [data-reveal].is-visible{ opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  [data-reveal]{ opacity:1 !important; transform:none !important; transition:none !important; }
}

/* ---------------- Lightweight store hero (pure CSS, no WebGL) ---------------- */
.store-hero{
  position: relative;
  min-height: 58vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: calc(var(--nav-h) + 40px) 32px 60px;
  overflow:hidden;
  text-align:center;
}
.store-hero__grid{
  position:absolute; inset: -10%;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 40%, #000 30%, transparent 75%);
  z-index: 0;
}
.store-hero__glow{
  position:absolute;
  top: 10%; left:50%; transform: translateX(-50%);
  width: 60vw; max-width: 700px; height: 60vw; max-height: 700px;
  background: radial-gradient(circle, rgba(124,92,255,0.35), transparent 70%);
  filter: blur(40px);
  animation: storyGlowPulse 6s ease-in-out infinite;
  z-index: 0;
}
@keyframes storyGlowPulse{
  0%, 100%{ opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%{ opacity: 0.9; transform: translateX(-50%) scale(1.08); }
}
@media (prefers-reduced-motion: reduce){
  .store-hero__glow{ animation:none; }
}
.store-hero__content{
  position:relative; z-index:1;
  max-width: 720px;
}
.store-hero__heading{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.store-hero__heading .line{ display:block; }
.store-hero__heading .line--accent{
  background: linear-gradient(90deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.trust-badges{
  display:flex; flex-wrap:wrap; justify-content:center; gap:12px;
  margin-top: 30px;
}
.trust-badge{
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ---------------- Category filters ---------------- */
.store-filters{
  display:flex; flex-wrap:wrap; gap:10px;
  margin-bottom: 32px;
}
.store-filter{
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight:600;
  cursor:pointer;
  transition: all .2s ease;
}
.store-filter.is-active, .store-filter:hover{
  border-color: var(--accent);
  color: var(--text);
  background: rgba(124,92,255,0.12);
}

/* ---------------- Product grid ---------------- */
.store-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}

.store-card{
  display:flex;
  flex-direction:column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow:hidden;
  transition: transform .3s ease, border-color .3s ease;
}
.store-card:hover{ transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 20px 50px rgba(124,92,255,0.15); }

/* Fixed aspect-ratio media box — every image is cropped to fit,
   never stretches, never grows the card, never breaks the grid. */
.store-card__media{
  position:relative;
  width:100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(11,16,23,0.7));
  overflow:hidden;
  flex-shrink:0;
}
.store-card__media img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  object-position: center;
  display:block;
}
.store-card__media .store-card__fallback{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display);
  font-weight:800;
  font-size: 2.4rem;
  color: rgba(255,255,255,0.5);
}
.store-card__category{
  position:absolute;
  top:12px; left:12px;
  background: rgba(5,7,11,0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.store-card__body{
  display:flex;
  flex-direction:column;
  gap: 8px;
  padding: 20px 22px 22px;
  flex:1;
}
.store-card__body h3{
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight:700;
}
.store-card__seller{
  color: var(--text-soft) !important;
  font-size: 0.76rem !important;
  margin: 4px 0 2px !important;
  flex: none !important;
}
.store-card__body p{
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height:1.5;
  flex:1;
}

.store-card__price{
  display:flex;
  align-items:baseline;
  gap: 8px;
  margin-top: 4px;
}
.store-card__price .price-now{
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight:800;
  color: var(--text);
}
.store-card__price .price-was{
  font-size: 0.85rem;
  color: var(--text-soft);
  text-decoration: line-through;
}
.store-card__price .price-free{
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight:800;
  color: #5CFFB0;
}

.store-card__buy{
  flex:1;
  justify-content:center;
}
.store-card__actions{
  display:flex;
  gap: 10px;
  margin-top: 14px;
}
.store-card__demo{
  justify-content:center;
  white-space: nowrap;
}

.store-empty{
  color: var(--text-soft);
  text-align:center;
  padding: 60px 20px;
}

/* ---------------- Buy modal: multi-step ---------------- */
.buy-step{ display:none; flex-direction:column; gap:12px; }
.buy-step.is-active{ display:flex; }
.buy-step h3{ font-family: var(--font-display); font-size:1.2rem; margin-bottom:6px; }

.delivery-options{ display:flex; flex-direction:column; gap:12px; }
.delivery-option{
  display:flex; align-items:flex-start; gap:12px;
  border:1px solid var(--border); border-radius:14px; padding:16px 18px;
  cursor:pointer; transition: border-color .2s ease, background .2s ease;
}
.delivery-option:has(input:checked){ border-color: var(--accent); background: rgba(124,92,255,0.1); }
.delivery-option input{ margin-top:4px; accent-color: var(--accent); }
.delivery-option div{ display:flex; flex-direction:column; gap:4px; }
.delivery-option strong{ font-size:0.98rem; }
.delivery-option span{ font-size:0.85rem; color: var(--text-soft); }
.delivery-option__price{ font-family: var(--font-display); font-weight:700; color: var(--text) !important; font-size:1rem !important; margin-top:2px; }

.price-summary{
  background: var(--bg2); border:1px solid var(--border); border-radius:12px;
  padding: 16px 18px; display:flex; flex-direction:column; gap:8px;
}
.price-summary > div{ display:flex; justify-content:space-between; font-size:0.88rem; color:var(--text-soft); }
.price-summary__total{
  border-top:1px solid var(--border); margin-top:6px; padding-top:10px;
  font-weight:700; color:var(--text) !important; font-size:1rem !important;
}
.price-summary__total span{ color:var(--text) !important; }

.payment-options{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.payment-option{
  display:flex; flex-direction:column; align-items:flex-start; gap:4px;
  border:1px solid var(--border); border-radius:14px; padding:18px;
  background: var(--card); cursor:pointer; transition: border-color .2s ease, transform .2s ease;
}
.payment-option:hover{ border-color: var(--accent); transform: translateY(-2px); }
.payment-option__label{ font-family: var(--font-display); font-weight:700; font-size:1rem; }
.payment-option__note{ font-size:0.78rem; color: var(--text-soft); }

.buy-step--success{ align-items:center; text-align:center; padding: 20px 0; }
.buy-step--success p{ color: var(--text-soft); font-size:0.92rem; line-height:1.6; max-width:340px; }

/* ---------------- Buy / checkout modal ---------------- */
.buy-modal__product{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}
.buy-modal__product img{
  width:56px; height:44px; object-fit:cover; border-radius:8px; flex-shrink:0;
}
.buy-modal__product .no-thumb{
  width:56px; height:44px; border-radius:8px; flex-shrink:0;
  background: rgba(124,92,255,0.2);
}
.buy-modal__product div strong{ display:block; font-size:0.95rem; }
.buy-modal__product div span{ color: var(--text-soft); font-size:0.85rem; }

@media (max-width: 560px){
  .store-grid{ grid-template-columns: 1fr; }
}

.price-gst{ font-size:0.72rem; color: var(--text-soft); margin-left:2px; }
