/* ═══════════════════════════════════════════════════════════
   LotokMarket — Store Page
   Layout: compact hero → product catalog → sticky buy bar
   ═══════════════════════════════════════════════════════════ */

/* Atmosphere comes from season.css. This is only the lifted fallback. */
body.storefront {
  background: #2c261e;
}

body.storefront::before { content: none; }

body.storefront .main-content {
  position: relative;
  z-index: 1;
}

body.storefront .navbar {
  height: 72px;
  background: rgba(42, 32, 22, 0.62);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

body.storefront .navbar.scrolled {
  background: rgba(38, 28, 20, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

body.storefront { --nav-h: 72px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: clamp(560px, 58vh, 680px);
  padding: 6.5rem 1.5rem 4.5rem;
  overflow: hidden;
}

.hero::before { content: none; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-full);
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-text-2);
  letter-spacing: 0.01em;
  text-transform: none;
  margin-bottom: 1.5rem;
  animation: heroIn 0.7s var(--ease-smooth) both;
}

.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 7px rgba(34,197,94,0.9);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

.hero-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-mark {
  display: block;
  width: min(920px, 100%);
  height: auto;
  aspect-ratio: 1400 / 360;
  margin: 0.15rem auto 0.15rem;
  background: transparent;
  border: 0;
  pointer-events: none;
  user-select: none;
}

.hero h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.25rem);
  font-weight: 560;
  color: #f7f7f8;
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin-bottom: 1.1rem;
  animation: heroIn 0.7s var(--ease-smooth) 0.06s both;
}

.hero h1 .hl {
  color: rgba(255, 255, 255, 0.72);
  background: none;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.72);
}

.hero-sub {
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.46);
  margin-bottom: 2rem;
  animation: heroIn 0.7s var(--ease-smooth) 0.12s both;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: heroIn 0.55s var(--ease-smooth) 0.21s both;
}

@keyframes heroIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body.storefront .main-content { animation: none; }

.hero-trust {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: heroIn 0.55s var(--ease-smooth) 0.28s both;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--c-text-4);
  font-weight: 500;
}
.hero-trust-item svg { width: 12px; height: 12px; color: var(--c-blue-l); opacity: 0.7; flex-shrink:0; }
.hero-trust-sep { width:1px; height:11px; background:rgba(91,140,255,0.18); }

/* ── Catalog wrapper ──────────────────────────────────────── */
.catalog {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 6.5rem;
  display: flex;
  flex-direction: column;
}

.catalog-section--nfa { order: 1; }
.catalog-section--mfa { order: 2; }
.catalog-section--special { order: 3; }

/* ── Catalog section (NFA / MFA / Special) ──────────────── */
.catalog-section {
  margin-bottom: 3rem;
}

.catalog-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4.25rem;
  min-height: 4.25rem;
  max-height: 4.25rem;
  margin-bottom: 1.35rem;
  padding-bottom: 0.85rem;
  border-bottom: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.catalog-section-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04) 42%, transparent 78%);
}

.catalog-section-icon { display: none; }
.catalog-section-icon svg { width: 20px; height: 20px; }

.catalog-section-header h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 560;
  color: #f4f4f6;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0;
  white-space: nowrap;
}
.catalog-section-header p {
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--c-text-4);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-count-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 9.5rem;
  height: 1.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-4);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-full);
  padding: 0 0.6rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Product grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

