:root {
  --bg: #f6f5f2; --surface: #ffffff; --text: #18181b; --muted: #6b6b73; --line: #e4e2dc;
  --accent: #2b50d8; --accent-text: #ffffff; --chip: #efede8;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121214; --surface: #1b1b1f; --text: #f0f0f2; --muted: #9a9aa3; --line: #2b2b31;
          --accent: #6f8cff; --accent-text: #0d0d12; --chip: #26262c; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; }
.brand { font-weight: 700; font-size: 20px; text-decoration: none; letter-spacing: -.01em; }
.top-links { display: flex; gap: 16px; font-size: 15px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.top-links a { text-decoration: none; }
.top-links a:hover { color: var(--text); }
main { padding: 24px 0 48px; min-height: 60vh; }
h1 { font-size: clamp(24px, 4vw, 32px); margin: 0; letter-spacing: -.02em; }
.head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.muted { color: var(--muted); margin: 0; }

.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.filters summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "▾"; float: right; color: var(--muted); }
.filters[open] summary::after { content: "▴"; }
.filters form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  padding: 4px 16px 16px; }
.filters label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
select, input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; min-height: 42px; width: 100%; }
.actions { display: flex; align-items: end; gap: 12px; }
button, .btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-text); border: 0;
  border-radius: 10px; padding: 11px 18px; min-height: 44px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.reset { color: var(--muted); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; height: 100%; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(0 0 0 / .08); }
.ph { aspect-ratio: 4 / 5; background: var(--chip); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 12px 14px 16px; }
.card h2 { font-size: 17px; margin: 0 0 6px; letter-spacing: -.01em; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; }
.specs span { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--muted); }
.price { margin: 0; font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.price.big { font-size: 30px; margin: 4px 0 16px; }

.empty { text-align: center; padding: 56px 0; color: var(--muted); }
.empty h1 { color: var(--text); margin-bottom: 8px; }

.crumb { margin: 0 0 12px; }
.crumb a { color: var(--muted); text-decoration: none; }
.device { display: grid; gap: 24px; grid-template-columns: 1fr; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; align-items: flex-start;
  border-radius: var(--radius); }
.gallery img { flex: 0 0 92%; width: 92%; min-width: 0; height: auto; aspect-ratio: 4 / 5; object-fit: contain;
  background: var(--chip); border-radius: var(--radius); scroll-snap-align: center; }
.info h1 { margin-bottom: 4px; }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 20px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 600; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
@media (min-width: 820px) {
  .device { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: start; }
  .gallery { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; scroll-snap-type: none; }
  .gallery img { flex: none; width: 100%; }
  .gallery img:first-child { grid-column: 1 / -1; aspect-ratio: 1 / 1; }
  .info { position: sticky; top: 16px; }
}
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 32px;
  color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
