@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg: #101114;
  --panel: #1b1d22;
  --panel-hover: #23262d;
  --border: #2b2e35;
  --text: #edeae3;
  --text-dim: #9a9ca3;
  --foil-a: #37e6c4;
  --foil-b: #8b6bff;
  --gold: #d8b45c;
  --danger: #e0554f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .display {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(16, 17, 20, 0.92);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(100deg, var(--foil-a), var(--foil-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.15s;
}
.main-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-form input {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.88rem;
  width: 180px;
}

.cart-link {
  position: relative;
  font-size: 0.92rem;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-badge {
  background: linear-gradient(100deg, var(--foil-a), var(--foil-b));
  color: #0a0a0c;
  font-weight: 700;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}

/* ---------- Hero (signature element: fanned card stack) ---------- */
.hero {
  padding: 72px 0 56px;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-copy { flex: 1 1 380px; }
.hero-copy h1 { font-size: 2.5rem; line-height: 1.08; }
.hero-copy p { color: var(--text-dim); max-width: 460px; margin-bottom: 24px; }

.hero-stack {
  position: relative;
  width: 260px;
  height: 200px;
  flex: 0 0 auto;
}

.hero-card {
  position: absolute;
  width: 150px;
  height: 210px;
  border-radius: 14px;
  top: 0;
  left: 55px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.35s ease;
}
.hero-card:nth-child(1) {
  background: linear-gradient(160deg, #2b2e35, #1b1d22);
  transform: rotate(-14deg) translateX(-70px);
}
.hero-card:nth-child(2) {
  background: linear-gradient(160deg, var(--foil-a), var(--foil-b));
  transform: rotate(-2deg) translateY(-10px);
}
.hero-card:nth-child(3) {
  background: linear-gradient(160deg, var(--gold), #8a6b2c);
  transform: rotate(12deg) translateX(70px);
}
.hero-stack:hover .hero-card:nth-child(1) { transform: rotate(-22deg) translateX(-95px) translateY(-6px); }
.hero-stack:hover .hero-card:nth-child(2) { transform: rotate(0deg) translateY(-24px); }
.hero-stack:hover .hero-card:nth-child(3) { transform: rotate(20deg) translateX(95px) translateY(-6px); }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(100deg, var(--foil-a), var(--foil-b));
  color: #0a0a0c;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-block { width: 100%; text-align: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Section headers ---------- */
.section { padding: 40px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 1.3rem; }
.section-head a { font-size: 0.85rem; color: var(--foil-a); }

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: transparent;
  background-image: linear-gradient(var(--panel), var(--panel)), linear-gradient(120deg, var(--foil-a), var(--foil-b));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transform: translateY(-3px);
}

.card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0c0d10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image .placeholder { color: var(--text-dim); font-size: 0.75rem; }

.card-body { padding: 12px 14px 16px; }
.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 8px; }
.card-price { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--gold); }
.card-oos { color: var(--danger); font-size: 0.72rem; font-weight: 600; }

.rarity-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold);
  margin-bottom: 6px;
}

/* ---------- Category chips ---------- */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.chip.active {
  border-color: transparent;
  background: linear-gradient(100deg, var(--foil-a), var(--foil-b));
  color: #0a0a0c;
  font-weight: 600;
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  padding: 40px 0;
}
.product-detail .card-image { border-radius: var(--radius); border: 1px solid var(--border); }
.product-info h1 { font-size: 1.6rem; }
.product-price { font-family: 'JetBrains Mono', monospace; font-size: 1.6rem; color: var(--gold); margin: 14px 0; }
.product-attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.attr { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.attr-label { font-size: 0.68rem; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.04em; }
.attr-value { font-weight: 600; margin-top: 2px; }
.qty-input { width: 60px; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px; margin-right: 10px; }

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

/* ---------- Cart / Checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table td, .cart-table th { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.88rem; }
.cart-table img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: #0c0d10; }
.cart-line-name { font-weight: 600; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-dim); font-size: 0.9rem; }
.summary-total { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); font-weight: 700; font-size: 1.1rem; margin-top: 8px; }

.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding: 40px 0; align-items: start; }
.checkout-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
#payment-element { margin: 20px 0; }
#payment-message { color: var(--danger); font-size: 0.85rem; margin-top: 10px; }

@media (max-width: 800px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

/* ---------- Forms (admin) ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table td, .admin-table th { padding: 10px; border-bottom: 1px solid var(--border); font-size: 0.85rem; text-align: left; }
.admin-shell { padding: 40px 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

/* ---------- Flash messages ---------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.88rem; }
.flash-success { background: rgba(55, 230, 196, 0.12); border: 1px solid var(--foil-a); }
.flash-error { background: rgba(224, 85, 79, 0.12); border: 1px solid var(--danger); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 60px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
