:root {
  --bg: #fbf6ef;
  --surface: #ffffff;
  --ink: #2b1d1a;
  --muted: #76655f;
  --line: #eadfd3;
  --accent: #7d1d3f;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3e9;
  --gold: #b8892d;
  --ok: #2f7a4a;
  --warn: #9a5b12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 30, 20, .06), 0 4px 14px rgba(60, 30, 20, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- header & filters ---------- */
.top {
  border-bottom: 1px solid var(--line);
  padding: 12px 0 10px;
}
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 { margin: 0; font: 600 1.5rem/1.1 var(--serif); color: var(--accent); }
.sub { margin: 0; font-size: .85rem; color: var(--muted); }
.search-row { display: flex; gap: 8px; margin-top: 8px; }
.search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px; height: 44px;
}
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; font-size: 16px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.filters { display: grid; gap: 6px; margin-top: 8px; }
.chip-row {
  display: flex; gap: 6px; align-items: center;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .label { flex: none; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 52px; }
.pill {
  flex: none;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 0 14px; height: 36px;
  font-size: .9rem; white-space: nowrap;
}
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.more-btn { justify-self: start; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: .9rem; padding: 6px 0; }
@media (max-width: 699px) { .filters:not(.open) .extra { display: none; } }
@media (min-width: 700px) { .more-btn { display: none; } }
.fav-pill { height: 44px; color: var(--accent); font-weight: 600; }
.fav-pill b { font-weight: 600; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 7px; font-size: .8rem; }
.fav-pill[aria-pressed="true"] b { background: rgba(255,255,255,.25); color: #fff; }
@media (max-width: 420px) { .fav-pill span { display: none; } }

.status-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 10px; flex-wrap: wrap; }
#status { margin: 0; color: var(--muted); font-size: .92rem; }
.sort { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sort select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; height: 36px; padding: 0 8px; color: var(--ink); }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.card {
  position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card-open { all: unset; cursor: pointer; display: flex; flex-direction: column; flex: 1; }
.card-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.card-img { position: relative; aspect-ratio: 3 / 4; background: #f1e9df; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-img .noimg, .slide .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.badge {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(43, 29, 26, .82); color: #fff; font-size: .78rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.photos { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.92); font-size: .75rem; padding: 2px 8px; border-radius: 999px; color: var(--ink); }
.heart {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); color: #b7a7a1; font-size: 1.25rem; line-height: 40px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.heart[aria-pressed="true"] { color: #d0234e; }
.card-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.price { font: 700 1.2rem/1.1 var(--sans); color: var(--accent); }
.price small { font-size: .78rem; font-weight: 500; color: var(--muted); }
.gst { font-size: .78rem; color: var(--muted); }
.title { font-size: .88rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.meta { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumbs { display: flex; gap: 4px; margin-top: 4px; }
.thumbs img, .thumbs span { width: 34px; height: 44px; border-radius: 6px; object-fit: cover; object-position: top; background: #f1e9df; flex: none; }
.thumbs span { display: grid; place-items: center; font-size: .72rem; color: var(--muted); }
.site { font-size: .75rem; color: var(--gold); font-weight: 600; letter-spacing: .02em; margin-top: 2px; }
.dots { display: flex; gap: 4px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; }
.foot { color: var(--muted); font-size: .82rem; padding-top: 28px; padding-bottom: 40px; }

/* ---------- detail view ---------- */
.detail { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.d-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: rgba(251, 246, 239, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.back { border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; height: 44px; padding: 0 16px 0 12px; font-weight: 600; }
.d-bar .heart { position: static; }
.d-wrap { max-width: 1100px; margin: 0 auto; display: grid; gap: 0; }
@media (min-width: 900px) {
  .d-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 20px 16px; }
}
.gallery { position: relative; }
.slides {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  background: #efe6db;
}
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; height: min(62vh, 680px); display: grid; place-items: center; }
@media (min-width: 900px) { .slide { height: min(78vh, 720px); } }
.slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.slide .cap { position: absolute; left: 10px; top: 10px; background: rgba(43,29,26,.8); color: #fff; font-size: .8rem; padding: 3px 10px; border-radius: 999px; }
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); box-shadow: var(--shadow); font-size: 1.3rem;
}
.nav-btn.prev { left: 8px; } .nav-btn.next { right: 8px; }
@media (hover: none) { .nav-btn { display: none; } }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; scrollbar-width: thin; }
.strip button { flex: none; border: 2px solid transparent; border-radius: 8px; padding: 0; background: none; }
.strip button[aria-current="true"] { border-color: var(--accent); }
.strip img { width: 54px; height: 70px; object-fit: cover; object-position: top; border-radius: 6px; background: #f1e9df; }

.info { padding: 14px 16px 120px; display: grid; gap: 14px; align-content: start; }
@media (min-width: 900px) { .info { padding: 0 0 40px; } }
.info h2 { margin: 0; font: 600 1.3rem/1.25 var(--serif); }
.d-site { font-size: .85rem; font-weight: 600; color: var(--gold); }
.price-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 4px; }
.price-box .big { font: 700 1.7rem/1.1 var(--sans); color: var(--accent); }
.price-box .big small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.price-box .row { font-size: .92rem; color: var(--muted); }
.price-box .row b { color: var(--ink); }
.stock { font-size: .88rem; font-weight: 600; }
.stock.ok { color: var(--ok); } .stock.check { color: var(--warn); }
.stock .checked { font-weight: 400; color: var(--muted); }
.colours { display: flex; flex-wrap: wrap; gap: 6px; }
.colour { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px; font-size: .85rem; }
.colour i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.section-h { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.specs { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .92rem; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.specs th { width: 38%; font-weight: 600; color: var(--muted); }
.desc { margin: 0; font-size: .95rem; white-space: pre-line; overflow-wrap: anywhere; }
.also a { color: var(--accent); }
.also li { margin: 4px 0; }
.also ul { margin: 0; padding-left: 18px; }

.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(251, 246, 239, .97); border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .actions { position: static; padding: 0; background: none; border: 0; }
}
.btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; border-radius: 12px; font-weight: 700; font-size: 1rem; text-decoration: none; border: 0;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.wa { flex: 0 0 auto; padding: 0 16px; background: #1f8f4d; color: #fff; }
@media (max-width: 380px) { .btn.wa span { display: none; } }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
