/* ---------- self-hosted Inter (no external requests, no cookies) ---------- */
/* latin covers most Western text; latin-ext adds Polish glyphs (ł ś ż ą ę ć ń ź). */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/inter-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/inter-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/inter-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ---------- design tokens ---------- */
:root {
  --ink: #000;
  --muted: #666;
  --line: #e5e5e5;
  --bg: #fff;
  --bg-alt: #f5f5f5;
  --max: 1200px;
  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

/* selection matches monochrome theme, not OS default blue */
::selection { background: var(--ink); color: #fff; }
::-moz-selection { background: var(--ink); color: #fff; }
/* inverted selection on dark sections (e.g. the black B2B band) so highlighted text stays legible */
.cta-band::selection, .cta-band ::selection { background: #fff; color: var(--ink); }
.cta-band::-moz-selection, .cta-band ::-moz-selection { background: #fff; color: var(--ink); }

body {
  min-height: 100vh;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  /* themes form-control highlights (checkboxes, and the <select> menu in Chrome/Edge) */
  accent-color: var(--ink);
}

/* best-effort themed highlight for the selected option (support varies by browser) */
option:checked,
option:hover { background: var(--ink); color: #fff; }

a { color: inherit; text-decoration: none; }
a:hover { color: #333; }
img { max-width: 100%; }

/* ---------- header / footer ---------- */
header { background: var(--bg); border-bottom: 1px solid var(--ink); }
footer { background: var(--bg); border-top: 1px solid var(--ink); font-size: 13px; line-height: 1.6; margin-top: auto; }
footer strong { letter-spacing: 0.08em; }
footer a { transition: color .2s; }
footer a:hover { color: #333; text-decoration: underline; }

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-head {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  text-transform: uppercase;
}
.footer-addr { font-style: normal; color: var(--muted); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
}
@media (max-width: 420px) {
  .footer-inner { grid-template-columns: 1fr; }
}

.logo { font-weight: 600; letter-spacing: 0.2em; font-size: 22px; }

nav { display: flex; align-items: center; flex-wrap: wrap; }
nav a {
  margin-left: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  border-bottom: 2px solid transparent;
}
nav a:hover { background: rgba(0,0,0,0.04); }
nav a.is-active { border-bottom-color: var(--ink); }

main { background: var(--bg-alt); flex: 1; }

/* ---------- homepage section ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.text-block { max-width: 560px; }
.hero-title { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 16px; }
.text-block p { font-size: 17px; margin-bottom: 20px; }
.text-block p a { border-bottom: 1px dotted #000; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero-btn {
  display: inline-block; background: var(--ink); color: #fff; padding: 12px 22px;
  border-radius: var(--radius); font-weight: 600; letter-spacing: 0.03em;
  border: 1px solid var(--ink); transition: background .15s, color .15s;
}
.hero-btn:hover { background: #333; color: #fff; }
.hero-btn-ghost { background: #fff; color: var(--ink); }
.hero-btn-ghost:hover { background: var(--bg-alt); color: var(--ink); }
.image-block { background: #ddd; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.image-block img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* rotating hero slideshow (progressive: first slide shows with JS off) */
.hero-slider { position: relative; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.hero-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid #fff; background: rgba(255,255,255,0.35); transition: background .2s;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.hero-dot:hover { background: rgba(255,255,255,0.7); }
.hero-dot.is-active { background: #fff; }
.hero-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }

/* ---------- homepage "Nasze marki" ---------- */
.brands { max-width: var(--max); margin: 0 auto; padding: 8px 20px 48px; }
.brands-title { font-size: 20px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 16px; }
/* compact 3-col grid of near-square tiles; the wordmark is zoomed to fill the
   tile and kill the dead side-margins of the wide banner artwork (issue #23) */
.brand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.brand-tile {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 5 / 4;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; transition: box-shadow .15s, transform .15s;
}
.brand-tile:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.brand-tile img { width: 100%; height: auto; display: block; transform: scale(2.7); }
.brand-tile.is-soon img { opacity: 0.72; }
.brand-badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff; background: var(--ink); padding: 3px 9px; border-radius: 999px;
}

/* ---------- homepage trust / value bar ---------- */
.value-bar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.value-grid {
  max-width: var(--max); margin: 0 auto; padding: 22px 20px;
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.value-item { display: flex; align-items: flex-start; gap: 13px; padding: 0 24px; }
.value-item:not(:first-child) { border-left: 1px solid var(--line); }
.value-icon { flex: none; color: var(--ink); }
.value-icon svg { display: block; width: 26px; height: 26px; }
.value-text { font-size: 14px; line-height: 1.5; color: var(--muted); }
.value-text strong { display: block; font-size: 15px; color: var(--ink); }

/* ---------- homepage "Polecane produkty" ---------- */
.featured { max-width: var(--max); margin: 0 auto; padding: 40px 20px 8px; }
.featured-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.featured-title { font-size: 20px; font-weight: 600; letter-spacing: 0.02em; }
.featured-all { font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.featured-all:hover { color: var(--ink); text-decoration: underline; }

/* ---------- homepage B2B call-to-action band ---------- */
.cta-band { background: var(--ink); color: #fff; }
.cta-inner {
  max-width: var(--max); margin: 0 auto; padding: 36px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-copy { max-width: 640px; }
.cta-title { font-size: 22px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 8px; }
.cta-text { font-size: 15px; line-height: 1.6; color: #ccc; }
.cta-btn {
  flex: none; background: #fff; color: var(--ink); padding: 14px 24px; border-radius: var(--radius);
  font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; transition: background .15s, color .15s;
}
.cta-btn:hover { background: #e5e5e5; color: var(--ink); }

/* contextual brand banner at the top of the catalogue results */
.brand-banner { margin-bottom: 24px; }
.brand-banner img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- catalogue shell ---------- */
.catalog { max-width: var(--max); margin: 0 auto; padding: 28px 20px 56px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.count { color: var(--muted); font-size: 13px; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search {
  border: 1px solid var(--line); background: #fff; padding: 9px 12px;
  font: inherit; font-size: 14px; border-radius: var(--radius); min-width: 220px;
}
.sort { border: 1px solid var(--line); background: #fff; padding: 9px 12px; font: inherit; font-size: 14px; border-radius: var(--radius); }
.search:focus, .sort:focus, .chip:focus-visible, .card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Page-size control (issue #50): „Pokaż: [20 ▾] na stronę". */
.perpage { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.perpage-select { border: 1px solid var(--line); background: #fff; padding: 9px 10px; font: inherit; font-size: 14px; border-radius: var(--radius); }
.perpage-select:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.perpage-go { border: 1px solid var(--ink); background: #fff; padding: 8px 12px; font: inherit; font-size: 14px; border-radius: var(--radius); cursor: pointer; }

.filter-toggle { display: none; border: 1px solid var(--ink); background: #fff; padding: 9px 14px; font: inherit; font-size: 14px; border-radius: var(--radius); cursor: pointer; }

.catalog-body { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }

/* ---------- filter sidebar ---------- */
.filters-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.filters-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.clear-filters { background: none; border: none; padding: 0; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; color: var(--muted); }
.clear-filters:hover { color: var(--ink); }
.clear-filters.is-hidden { visibility: hidden; pointer-events: none; }

.facet-group { padding: 16px 0; border-top: 1px solid var(--line); }
.facet-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.facet {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; font-size: 14px; cursor: pointer;
}
.facet-box { width: 15px; height: 15px; cursor: pointer; accent-color: #000; }
.facet-name { flex: 1; }
.facet-count { color: var(--muted); font-size: 12px; }
.facet.is-empty { opacity: 0.4; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.25); flex: none; }

/* Kategoria: collapsible Main > Sub tree (issue #36) */
.facet-main-head { display: flex; align-items: center; gap: 4px; }
.facet-main-head .facet { flex: 1; }
.facet-caret {
  flex: none; width: 22px; height: 22px; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--ink);
  font-size: 15px; line-height: 1;
}
.facet-caret:hover { color: var(--muted); }
.facet-children { margin-left: 40px; }
.facet-main.is-collapsed { padding-bottom: 0; }

/* ---------- price filter (dual-handle slider + inputs) ---------- */
.price-slider { position: relative; height: 24px; margin: 6px 6px 2px; }
.price-rail {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%);
  background: var(--line); border-radius: 999px;
}
.price-fill {
  position: absolute; top: 50%; height: 3px; transform: translateY(-50%);
  background: var(--ink); border-radius: 999px;
}
/* Two range inputs stacked on the same track: the track is inert, only the thumbs
   catch the pointer so both handles stay grabbable. */
.price-handle {
  position: absolute; left: 0; top: 0; width: 100%; height: 24px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.price-handle:focus-visible { outline: none; }
.price-handle::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.price-handle::-moz-range-thumb {
  pointer-events: auto; cursor: pointer;
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.price-handle::-webkit-slider-runnable-track { background: none; }
.price-handle::-moz-range-track { background: none; }
.price-handle:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--ink); outline-offset: 2px; }
.price-handle:focus-visible::-moz-range-thumb { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Keep the max handle above so overlapping thumbs stay draggable. */
.price-handle-max { z-index: 2; }

.price-inputs { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.price-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex: 1; }
.price-num {
  width: 100%; min-width: 0; padding: 6px 8px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
.price-num:focus { outline: none; border-color: var(--ink); }
.price-dash { color: var(--muted); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.grid--featured { grid-template-columns: repeat(4, 1fr); }

/* Pager under the grid (issue #50): ‹ 1 [2] 3 4 5 ›. */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 36px; }
.pager[hidden] { display: none; }
.pager-num, .pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
  font: inherit; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer;
}
a.pager-num:hover, a.pager-btn:hover { border-color: var(--ink); }
.pager-num.is-current { background: var(--ink); border-color: var(--ink); color: #fff; cursor: default; }
.pager-btn.is-disabled { color: var(--muted); border-color: var(--line); cursor: default; opacity: .55; }
.pager-gap { min-width: 24px; text-align: center; color: var(--muted); }
.pager-num:focus-visible, .pager-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.card {
  border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column;
  cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-alt); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-brand { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.card-name { font-size: 15px; font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.card-price { font-size: 15px; font-weight: 600; }
.card-more { font-size: 12px; color: var(--muted); }

/* Unavailable products (issue #117): whole tile dimmed + grayscale image, with a
   „Niedostępny" pill in the top corner. These also sink to the end of the results
   (ordering handled in js/catalog.js + catalog.php, not here). */
.card.is-unavailable { opacity: 0.6; }
.card.is-unavailable:hover { opacity: 0.75; }
.card.is-unavailable .card-media img { filter: grayscale(1); }
.card-badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px;
}
.empty { grid-column: 1 / -1; color: var(--muted); padding: 40px 0; }
.empty-soon { grid-column: 1 / -1; text-align: center; padding: 56px 20px; }
.empty-soon-title { font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.empty-soon-text { color: var(--muted); }

/* ---------- promo / deals price (issue #30) ---------- */
/* Shared by the card, modal and product page. A plain price is just .price-now;
   a sale adds the struck-through .price-was and a red -NN% .price-badge. Sizes
   are relative (em) so the block scales with whatever container font-size it
   sits in (card 15px, modal 20px, product page 22px). */
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; }
.price-now { font-weight: 600; }
.price.is-sale .price-now { color: #c0392b; }
.price-was { font-size: 0.8em; font-weight: 400; color: var(--muted); text-decoration: line-through; }
.price-badge {
  font-size: 0.7em; font-weight: 700; line-height: 1; color: #fff; background: #c0392b;
  padding: 3px 6px; border-radius: 4px; letter-spacing: 0.02em; align-self: center;
}
.price-omnibus { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.card-body .price-omnibus { font-size: 11px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; display: none; z-index: 50; background: rgba(0,0,0,0.55); padding: 24px; overflow-y: auto; }
.modal.open { display: flex; align-items: flex-start; justify-content: center; }
.modal-dialog {
  position: relative; background: #fff; width: min(920px, 100%); margin: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px; border-radius: var(--radius);
}
.modal-close { position: absolute; top: 8px; right: 12px; background: transparent; border: none; cursor: pointer; font-size: 36px; line-height: 1; color: var(--ink); z-index: 2; }
.modal-close:hover { color: var(--muted); }
.modal-brand-logo { position: absolute; top: 22px; right: 60px; height: 38px; width: auto; opacity: 0.9; pointer-events: none; }
.modal-main { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-alt); border-radius: var(--radius); }
.modal-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 60px; height: 60px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; border-radius: 3px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active { border-color: var(--ink); }
.modal-info { display: flex; flex-direction: column; gap: 10px; }
.modal-name { font-size: 24px; font-weight: 600; }
.modal-price { font-size: 20px; font-weight: 600; }
.modal-desc { color: #222; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: #333; }
/* Label column sizes to its content but never past 45% of the table (issue #37):
   one very long label — "Produkt wprowadzony do obrotu…" — used to widen the dt
   track for every row and squeeze the values onto two lines. Past the cap the
   label wraps instead; min-width:0 keeps either side from overflowing. */
.modal-specs { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: 4px 16px; font-size: 14px; margin: 4px 0; }
.modal-specs dt { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.modal-specs dd { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
/* Multi-value parameters (issue #118): 2+ values render as small wrapping chips
   so long lists never overflow the value cell; single values stay plain text.
   Shared by the JS catalogue modal and the SSR product page. */
.spec-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.spec-chip {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-alt); font-weight: 500; font-size: 13px; line-height: 1.5;
}

/* Product variants (issue #32): a row of thumbnail swatches (colour, size, shelf
   count, …), shared by the product page and the catalogue modal. */
.variants { display: flex; flex-direction: column; gap: 8px; }
.variants-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-swatch {
  width: 72px; height: 72px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; padding: 0; background: var(--bg-alt); flex: none; display: block;
  transition: border-color 0.12s ease;
}
.variant-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.variant-swatch:hover { border-color: var(--ink); }
.variant-swatch.is-active { border-color: var(--ink); border-width: 2px; cursor: default; }
.buy { margin-top: auto; display: inline-block; text-align: center; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: var(--radius); font-weight: 600; letter-spacing: 0.03em; }
.buy:hover { color: #fff; background: #333; }
.buy.is-disabled { background: #bbb; cursor: default; }
/* Stock note (issue #82): plain „Na stanie" is muted; low stock is emphasised. */
.product-stock { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.product-stock.is-low { color: #b23b3b; }
.modal-fullpage { margin-top: 8px; font-size: 14px; color: var(--muted); align-self: flex-start; }
.modal-fullpage:hover { color: var(--ink); text-decoration: underline; }

/* ---------- product detail page (produkt.php) ---------- */
/* Centered, padded container: fixes the full-width sprawl AND gives the
   absolutely-positioned brand logo breathing room from the viewport edge. */
.product { position: relative; max-width: 1080px; margin: 0 auto; padding: 40px 20px; }
.product-brand-logo { position: absolute; top: 40px; right: 20px; height: 38px; width: auto; opacity: 0.9; pointer-events: none; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { text-decoration: underline; }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
/* Cap the main image height so it stays balanced against the info column. */
.product-main { width: 100%; aspect-ratio: 1 / 1; max-height: 480px; object-fit: cover; background: var(--bg-alt); border-radius: var(--radius); }
.product-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.product-thumbs .thumb { width: 80px; height: 80px; }
.product-info { display: flex; flex-direction: column; gap: 12px; }
.product-name { font-size: 28px; font-weight: 600; }
.product-price { font-size: 22px; font-weight: 600; }
.product-desc { color: #222; }
.product-back { margin-top: 6px; font-size: 14px; color: var(--muted); }
.product-back:hover { text-decoration: underline; }

/* Legal / safety block (issue #29): GPSR responsible person + safety PDF. */
.product-legal { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.product-legal-line { font-size: 13px; color: var(--muted); margin: 0; }
.product-legal-link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.product-legal-link:hover { color: var(--muted); }

/* Responsible-person modal. Reuses .modal / .modal-dialog; single-column and
   opened by CSS :target (no JS required to open). */
.legal-modal:target { display: flex; align-items: flex-start; justify-content: center; }
.legal-dialog { display: block; width: min(520px, 100%); }
.legal-specs { margin-top: 4px; }
.legal-specs dd a { text-decoration: underline; text-underline-offset: 2px; }

/* Photo lightbox (issue #52): fullscreen view of the main gallery image, built
   in JS (see produkt.php). Shown by clearing [hidden]; prev/next flank the image. */
.product-main.is-zoomable { cursor: zoom-in; }
body.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px 72px; background: rgba(0,0,0,0.85); }
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 100%; max-height: 88vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: 14px; right: 20px; background: transparent; border: none; cursor: pointer; font-size: 40px; line-height: 1; color: #fff; z-index: 2; }
.lightbox-close:hover { color: #ccc; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.12); border: none; cursor: pointer; color: #fff; font-size: 34px; line-height: 1; width: 52px; height: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.lightbox-nav:hover { background: rgba(255,255,255,0.28); }
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }

/* ---------- custom themed dropdown (replaces native <select>) ---------- */
.cselect { position: relative; display: inline-block; }
.cselect-native { display: none; }  /* hidden; still submits its value in forms + no-JS fallback shows it */
.cselect-btn {
  font: inherit; font-size: 14px; padding: 9px 34px 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  cursor: pointer; text-align: left; width: 100%; min-width: 160px; position: relative;
}
.cselect-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cselect-caret {
  position: absolute; right: 13px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
}
.cselect-btn[aria-expanded="true"] .cselect-caret { transform: translateY(-30%) rotate(225deg); }
.cselect-list {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); list-style: none; padding: 4px;
  max-height: 300px; overflow: auto; white-space: nowrap;
}
.cselect-opt { padding: 8px 12px; border-radius: 3px; cursor: pointer; font-size: 14px; }
.cselect-opt.is-active { background: var(--ink); color: #fff; }   /* themed hover — no more blue */
.cselect-opt[aria-selected="true"] { font-weight: 600; }
.cselect-opt[aria-selected="true"].is-active { color: #fff; }

/* ---------- content page + B2B form ---------- */
.page { max-width: 900px; margin: 0 auto; padding: 40px 20px 64px; }
.page-head { max-width: 640px; margin: 0 auto 28px; text-align: center; }
.page-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 12px; }
.page-lead { color: #222; }

.order-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }

.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.info-card h2 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.info-card h2:first-child { margin-top: 0; }
.info-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.info-card li { padding-left: 16px; position: relative; }
.info-card li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.info-card p { font-size: 14px; }
.info-card a { border-bottom: 1px dotted #000; }

/* "Podobne produkty" on the product page (issue #21). Reuses the catalogue
   .card/.grid; a tighter minmax keeps ~4 across under the constrained width. */
.related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.related-head { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.related-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Pipe-split "Informacje dodatkowe" feature list in the spec table (issue #34). */

/* ---------- detailed product description (issue #34) ---------- */
.product-detail { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.product-detail-head { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.product-detail-body { max-width: 960px; margin: 0 auto; color: #222; line-height: 1.7; }
.product-detail-body h1, .product-detail-body h2, .product-detail-body h3, .product-detail-body h4 {
  font-weight: 600; line-height: 1.3; margin: 28px 0 12px; color: var(--ink);
}
.product-detail-body h2 { font-size: 20px; }
.product-detail-body h3 { font-size: 17px; }
.product-detail-body h4 { font-size: 15px; }
.product-detail-body p { margin: 0 0 14px; }
.product-detail-body ul, .product-detail-body ol { margin: 0 0 14px; padding-left: 22px; }
.product-detail-body li { margin: 4px 0; }
.product-detail-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.product-detail-body > *:first-child { margin-top: 0; }
.product-detail-img {
  display: block; width: 100%; height: auto; margin: 0 auto;
  border-radius: var(--radius); background: var(--bg-alt);
}
/* Admin live-preview only (issue #40): a [[img:N]] token whose gallery slot is
   empty/out-of-range. Never emitted on the live page — there such tokens drop. */
.product-detail-imgph {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: 16px; text-align: center;
  border: 2px dashed #c7ccd4; border-radius: var(--radius);
  background: var(--bg-alt); color: #6b7280; font-size: 14px; font-weight: 600;
}

/* BaseLinker 12-col layout preserved from the XML (issue #34): a `.section` is a
   row; `.item-6` = half width (image|text side-by-side), `.item-12` = full width.
   The admin can re-flow a row by editing item-6 ↔ item-12 in the description HTML. */
.product-detail-body .section {
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; margin: 0 0 16px;
  /* These rows inherit the homepage .section box (padding: 40px 20px) by class
     name — that 40px top+bottom was most of the dead space between rows. Drop the
     vertical padding only; the 20px sides stay so the row keeps its width. */
  padding: 0 20px; max-width: none;
}
.product-detail-body .section:last-child { margin-bottom: 0; }
.product-detail-body .item { flex: 1 1 100%; min-width: 0; }
.product-detail-body .item-6 { flex: 1 1 calc(50% - 32px); }
.product-detail-body .item-4 { flex: 1 1 calc(33.333% - 32px); }
.product-detail-body .item-3 { flex: 1 1 calc(25% - 32px); }
.product-detail-body .item-8 { flex: 1 1 calc(66.666% - 32px); }
.product-detail-body .item-12 { flex: 1 1 100%; }
/* Inside a grid the image sits flush; vertical spacing comes from the row gap. */
.product-detail-body .image-item { margin: 0; }
.product-detail-body .text-item > *:first-child { margin-top: 0; }
.product-detail-body .text-item > *:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .product-detail-body .item-6,
  .product-detail-body .item-4,
  .product-detail-body .item-3,
  .product-detail-body .item-8 { flex-basis: 100%; }
}

.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-size: 13px; font-weight: 500; }
.req { color: #b23b3b; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; max-height: 320px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: #333; cursor: pointer; }
.consent input { margin-top: 3px; width: 15px; height: 15px; accent-color: #000; flex: none; }

/* Cloudflare Turnstile (issue #35): the widget is a fixed-width iframe dropped
   into a full-width div, so centre it in the form column (issue #37). */
.form .cf-turnstile { display: flex; justify-content: center; }

.btn {
  align-self: flex-start; background: var(--ink); color: #fff; border: none;
  padding: 13px 24px; border-radius: var(--radius); font: inherit; font-weight: 600;
  letter-spacing: 0.03em; cursor: pointer;
}
.btn:hover { background: #333; }
/* Submit sits at the end of the form column, under the widget (issue #37). */
.form .btn { align-self: flex-end; }
.form-note { font-size: 13px; color: var(--muted); }
.form-note a { border-bottom: 1px dotted currentColor; }
.form-note--ok { color: #1a7f37; }
.form-note--error { color: #b3261e; }

/* Honeypot: kept in the DOM for bots, removed from view/flow for humans. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .value-grid { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .value-item:not(:first-child) { border-left: none; }
  .value-item:nth-child(even) { border-left: 1px solid var(--line); }
  .grid--featured { grid-template-columns: repeat(2, 1fr); }
  .order-layout { grid-template-columns: 1fr; }
  .catalog-body { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-block; order: -1; }
  .filters {
    display: none; margin-bottom: 20px; padding: 4px 16px 12px;
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  }
  .filters.open { display: block; }
}
@media (max-width: 767px) {
  .value-grid { grid-template-columns: 1fr; gap: 14px; }
  .value-item, .value-item:nth-child(even) { border-left: none; padding: 0; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .header-inner { flex-wrap: wrap; justify-content: center; }
  nav { justify-content: center; }
  nav a { margin: 4px; }
  .section { grid-template-columns: 1fr; padding: 24px 16px; }
  .toolbar-right { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .search { flex: 1 1 100%; min-width: 0; }
  .sort { flex: 1 1 auto; }
  .perpage { flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .modal { padding: 0; }
  .modal-dialog { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; }
  .product-layout { grid-template-columns: 1fr; gap: 20px; }
  .product-brand-logo { height: 30px; }
  .brand-grid { grid-template-columns: 1fr 1fr; }
}
