:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #14202f;
  --muted: #5d6877;
  --line: #e4e0d6;
  --navy: #0f1b2d;
  --gold: #b8913a;
  --gold-soft: #f3ead6;
  --wa: #1fa855;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c131d; --surface: #141e2b; --ink: #edf0f4; --muted: #9aa6b5; --line: #243142;
    --gold: #d8b25c; --gold-soft: #2a2516; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 24px 16px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.brand { text-decoration: none; font: 600 20px/1 Fraunces, Georgia, serif; letter-spacing: .2px; display: flex; align-items: center; gap: 6px; }
.brand-mark { color: var(--gold); }
.lang { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 12px; font: 600 13px Inter, sans-serif; cursor: pointer; }

/* hero + search */
.hero { background: linear-gradient(180deg, var(--navy) 0, var(--navy) 62%, transparent 62%); color: #fff; padding: 28px 16px 8px; }
.hero > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.eyebrow { display: inline-block; margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.hero h1 { font: 600 clamp(28px, 6vw, 46px)/1.1 Fraunces, Georgia, serif; margin: 0 0 12px; }
.hero .sub { margin: 0 0 22px; color: #c9d1dc; max-width: 640px; }
.search-card { background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.field.wide { grid-column: 1 / -1; }
@media (min-width: 760px) { .field.wide { grid-column: span 2; } }
.field.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); align-self: end; padding-bottom: 10px; }
input, select { width: 100%; font: 15px Inter, sans-serif; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--navy); }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.more { margin: 12px 0 4px; }
.more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); padding: 6px 0; }
.more .grid { margin-top: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font: 600 15px Inter, sans-serif; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.big { width: 100%; padding: 14px 18px; font-size: 16px; margin-top: 12px; }
.btn.primary { background: var(--gold); color: #1a1405; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.wa { background: var(--wa); color: #fff; }

/* results */
.results-head { max-width: 1180px; margin: 18px auto 8px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-head p { margin: 0; font-weight: 600; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort select { width: auto; min-height: 36px; padding: 6px 10px; }
.cards { max-width: 1180px; margin: 0 auto; padding: 0 16px 16px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card .ph { position: relative; aspect-ratio: 4 / 3; background: var(--gold-soft); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; left: 10px; top: 10px; background: rgba(15,27,45,.85); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.card .body { padding: 12px 14px 14px; }
.price { font-weight: 700; font-size: 20px; }
.price small, .dprice small { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 2px; }
.ttl { font-weight: 600; margin-top: 2px; }
.specs { margin-top: 6px; font-size: 14px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; }
.skel .ph { animation: pulse 1.2s infinite alternate; }
.skel i { display: block; height: 12px; background: var(--line); border-radius: 6px; margin: 8px 0; }
.skel i + i { width: 60%; }
@keyframes pulse { to { opacity: .5; } }
#moreBtn { margin: 8px 0 32px; }

/* detail */
.detail { max-width: 920px; margin: 0 auto; padding: 16px 16px 120px; }
.back { display: inline-block; margin: 0 0 12px; text-decoration: none; font-weight: 600; color: var(--muted); }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; border-radius: var(--radius); background: var(--gold-soft); }
@media (min-width: 760px) { .gallery img { flex-basis: 70%; } }
.nophoto { width: 100%; aspect-ratio: 16 / 9; background: var(--gold-soft); border-radius: var(--radius); }
.dhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 16px 0 8px; }
.dhead h1 { font: 600 clamp(24px, 5vw, 34px)/1.15 Fraunces, Georgia, serif; margin: 8px 0 2px; }
.dhead p { margin: 0; }
.pill { display: inline-block; background: var(--gold-soft); color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.dprice { font-weight: 700; font-size: 26px; display: flex; flex-direction: column; align-items: flex-end; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 16px 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.facts b { display: block; font-size: 20px; }
.facts span { font-size: 12px; color: var(--muted); }
.detail h2 { font: 600 20px Fraunces, Georgia, serif; margin: 28px 0 10px; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; margin: 0; }
.dl div { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.feat { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feat li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.desc { white-space: pre-line; margin: 0; }
.cta-inline { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.cta-inline .btn.big { width: auto; flex: 1 1 260px; margin: 0; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,27,45,.08); }
.sticky-cta > div { display: flex; flex-direction: column; line-height: 1.2; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }
body:has(#detailView:not([hidden])) .foot { padding-bottom: 110px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand .by { font: 500 11px/1.2 Inter, system-ui, sans-serif; color: #b9c3d0; letter-spacing: .3px; margin-top: 3px; }
