:root {
  --bg: #0f1220;
  --panel: #181c2e;
  --panel2: #20253b;
  --text: #eef0f8;
  --muted: #9aa1bd;
  --accent: #ffcb05;
  --accent2: #3b82f6;
  --good: #34d399;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.top { position: sticky; top: 0; z-index: 5; background: rgba(15,18,32,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--panel2); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.3rem; text-decoration: none; letter-spacing: .5px; }
.brand span { color: var(--accent); }
.links { display: flex; gap: 18px; }
.links a { text-decoration: none; color: var(--muted); font-weight: 600; }
.links a:hover { color: var(--text); }

.hero { padding: 48px 0 28px; text-align: center; background: radial-gradient(ellipse at top, #2a2f55 0%, var(--bg) 70%); }
.hero h1 { margin: 0 0 14px; font-size: clamp(1.4rem, 3.5vw, 2.2rem); }
.badge { display: inline-block; margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--accent); color: #111; font-weight: 800; }

.toolbar { display: flex; gap: 12px; margin: 24px 0 8px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  background: var(--panel); color: var(--text); border: 1px solid var(--panel2);
  border-radius: 10px; padding: 12px 14px; font-size: 1rem;
}
.toolbar input { flex: 1 1 260px; }
.count { color: var(--muted); margin: 6px 0 16px; font-size: .9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--panel2); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s; text-align: left; color: inherit; font: inherit; padding: 0;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--accent); outline: none; }
.card .img { aspect-ratio: 1 / 1; background: #fff; display: flex; align-items: center; justify-content: center; }
.card img { width: 100%; height: 100%; object-fit: contain; }
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .title { font-size: .95rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .prices { margin-top: auto; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--good); }
.was { color: var(--muted); text-decoration: line-through; margin-left: 8px; font-size: .9rem; }
.save { font-size: .75rem; font-weight: 700; background: rgba(52,211,153,.15); color: var(--good); padding: 2px 8px; border-radius: 999px; align-self: flex-start; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.foot { margin-top: 60px; padding: 28px 0; border-top: 1px solid var(--panel2); color: var(--muted); font-size: .85rem; text-align: center; }

dialog {
  width: min(960px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--panel2);
  border-radius: var(--radius); background: var(--panel); color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.7); }
.close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--text); font-size: 2rem; cursor: pointer; z-index: 2; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; }
.gallery img#m-img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #fff; border-radius: 10px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.thumbs img.active { border-color: var(--accent); }
.info h2 { margin: 0 32px 6px 0; font-size: 1.3rem; }
.m-cond { color: var(--muted); margin: 0 0 12px; }
.info .prices { margin-bottom: 16px; }
.info .price { font-size: 1.8rem; }
.btn {
  display: block; text-align: center; text-decoration: none; font-weight: 800;
  background: var(--accent); color: #111; padding: 13px; border-radius: 10px; margin-bottom: 10px;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--panel2); font-weight: 600; }
.desc { margin-top: 16px; color: #cfd3e6; font-size: .92rem; white-space: pre-line; max-height: 40vh; overflow: auto; }

@media (max-width: 720px) {
  .modal-body { grid-template-columns: 1fr; }
  .links { gap: 12px; font-size: .9rem; }
}
