/* PROTERM UX-03-T „Editorial content layout” (KOPIA, DEC-036) — prezentacja ISTNIEJĄCYCH treści SEO: strona główna (#custom-text) i opisy kategorii (#category-description).
   Tylko CSS: treść, kolejność elementów w HTML, nagłówki, linki, anchory, obrazy i ALT — bez zmian; nic nie jest ukrywane ani skracane.
   Rekomendowany układ: strona główna — wariant B (sekcje redakcyjne), kategorie — wariant B2 (pełnoszeroka sekcja pod listingiem i filtrami + sekcje redakcyjne).
   ≥ 1200 px: nagłówki sekcji w lewej kolumnie, treść obok (ok. 72–83 znaki w wierszu); 768/992–1199 px: jedna wyśrodkowana kolumna; telefon — jak dotąd (UX-02-H, UX-01-B),
   z poprawką szerokich tabel (przewijanie we własnym obszarze zamiast przewijania strony w bok).
   Działa PO ux02-h.css i ux01-b.css. Wycofanie: usunięcie tego pliku (wspólny stylesheets.tpl dołącza go tylko, gdy istnieje). */

/* ===== 1. Strona główna — opis SEO (#custom-text) ===== */
@media (min-width: 768px) {
  body#index #custom-text { max-width: 1120px !important; margin: 56px auto 32px !important; background: #f6f8fb !important; border: 1px solid #e3e8ef !important; border-top: 3px solid #2271ce !important; border-radius: 16px !important; }
  body#index #custom-text .card-body { padding: 36px 28px 30px !important; }
  body#index #custom-text .card-body > * { max-width: 760px; margin-left: auto !important; margin-right: auto !important; } /* 768–1199 px: ok. 80 znaków w wierszu */
  body#index #custom-text .card-body > table { max-width: none; }
  body#index #custom-text p { font-size: 17px; line-height: 1.75; color: #2b3036; }
}
@media (min-width: 1200px) {
  body#index #custom-text .card-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); column-gap: 56px; padding: 56px 56px 48px !important; align-items: start; }
  body#index #custom-text .card-body > * { grid-column: 2; max-width: none; margin-left: 0 !important; margin-right: 0 !important; }
  body#index #custom-text .card-body > h1, body#index #custom-text .card-body > h1 + p, body#index #custom-text .card-body > h4:has(+ table), body#index #custom-text .card-body > table { grid-column: 1 / -1; }
  body#index #custom-text .card-body > h1 + p { font-size: 19px; line-height: 1.7; max-width: 900px; margin-bottom: 8px !important; }
  body#index #custom-text .card-body > h2, body#index #custom-text .card-body > h3, body#index #custom-text .card-body > h4:not(:has(+ table)) { grid-column: 1; margin: 0 !important; padding: 30px 0 0 !important; border-top: 0 !important;
    font-size: 21px !important; line-height: 1.3 !important; text-wrap: balance; }
  body#index #custom-text .card-body > h2 + p, body#index #custom-text .card-body > h3 + p, body#index #custom-text .card-body > h4 + p { padding-top: 30px; }
  body#index #custom-text .card-body > h2, body#index #custom-text .card-body > h2 + p { border-top: 1px solid #e3e8ef !important; margin-top: 28px !important; }
  body#index #custom-text p { font-size: 17.5px; line-height: 1.75; max-width: none; }
  body#index #custom-text h1 { font-size: 34px !important; }
}
/* spis „Przeglądaj grzejniki według typu” — biała karta, 3 równe kolumny z separatorami; telefon — bez zmian (UX-02-H) */
@media (min-width: 768px) {
  body#index #custom-text .card-body > h4:has(+ table) { margin-top: 40px !important; }
  body#index #custom-text table { table-layout: fixed; background: #fff !important; border: 1px solid #e3e8ef; border-radius: 12px; margin-top: 12px !important; }
  body#index #custom-text table td { padding: 18px 18px !important; line-height: 1.85; font-size: 15px; }
  body#index #custom-text table td + td { border-left: 1px solid #edf1f5; }
  body#index #custom-text table td b { font-size: 15.5px; color: #1f2328; margin: 6px 0 2px; }
  body#index #custom-text table td a { color: #1b5fae !important; text-decoration: none !important; text-wrap: pretty; }
  body#index #custom-text table td a:hover { text-decoration: underline !important; text-underline-offset: 3px; }
}
@media (min-width: 1200px) {
  body#index #custom-text table td { padding: 26px 28px !important; line-height: 1.95; font-size: 15.5px; }
}

