/* =========================================================
   /CZESCI — programmatic SEO: hub producentów, lista, produkt.
   Ładowany tylko na tych podstronach (Template_: 'css' => 'czesci'),
   korzysta z tokenów i klas bazowych (.section, .sec-head, .kicker,
   .offer-panel, .copy-chip, .cta-band).
   ========================================================= */

.parts-head { padding-top: clamp(1.6rem, 3.5vw, 3rem); }
.parts .sec-head h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.8rem);
  line-height: 0.92;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* ---------- Okruszki ---------- */
.crumbs {
  margin-bottom: clamp(1.6rem, 3.5vw, 2.8rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; }
.crumbs li { display: flex; align-items: center; gap: 0.6rem; min-width: 0; color: var(--muted); }
.crumbs li + li::before { content: "/"; color: var(--red); }
.crumbs a { color: var(--ink); text-decoration: none; transition: color 150ms; }
.crumbs a:hover { color: var(--red); }
.crumbs [aria-current] { color: var(--faint); }
.crumbs [aria-current] span {
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Hub: indeks producentów A–Z ---------- */
.az-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.az-nav a {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: background 180ms, color 180ms;
}
.az-nav a:hover { background: var(--red); color: #fff; }

.az-group { scroll-margin-top: 100px; margin-bottom: clamp(1.8rem, 3.5vw, 2.6rem); }
.az-letter {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
  color: var(--red);
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line-strong);
}
.brand-index {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(0.4rem, 0.8vw, 0.6rem);
}
.brand-index a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: background 180ms var(--ease);
}
.brand-index-name { font-weight: 700; font-size: 0.92rem; text-transform: uppercase; color: var(--ink); overflow-wrap: anywhere; transition: color 180ms; }
.brand-index-count { flex: none; font-family: var(--mono); font-size: 0.72rem; color: var(--faint); transition: color 180ms; }
.brand-index a:hover { background: var(--ink); }
.brand-index a:hover .brand-index-name { color: #fff; }
.brand-index a:hover .brand-index-count { color: var(--red); }

/* ---------- Marki priorytetowe (seo_priority_groups) ---------- */
.brand-index a.is-priority { box-shadow: inset 3px 0 0 var(--red), var(--shadow-card); }
.brand-index--featured a { background: var(--ink); padding-block: 1rem; }
.brand-index--featured .brand-index-name { color: #fff; }
.brand-index--featured .brand-index-count { color: rgba(255, 255, 255, 0.55); }
.brand-index--featured a:hover { background: var(--red); }
.brand-index--featured a:hover .brand-index-count { color: #fff; }

.parts-featured { padding: clamp(2.2rem, 4.5vw, 3.4rem) 0; background: var(--paper); }
.parts-featured .kicker { margin-bottom: 1.2rem; }
.brand-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.brand-chips a {
  display: inline-block;
  padding: 0.6rem 0.95rem;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--red), var(--shadow-card);
  transition: background 180ms, color 180ms;
}
.brand-chips a:hover { background: var(--ink); color: #fff; }
.brand-chips a.is-hub { background: var(--ink); color: #fff; }
.brand-chips a.is-hub:hover { background: var(--red); }

/* Powiązane grupy na stronie producenta (np. STELLOX ↔ STELLOX CZUJNIKI) */
.brand-siblings { margin: calc(-1 * clamp(1rem, 2.5vw, 2rem)) 0 clamp(1.6rem, 3vw, 2.4rem); }
.brand-siblings-label {
  margin-bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Lista produktów (producent, powiązane) ---------- */
.parts-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.5rem, 1.1vw, 1rem);
}
.parts-grid > li { display: flex; min-width: 0; }
.part-card {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 0.35rem 1rem;
  padding: 1.1rem 1.3rem;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: background 200ms var(--ease);
}
.part-card-code { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--red); overflow-wrap: anywhere; }
.part-card-name { grid-column: 1; font-weight: 700; font-size: 0.98rem; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; transition: color 200ms; }
.part-card-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--faint);
  transition: color 200ms, transform 220ms var(--ease);
}
.part-card:hover { background: var(--ink); }
.part-card:hover .part-card-name { color: #fff; }
.part-card:hover .part-card-arrow { color: var(--red); transform: translateX(4px); }

/* ---------- Paginacja ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.2rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.pager-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pager-list a, .pager-current {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.6rem;
  text-decoration: none;
}
.pager-list a { background: #fff; color: var(--ink); box-shadow: var(--shadow-card); transition: background 150ms, color 150ms; }
.pager-list a:hover { background: var(--ink); color: #fff; }
.pager-current { background: var(--red); color: #fff; font-weight: 500; }
.pager-gap { display: grid; place-items: center; min-width: 1.4rem; color: var(--faint); }
.pager-step { padding: 0.6rem 0.2rem; color: var(--ink); text-decoration: none; text-transform: uppercase; letter-spacing: 0.08em; transition: color 150ms; }
.pager-step:hover { color: var(--red); }

.parts-back { margin-top: clamp(1.6rem, 3vw, 2.4rem); font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; }
.parts-back a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--red); padding-bottom: 0.15rem; transition: color 150ms; }
.parts-back a:hover { color: var(--red); }

/* ---------- Strona produktu ---------- */
.part-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: clamp(1.8rem, 4vw, 4rem);
  align-items: start;
}
.part-title {
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  line-height: 1;
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.part-media {
  display: grid;
  place-items: center;
  max-width: 560px;
  aspect-ratio: 4 / 3;
  margin: 0 0 clamp(1.4rem, 3vw, 2rem);
  padding: 1.5rem;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.part-media img { width: 100%; height: 100%; object-fit: contain; }

.part-content { max-width: 72ch; color: var(--muted); font-size: 1.02rem; line-height: 1.75; }
.part-content > * + * { margin-top: 1rem; }
.part-content h2, .part-content h3 { margin-top: 2rem; color: var(--ink); font-weight: 800; text-transform: uppercase; line-height: 1.15; }
.part-content h2 { font-size: 1.3rem; }
.part-content h3 { font-size: 1.08rem; }
.part-content ol { padding-left: 1.3rem; }
.part-content li + li { margin-top: 0.4rem; }

/* Listy w opisie: czerwony długi myślnik zamiast kropki */
.part-content ul { list-style: none; padding-left: 0; }
.part-content ul li { position: relative; padding-left: 2.2rem; }
.part-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.875em - 1px); /* środek pierwszej linii przy line-height 1.75 */
  width: 1.35rem;
  height: 2px;
  background: var(--red);
}

/* Animacja przy wjeździe na ekran: pozycje pojawiają się po kolei od góry, wjeżdżając z lewej,
   a myślnik rozsuwa się od lewej. Stan ukryty obowiązuje od pierwszego renderu (klasa .js na <html>
   ustawiana w <head>) — gdyby ukrywał go dopiero main.js, listy widoczne od razu po wczytaniu
   dostawałyby „is-visible” w tej samej klatce i nie byłoby czego animować. Przejście jest
   przypięte do stanu widocznego (is-visible dodaje obserwator w main.js). */
.js .part-content ul li { opacity: 0; transform: translate3d(-1.25rem, -0.35rem, 0); }
.js .part-content ul li::before { transform: scaleX(0); transform-origin: left center; }
.js .part-content ul.is-visible li {
  opacity: 1;
  transform: none;
  transition: opacity 500ms var(--ease), transform 650ms var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms);
}
.js .part-content ul.is-visible li::before {
  transform: scaleX(1);
  transition: transform 550ms var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms + 220ms);
}

