/* ============================================================
   Strona produktu — „Opis produktu" (natywny opis WC, post_content)
   Render: collibre_render_description() w inc/produkt-sekcje.php.
   Treść to stary HTML z klasycznego edytora: floatujące zdjęcia (alignleft/right),
   tabele z INLINE stylami (border/background — stąd !important), blockquote
   i listy ikon z klasami Tailwinda (divide-y / flex), których motyw nie ładuje.
   Typografia jak w artykule bloga (.tech-article__prose).
   ============================================================ */

.tech-desc {
  --tech-desc-preview: 520px; /* wysokość podglądu po zwinięciu (czyta też product-buy.js) */
  border-top: 1px solid var(--tech-border);
  scroll-margin-top: 6rem;
}
/* Pełna szerokość kontenera (jak „Co znajdziesz w jednym shocie"), nagłówek NAD opisem —
   lewa krawędź w linii z sekcją składników (decyzja usera 2026-10-21). */
.tech-desc__head .tech-psec__heading { margin-bottom: 2rem; }

/* --- Zwijanie (klasę ustawia JS; bez JS opis jest pełny) --- */
.tech-desc__wrap { position: relative; }
.tech-desc.is-collapsed .tech-desc__wrap {
  max-height: var(--tech-desc-preview);
  overflow: hidden;
}
.tech-desc.is-collapsed .tech-desc__wrap::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 9rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--tech-white));
  pointer-events: none;
}

/* Przycisk: obrys pill (reset stylu <button> Astry jak w akordeonie) */
.tech-desc__toggle,
.tech-desc__toggle:hover,
.tech-desc__toggle:focus,
.tech-desc__toggle:active {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.75rem;
  padding: .75rem 1.5rem;
  background: transparent !important;
  border: 1px solid var(--tech-ink) !important;
  border-radius: var(--tech-radius-pill) !important;
  box-shadow: none !important;
  color: var(--tech-ink) !important;
  font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-bold);
  letter-spacing: normal; line-height: 1;
  cursor: pointer;
}
.tech-desc__toggle:hover { background: var(--tech-mist) !important; }
.tech-desc__toggle[hidden] { display: none; }
.tech-desc__chev { width: 18px; height: 18px; transform: rotate(180deg); transition: transform .3s ease; }
.tech-desc.is-collapsed .tech-desc__chev { transform: none; }

/* --- Typografia treści --- */
.tech-desc__body { color: var(--tech-slate); line-height: 1.75; }
.tech-desc__body::after { content: ""; display: table; clear: both; } /* domknięcie floatów */
.tech-desc__body p { margin: 0 0 1.1rem; }
.tech-desc__body strong,
.tech-desc__body b { color: var(--tech-ink); font-weight: var(--tech-fw-semibold); }
.tech-desc__body span[style*="font-weight"] { font-weight: inherit !important; }
.tech-desc__body a { color: var(--tech-ink); text-decoration: underline; text-underline-offset: 2px; }
.tech-desc__body h2,
.tech-desc__body h3 {
  clear: both;
  margin: 2.5rem 0 .75rem;
  font-size: var(--tech-fs-xl);
  font-weight: var(--tech-fw-bold);
  letter-spacing: var(--tech-tracking-tight);
  line-height: 1.25;
  color: var(--tech-ink);
}
.tech-desc__body h3 { font-size: var(--tech-fs-lg); }
.tech-desc__body h2:first-child { margin-top: 0; }
.tech-desc__body h2 strong,
.tech-desc__body h2 b { font-weight: inherit; }
.tech-desc__body ul,
.tech-desc__body ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
.tech-desc__body li { margin-bottom: .5rem; }

