/* CurioQuest Collectibles — storefront + admin styles */
:root {
  /* CurioQuest mascot brand palette */
  --charcoal: #16161A;
  --slate: #3A3A42;
  --ember: #F26322;
  --flame: #C4321C;
  --gold: #FAA61A;
  --bone: #F7F1E6;

  --bg: #F7F1E6;
  --surface: #ffffff;
  --ink: #16161A;
  --muted: #6f6a60;
  --line: #e7dfce;
  --brand: #F26322;
  --brand-dark: #C4321C;
  --accent: #FAA61A;
  --ok: #15803d;
  --warn: #b45309;
  --err: #C4321C;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(22, 22, 26, .08), 0 8px 24px rgba(22, 22, 26, .06);
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.55 var(--body);
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2, h3, .brand, .section-title { font-family: var(--display); letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

/* Nav */
header { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .logo { flex: none; display: block; }
.brand em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 14px; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--ink); font-weight: 500; }
.cart-link .badge {
  background: var(--brand); color: #fff; border-radius: 999px;
  padding: 1px 8px; font-size: 12px; margin-left: 2px;
}

/* Hero */
.hero {
  margin-bottom: 24px; padding: 38px 34px; border-radius: 18px; color: var(--bone);
  background: radial-gradient(120% 150% at 88% 15%, #321d16 0%, #16161A 58%), var(--charcoal);
  border: 1px solid #2a2a31; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 28px; justify-content: space-between;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; right: 6%; top: 50%; width: 360px; height: 360px;
  transform: translateY(-50%); pointer-events: none;
  background: radial-gradient(circle, rgba(242,99,34,.28), transparent 66%);
}
.hero-text { position: relative; z-index: 1; max-width: 600px; }
.hero h1 { margin: 0; font-size: 38px; font-weight: 900; color: #fff; }
.hero .tagline { margin: 4px 0 10px; font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--gold); }
.hero p { margin: 0; color: rgba(247,241,230,.82); }
.hero-badge { position: relative; z-index: 1; width: 190px; max-width: 36%; height: auto; flex: none; filter: drop-shadow(0 10px 24px rgba(0,0,0,.5)); }
.search { display: flex; gap: 8px; margin-top: 18px; max-width: 540px; }
.search input { flex: 1; border: 0; }
.search .btn-ghost { background: rgba(247,241,230,.14); color: var(--bone); border-color: rgba(247,241,230,.30); }
@media (max-width: 720px) {
  .hero { flex-direction: column-reverse; align-items: flex-start; padding: 26px 22px; }
  .hero-badge { width: 128px; }
  .hero h1 { font-size: 30px; }
}

/* Shop by game category tiles */
.cats { margin-bottom: 30px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cat-tile { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .12s ease, box-shadow .12s ease; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(22,22,26,.18); }
.cat-tile img { display: block; width: 100%; height: auto; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Benefits strip */
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 28px; }
.benefits > div { display: flex; gap: 11px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.benefits span { font-size: 20px; line-height: 1.2; }
.benefits strong { display: block; font-size: 14px; }
.benefits p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.section-title { font-size: 17px; margin: 0 0 14px; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 28px rgba(20,24,40,.12); }
.card-img { position: relative; aspect-ratio: 3/4; background: #efece6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card.oos .card-img img, .card.oos .noimg { filter: grayscale(.85); opacity: .7; }
.oos-badge {
  position: absolute; top: 10px; left: 10px; background: var(--err); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.stock.sold { color: var(--err); font-weight: 600; }
.noimg { color: var(--muted); font-size: 13px; }
.noimg.sm { width: 40px; height: 54px; display: flex; align-items: center; justify-content: center; background: #efece6; border-radius: 6px; }
.card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h3 { margin: 0; font-size: 15px; }
.card-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; padding-top: 6px; }
.price { font-weight: 700; font-size: 16px; }
.stock { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }

/* Product detail */
.product { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 32px; }
.product-img { background: #efece6; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { margin: 0 0 4px; font-size: 26px; }
.price-lg { font-size: 26px; font-weight: 800; margin: 14px 0; }
.desc { white-space: pre-wrap; }
.buy { display: flex; align-items: flex-end; gap: 12px; margin: 18px 0; }
.soldout { color: var(--err); font-weight: 600; }

/* Buttons */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: 0; border-radius: 9px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:hover, button:hover { background: var(--brand-dark); text-decoration: none; }
.btn-primary { background: var(--brand); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-small { padding: 6px 11px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #efece6; color: var(--ink); }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.form { max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.form-row { display: flex; gap: 14px; }
.form-row > label { flex: 1; }
.form label { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.buy select { width: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf9f6; }
tr:last-child td { border-bottom: 0; }
.cart-table .ci { display: flex; align-items: center; gap: 12px; }
.ci-img, .thumb img { width: 44px; height: 58px; border-radius: 6px; object-fit: cover; }
.thumb img { display: block; }
.qtyform { display: flex; gap: 6px; align-items: center; }
.qtyform input { width: 76px; }

.cart-summary { margin-top: 22px; max-width: 420px; margin-left: auto; }
.subtotal { font-size: 18px; text-align: right; margin-bottom: 12px; }
.checkout-form button { width: 100%; }

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.admin-table .row-actions { display: flex; gap: 8px; align-items: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.tag-on, .tag-paid, .tag-fulfilled { background: #dcfce7; color: var(--ok); }
.tag-off, .tag-pending { background: #fef3c7; color: var(--warn); }
.tag-cancelled { background: #fee2e2; color: var(--err); }
.login { max-width: 360px; margin: 40px auto; }

/* Notices / states */
.notice { padding: 11px 14px; border-radius: 9px; margin: 12px 0; font-size: 14px; }
.notice-info { background: #e0f2fe; color: #075985; }
.notice-success { background: #dcfce7; color: var(--ok); }
.notice-error { background: #fee2e2; color: var(--err); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.success, .mockpay { max-width: 560px; margin: 20px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.success h1 { margin-top: 0; }

footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 20px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 26px 20px 14px;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: space-between;
}
.foot-brand strong { font-size: 15px; }
.foot-brand p { margin: 4px 0 0; font-size: 13px; max-width: 280px; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--ink); font-size: 14px; }
.foot-trust { font-size: 13px; }
.copyright { max-width: 1100px; margin: 0 auto; padding: 0 20px 20px; color: var(--muted); font-size: 12.5px; }

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

@media (max-width: 720px) {
  .product { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
}