/* ===== 2. Opisy kategorii — elementy treści obecne w HTML (.lead, .seo-box, .seo-table, .faq-list; dotąd bez stylów) ===== */
#category-description ul { list-style: disc; }
#category-description .seo-box { background: #fff; border: 1px solid #e3e8ef; border-left: 4px solid #2271ce; border-radius: 12px; padding: 18px 22px 8px; margin: 22px auto; }
#category-description .seo-box > h2:first-child, #category-description .seo-box > h3:first-child { margin-top: 0 !important; font-size: 18px; }
#category-description .seo-box ul { margin-bottom: .6em; }
#category-description table.seo-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid #e3e8ef; border-radius: 12px; overflow: hidden; font-size: 15.5px; line-height: 1.55; margin: 16px auto 26px; }
#category-description table.seo-table th, #category-description table.seo-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid #edf1f5; }
#category-description table.seo-table th { background: #eef3f9; color: #1f2328; font-weight: 700; }
#category-description table.seo-table tr:last-child td { border-bottom: 0; }
#category-description table.seo-table td:first-child { font-weight: 600; color: #1f2328; }
#category-description .faq-list > h3 { font-size: 17px; margin: 18px 0 6px !important; padding-top: 16px; border-top: 1px solid #e3e8ef; }
#category-description .faq-list > h3:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 575.98px) {
  /* telefon: szeroka tabela przewija się wewnątrz własnego obszaru — cała treść dostępna, strona nie przewija się w bok (dotąd 320 px: kat. 12 +39 px, kat. 43 +14 px) */
  #category-description table.seo-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 15px; }
  #category-description table.seo-table th, #category-description table.seo-table td { padding: 10px 12px; min-width: 140px; }
}
@media (min-width: 768px) {
  #category-description p.lead { font-size: 18px; line-height: 1.65; color: #1f2328; }
}

/* ===== 3. Opisy kategorii — pełnoszeroka sekcja pod listingiem i filtrami (≥ 992 px, tylko kategorie z opisem) =====
   Bez zmiany DOM i bez pozycjonowania absolutnego: lewa kolumna (filtry) jest opływana (float), bloki listingu mają lewy margines równy jej szerokości,
   blok opisu ma „clear” — zaczyna się pod niższą z kolumn (nie nachodzi na filtry także przy krótkiej liście). Filtry, sortowanie, paginacja — bez zmian. */
@media (min-width: 992px) {
  body#category .row:has(> #left-column):has(> #content-wrapper #category-description) { display: block; }
  body#category .row:has(> #left-column):has(> #content-wrapper #category-description)::after { content: ""; display: table; clear: both; }
  body#category .row:has(> #left-column):has(> #content-wrapper #category-description) > #left-column { float: left; width: 25%; max-width: 25%; position: relative; z-index: 2; } /* nad #content-wrapper (kolumna Bootstrapa ma position: relative i — późniejsza w DOM — przykrywałaby filtry) */
  body#category .row:has(> #left-column):has(> #content-wrapper #category-description) > #content-wrapper { float: none; width: 100%; max-width: 100%; }
  body#category #content-wrapper:has(#category-description) #main > *:not(#products),
  body#category #content-wrapper:has(#category-description) #products > *:not(:has(> #category-description)) { margin-left: calc(25% + 7.5px); }
  body#category #products > div:has(> #category-description) { clear: left; padding-top: 40px; }
  #category-description { padding: 52px 48px 32px !important; font-size: 17px !important; line-height: 1.75 !important; }
  #category-description > * { max-width: 760px !important; margin-left: auto !important; margin-right: auto !important; } /* 992–1199 px: ok. 80 znaków w wierszu */
  #category-description > table.seo-table, #category-description > .seo-box, #category-description > .faq-list { max-width: 880px !important; }
  #category-description h2 { font-size: 24px !important; line-height: 1.3; }
  #category-description h3 { font-size: 19px !important; }
}
@media (min-width: 1200px) {
  #category-description { display: grid !important; grid-template-columns: 250px minmax(0, 760px); column-gap: 56px; justify-content: center; align-items: start; padding: 56px 48px 36px !important; }
  #category-description > * { grid-column: 2; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
  #category-description > :not(h2):not(h2 ~ *) { grid-column: 1 / -1; max-width: 820px !important; }
  #category-description > h2, #category-description > h3, #category-description > h4 { grid-column: 1; margin: 0 !important; padding-top: 28px !important; font-size: 19px !important; line-height: 1.32 !important; text-wrap: balance; }
  #category-description > h2 { font-size: 21px !important; }
  #category-description > h2 + *, #category-description > h3 + *, #category-description > h4 + * { margin-top: 28px !important; }
}