@media (prefers-reduced-motion: reduce) {
  .js .part-content ul li,
  .js .part-content ul li::before { opacity: 1; transform: none; transition: none; }
}
.part-content strong, .part-content b { color: var(--ink); }

/* Link do strony głównej frazy (Config\SeoHubs) */
.part-hub { max-width: 72ch; margin-top: clamp(1.4rem, 3vw, 2rem); padding: 1rem 1.3rem; background: #fff; box-shadow: inset 3px 0 0 var(--red), var(--shadow-card); color: var(--muted); }
.part-hub a { color: var(--ink); font-weight: 700; text-decoration-color: var(--red); text-underline-offset: 3px; }
.part-hub a:hover { color: var(--red); }

.part-aside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: clamp(0.8rem, 1.6vw, 1.2rem); }
.part-specs { padding: 0.4rem 1.3rem; background: #fff; box-shadow: var(--shadow-card); }
.part-specs > div { display: grid; gap: 0.3rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.part-specs > div:last-child { border-bottom: 0; }
.part-specs dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.part-specs dd { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.part-specs a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--red); transition: color 150ms; }
.part-specs a:hover { color: var(--red); }

/* .copy-chip jest zaprojektowany na ciemne tło — tu stoi na białej karcie */
.part-code { background: var(--paper-2); border-color: var(--line-strong); color: var(--ink); font-size: 0.95rem; font-weight: 500; }
.part-code.copied { color: var(--ink); }

/* Panel CTA — .offer-panel ze strony głównej, ale bez wysokości „hero” */
.part-cta { min-height: 0; justify-content: flex-start; padding: clamp(1.5rem, 2.6vw, 2rem); }
.part-cta .kicker--light { margin-bottom: 0.2rem; }
.part-cta h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 800; text-transform: uppercase; line-height: 1.05; color: #fff; }
.part-cta strong { color: #fff; font-family: var(--mono); font-weight: 500; }
.part-phones { list-style: none; align-self: stretch; margin-top: 0.8rem; border-top: 1px solid var(--line-dark); }
.part-phones li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.2rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line-dark);
}
.part-phones-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.part-phones a { color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap; transition: color 150ms; }
.part-phones a:hover { color: var(--red); }

.parts-links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- Responsywność ---------- */
@media (max-width: 1020px) {
  .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part-layout { grid-template-columns: minmax(0, 1fr); }
  .part-aside { position: static; }
}

@media (max-width: 620px) {
  .parts-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-index { grid-template-columns: minmax(0, 1fr); }
  .crumbs [aria-current] span { max-width: 78vw; }
}
