/* TEREA HOUSE — mobile-first, calm premium retail. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #17181b;
  --muted: #5d606a;
  --line: #e4e1da;
  --accent: #1f4e46;
  --accent-ink: #ffffff;
  --accent-soft: #e3eeeb;
  --gold: #b7791f;
  --danger: #b3261e;
  --ok: #2e7d32;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20,20,20,.04), 0 8px 24px rgba(20,20,20,.06);
  --tap: 48px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214; --surface: #1a1b1e; --surface-2: #25262a; --text: #f1f1f2;
    --muted: #a7aab2; --line: #2d2f34; --accent: #8fd3c4; --accent-ink: #0d1f1b;
    --accent-soft: #1b2b28; --gold: #e0a345; --danger: #ff8a80; --ok: #81c784;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.error { color: var(--danger); margin: 0; font-size: 14px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 999; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.demo-bar { background: #fff4cc; color: #4a3b00; text-align: center; font-size: 12px; padding: 5px 12px; font-weight: 600; letter-spacing: .02em; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 10px; }
.wordmark { font-weight: 500; letter-spacing: .16em; font-size: 16px; }
.wordmark b { font-weight: 800; }
.cart-btn { position: relative; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.cart-btn svg { width: 24px; height: 24px; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.badge.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.3); } }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; max-width: 440px; }
.segmented button { height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; color: var(--muted); font-size: 15px; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Hero */
.hero { padding: 22px 0 6px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.hero p { margin: 0 0 14px; color: var(--muted); }
.trust { list-style: none; padding: 0 16px; margin: 0 -16px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.trust::-webkit-scrollbar { display: none; }
.trust li { flex: none; white-space: nowrap; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 6px; }
.trust li span { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; padding: 0 4px; }
@media (min-width: 720px) { .hero h1 { font-size: 34px; } .hero { padding-top: 32px; } }

.nicotine { display: block; margin-top: 16px; padding: 12px 16px; background: #fff; color: #000; border: 2px solid #000; font-weight: 700; font-size: 14px; text-align: center; }

/* Compat + chips */
.compat { margin: 16px 0 4px; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius-sm); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.compat b { color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Grid + cards */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 32px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.thumb { aspect-ratio: 1 / 1; display: grid; place-items: center; position: relative; overflow: hidden; }
.thumb svg { width: 62%; height: auto; filter: drop-shadow(0 10px 14px rgba(0,0,0,.14)); }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10%; }
.tag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.92); color: #2a2a2a; letter-spacing: .02em; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.meta { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
.compat-line { align-self: flex-start; font-size: 11px; color: var(--accent); background: var(--accent-soft); font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .02em; }
.variants { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.variants button { min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.15; padding: 4px; }
.variants button small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.variants button[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
.unit-line { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.price { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.price.tbd { font-size: 15px; color: var(--muted); font-weight: 700; }
.price .per { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.buy { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: auto; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); height: 44px; background: var(--surface); }
.stepper button { width: 40px; height: 100%; border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.btn { height: 50px; padding: 0 18px; border-radius: var(--radius-sm); border: 0; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-primary.added { background: var(--ok); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-block { width: 100%; }
.add { height: 44px; font-size: 14px; padding: 0 10px; }

@media (max-width: 400px) {
  .buy { grid-template-columns: 1fr; }
  .stepper { justify-content: space-between; }
}

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 40; width: max-content; max-width: calc(100% - 32px); font-size: 15px; }
.toast .link-btn { background: var(--bg); color: var(--text); border: 0; border-radius: 999px; height: 40px; padding: 0 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.toast:not([hidden]) { animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 50; }
.sheet { position: fixed; z-index: 60; background: var(--surface); display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: up .25s ease; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
@media (min-width: 720px) { .sheet { left: auto; top: 0; width: 440px; max-height: none; border-radius: 0; animation: none; } }
.sheet-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 19px; text-align: center; grid-column: 2; }
.sheet-head #cart-close { grid-column: 3; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px; }
.step { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cart-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.cart-list { list-style: none; margin: 0; padding: 4px 16px; }
.cart-list li.item { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-list .mini { width: 60px; height: 60px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.cart-list .mini svg { width: 66%; }
.cart-list .mini img { width: 100%; height: 100%; object-fit: contain; }
.cart-list .name { font-weight: 650; font-size: 15px; }
.cart-list .sub { font-size: 13px; color: var(--muted); }
.cart-list .right { display: grid; justify-items: end; gap: 6px; }
.cart-list .stepper { height: 38px; }
.cart-list .stepper button { width: 34px; }
.remove { background: none; border: 0; color: var(--danger); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px 0; min-height: 32px; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.sheet-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; background: var(--surface); }
.sheet-foot .row { display: flex; justify-content: space-between; font-size: 18px; font-variant-numeric: tabular-nums; }
.sheet-foot p { margin: 0; }
.sheet-foot .row.sm { font-size: 15px; color: var(--muted); }
.sheet-foot .row strong { font-size: 20px; }

/* Shipping choice */
.ship { padding: 8px 16px 18px; gap: 10px; }
.ship-hint { --p: 0; margin: 0; font-size: 13.5px; color: var(--text); padding-bottom: 10px; position: relative; }
.ship-hint::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 4px;
  background: linear-gradient(var(--accent), var(--accent)) 0 0 / calc(var(--p) * 100%) 100% no-repeat, var(--surface-2); transition: background-size .3s; }
.ship-hint.ok { color: var(--accent); }
.ship-options { display: grid; gap: 8px; }
.ship-opt { position: relative; display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center;
  min-height: 60px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.ship-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ship-opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: border-color .15s; }
.ship-opt .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .15s; }
.ship-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ship-opt:has(input:checked) .radio { border-color: var(--accent); }
.ship-opt:has(input:checked) .radio::after { transform: scale(1); }
.ship-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ship-text { display: grid; gap: 1px; }
.ship-text b { font-size: 15px; font-weight: 650; }
.ship-text small { font-size: 12.5px; color: var(--muted); }
.ship-price { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; display: grid; justify-items: end; }
.ship-price s { font-weight: 500; font-size: 12px; color: var(--muted); }
.ship-price.free { color: var(--accent); }

/* Form */
.form-body { overflow-y: auto; padding: 8px 16px 16px; flex: 1; display: grid; gap: 14px; align-content: start; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
legend { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 0 4px; }
.form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.form .opt { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
.form .lt { display: block; }
.form input, .form select, .input { height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); padding: 0 12px; width: 100%; font-size: 16px; font-weight: 400; }
.form input[aria-invalid="true"], .form select[aria-invalid="true"] { border-color: var(--danger); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.check { display: flex !important; grid-template-columns: none; gap: 10px; align-items: flex-start; font-weight: 500 !important; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

/* Done */
.done { padding: 20px 16px; gap: 12px; overflow-y: auto; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin: 8px auto 0; }
.done h3 { margin: 0; text-align: center; font-size: 22px; }
.done-lead { margin: 0; text-align: center; font-size: 16px; line-height: 1.45; }
.done-summary { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.done-summary:empty { display: none; }
.next-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.pay-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; white-space: pre-line; }

/* Age gate */
.age-gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.age-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 20px; display: grid; gap: 12px; }
.age-card img { border-radius: 14px; }
.age-card h1 { margin: 0; font-size: 24px; }
.age-card p { margin: 0; }
.field-label { font-weight: 600; font-size: 14px; }

.foot { padding-top: 8px; padding-bottom: 96px; font-size: 14px; border-top: 1px solid var(--line); }
.foot-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .14em; margin: 20px 0 8px; }
.foot-brand img { border-radius: 8px; }
.foot p { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Carton (block) art is wide — give it more room than the upright device art */
.thumb svg.carton { width: 88%; filter: drop-shadow(0 8px 12px rgba(0,0,0,.10)); }
.cart-list .mini svg.carton { width: 92%; }

/* Device colors */
.colors { display: grid; gap: 6px; }
.color-name { font-size: 13px; color: var(--muted); }
.color-name b { color: var(--text); font-weight: 650; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; position: relative; }
.swatches button::after { content: ""; position: absolute; inset: -8px; } /* 48px tap target */
.swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--text); }
