/*
 * Shop pages with the "Strona sklepu" template (Regulamin sklepu, Zwroty i odstąpienie od umowy, Dostawa
 * i płatności): long legal text in the site's quiet type — readable line length, numbered paragraphs
 * (ust. 1., pkt 1)), tables, the withdrawal form as a printable sheet. Content: content/shop/legal/.
 */
@counter-style sb-pkt {
	system: extends decimal;
	suffix: ") ";
}

.sb-legal-page h1.wp-block-post-title { max-width: 800px; font-size: 42px !important; line-height: 1.15; }

.sb-legal { color: var(--sem-color-text-default); font-size: 16px; line-height: 1.65; }
/* Blocks stack with one gap (wins over the block layout's own gap); headings add space above. */
.sb-legal :where(p, ol, ul, figure) { margin: 0; }
.sb-legal.sb-legal > * + *, .sb-legal .sb-legal-lead > * + *, .sb-legal .sb-legal-form > * + * { margin-block-start: 16px; }
.sb-legal h2 { color: var(--sem-color-text-strong); font-size: 26px !important; line-height: 1.25; }
.sb-legal h3 { color: var(--sem-color-text-strong); font-size: 20px !important; line-height: 1.3; }
.sb-legal.sb-legal > h2 { margin-block-start: 48px; }
.sb-legal.sb-legal > h3 { margin-block-start: 32px; }
.sb-legal.sb-legal > :first-child, .sb-legal :where(.sb-legal-lead, .sb-legal-form, .sb-legal-toc) > :first-child { margin-block-start: 0; }
.sb-legal a { color: var(--sem-color-text-strong); text-decoration: underline; text-underline-offset: 3px; }
.sb-legal strong { color: var(--sem-color-text-strong); font-weight: 500; }
.sb-legal ol, .sb-legal ul { padding-left: 28px; }
.sb-legal li { margin: 0; padding-left: 4px; }
.sb-legal li + li { margin-top: 8px; }
.sb-legal li > ol, .sb-legal li > ul { margin-top: 8px; }
.sb-legal ol ol { list-style: sb-pkt; }
.sb-legal ul { list-style: disc; }
.sb-legal hr { margin: 48px 0; border: 0; border-top: 1px solid var(--sem-color-border-default); }

/* Short summary under the title (e.g. "Masz 14 dni na zwrot"). */
.sb-legal-lead { padding: 20px 24px; border-radius: var(--radius-xl, 16px); background: var(--sem-color-surface-soft); }
.sb-legal-meta { color: var(--sem-color-text-muted); font-size: 14px; }
.sb-legal-toc ol { columns: 2; column-gap: 32px; font-size: 15px; }
.sb-legal-toc li { break-inside: avoid; }

.sb-legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sb-legal th, .sb-legal td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--sem-color-border-default); text-align: left; vertical-align: top; }
.sb-legal th { color: var(--sem-color-text-strong); font-weight: 500; }
.sb-legal .wp-block-table { margin: 0; overflow-x: auto; }

/* The withdrawal form: a sheet to print, fill in by hand and send. */
.sb-legal-form { padding: 32px; border: 1px solid var(--sem-color-border-default); border-radius: var(--radius-xl, 16px); background: var(--sem-color-surface-default, #fff); }
.sb-legal-form .sb-legal-form__line { min-height: 32px; border-bottom: 1px dotted var(--sem-color-text-muted); }
.sb-legal-form .sb-legal-form__label { color: var(--sem-color-text-muted); font-size: 14px; }
.sb-legal-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.sb-legal-actions a, .sb-legal-actions button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--sem-color-text-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--sem-color-text-strong);
	font: inherit;
	font-size: 15px;
	text-decoration: none;
	cursor: pointer;
}
.sb-legal-actions a:hover, .sb-legal-actions button:hover { background: var(--sem-color-text-strong); color: var(--sem-color-surface-default, #fff); }

@media (max-width: 781px) {
	.sb-legal-page h1.wp-block-post-title { font-size: 32px !important; }
	.sb-legal h2 { font-size: 22px !important; }
	.sb-legal-toc ol { columns: 1; }
	.sb-legal-form { padding: 20px; }
}

/* Print: only the page text; "Wydrukuj formularz" prints only the withdrawal form. */
@media print {
	.sb-site-chrome, .sb-site-footer, .sb-legal-actions, .wp-block-woocommerce-store-notices { display: none !important; }
	.sb-legal-page .sb-main { padding: 0 !important; }
	.sb-legal { font-size: 11pt; }
	.sb-legal a { color: inherit; }
	.sb-legal-form { border: 0; padding: 0; }
	body.sb-print-form .sb-main > *, body.sb-print-form .sb-legal > * { display: none !important; }
	body.sb-print-form .sb-main > .wp-block-post-content, body.sb-print-form .sb-legal, body.sb-print-form .sb-legal > .sb-legal-form { display: block !important; }
}
