:root {
  color-scheme: light;
  --bg: #e6e6e6;
  --panel: #f4f4f4;
  --panel-2: #ffffff;
  --line: #c6c9cf;
  --text: #1b1e23;
  --muted: #59616d;
  --accent: #cc4700;
  --accent-ink: #ffffff;
  --ok: #18804f;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
h2, h3, p { margin: 0; }
button, select, input { font: inherit; color: inherit; }

/* ---------- header ---------- */
.site-head {
  /* --edge poravnava sadržaj zaglavlja sa .layout (max 1500px, 24px sa strane) */
  --edge: max(24px, calc((100% - 1500px) / 2 + 24px));
  --logo-size: clamp(34px, 4.4vw, 64px);
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 36px);
  padding: 20px var(--edge);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 24px); text-decoration: none; color: var(--text); flex: none; }
.logo-mark {
  background: var(--accent); color: var(--accent-ink);
  font-weight: 900; letter-spacing: .5px; line-height: 1.2;
  padding: .32em .7em; border-radius: .28em; font-size: clamp(24px, 3vw, 44px);
}
.logo-text { font-size: var(--logo-size); font-weight: 900; letter-spacing: -.5px; line-height: 1.1; white-space: nowrap; }
/* Slogan u dva reda, visok tačno koliko i velika slova natpisa: vrh prvog reda je u ravni sa
   vrhom slova "New Bike Day", a osnova drugog reda sa njihovom osnovom.
   0.378 = visina velikog slova (0.7) / (0.7 + prored 1.15); top spušta blok na zajedničku osnovu. */
.tagline {
  color: var(--muted); font-size: calc(var(--logo-size) * .378); line-height: 1.15;
  white-space: nowrap; position: relative; top: .105em;
}

