/* styles.css — Siam Heritage design system
   Auction-house: navy + gold, elegant serif, hairline rules, whitespace.
   Tokens are driven by data-attributes set from Tweaks. */

:root {
  /* type — overridden by font tweak */
  --font-display: "Cormorant Garamond", "Noto Serif Thai", Georgia, serif;
  --font-body: "Sarabun", "Noto Sans Thai", system-ui, sans-serif;

  /* radius + density — overridden by tweaks */
  --radius: 4px;
  --pad-card: 22px;
  --gap-grid: 28px;

  /* accent (gold) — overridden by theme tweak */
  --gold: #b08d4f;
  --gold-soft: #cdae74;
}

/* ---------- THEMES ---------- */
[data-theme="navy"] {
  --bg: #f6f4ee;
  --bg-2: #efece3;
  --surface: #ffffff;
  --ink: #16223d;
  --ink-soft: #5d6577;
  --line: #e2ddd0;
  --line-strong: #cfc8b6;
  --navy: #16223d;
  --on-navy: #f4f1e8;
}
[data-theme="emerald"] {
  --bg: #f4f3ed;
  --bg-2: #ebeae1;
  --surface: #ffffff;
  --ink: #14271f;
  --ink-soft: #586158;
  --line: #ded8c9;
  --line-strong: #c7c2b0;
  --navy: #163a2b;
  --on-navy: #f1f0e6;
  --gold: #b0894a;
  --gold-soft: #c9a96d;
}
[data-theme="oxblood"] {
  --bg: #f6f2ec;
  --bg-2: #efe8df;
  --surface: #ffffff;
  --ink: #2a1518;
  --ink-soft: #6a5654;
  --line: #e3d8cd;
  --line-strong: #cdbbac;
  --navy: #4a1f24;
  --on-navy: #f3eae3;
  --gold: #a9823f;
  --gold-soft: #c7a268;
}
[data-theme="charcoal"] {
  --bg: #f3f2f0;
  --bg-2: #e9e8e4;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --ink-soft: #5f5e59;
  --line: #e1dfd9;
  --line-strong: #cbc9c1;
  --navy: #232220;
  --on-navy: #f1efe9;
  --gold: #9a875a;
  --gold-soft: #b6a473;
}

/* dark mode layer */
[data-mode="dark"] {
  --bg: #0c1322;
  --bg-2: #0f1830;
  --surface: #14203a;
  --ink: #ece7da;
  --ink-soft: #9aa3b5;
  --line: #24304a;
  --line-strong: #31405f;
  --on-navy: #f3efe4;
}
[data-mode="dark"][data-theme="navy"] { --navy: #0f1830; }
[data-mode="dark"][data-theme="emerald"] { --navy: #0e2219; --bg: #0a160f; --bg-2: #0e1d15; --surface: #122a1f; }
[data-mode="dark"][data-theme="oxblood"] { --navy: #2a1216; --bg: #160c0e; --bg-2: #1d1012; --surface: #261518; }
[data-mode="dark"][data-theme="charcoal"] { --navy: #1a1a18; --bg: #0e0e0d; --bg-2: #141413; --surface: #1c1c1a; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
.app { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: 0.01em; }
.serif { font-family: var(--font-display); }
.tnum { font-variant-numeric: tabular-nums; }

.wrap { width: min(1180px, 92vw); margin: 0 auto; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hdr-bar { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: flex; flex-direction: column; line-height: 1; cursor: pointer; }
.brand-name { font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: 0.16em; color: var(--ink); white-space: nowrap; }
.brand-sub { font-size: 9.5px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold); margin-top: 5px; }
.nav { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav a { font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 0; position: relative; cursor: pointer; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); }
.hdr-tools { display: flex; align-items: center; gap: 14px; }
.lang-toggle { display: flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.lang-toggle button { font-family: var(--font-body); border: 0; background: transparent; color: var(--ink-soft); padding: 5px 11px; font-size: 11px; letter-spacing: 0.08em; cursor: pointer; }
.lang-toggle button.on { background: var(--navy); color: var(--on-navy); }
.cart-btn { position: relative; cursor: pointer; background: none; border: 0; color: var(--ink); padding: 6px; }
.cart-count { position: absolute; top: -4px; right: -6px; background: var(--gold); color: #1a1205; font-size: 10px; min-width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; padding: 0 3px; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-body); cursor: pointer; border: 1px solid transparent;
  border-radius: var(--radius); padding: 12px 22px; font-size: 13px; letter-spacing: 0.06em;
  transition: all .16s ease; display: inline-flex; align-items: center; gap: 9px; justify-content: center;
}
.btn-solid { background: var(--navy); color: var(--on-navy); }
.btn-solid:hover { background: color-mix(in srgb, var(--navy) 88%, #000); }
.btn-gold { background: var(--gold); color: #1a1205; font-weight: 600; }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-soft); padding: 8px 10px; }
.btn-quiet:hover { color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 15px 30px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- kicker / headings ---------- */
.kicker { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 12px; }
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--gold); display: inline-block; }
.section-title { font-size: clamp(28px, 4vw, 42px); margin: 14px 0 0; }

/* ---------- placeholder art ---------- */
.ph-wrap { position: relative; width: 100%; background: var(--bg-2); overflow: hidden; border-radius: calc(var(--radius) * 0.6); }
.ph-svg, .ph-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-tag { position: absolute; left: 10px; bottom: 9px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 9.5px; letter-spacing: 0.05em; color: var(--ink-soft); background: color-mix(in srgb, var(--surface) 78%, transparent); padding: 2px 7px; border-radius: 3px; text-transform: lowercase; }

/* ---------- product card ---------- */
.grid { display: grid; gap: var(--gap-grid); grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: 0 18px 40px -28px rgba(20,30,55,.4); }
.card .ph-wrap { aspect-ratio: 1; border-radius: 0; }
.card-body { padding: var(--pad-card); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-era { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.card-name { font-family: var(--font-display); font-size: 20px; line-height: 1.12; color: var(--ink); }
.card-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.chip { font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.card-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--line); }
.price { font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.price-sm { font-size: 13px; color: var(--ink-soft); }

/* ---------- status pills ---------- */
.status { font-size: 11px; letter-spacing: 0.06em; padding: 4px 11px; border-radius: 999px; font-weight: 600; white-space: nowrap; display: inline-block; }
.status-warn { background: #fbf0d8; color: #8a6516; }
.status-info { background: #dfeaf6; color: #2c5680; }
.status-good { background: #ddeede; color: #2c6b3f; }
.status-accent { background: #e7e0f1; color: #5a4288; }
.status-muted { background: var(--bg-2); color: var(--ink-soft); }
.status-bad { background: #f6dede; color: #97352f; }
[data-mode="dark"] .status { filter: brightness(.92); }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
input, textarea, select {
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 11px 13px; width: 100%; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 84px; }

/* ---------- generic surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* ---------- footer ---------- */
.ftr { margin-top: auto; background: var(--navy); color: var(--on-navy); }
.ftr-in { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; padding: 48px 0; }
.ftr a { color: color-mix(in srgb, var(--on-navy) 72%, transparent); font-size: 13px; }
.ftr a:hover { color: var(--on-navy); }
.ftr-name { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.16em; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--on-navy); padding: 13px 22px; border-radius: var(--radius); font-size: 13px; z-index: 80; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); display: flex; gap: 12px; align-items: center; }
.toast .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--gold); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .hdr-bar { height: 64px; gap: 14px; }
  .brand-name { font-size: 20px; letter-spacing: 0.12em; }
}
