/* ===== Tokeny: tryb jasny / ciemny ===== */
:root {
  --bg: #f3f2ee; --surface: #ffffff; --surface-2: #ebe9e3; --text: #1a1c20; --muted: #5a5f68;
  --line: #d9d6cd; --accent: #a85f00; --btn-bg: #1a1c20; --btn-fg: #ffffff;
  --shadow: 0 1px 2px rgba(20,20,20,.06), 0 6px 20px rgba(20,20,20,.06);
  --radius: 12px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #121417; --surface: #1b1e23; --surface-2: #252930; --text: #eceae4; --muted: #a0a5ae;
  --line: #2f343c; --accent: #f5a623; --btn-bg: #f5a623; --btn-fg: #14161a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: .2px; }
.wrap { width: min(1280px, 100% - 32px); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===== Nagłówek ===== */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font: 700 22px var(--font-head); letter-spacing: .5px; text-transform: uppercase; }
.brand-text small { color: var(--muted); font-size: 12px; display: none; }
.tools { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang a { text-decoration: none; font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 999px; color: var(--muted); min-width: 36px; text-align: center; }
.lang a[aria-current] { background: var(--btn-bg); color: var(--btn-fg); }
.theme-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }

main { padding: 20px 0 48px; min-height: 70vh; }
.page-title { font-size: 34px; margin-bottom: 16px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 20px 0 28px; }

/* ===== Przyciski / pola ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; background: var(--btn-bg); color: var(--btn-fg); font: 600 15px var(--font); text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.wide { width: 100%; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--btn-fg); font: 600 12px/22px var(--font); text-align: center; }
:root:not([data-theme="dark"]) .badge { color: #fff; }

input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 0 12px; width: 100%; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

/* ===== Lista + filtry ===== */
.layout { display: grid; gap: 16px; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); }
.search svg { flex: none; color: var(--muted); }
.search input { border: 0; background: transparent; padding: 0; }
.search input:focus-visible { outline: none; }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.adv { margin-top: 10px; }
.adv > summary { list-style: none; cursor: pointer; font: 700 18px var(--font-head); text-transform: uppercase; letter-spacing: .6px; padding: 10px 2px; display: flex; align-items: center; gap: 8px; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.adv[open] > summary::after { transform: rotate(180deg); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; padding-top: 4px; }
.field { display: flex; flex-direction: column; gap: 4px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 8px; }
.range legend { grid-column: 1 / -1; margin-bottom: 4px; float: left; width: 100%; }
.range.power { grid-template-columns: 1fr auto 1fr 84px; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.actions .btn { flex: 1; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.count { color: var(--muted); font-weight: 500; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort span { color: var(--muted); font-size: 14px; display: none; }
.sort select { width: auto; min-width: 190px; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
.card { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, border-color .18s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.photos { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; padding: 3px 9px; border-radius: 999px; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h2 { font-size: 24px; }
.sub { color: var(--muted); margin: 0; font-size: 14px; }
.specs { margin: 2px 0 0; font-weight: 500; font-size: 15px; }
.price-row { margin-top: auto; padding-top: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); }
.price strong { font: 700 28px/1 var(--font-head); color: var(--accent); }
.price small { color: var(--muted); font-size: 13px; }
.price span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.more { font-weight: 600; font-size: 14px; white-space: nowrap; }

@media (min-width: 640px) {
  .brand-text small { display: block; }
  .sort span { display: inline; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .page-title { font-size: 44px; }
  .layout { grid-template-columns: 300px 1fr; align-items: start; }
  .filters { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
  .adv > summary { pointer-events: none; }
  .adv > summary::after { display: none; }
  .grid { grid-template-columns: 1fr; }
}
@media (min-width: 1280px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1500px) { .wrap { width: min(1440px, 100% - 48px); } .cards { grid-template-columns: repeat(3, 1fr); } }

/* ===== Strona pojazdu ===== */
.crumb { margin: 0 0 12px; }
.crumb a { text-decoration: none; color: var(--muted); font-weight: 600; }
.crumb a:hover { color: var(--text); }
.v-head h1 { font-size: 30px; }
.v-head .sub { margin-top: 6px; font-size: 15px; }
.v-grid { display: grid; gap: 20px; margin-top: 16px; }

.gallery .stage { position: relative; background: #0c0d0f; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; display: grid; place-items: center; touch-action: pan-y; }
.gallery .stage img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.nav:hover { background: rgba(0,0,0,.8); }
.nav.prev { left: 10px; } .nav.next { right: 10px; }
.counter { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.thumbs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
.thumbs li { flex: 0 0 auto; scroll-snap-align: start; }
.thumbs button { display: block; width: 88px; height: 62px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); opacity: .65; }
.thumbs button[aria-current] { border-color: var(--accent); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.buy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); align-self: start; }
.buy h2 { font-size: 22px; margin: 20px 0 6px; text-transform: uppercase; letter-spacing: .6px; }
.price.big { margin-bottom: 14px; }
.price.big strong { font-size: 40px; }
.price.big span { font-size: 14px; }
.data { margin: 0; }
.data > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.data > div:last-child { border-bottom: 0; }
.data dt { color: var(--muted); }
.data dd { margin: 0; font-weight: 600; text-align: right; }

.equipment { margin-top: 32px; }
.equipment h2 { font-size: 28px; }
.equipment .note { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.eq-grid { display: grid; gap: 10px; }
.eq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.eq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 52px; font: 700 19px var(--font-head); text-transform: uppercase; letter-spacing: .5px; }
.eq summary::-webkit-details-marker { display: none; }
.eq summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.eq[open] summary::after { transform: rotate(180deg); }
.eq ul { margin: 0; padding: 0 0 14px; list-style: none; columns: 1; }
.eq li { padding: 5px 0 5px 20px; position: relative; break-inside: avoid; font-size: 15px; }
.eq li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }

@media (min-width: 640px) { .v-head h1 { font-size: 40px; } .eq ul { columns: 2; column-gap: 28px; } }
@media (min-width: 960px) {
  .v-grid { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
  .buy { position: sticky; top: 76px; }
  .v-head h1 { font-size: 48px; }
  .eq-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .eq ul { columns: 1; }
}

/* ===== Lightbox ===== */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.94); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; touch-action: pan-y; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 32px; cursor: pointer; z-index: 2; }
.lightbox .nav { position: absolute; z-index: 2; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== Poprawki mobile (zapobiegają przewijaniu poziomemu) ===== */
.v-grid > *, .layout > * { min-width: 0; }
.bar { min-width: 0; }
.brand { min-width: 0; }
.brand-text b { font-size: 19px; }
@media (max-width: 420px) {
  .brand svg { width: 32px; height: 22px; }
  .brand-text b { font-size: 17px; }
  .tools { gap: 6px; }
  .lang a { padding: 6px 7px; min-width: 30px; font-size: 12px; }
  .theme-btn { width: 36px; height: 36px; }
}
.eq-grid { grid-template-columns: minmax(0, 1fr); }
.eq-grid > *, .vehicle { min-width: 0; }
.eq li { overflow-wrap: anywhere; }
@media (min-width: 960px) { .eq-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.eq-t { min-width: 0; overflow-wrap: anywhere; }
.eq summary .badge { flex: none; }
.eq summary::after { flex: none; }

/* ===== Dodatki: paginacja, rezerwacja ===== */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0 8px; flex-wrap: wrap; }
.pager-info { color: var(--muted); font-weight: 500; }
.thumb { position: relative; }
.ribbon { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #14161a; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.status-note { margin: 0 0 10px; color: var(--accent); font-weight: 700; }
.site-footer a { color: inherit; }

/* cel dotykowy logo ≥ 44 px (audyt mobilny) */
.brand { min-height: 44px; }

/* ===== Urządzenia dotykowe: cele ≥ 44 px (audyt mobilny) ===== */
.adv summary { min-height: 44px; }
@media (pointer: coarse), (max-width: 640px) {
  .lang { padding: 0; }
  .lang a { min-width: 40px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
  .theme-btn { width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .brand svg { display: none; }   /* na wąskich ekranach sam napis – mieści się przełącznik języka i motywu */
}

/* ===== Kontakt: WhatsApp, telefon, pasek mobilny, formularz zapytania ===== */
.btn.wa { background: #0f7a40; color: #fff; gap: 8px; }
.btn.wa:hover { background: #0c6535; }
.contact { display: grid; gap: 8px; margin-bottom: 8px; }
.contact .hint { margin: 2px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.sticky-contact { display: none; }
@media (max-width: 899px) {
  .sticky-contact { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.12); }
  .sticky-contact .sc-price { flex: 1; min-width: 0; line-height: 1.1; }
  .sticky-contact .sc-price strong { display: block; font: 700 20px var(--font-head); color: var(--accent); white-space: nowrap; }
  .sticky-contact .sc-price small { color: var(--muted); font-size: 12px; }
  .sticky-contact .btn { min-height: 48px; padding: 0 16px; }
  body:has(.sticky-contact) { padding-bottom: 76px; }
  /* pierwszy blok kontaktu przy cenie – pasek już go zastępuje na telefonie */
  .buy .contact { display: none; }
}
.inquiry { max-width: 640px; margin: 28px 0; }
.inquiry h2 { font-size: 24px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.inquiry form { display: grid; gap: 12px; }
.inquiry textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 120px; resize: vertical; }
.inquiry input, .inquiry textarea { font-size: 16px; }
.inquiry .err { color: #b3261e; font-size: 13px; font-weight: 600; }
:root[data-theme="dark"] .inquiry .err { color: #ff8a80; }
.inquiry [aria-invalid="true"] { border-color: #b3261e; }
.check { display: flex; gap: 12px; align-items: center; font-size: 14px; min-height: 44px; padding: 6px 0; cursor: pointer; }
.check input { width: 24px; min-height: 24px; height: 24px; flex: none; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.flash { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); margin: 0 0 8px; }
.flash.success { border-color: #0f7a40; }
.flash.error { border-color: #b3261e; }

.prose { max-width: 720px; margin: 8px auto 32px; }
.prose h1 { font-size: 34px; margin-bottom: 12px; }
.prose h2 { font-size: 22px; margin: 24px 0 6px; text-transform: uppercase; letter-spacing: .5px; }
.prose p { margin: 0 0 10px; }
.site-footer a { display: inline-block; padding: 8px 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.check span a { display: flex; align-items: center; min-height: 44px; }
