/*
 * Targ. Styl: księga bez koloru w ramach (achromatic ledger). Kolor tylko na cenie, jedna zieleń pola.
 * Podłoga: kamień (#f4f3f1) zamiast szarości z zestawu. Karty białe, bez cieni, promień 8/6.
 * Telefon: tekst 16 px i cele dotyku 48 px, bo Targ otwiera się w polu, jedną ręką i w słońcu.
 * Komputer: kolumna 1200 px = filtry 264 + odstęp 24 + lista 912.
 */

@font-face {
  font-family: 'Geist';
  src: url('/fonty/geist-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonty/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ground: #f4f3f1;
  --surface: #ffffff;
  --raised: #eceae6;
  --border: #e3e1dc;
  --rule: #eeece8;
  --control: #cfccc6;
  --text: #0a0a0a;
  --muted: #5e5c57;
  --accent: #141414;
  --dane: #1f6b3a;
  --pill-warning-bg: #fffbeb;
  --pill-warning-ink: #92400e;
  --pill-negative-bg: #ffedea;
  --pill-negative-ink: #831c1e;
  --radius-card: 8px;
  --radius-control: 6px;
  --gap: 12px;
  --dotyk: 48px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }
a { color: var(--text); }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.kolumna { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Nagłówek */
.gora { background: var(--ground); border-bottom: 1px solid var(--border); }
.gora-w { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 16px; }
.marka { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; min-height: 44px; }
.znak { flex: none; display: block; }
.menu { display: none; align-items: center; gap: 24px; font-size: 15px; }
.menu a { text-decoration: none; color: var(--muted); font-weight: 500; }
.menu a:hover, .menu a[aria-current] { color: var(--text); }
.uwaga-test { background: var(--pill-warning-bg); color: var(--pill-warning-ink); border-bottom: 1px solid #fde68a; font-size: 13px; line-height: 1.35; padding: 6px 0; }
.uwaga-test .kolumna { display: block; }

.tresc-strony { padding-top: 16px; padding-bottom: 32px; }

/* Przyciski */
.przycisk, .przycisk-drugi {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--dotyk); padding: 0 18px;
  border-radius: var(--radius-control); font: 500 16px var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.przycisk { background: var(--accent); color: #fff; }
.przycisk:hover { background: #2b2b2b; }
.przycisk:active { background: #000; }
.przycisk-drugi { background: var(--raised); color: var(--text); }
.przycisk-drugi:hover { background: #e2dfd9; }
.przycisk-pelny { width: 100%; }
.przycisk-tekst { justify-self: start; background: none; border: 0; padding: 0; min-height: 44px; font: 500 15px var(--font); color: var(--text); text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.menu .przycisk { color: #fff; min-height: 40px; padding: 0 14px; font-size: 15px; }
.przyciski { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Układ listy */
.uklad { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.naglowek-listy { display: grid; gap: 4px; }
.wynik { color: var(--muted); font-size: 15px; }
.figura { font-size: 30px; line-height: 1.1; font-weight: 700; color: var(--dane); letter-spacing: -0.01em; margin-top: 4px; }
.figura-brak { font-size: 20px; font-weight: 500; margin-top: 4px; }
.okruszki { font-size: 14px; color: var(--muted); }
.okruszki a { color: var(--muted); display: inline-block; padding: 4px 0; }
.drobny { color: var(--muted); font-size: 13px; line-height: 1.4; }
.ile { color: var(--muted); font-weight: 400; }
.boczne { display: grid; gap: 12px; min-width: 0; }

/* Filtry */
.filtry { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px 10px; align-items: start; }
/* W filtrach położenie stoi w rzędzie etykiety, żeby lista zaczynała się wyżej. */
.filtry [data-gps] { position: absolute; right: 0; top: -12px; font-size: 13px; }
.pole { display: grid; gap: 4px; position: relative; min-width: 0; }
.pole > label, legend, .do-recznego label { font-size: 14px; font-weight: 500; }
input[type='text'], input[type='tel'], input[type='email'], input[type='url'], select, textarea {
  width: 100%; min-height: var(--dotyk); padding: 0 12px; background: var(--surface); color: var(--text);
  font: 400 16px var(--font); border: 1px solid var(--control); border-radius: var(--radius-control);
}
textarea { padding: 10px 12px; min-height: 72px; line-height: 1.4; resize: vertical; display: block; }
input::placeholder, textarea::placeholder { color: #6b6962; }
select:disabled { color: var(--muted); background: var(--raised); }
.podpowiedzi { list-style: none; padding: 0; position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% - 44px); background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-control); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); overflow: hidden; }
.pole > input + .podpowiedzi { top: 74px; }
.podpowiedzi button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 10px 12px; font: inherit; cursor: pointer; min-height: 48px; }
.podpowiedzi li:last-child button { border-bottom: 0; }
.podpowiedzi button:hover, .podpowiedzi button:focus-visible { background: var(--raised); }
.podpowiedzi strong { display: block; font-weight: 500; }
.podpowiedzi span { color: var(--muted); font-size: 13px; }
.filtry .przycisk-drugi { grid-column: 1 / -1; }

/* Kategorie: rząd do przesuwania na telefonie, kolumna na komputerze */
.kategorie { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.kategorie::-webkit-scrollbar { display: none; }
.kategorie a { flex: none; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-control); background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.kategorie a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.kategorie a[aria-current] .ile { color: #d4d2cd; }

/* Sprzedam / Kupię i kolejność */
.pasek-listy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.typy, .sort { display: inline-flex; gap: 2px; padding: 2px; background: var(--raised); border-radius: var(--radius-control); max-width: 100%; }
.typy a, .sort a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 5px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
/* Wybór musi być widać w słońcu, więc pełne wypełnienie, nie biel na szarym. */
.typy a[aria-current], .sort a[aria-current] { background: var(--accent); color: #fff; }
.typy a[aria-current] .ile { color: #d4d2cd; }
.nota-sortowania { margin-bottom: 10px; }
main > .typy { margin: 12px 0 8px; }

/* Kafelki: wiersz z miniaturą na telefonie, kafel ze zdjęciem na komputerze */
.siatka { list-style: none; padding: 0; display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.kafel a { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px; padding: 10px; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); text-decoration: none; }
.kafel a:hover { border-color: var(--control); }
.kafel a:active { background: #fbfaf8; }
.foto { display: block; aspect-ratio: 4 / 3; background: var(--raised); border-radius: 4px; overflow: hidden; }
.foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.foto-brak { display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.pog { display: block; font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 3px; }
.tresc { display: flex; flex-direction: column; gap: 2px; grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.nazwa { font-size: 17px; font-weight: 600; line-height: 1.25; }
.zdanie { font-size: 15px; line-height: 1.35; color: var(--muted); }
.cena { font-weight: 700; color: var(--dane); }
.linia { font-size: 14px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.slaba { color: var(--muted); }
.plakietka { display: inline-block; flex: none; white-space: nowrap; vertical-align: 2px; font-size: 11px; font-weight: 500; line-height: 16px; padding: 0 5px; border-radius: 4px; background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pusto { background: var(--surface); border: 1px dashed var(--control); border-radius: var(--radius-card); padding: 20px; display: grid; gap: 12px; }
.lista > .drobny { margin: 10px 0; }

/* Karta */
.karta { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.karta-foto .foto { border-radius: var(--radius-card); aspect-ratio: 16 / 9; }
.karta-foto .pog { font-size: 12px; margin-top: 4px; }
.karta-foto .foto-brak { font-size: 20px; }
.karta-dane { display: grid; gap: 12px; min-width: 0; }
.fakty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 2px 14px; }
.fakty > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.fakty > div:last-child { border-bottom: 0; }
.fakty dt { color: var(--muted); flex: none; }
.fakty dd { text-align: right; overflow-wrap: anywhere; }
.opis-oferty { white-space: pre-line; overflow-wrap: anywhere; }
.kontakt, .udostepnij { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; display: grid; gap: 8px; }
.numer { font-size: 26px; font-weight: 600; letter-spacing: 0.01em; }
.informacje { display: grid; gap: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.do-recznego summary { cursor: pointer; font-size: 14px; font-weight: 500; min-height: 36px; display: flex; align-items: center; }
.do-recznego input, .do-recznego textarea { margin-bottom: 10px; font-size: 14px; }
.do-recznego label { display: block; margin-bottom: 4px; }
.uwaga { background: var(--pill-warning-bg); color: var(--pill-warning-ink); border: 1px solid #fde68a; border-radius: var(--radius-control); padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.podobne { margin-top: 28px; display: grid; gap: 12px; }

/* Dodawanie */
.wybor { margin-top: 18px; display: grid; gap: 8px; }
.wybor-siatka { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wybor-siatka .kafel a { display: block; padding: 0; overflow: hidden; }
.wybor-siatka .foto { border-radius: 0; }
.wybor-siatka .pog { padding: 2px 6px 0; font-size: 10.5px; }
.wybor-siatka .tresc { padding: 2px 6px 8px; }
.wybor-siatka .nazwa { font-size: 14px; }
.formularz-uklad { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.formularz-towar { display: none; }
.formularz { display: grid; gap: 14px; min-width: 0; }
.rzad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.stala { display: flex; align-items: center; min-height: var(--dotyk); color: var(--muted); }
.z-dopiskiem { display: flex; align-items: center; gap: 8px; }
.z-dopiskiem > span { flex: none; color: var(--muted); }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { padding: 0; margin-bottom: 6px; }
fieldset label { flex: 1 1 140px; display: flex; align-items: center; gap: 10px; min-height: var(--dotyk); padding: 0 12px; background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-control); cursor: pointer; }
fieldset label:has(input:checked) { border-color: var(--text); outline: 1px solid var(--text); outline-offset: -2px; }
fieldset .blad { flex: 1 1 100%; }
input[type='radio'], input[type='checkbox'] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.zaznacz { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; cursor: pointer; padding: 4px 0; }
.oswiadczenie { font-size: 14px; color: var(--text); }
.dodatki summary { cursor: pointer; font-weight: 500; min-height: var(--dotyk); display: flex; align-items: center; }
.dodatki[open] > .pole { margin-bottom: 12px; }
.blad { color: var(--pill-negative-ink); font-size: 14px; line-height: 1.35; }
.ma-blad input, .ma-blad select, .ma-blad textarea { border-color: var(--pill-negative-ink); }
.uwaga-blad { background: var(--pill-negative-bg); color: var(--pill-negative-ink); border-radius: var(--radius-control); padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.uwaga-blad ul { padding-left: 18px; margin-top: 4px; }
.uwaga-blad a { color: inherit; }
.puste { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Komunikaty i teksty */
.komunikat { max-width: 560px; display: grid; gap: 12px; }
.komunikat h2 { margin-top: 8px; }
.komunikat label { font-size: 14px; font-weight: 500; }
.tekst { max-width: 680px; display: grid; gap: 10px; }
.tekst h2 { margin-top: 18px; }
.tekst ul { padding-left: 20px; display: grid; gap: 6px; }
.szeroki { max-width: 960px; }
.tabela { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--border); }
tbody th { font-weight: 500; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* Stopka i dolny pasek */
.stopka { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.5; padding: 16px 0 20px; }
.stopka a { color: var(--muted); }
.stopka p + p { margin-top: 4px; }
.dol { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.dol a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.dol a[aria-current] { color: var(--text); }
.dol a:active { background: var(--raised); }
.dol .dol-dodaj { color: var(--text); }
.dol .dol-dodaj svg { background: var(--accent); color: #fff; border-radius: 6px; padding: 3px; width: 30px; height: 30px; }

@media (max-width: 480px) {
  .pasek-listy { gap: 6px; }
  .typy a, .sort a { padding: 0 8px; font-size: 13px; gap: 4px; }
}

@media (min-width: 600px) and (max-width: 899.98px) {
  .siatka { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wybor-siatka { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .karta-foto .foto { aspect-ratio: 4 / 3; }
  .wybor-siatka .pog { padding: 4px 10px 0; font-size: 11px; }
  .wybor-siatka .tresc { padding: 2px 10px 10px; }
  .wybor-siatka .nazwa { font-size: 15px; }
  .filtry [data-gps] { font-size: 14px; }
  .dol { display: none; }
  .gora-w { min-height: 60px; }
  .menu { display: flex; }
  .kolumna { padding: 0 24px; }
  .tresc-strony { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
  .uklad { grid-template-columns: 264px minmax(0, 1fr); grid-template-areas: 'filtry naglowek' 'filtry lista'; gap: 16px 24px; align-items: start; }
  .naglowek-listy { grid-area: naglowek; }
  .boczne { grid-area: filtry; position: sticky; top: 16px; gap: 16px; }
  .lista { grid-area: lista; }
  .filtry { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kategorie { flex-direction: column; overflow: visible; margin: 0; padding: 0; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
  .kategorie a { justify-content: space-between; border: 0; border-radius: 0; background: none; border-bottom: 1px solid var(--rule); }
  .kategorie a:last-child { border-bottom: 0; }
  .kategorie a:first-child { border-radius: 7px 7px 0 0; }
  .kategorie a:last-child { border-radius: 0 0 7px 7px; }
  .kategorie a:hover { background: var(--ground); }
  .kategorie a[aria-current] { background: var(--raised); color: var(--text); border-color: var(--rule); }
  .kategorie a[aria-current] .ile { color: var(--muted); }
  .siatka { grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 16px; }
  .kafel a { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .kafel .foto { border-radius: 0; }
  .kafel .pog { padding: 4px 12px 0; margin: 0; }
  .kafel .tresc { padding: 6px 12px 14px; }
  .wybor-siatka { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .karta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .karta-foto { position: sticky; top: 16px; }
  .podobne .siatka { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .formularz-uklad { grid-template-columns: 280px minmax(0, 560px); gap: 32px; align-items: start; }
  .formularz-towar { display: block; position: sticky; top: 16px; }
  .formularz-towar .foto { border-radius: var(--radius-card); }
  .formularz-towar .pog { font-size: 12px; margin-top: 4px; }
  h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: no-preference) {
  .przycisk, .przycisk-drugi, .kafel a, .kategorie a, .typy a, .sort a { transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
}