/* ---------- jezik / donacije ---------- */
.head-actions { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.lang button {
  background: var(--panel-2); border: 0; padding: 3px 7px; cursor: pointer;
  font-weight: 700; font-size: 10px; line-height: 1.3; letter-spacing: .5px; color: var(--muted);
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.donate {
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
  padding: 7px 13px; border-radius: 7px; white-space: nowrap; font-size: 13.5px;
}
.donate:hover { filter: brightness(1.1); }

/* ---------- top picker ---------- */
.picker {
  position: sticky; top: 0; z-index: 20;
  --edge: max(24px, calc((100% - 1500px) / 2 + 24px));
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 14px; align-items: end;
  /* levo: širina panela sa specifikacijama (290px) + razmak (24px), da polja stoje iznad tabele */
  padding: 14px var(--edge) 14px calc(var(--edge) + 314px);
  background: rgba(230, 230, 230, .96);
  border-bottom: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .sort > span {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted);
}
select, input[type="number"] {
  width: 100%; min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select.active, input.active { border-color: var(--accent); }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px;
  padding: 24px; max-width: 1500px; margin: 0 auto;
}

/* ---------- filters ---------- */
.filters {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; align-self: start;
  position: sticky; top: 92px; max-height: calc(100vh - 108px); overflow-y: auto;
}
.filters-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.filters-head h2 { font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.group { padding: 12px 0; border-top: 1px solid var(--line); }
.group h3 { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.group h3 small { color: var(--muted); font-weight: 400; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.range span { color: var(--muted); }
.range input { padding: 7px 9px; }

.chips, .toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .toggle {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.toggle { border-radius: 8px; padding: 7px 11px; }
.chip:hover, .toggle:hover { color: var(--text); border-color: #8a919c; }
.chip[aria-pressed="true"], .toggle[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.toggle[aria-pressed="true"]::before { content: "✓ "; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.count { font-size: 16px; font-weight: 600; margin-right: auto; }
.count b { color: var(--accent); }
.sort { display: flex; align-items: center; gap: 8px; }
.sort select { width: auto; }
.btn-filters { display: none; }
.btn, .btn-filters {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; cursor: pointer;
}
.btn:hover, .btn-filters:hover { border-color: var(--accent); }
#filterCount:not(:empty) {
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
  padding: 0 7px; font-size: 12px; font-weight: 700; margin-left: 4px;
}

/* ---------- table ---------- */
.table-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; }
thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--panel); user-select: none;
}
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--text); }
th.sorted { color: var(--accent); }
th.sorted::after { content: " ▲"; font-size: 9px; }
th.sorted.desc::after { content: " ▼"; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { border-top: 1px solid var(--line); cursor: pointer; }
tbody tr:first-child { border-top: 0; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.selected { background: rgba(204, 71, 0, .1); box-shadow: inset 3px 0 0 var(--accent); }
.m-brand { color: var(--muted); font-size: 12px; }
.m-name { font-weight: 600; white-space: normal; }
.m-type { color: var(--muted); font-size: 12px; }
td.hl { color: var(--accent); font-weight: 700; }
.eq { display: flex; gap: 4px; }
.eq span {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted);
}
.eq span.want { border-color: var(--accent); color: var(--accent); }
.btn-reset { height: 40px; white-space: nowrap; }
.btn-reset:hover { color: var(--accent); }
.ver { color: var(--ok); font-weight: 700; }
.gear { color: var(--muted); font-size: 13px; }
.detail-src { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.detail-src.ok { color: var(--ok); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 14px; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 14px; max-width: 900px; }

/* ---------- detail card ---------- */
.detail {
  background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 20px; position: relative;
}
.detail-brand { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.detail h2 { font-size: 24px; margin: 2px 40px 2px 0; }
.detail-type { color: var(--muted); margin-bottom: 14px; }
.detail-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1;
}
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.spec { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.spec dt { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.spec dd { margin: 2px 0 0; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.spec dd small { font-size: 12px; font-weight: 400; color: var(--muted); }
dl { margin: 0; }
.eq-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 0; list-style: none; }
.eq-list li { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.eq-list li.yes { color: var(--ok); border-color: rgba(24, 128, 79, .45); }
.eq-list li.yes::before { content: "✓ "; }
.eq-list li.no { text-decoration: line-through; opacity: .6; }

/* ---------- servisni delovi ---------- */
.parts { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.parts h3 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.parts-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.parts-links span { color: var(--muted); font-size: 13px; }
.parts-links a {
  font-size: 13px; padding: 4px 10px; border-radius: 999px; text-decoration: none;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.parts-links a::after { content: " ↗"; color: var(--muted); }
.parts-links a:hover { border-color: var(--accent); color: var(--accent); }
.parts p { font-size: 12.5px; color: var(--muted); }

/* ---------- poređenje ---------- */
.pick-col { width: 36px; padding-right: 0; cursor: pointer; }
.pick {
  display: block; width: 20px; height: 20px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--panel-2); border: 2px solid #8a919c;
  font-size: 12px; font-weight: 900; line-height: 16px; text-align: center; color: var(--accent-ink);
}
.pick:hover { border-color: var(--accent); }
.pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.pick[aria-pressed="true"]::before { content: "✓"; }
#cmpClear[aria-pressed="true"]::before { content: "×"; font-size: 15px; }
#cmpClear:disabled { opacity: .45; cursor: default; border-color: #8a919c; }
.cmp-full .pick[aria-pressed="false"] { opacity: .3; cursor: not-allowed; }
.btn-compare { font-weight: 700; }
.btn-compare:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-compare:not(:disabled):hover { filter: brightness(1.1); }
.btn-compare:disabled { color: var(--muted); cursor: default; }
.btn-compare:disabled:hover { border-color: var(--line); }

.compare h2 { margin-bottom: 12px; }
.cmp-scroll { overflow-x: auto; }
table.cmp { table-layout: fixed; min-width: 460px; }
table.cmp th, table.cmp td { white-space: normal; padding: 8px 12px; vertical-align: top; }
table.cmp thead th {
  position: relative; text-transform: none; letter-spacing: 0; font-size: 12px;
  background: none; padding-right: 34px; border-bottom: 1px solid var(--line);
}
table.cmp thead th:first-child, table.cmp tbody th { width: 150px; }
table.cmp tbody th { font-size: 12.5px; font-weight: 400; color: var(--muted); }
table.cmp tbody tr { cursor: default; }
table.cmp tbody tr:hover { background: none; }
table.cmp td { font-variant-numeric: tabular-nums; }
table.cmp td.best { color: var(--accent); font-weight: 700; }
table.cmp td.na { color: var(--muted); }
.cmp-name { font-size: 17px; font-weight: 700; color: var(--text); }
.cmp-x {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; line-height: 1;
}
.cmp-x:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .site-head { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .head-actions { flex-direction: row; align-items: center; }
  .tagline { display: none; }
  .picker { grid-template-columns: 1fr 1fr; padding: 10px 16px; gap: 10px; position: static; }
  .field-wide { grid-column: 1 / -1; }
  .btn-reset { grid-column: 1 / -1; }
  .site-head { --logo-size: 26px; }
  .logo-mark { font-size: 19px; }
  .head-actions { margin-left: 0; width: 100%; justify-content: space-between; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .filters { position: static; max-height: none; display: none; }
  .filters.open { display: block; }
  .btn-filters { display: inline-block; }
  .count { margin-right: 0; flex: 1; }
  .sort > span { display: none; }
  th, td { padding: 9px 10px; }
}