/* --- Zdjęcia --- */
.tech-desc__body img { max-width: 100%; height: auto; }
.tech-desc__body p img { border-radius: var(--tech-radius-lg); }
.tech-desc__body img.alignnone,
.tech-desc__body img.aligncenter { display: block; margin: 1.5rem 0; }
.tech-desc__body img.aligncenter { margin-inline: auto; }
/* Duże zdjęcia w treści (630px) nie rozpychają opisu na pełną szerokość */
.tech-desc__body p img.alignnone,
.tech-desc__body p img.aligncenter { max-width: min(100%, 30rem); }
.tech-desc__body img.alignright,
.tech-desc__body img.alignleft { display: block; float: none; max-width: min(75%, 22rem); margin: .25rem auto 1.5rem; } /* float WP/Astry wyłączony na mobile */
@media (min-width: 768px) {
  .tech-desc__body img.alignright,
  .tech-desc__body img.alignleft { max-width: 40%; }
  .tech-desc__body img.alignright { float: right; margin: .25rem 0 1.25rem 2rem; }
  .tech-desc__body img.alignleft  { float: left;  margin: .25rem 2rem 1.25rem 0; }
}

/* --- Tabele (skład, wartość odżywcza) ---
   Wrapper .tech-desc__table dokłada PHP (collibre_wrap_description_tables): szeroka tabela
   przewija się lokalnie zamiast zostać uciętą przez overflow-x:clip strony produktu. */
.tech-desc__table {
  clear: both;
  margin: 1.75rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tech-desc__body table {
  clear: both;
  width: 100% !important;
  margin: 0;
  border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--tech-border) !important;
  border-radius: var(--tech-radius-lg);
  overflow: hidden;
  font-size: var(--tech-fs-sm);
  line-height: var(--tech-lh-snug);
}
.tech-desc__body tr { border: 0 !important; }
.tech-desc__body td,
.tech-desc__body th {
  padding: .75rem 1rem;
  border: 0 !important;
  border-top: 1px solid var(--tech-border) !important;
  background: var(--tech-white) !important;
  color: var(--tech-slate);
  text-align: left;
  vertical-align: middle;
}
.tech-desc__body td:not(:first-child),
.tech-desc__body th:not(:first-child) { text-align: right; white-space: nowrap; color: var(--tech-ink); font-weight: var(--tech-fw-semibold); }
/* Pierwszy wiersz to nagłówek (w treści jako <td><strong>) — tło mist */
.tech-desc__body tr:first-child > td,
.tech-desc__body tr:first-child > th,
.tech-desc__body thead td,
.tech-desc__body thead th {
  border-top: 0 !important;
  background: var(--tech-mist) !important;
  color: var(--tech-ink);
  font-weight: var(--tech-fw-bold);
}
.tech-desc__body tbody tr:nth-child(even):not(:first-child) > td { background: #fbfbfc !important; }
@media (max-width: 480px) {
  .tech-desc__body td,
  .tech-desc__body th { padding: .625rem .75rem; }
}

/* --- Cytat --- */
.tech-desc__body blockquote {
  clear: both;
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border: 0;
  border-left: 3px solid var(--tech-ink);
  border-radius: 0 var(--tech-radius-lg) var(--tech-radius-lg) 0;
  background: var(--tech-mist);
  color: var(--tech-ink);
  font-style: italic;
}
.tech-desc__body blockquote p { margin: 0; }

/* --- Listy ikon (klasy Tailwinda z dawnego motywu: divide-y + flex) --- */
.tech-desc__body .divide-y { clear: both; margin: 1.5rem 0; border-block: 1px solid var(--tech-border); }
.tech-desc__body .divide-y > div {
  display: flex; align-items: center; gap: .875rem;
  padding: 1rem 0;
  color: var(--tech-ink);
  line-height: var(--tech-lh-normal);
}
.tech-desc__body .divide-y > div + div { border-top: 1px solid var(--tech-border); }
.tech-desc__body .divide-y > div:empty { display: none; }
.tech-desc__body .divide-y img { flex: 0 0 auto; width: 30px; margin: 0; border-radius: 0; }
