/* ============================================================
   Podręcznik użytkownika — eHandel i mHandel
   Nadbudowa na styles.css (korzysta z tokenów :root stamtąd).
   ============================================================ */

:root {
  --doc-sidebar: 268px;
  --doc-max: 860px;
}

/* ---------- układ strony ---------- */
.doc-hero {
  padding: 132px 0 40px;
  background:
    radial-gradient(900px 420px at 12% -10%, var(--green-50) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border-bottom: 1px solid var(--divider);
}
.doc-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 14px 0 12px;
  color: var(--ink);
}
.doc-hero .doc-lead {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 1.06rem;
  line-height: 1.62;
  margin: 0;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--muted);
}
.doc-meta b { color: var(--ink-2); font-weight: 600; }

/* ---------- przełącznik produktu ---------- */
.doc-switch {
  position: sticky;
  top: 66px;
  z-index: 40;
  background: rgba(252, 253, 252, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
}
.doc-switch-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--pill);
  border-radius: var(--r-pill);
}
.seg button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-2);
  background: transparent;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.22s var(--ease-soft), color 0.22s var(--ease-soft), box-shadow 0.22s var(--ease-soft);
}
.seg button svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected='true'] {
  background: var(--surface);
  color: var(--green-700);
  box-shadow: 0 1px 2px rgba(20, 50, 30, 0.12), 0 4px 12px -6px rgba(20, 50, 30, 0.2);
}
.doc-switch-note { font-size: 0.86rem; color: var(--muted); }

/* ---------- siatka: TOC + treść ---------- */
.doc-wrap { padding: 36px 0 90px; }
.doc-grid {
  display: grid;
  grid-template-columns: var(--doc-sidebar) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.toc { position: sticky; top: 140px; }
.toc-title {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.915rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.toc a::before {
  content: counter(toc);
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.1em;
}
.toc a:hover { background: var(--bg-3); color: var(--ink); }
.toc a.is-active {
  background: var(--green-50);
  color: var(--green-700);
  border-left-color: var(--green-500);
  font-weight: 600;
}
.toc a.is-active::before { color: var(--green-600); }

/* ---------- treść dokumentu ---------- */
.doc-body { max-width: var(--doc-max); min-width: 0; }
.doc-sec { scroll-margin-top: 150px; padding-bottom: 12px; }
.doc-sec + .doc-sec { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--divider); }
.doc-sec > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.3vw, 1.92rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 10px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.doc-sec > h2 .num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-600);
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  flex: none;
  font-family: var(--font);
  letter-spacing: 0;
  transform: translateY(-2px);
}
.doc-sec h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--ink);
  margin: 34px 0 8px;
  letter-spacing: -0.01em;
}
.doc-sec p { color: var(--ink-2); line-height: 1.68; margin: 0 0 12px; }
.doc-sec p.intro { font-size: 1.04rem; color: var(--ink-2); }
.doc-sec a:not(.btn) { color: var(--green-700); text-decoration: underline; text-underline-offset: 2px; }
.doc-sec strong { color: var(--ink); font-weight: 600; }
.doc-sec code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.87em;
  background: var(--pill);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink);
}

/* listy kroków */
ol.doc-steps { list-style: none; margin: 16px 0 18px; padding: 0; counter-reset: st; }
ol.doc-steps > li {
  counter-increment: st;
  position: relative;
  padding: 0 0 16px 46px;
  color: var(--ink-2);
  line-height: 1.62;
}
ol.doc-steps > li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-600);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
ol.doc-steps > li::after {
  content: '';
  position: absolute;
  left: 13.5px;
  top: 30px;
  bottom: 2px;
  width: 1px;
  background: var(--divider);
}
ol.doc-steps > li:last-child { padding-bottom: 0; }
ol.doc-steps > li:last-child::after { display: none; }
ol.doc-steps b { color: var(--ink); font-weight: 600; }

ul.ticks { list-style: none; margin: 12px 0 16px; padding: 0; }
ul.ticks li {
  position: relative;
  padding: 0 0 9px 26px;
  color: var(--ink-2);
  line-height: 1.6;
}
ul.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--green-600);
  border-bottom: 2px solid var(--green-600);
  transform: rotate(-45deg);
}
ul.plain { margin: 12px 0 16px; padding-left: 20px; color: var(--ink-2); line-height: 1.64; }
ul.plain li { margin-bottom: 7px; }