/* ── Product card ─────────────────────────────────────────── */
.product-card {
  background:
    linear-gradient(180deg, rgba(46, 49, 64, 0.94) 0%, rgba(34, 37, 50, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.22s var(--ease-smooth), transform 0.22s var(--ease-smooth), box-shadow 0.22s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 28px rgba(0,0,0,0.18);
}

.product-card:hover {
  border-color: rgba(91, 140, 255, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 18px 40px -18px rgba(59, 130, 246, 0.45);
}

.product-card.selected {
  border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.product-card.out-of-stock {
  opacity: 0.55;
  cursor: default;
}
.product-card.out-of-stock:hover { transform: none; box-shadow: none; }

.product-card.coming-soon { opacity: 0.42; cursor: default; }
.product-card.coming-soon:hover { transform: none; box-shadow: none; }

/* Product art — the "image" area */
.product-art {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: #242838;
}

/* Gradient backgrounds per type */
.product-art.art-default {
  background: linear-gradient(135deg, rgba(91,140,255,0.34) 0%, rgba(0,224,255,0.2) 100%);
}
.product-art.art-green {
  background: linear-gradient(135deg, rgba(34,197,94,0.36) 0%, rgba(74,222,128,0.2) 100%);
}
.product-art.art-aqua {
  background: linear-gradient(135deg, rgba(0,224,255,0.34) 0%, rgba(96,238,255,0.2) 100%);
}
.product-art.art-purple {
  background: linear-gradient(135deg, rgba(155,114,255,0.38) 0%, rgba(91,140,255,0.22) 100%);
}
.product-art.art-gold {
  background: linear-gradient(135deg, rgba(245,158,11,0.4) 0%, rgba(252,236,82,0.18) 100%);
}
.product-art.art-red {
  background: linear-gradient(135deg, rgba(239,68,68,0.32) 0%, rgba(249,115,22,0.18) 100%);
}
.product-art.art-mfa {
  background: linear-gradient(135deg, rgba(245,158,11,0.32) 0%, rgba(91,140,255,0.22) 100%);
}

/* Subtle grid pattern on art bg */
.product-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity: 0.8;
}

.product-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

.product-art:has(img)::before {
  display: none;
}

.product-art svg {
  width: 72px; height: 72px;
  position: absolute;
  z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

/* Selected checkmark on card */
.product-card.selected .product-art::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: var(--c-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  z-index: 2;
  font-weight: 700;
}

/* Product body */
.product-body {
  box-sizing: border-box;
  height: 208px;
  min-height: 208px;
  max-height: 208px;
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 0 0 208px;
  overflow: hidden;
}

.product-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 560;
  color: #f4f4f6;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.3;
  height: 2.6em;
  min-height: 2.6em;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Tag pills */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.25rem;
  height: 3.05rem;
  min-height: 3.05rem;
  max-height: 3.05rem;
  overflow: hidden;
}

.ptag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: var(--r-xs);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.ptag-default  { background: rgba(91,140,255,0.12); color: var(--c-blue-l); }
.ptag-mfa      { background: rgba(245,158,11,0.14); color: #FCD34D; }
.ptag-nfa      { background: rgba(91,140,255,0.14); color: var(--c-blue-l); }
.ptag-ok       { background: rgba(34,197,94,0.12); color: #4ADE80; }
.ptag-banned   { background: rgba(239,68,68,0.12); color: #FCA5A5; }
.ptag-vip      { background: rgba(34,197,94,0.12); color: #4ADE80; }
.ptag-mvp      { background: rgba(0,224,255,0.12); color: var(--c-cyan); }
.ptag-mvpp     { background: rgba(155,114,255,0.12); color: var(--c-purple); }
.ptag-neutral  { background: rgba(255,255,255,0.06); color: var(--c-text-3); }

/* Price + stock row */
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(91,140,255,0.08);
}

.product-price-area {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.product-price-label {
  font-size: 0.7rem;
  color: var(--c-text-4);
}

.product-price {
  display: inline-block;
  min-width: 6.6rem;
  white-space: nowrap;
  font-family: 'Space Grotesk', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #f7f7f8;
  background: none;
  -webkit-text-fill-color: #f7f7f8;
  letter-spacing: -0.03em;
}

.product-stock-line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.15rem;
  min-height: 1.15rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  color: var(--c-text-4);
}

.pstock-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 5px rgba(34,197,94,0.7);
  flex-shrink: 0;
}
.pstock-dot.empty { background: var(--c-error); box-shadow: 0 0 5px rgba(239,68,68,0.7); }
.pstock-dot.loading { background: var(--c-text-4); box-shadow: none; animation: stockPulse 1.2s ease-in-out infinite; }
@keyframes stockPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.product-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  background: rgba(91,140,255,0.12);
  border: 1px solid rgba(91,140,255,0.25);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-blue-l);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.product-buy:hover {
  background: rgba(91,140,255,0.22);
  border-color: rgba(91,140,255,0.5);
  color: white;
}

.product-card.selected .product-buy {
  background: var(--g-brand);
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 12px rgba(91,140,255,0.4);
}

.product-card.out-of-stock .product-buy {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Sticky Purchase Bar ──────────────────────────────────── */
#purchaseWidget {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 800;
  background: rgba(32, 34, 46, 0.96);
  border-top: 1px solid rgba(91,140,255,0.25);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6), 0 -1px 0 rgba(91,140,255,0.1);
  animation: slideUpBar 0.3s var(--ease-smooth);
}

@keyframes slideUpBar {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.purchase-panel-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Selected product info */
.bar-product {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.bar-product-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-product-sub {
  font-size: 0.75rem;
  color: var(--c-text-4);
}

/* Stock in bar */
.bar-stock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.bar-label { font-size: 0.68rem; color: var(--c-text-4); text-transform: uppercase; letter-spacing: 0.5px; }
.bar-stock-val {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--c-text);
}

/* Qty in bar */
.bar-qty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.qty-control {
  display: flex;
  align-items: center;
  background: rgba(8, 12, 28, 0.8);
  border: 1px solid rgba(91,140,255,0.2);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.qty-btn {
  width: 32px; height: 36px;
  background: rgba(91,140,255,0.07);
  border: none;
  color: var(--c-text-2);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qty-btn:hover { background: rgba(91,140,255,0.16); color: var(--c-text); }

.qty-display {
  min-width: 36px;
  text-align: center;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--c-text);
  padding: 0 4px;
}

/* Hidden quantity input for JS compat */
#quantity {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Total price in bar */
.bar-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.bar-total-val {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--g-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* per-unit hidden span for JS to update totalAmount */
#totalAmount { display: none; }
#stockCount  { display: none; }
#stockBar    { display: none; }
#pricePerUnit { display: none; }

/* Purchase button in bar */
.purchase-btn {
  padding: 0.75rem 1.75rem;
  background: var(--g-brand);
  border: none;
  border-radius: var(--r-md);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 4px 20px rgba(91,140,255,0.4);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.1px;
  flex-shrink: 0;
}
.purchase-btn:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(91,140,255,0.6);
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.purchase-btn:active { transform: scale(0.97); }
.purchase-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.purchase-btn svg { width: 17px; height: 17px; }

/* Bar close button */
.bar-close {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  cursor: pointer;
  color: var(--c-text-4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}
.bar-close:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #EF4444; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 700px) {
  .hero { min-height: 0; padding: 4.25rem 1.1rem 2.75rem; }
  .hero h1 { font-size: 2.35rem; }
  .hero-trust { gap: 0.7rem; }
  .hero-trust-sep { display: none; }

  .purchase-panel-inner { gap: 0.75rem; padding: 0.625rem 1rem; }
  .bar-product { display: none; }
  .bar-stock { display: none; }
  .purchase-btn { padding: 0.7rem 1.25rem; font-size: 0.9rem; }
}

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