:root {
  --ink: #111111;
  --ink-2: #4a4a4a;
  --ink-3: #8a8a8a;
  --line: #e6e6e6;
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --volt: #c8f03c;
  --ok: #1a7f37;
  --warn: #b54708;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --panel-w: 400px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.panel-open { padding-right: var(--panel-w); }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.topbar { background: var(--ink); color: #fff; font-size: 12px; letter-spacing: .04em; text-align: center; padding: 7px 16px; }
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { font-weight: 800; letter-spacing: .18em; font-size: 15px; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 20px; flex: 1; overflow-x: auto; }
.nav a { text-decoration: none; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--ink); }
.header-tools { display: flex; align-items: center; gap: 14px; }
.market-select { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; background: #fff; }
.cart-link { text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-block; border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; }
.btn:hover { background: #333; }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.secondary:hover { background: var(--bg-2); }
.btn.block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.link-btn { background: none; border: none; padding: 0; text-decoration: underline; color: var(--ink-2); font-size: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email] { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ---------- home ---------- */
.hero { background: var(--ink); color: #fff; }
.hero .wrap { padding-top: 88px; padding-bottom: 88px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -.02em; max-width: 12ch; }
.hero p { color: #cfcfcf; font-size: 18px; max-width: 46ch; margin: 0 0 28px; }
.hero .btn { background: var(--volt); color: var(--ink); border-color: var(--volt); }
.section { padding: 56px 0; }
.section h2 { font-size: 26px; margin: 0 0 20px; letter-spacing: -.01em; }
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.cat-card { background: var(--bg-2); border-radius: 12px; padding: 22px 18px; text-decoration: none; font-weight: 700; font-size: 15px; min-height: 110px; display: flex; align-items: flex-end; }
.cat-card:hover { background: #ececec; }
.teaser { background: var(--bg-2); border-radius: 16px; padding: 36px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.teaser h3 { margin: 0 0 6px; font-size: 22px; }
.teaser p { margin: 0; color: var(--ink-2); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { text-decoration: none; }
.card img { border-radius: 12px; aspect-ratio: 5 / 6; object-fit: cover; width: 100%; }
.card .name { font-weight: 600; font-size: 15px; margin-top: 10px; }
.card .price { color: var(--ink-2); font-size: 14px; }
.page-title { font-size: 34px; margin: 36px 0 6px; letter-spacing: -.01em; }
.page-sub { color: var(--ink-2); margin: 0 0 28px; }

/* ---------- product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; padding: 36px 0 64px; }
.pdp img { border-radius: 16px; width: 100%; aspect-ratio: 5 / 6; object-fit: cover; }
.pdp h1 { font-size: 32px; margin: 0 0 6px; }
.pdp .price { font-size: 20px; margin: 0 0 18px; }
.pdp .blurb { color: var(--ink-2); margin: 0 0 22px; }
.opt-label { font-size: 13px; font-weight: 600; margin: 18px 0 8px; display: flex; justify-content: space-between; }
.swatches, .sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.selected { box-shadow: 0 0 0 2px var(--ink); }
.size { min-width: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; }
.size.selected { border-color: var(--ink); background: var(--ink); color: #fff; }
.pdp .actions { margin-top: 26px; }
.sku { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 14px; }

/* ---------- cart / checkout ---------- */
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; padding-bottom: 64px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line img { border-radius: 8px; width: 72px; aspect-ratio: 5 / 6; object-fit: cover; }
.line .meta { font-size: 14px; }
.line .meta .sub { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
.summary { background: var(--bg-2); border-radius: 16px; padding: 24px; align-self: start; }
.summary .row { display: flex; justify-content: space-between; margin: 6px 0; font-size: 14px; }
.summary .total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.empty { padding: 48px 0; color: var(--ink-2); }

/* ---------- confirmation / waitlist ---------- */
.center-card { max-width: 620px; margin: 56px auto 80px; text-align: center; }
.center-card h1 { font-size: 34px; margin: 10px 0; }
.order-no { font-family: var(--mono); background: var(--bg-2); display: inline-block; padding: 6px 12px; border-radius: 8px; }
.waitlist { max-width: 560px; }
.inline-form { display: flex; gap: 10px; margin-top: 18px; }
.inline-form input { flex: 1; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--ink-2); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- consent banner ---------- */
.consent { position: fixed; left: 24px; bottom: 24px; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.14); padding: 22px; z-index: 40; }
.consent h4 { margin: 0 0 6px; font-size: 16px; }
.consent p { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.consent .row { display: flex; gap: 10px; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 28px; width: min(520px, 92vw); }
.modal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0 20px; }
.modal th, .modal td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.toast { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------- event panel ---------- */
.ev-toggle { position: fixed; right: 20px; bottom: 20px; z-index: 45; background: var(--ink); color: #fff; border: none; border-radius: 999px; padding: 12px 18px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
body.panel-open .ev-toggle { display: none; }
.ev-head .title .btns { display: flex; gap: 6px; }
.ev-panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-w); background: #0f0f10; color: #e8e8e8; z-index: 44; display: none; flex-direction: column; font-size: 13px; border-left: 1px solid #222; }
body.panel-open .ev-panel { display: flex; }
.ev-head { padding: 16px 18px 12px; border-bottom: 1px solid #222; }
.ev-head .title { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.ev-head .title button { background: none; border: 1px solid #333; color: #bbb; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.ev-status { margin-top: 10px; display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 12px; }
.ev-status .k { color: #8a8a8a; }
.ev-status .v { font-family: var(--mono); word-break: break-all; }
.ev-status .v.bad { color: #ffb4a2; }
.ev-status .v.good { color: var(--volt); }
.ev-list { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.ev { background: #18181a; border: 1px solid #242427; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.ev .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ev .nm { font-family: var(--mono); font-weight: 700; color: #fff; }
.ev .when { color: #777; font-size: 11px; white-space: nowrap; }
.ev .sum { color: #cfcfcf; margin-top: 4px; word-break: break-word; }
.ev .wire { margin-top: 4px; font-family: var(--mono); font-size: 11.5px; color: #9a9a9a; }
.ev .wire.has-click { color: var(--volt); }
.ev .st { display: inline-block; margin-top: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.st.queued { background: #2a2a2d; color: #bbb; }
.st.sent { background: rgba(200,240,60,.14); color: var(--volt); }
.st.blocked { background: rgba(255,120,90,.14); color: #ffb4a2; }
.ev pre { margin: 8px 0 0; background: #0b0b0c; border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: #d6d6d6; white-space: pre-wrap; word-break: break-word; display: none; }
.ev.open pre { display: block; }
.ev .expand { background: none; border: none; color: #8a8a8a; font-size: 11px; padding: 0; margin-top: 6px; }
.ev.note { background: transparent; border-style: dashed; color: #a8a8a8; }
.ev.note .nm { color: #a8a8a8; font-weight: 600; font-family: inherit; }
.ev.note .sum { font-family: var(--mono); font-size: 11.5px; color: #9a9a9a; }

@media (max-width: 1100px) {
  body.panel-open { padding-right: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .pdp, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --panel-w: 100vw; }
  .site-header .wrap { gap: 14px; }
  .nav { display: none; }
  .teaser { flex-direction: column; align-items: flex-start; }
}
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
.stock-note { color: var(--warn); font-size: 13px; font-weight: 600; margin: 16px 0 0; }