/* ---------- callouts ---------- */
.note {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  margin: 18px 0;
  font-size: 0.945rem;
  line-height: 1.58;
  border: 1px solid transparent;
}
.note svg { width: 19px; height: 19px; flex: none; margin-top: 1px; stroke-width: 1.9; fill: none; }
.note p { margin: 0; color: inherit; }
.note b { font-weight: 700; }
.note-tip { background: var(--green-50); border-color: var(--green-100); color: var(--brand-ink); }
.note-tip svg { stroke: var(--green-600); }
.note-warn { background: var(--amber-bg); border-color: #f3e2b6; color: var(--amber-ink); }
.note-warn svg { stroke: var(--amber-ink); }
.note-stop { background: #fdf1f1; border-color: #f6d9d9; color: #8a2020; }
.note-stop svg { stroke: #b03636; }

/* ---------- zrzuty ekranu ---------- */
figure.shot { margin: 20px 0 26px; }
figure.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-card);
  background: var(--surface);
  cursor: zoom-in;
}
figure.shot figcaption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}
figure.shot figcaption b { color: var(--ink-2); font-weight: 600; }

/* telefon — węższy kadr, ramka urządzenia */
.shots-phone {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 22px;
  margin: 20px 0 26px;
}
.shots-phone figure { margin: 0; }
.shots-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  background: var(--surface);
}
.shots-phone figcaption {
  margin-top: 9px;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.45;
}
.shots-phone figcaption b { display: block; color: var(--ink-2); font-weight: 600; }

/* dwa zrzuty obok siebie (web) */
.shots-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin: 20px 0 26px;
}
.shots-2 figure { margin: 0; }

/* ---------- tabele ---------- */
.doc-table-wrap { overflow-x: auto; min-width: 0; margin: 18px 0 24px; -webkit-overflow-scrolling: touch; }
table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 460px;
}
table.doc-table th,
table.doc-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
  line-height: 1.5;
}
table.doc-table thead th {
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-2);
}
table.doc-table tbody th { font-weight: 600; color: var(--ink); }
table.doc-table td { color: var(--ink-2); }
table.doc-table tbody tr:last-child td,
table.doc-table tbody tr:last-child th { border-bottom: 0; }
.ok-yes { color: var(--green-700); font-weight: 700; }
.ok-no { color: #b03636; font-weight: 700; }

/* ---------- FAQ / problemy ---------- */
.qa { border-top: 1px solid var(--divider); }
.qa details { border-bottom: 1px solid var(--divider); }
.qa summary {
  cursor: pointer;
  padding: 15px 34px 15px 0;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  list-style: none;
  line-height: 1.45;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 21px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.22s var(--ease-soft);
}
.qa details[open] summary::after { transform: rotate(-135deg); }
.qa .qa-body { padding: 0 0 16px; color: var(--ink-2); line-height: 1.66; }
.qa .qa-body p { margin: 0 0 10px; }
.qa .qa-body p:last-child { margin-bottom: 0; }

/* ---------- panele produktu ---------- */
.doc-panel[hidden] { display: none; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 20, 14, 0.9);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease-soft);
}
.lb.is-open { opacity: 1; pointer-events: auto; }
.lb img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  background: #fff;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.28); }
.lb-cap {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  padding: 0 24px;
}

/* ---------- powrót na górę ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 19px; height: 19px; stroke: var(--ink-2); stroke-width: 2; fill: none; }

/* ---------- mobile ---------- */
@media (max-width: 1000px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc {
    position: static;
    margin-bottom: 30px;
    border: 1px solid var(--divider);
    border-radius: var(--r-md);
    background: var(--surface);
    padding: 6px 8px 10px;
  }
  .toc-title { padding: 10px 8px 4px; margin: 0; }
  .toc ol { max-height: 232px; overflow-y: auto; }
}
@media (max-width: 720px) {
  .doc-hero { padding: 108px 0 30px; }
  .doc-switch { top: 60px; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; padding: 10px 12px; }
  .doc-switch-note { display: none; }
  .doc-sec > h2 { flex-direction: column; gap: 8px; }
  .doc-sec > h2 .num { transform: none; align-self: flex-start; }
  .shots-phone { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
}
