/* Seaglass – sklep: karty produktow i elementy WooCommerce */

/* ---------- Karta ---------- */
.sg-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--medium);
	box-shadow: var(--wp--preset--shadow--soft);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) {
	.sg-card:hover {
		transform: translateY(-3px);
		box-shadow: var(--wp--preset--shadow--lifted);
	}
}
.sg-card > .sg-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: .35rem;
	padding: .8rem 1rem 1rem;
}
.sg-card > .sg-card__body > :last-child {
	margin-top: auto;
}

/* ---------- Zdjecie + nakladki ---------- */
.sg-card__media {
	position: relative;
	margin: 0;
}
.sg-card__media .wc-block-components-product-image {
	position: relative;
	margin: 0 !important;
	background: linear-gradient(150deg, var(--wp--preset--color--sea-foam), var(--wp--preset--color--misty-blue));
	aspect-ratio: 2 / 3;
	overflow: hidden;
}
.sg-card__media .wc-block-components-product-image a,
.sg-card__media .wc-block-components-product-image img {
	display: block;
	width: 100%;
	height: 100%;
}
.sg-card__media .wc-block-components-product-image img {
	object-fit: cover;
	border-radius: 0;
}
/* zaslepka Woo bez zdjecia – delikatniej */
.sg-card__media img[src*="woocommerce-placeholder"] {
	box-sizing: border-box;
	object-fit: contain;
	padding: 28%;
	opacity: .35;
	mix-blend-mode: multiply;
}

.sg-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	pointer-events: none;
}
.sg-badge {
	display: inline-block;
	font-size: .72rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .02em;
	padding: .4em .7em;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--surface);
}
.sg-badge--sale { background: var(--wp--preset--color--sale); }
.sg-badge--new { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); }
.sg-badge--out { background: var(--wp--preset--color--muted); }

.sg-format {
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: .66rem;
	font-weight: 700;
	line-height: 1;
	padding: .4em .55em;
	border-radius: 6px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 92%, transparent);
	color: var(--wp--preset--color--contrast);
	pointer-events: none;
}

/* Cena jako pigulka na zdjeciu */
.sg-card__media .wp-block-woocommerce-product-price,
.sg-card__media .wc-block-components-product-price {
	position: absolute;
	right: 10px;
	bottom: 10px;
	margin: 0 !important;
	padding: .4rem .75rem;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	box-shadow: 0 4px 12px rgb(var(--wp--custom--ink-rgb) / .18);
	font-weight: 800;
	font-size: .9rem;
	line-height: 1.2;
	white-space: nowrap;
}
.sg-card__media .wp-block-woocommerce-product-price .wc-block-components-product-price {
	position: static;
	padding: 0;
	box-shadow: none;
	background: none;
}
.sg-card__media del {
	font-weight: 500;
	font-size: .75em;
	color: var(--wp--preset--color--muted);
	margin-right: .25em;
}
.sg-card__media ins {
	text-decoration: none;
	color: var(--wp--preset--color--sale);
}

/* ---------- Tresc karty ---------- */
.sg-card .wp-block-post-title {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 !important;
}
.sg-card .wp-block-post-title a { color: inherit; text-decoration: none; }
.sg-card .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }

.sg-meta {
	margin: 0;
	font-size: .8rem;
	color: var(--wp--preset--color--muted);
}
.sg-avail,
.sg-card .wc-block-components-product-stock-indicator {
	display: flex;
	align-items: center;
	gap: .4rem;
	margin: 0;
	font-size: .8rem;
	font-weight: 600;
	color: var(--wp--preset--color--success);
}
.sg-avail::before,
.sg-card .wc-block-components-product-stock-indicator::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}
.sg-card .wc-block-components-product-stock-indicator--low-stock { color: var(--wp--custom--warning); }
.sg-card .wc-block-components-product-stock-indicator--out-of-stock { color: var(--wp--preset--color--muted); }

.sg-card .wp-block-woocommerce-product-button { padding-top: 8px; }
.sg-card .wp-block-button__link,
.sg-card .wc-block-components-product-button__button {
	width: 100%;
	justify-content: center;
	font-size: .88rem;
	padding: .45rem 1.1rem;
	line-height: 1.4;
	min-height: 0;
	margin: 0;
}
.sg-card .added_to_cart {
	display: block;
	margin-top: .4rem;
	font-size: .85rem;
	text-align: center;
}

/* ---------- Pasek nad lista ---------- */
.sg-shop-bar {
	font-size: .9rem;
	color: var(--wp--preset--color--muted);
}
.sg-shop-bar p { margin: 0; }


/* ---------- Telefon: 2 kolumny, mniejsze elementy ---------- */
@media (max-width: 600px) {
	.sg-products .wc-block-product-template { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	.sg-card > .sg-card__body { padding: .65rem .7rem .8rem; }
	.sg-card .wp-block-post-title { font-size: .9rem; }
	.sg-card__media .wp-block-woocommerce-product-price { font-size: .8rem; padding: .3rem .6rem; }
	.sg-badge { font-size: .66rem; }
}

/* =========================================================
   Strona produktu
   ========================================================= */
.sg-pdp { margin-top: var(--wp--preset--spacing--40); align-items: flex-start; }

.sg-pdp__media .wc-block-components-product-image,
.sg-pdp__media .wp-block-woocommerce-product-image {
	position: relative;
	margin: 0;
	border-radius: var(--wp--custom--radius--medium);
	overflow: hidden;
	box-shadow: var(--wp--preset--shadow--lifted);
	background: linear-gradient(150deg, var(--wp--preset--color--sea-foam), var(--wp--preset--color--misty-blue));
}
.sg-pdp__media img { display: block; width: 100%; height: auto; border-radius: 0; }
.sg-pdp__media .sg-badges { top: 14px; left: 14px; }
.sg-pdp__media .sg-badge { font-size: .8rem; }
.sg-pdp__media .sg-format { top: 14px; right: 14px; font-size: .72rem; }
@media (min-width: 782px) {
	.sg-pdp__media { position: sticky; top: 24px; }
}

.sg-pdp__info { display: flex; flex-direction: column; gap: .9rem; }
.sg-pdp__info > * { margin: 0 !important; }
.sg-pdp__cat { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sg-pdp__cat a { color: var(--wp--preset--color--primary); text-decoration: none; }
.sg-pdp__info .wp-block-post-title { font-size: var(--wp--preset--font-size--xx-large); }
.sg-pdp__price,
.sg-pdp__price .wc-block-components-product-price {
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--wp--preset--color--contrast);
}
.sg-pdp__price del { font-size: .6em; font-weight: 500; color: var(--wp--preset--color--muted); margin-right: .35em; }
.sg-pdp__price ins { text-decoration: none; color: var(--wp--preset--color--sale); }
.sg-pdp__excerpt { color: var(--wp--preset--color--muted); font-size: 1.05rem; }
.sg-pdp__excerpt p { margin: 0; }

/* Ramka z faktami */
.sg-facts {
	padding: 1rem 1.15rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface);
}
.sg-facts .sg-avail { font-size: .9rem; margin-bottom: .6rem; }
.sg-facts__list { margin: 0; display: grid; gap: .45rem; }
.sg-facts__list > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; font-size: .92rem; }
.sg-facts__list dt { color: var(--wp--preset--color--muted); }
.sg-facts__list dd { margin: 0; font-weight: 600; overflow-wrap: break-word; }
.sg-facts__hint {
	display: flex;
	gap: .5rem;
	align-items: flex-start;
	margin: .75rem 0 0;
	padding-top: .7rem;
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: .88rem;
	line-height: 1.45;
	color: var(--wp--preset--color--muted);
}
.sg-facts__hint::before {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: .1em;
	background: var(--wp--preset--color--primary);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2.5' width='12' height='19' rx='2.5'/%3E%3Cpath d='M11 18.5h2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2.5' width='12' height='19' rx='2.5'/%3E%3Cpath d='M11 18.5h2'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (forced-colors: active) {
	.sg-facts__hint::before { background: CanvasText; }
}

/* Darmowy fragment (pole Seaglass Tools): przycisk albo odtwarzacz audio */
.sg-sample {
	margin: .9rem 0 0;
	padding-top: .9rem;
	border-top: 1px solid var(--wp--preset--color--line);
}
.sg-sample__link {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	min-height: 40px;
	padding: .4rem 1.15rem;
	border: 1.5px solid var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--primary);
	font-size: .92rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}
.sg-sample__link:hover { background: var(--wp--custom--tint--soft); }
.sg-sample__link::before {
	content: "";
	width: 17px;
	height: 17px;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10 5 7 4.5 3.5 5v13c3.5-.5 6.5 0 8.5 1.5 2-1.5 5-2 8.5-1.5V5C17 4.5 14 5 12 6.5zM12 6.5v13'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10 5 7 4.5 3.5 5v13c3.5-.5 6.5 0 8.5 1.5 2-1.5 5-2 8.5-1.5V5C17 4.5 14 5 12 6.5zM12 6.5v13'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sg-sample__link.is-video::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10 8.5v7l5.5-3.5z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10 8.5v7l5.5-3.5z'/%3E%3C/svg%3E");
}
.sg-sample__label { margin: 0 0 .4rem; font-size: .9rem; font-weight: 600; }
.sg-sample audio { display: block; width: 100%; height: 40px; }
@media (forced-colors: active) {
	.sg-sample__link::before { background: LinkText; }
}

/* Formularz dodania do koszyka */
/* Produkt cyfrowy (klasa z seaglass_digital_body_class): plik kupuje sie w jednej sztuce, bez pola ilosci. */
.sg-digital-product .sg-pdp__info form.cart .quantity { display: none; }
.sg-pdp__info form.cart { display: flex; gap: .6rem; flex-wrap: wrap; align-items: stretch; margin: 0; }
.sg-pdp__info form.cart .quantity input {
	width: 4.5rem;
	height: 100%;
	min-height: 48px;
	text-align: center;
	border: 1px solid var(--sg-field-border);
	border-radius: var(--wp--custom--radius--pill);
	font: inherit;
}
.sg-pdp__info .single_add_to_cart_button {
	flex: 1 1 220px;
	min-height: 52px;
	border: 0;
	border-radius: var(--wp--custom--radius--pill) !important;
	background: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--surface) !important;
	font: inherit;
	font-size: 1.05rem !important;
	font-weight: 700 !important;
	cursor: pointer;
}
.sg-pdp__info .single_add_to_cart_button:hover { background: var(--wp--preset--color--contrast) !important; }

.sg-trust { gap: .4rem 1.2rem !important; font-size: .85rem; color: var(--wp--preset--color--muted); }
.sg-trust p { margin: 0; display: flex; align-items: center; gap: .4rem; }
.sg-trust p::before {
	content: "";
	width: 16px;
	height: 16px;
	flex: none;
	background: var(--wp--preset--color--success);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Zakladki: Opis / Informacje dodatkowe / Opinie */
.sg-pdp__details { margin-top: var(--wp--preset--spacing--60) !important; }
.sg-pdp__details .woocommerce-tabs ul.tabs,
.sg-pdp__details ul.wc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin: 0 0 1.25rem !important;
	padding: 0 !important;
	list-style: none;
	border: 0 !important;
}
.sg-pdp__details ul.wc-tabs::before,
.sg-pdp__details ul.wc-tabs li::before,
.sg-pdp__details ul.wc-tabs li::after { display: none !important; }
.sg-pdp__details ul.wc-tabs li {
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: var(--wp--custom--radius--pill) !important;
	background: var(--wp--preset--color--surface) !important;
}
.sg-pdp__details ul.wc-tabs li a {
	display: block;
	padding: .34rem .95rem !important;
	font-size: .9rem;
	line-height: 1.4;
	color: var(--wp--preset--color--contrast) !important;
	font-weight: 600;
	text-decoration: none;
}
.sg-pdp__details ul.wc-tabs li.active {
	background: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
}
.sg-pdp__details ul.wc-tabs li.active a { color: var(--wp--preset--color--surface) !important; }
.sg-pdp__details .woocommerce-Tabs-panel,
.sg-pdp__details .wc-tab {
	padding: 1.25rem 1.5rem 1.5rem !important;
	margin: 0 !important;
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
}
.sg-pdp__details .woocommerce-Tabs-panel h2,
.sg-pdp__details .wc-tab h2 {
	font-size: var(--wp--preset--font-size--large) !important;
	margin: 0 0 .75rem !important;
	line-height: 1.3;
}
.sg-pdp__details .woocommerce-Tabs-panel > :last-child { margin-bottom: 0; }
.sg-pdp__details table.shop_attributes { width: 100%; border-collapse: collapse; }
.sg-pdp__details table.shop_attributes th,
.sg-pdp__details table.shop_attributes td {
	padding: .6rem .5rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	font-style: normal;
}
.sg-pdp__details table.shop_attributes th { width: 30%; color: var(--wp--preset--color--muted); font-weight: 500; }

/* FAQ produktu (pola wtyczki Seaglass Tools) – pod zakladkami, wezsza kolumna dla czytelnosci */
.sg-product-faq { margin-top: var(--wp--preset--spacing--60) !important; }
.sg-product-faq > * { max-width: 820px; }
.sg-product-faq__title {
	margin: 0 0 var(--wp--preset--spacing--40) !important;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
}
.sg-product-faq__answer a { color: var(--wp--preset--color--primary); }
.sg-product-faq__answer :is(ul, ol) { padding-left: 1.3em; }

/* Podobne: chowamy naglowek, gdy brak produktow */
.sg-related-title:not(:has(+ .sg-related .wc-block-product)) { display: none; }
.sg-card p.wp-block-post-title { margin: 0; }

@media (max-width: 781px) {
	.sg-pdp__media { max-width: 420px; margin-inline: auto; width: 100%; }
	.sg-pdp__info .wp-block-post-title { font-size: var(--wp--preset--font-size--x-large); }
}

/* Tytul sekcji jako akapit (wyglada jak H2, ale nie jest naglowkiem) */
.sg-section-title {
	margin-top: var(--wp--preset--spacing--60) !important;
	margin-bottom: var(--wp--preset--spacing--50) !important;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--contrast);
}
.sg-upsells-title:not(:has(+ .sg-upsells .wc-block-product)) { display: none; }

/* Opisy kategorii: krotki wstep nad produktami i dluzszy tekst pod nimi.
   Marginesy boczne zostawiamy layoutowi (auto), zeby blok trzymal sie kolumny tresci. */
.sg-term-intro {
	margin-top: .9rem !important;
	margin-bottom: var(--wp--preset--spacing--40) !important;
	color: var(--wp--preset--color--muted);
	font-size: 1.05rem;
}
.sg-term-intro p { margin: 0 0 .5em; }
.sg-term-bottom {
	margin-top: var(--wp--preset--spacing--70) !important;
	padding: clamp(1.25rem, 3vw, 2.25rem);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface);
}
.sg-term-bottom > :first-child { margin-top: 0; }
.sg-term-bottom > :last-child { margin-bottom: 0; }
.sg-term-bottom h2 { font-size: var(--wp--preset--font-size--x-large); margin: 1.6em 0 .5em; }
.sg-term-bottom h3 { font-size: var(--wp--preset--font-size--large); margin: 1.4em 0 .4em; }
.sg-term-bottom img { max-width: 100%; height: auto; border-radius: var(--wp--custom--radius--small); }

/* Wyjustowanie opisow kategorii (z dzieleniem wyrazow, zeby nie robily sie dziury) */
.sg-term-intro p,
.sg-term-bottom p,
.sg-term-bottom li {
	text-align: justify;
	-webkit-hyphens: auto;
	hyphens: auto;
}
@media (max-width: 480px) {
	.sg-term-intro p,
	.sg-term-bottom p,
	.sg-term-bottom li { text-align: left; }
}

/* Linki w opisach kategorii: delikatna kapsulka zamiast podkreslenia */
.sg-term-intro a,
.sg-term-bottom a {
	padding: .05em .5em;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--custom--tint--strong);
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	text-decoration: none;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	transition: background-color .15s ease, color .15s ease;
}
.sg-term-intro a:hover,
.sg-term-bottom a:hover {
	background: var(--wp--preset--color--sea-foam);
	color: var(--wp--preset--color--contrast);
}
.sg-term-intro a:focus-visible,
.sg-term-bottom a:focus-visible { outline-offset: 1px; }

/* =========================================================
   Okruszki
   ========================================================= */
.woocommerce-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .3rem;
	margin: 0;
	font-size: .82rem;
	line-height: 1.4;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}
.woocommerce-breadcrumb a {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .2rem .6rem;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--muted);
	font-weight: 500;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.woocommerce-breadcrumb a:hover {
	background: var(--wp--custom--tint--strong);
	color: var(--wp--preset--color--primary);
}
/* pierwszy link (strona glowna) z ikonka domku */
.woocommerce-breadcrumb a:first-child { padding-left: .45rem; }
.woocommerce-breadcrumb a:first-child::before {
	content: "";
	width: 15px;
	height: 15px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sg-bc-sep {
	width: 12px;
	height: 12px;
	flex: none;
	background: var(--wp--preset--color--dusty-sky);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* =========================================================
   Sortowanie
   ========================================================= */
.woocommerce-ordering { margin: 0; }
.woocommerce-ordering select,
.sg-shop-bar select,
.sg-pdp__info .variations select {
	-webkit-appearance: none;
	appearance: none;
	min-height: 42px;
	padding: .5rem 2.6rem .5rem 1.1rem;
	border: 1px solid var(--sg-field-border);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23355F63' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 1rem center / 14px;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: .9rem;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 1px 2px rgb(var(--wp--custom--ink-rgb) / .04);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.woocommerce-ordering select:hover,
.sg-shop-bar select:hover,
.sg-pdp__info .variations select:hover { border-color: var(--wp--preset--color--primary); }
.woocommerce-ordering select:focus-visible,
.sg-shop-bar select:focus-visible,
.sg-pdp__info .variations select:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 1px var(--wp--preset--color--primary), 0 0 0 4px var(--wp--custom--tint--strong);
}

/* Rozwijana lista: w nowszych przegladarkach (Chrome/Edge) w pelni stylowana,
   w pozostalych zostaje systemowa lista – wszystko dalej dziala. */
@supports (appearance: base-select) {
	.woocommerce-ordering select,
	.sg-shop-bar select,
.sg-pdp__info .variations select { appearance: base-select; background-image: none; }
	.woocommerce-ordering select::picker-icon,
	.sg-shop-bar select::picker-icon,
.sg-pdp__info .variations select::picker-icon {
		content: "";
		width: 14px;
		height: 14px;
		background: var(--wp--preset--color--primary);
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
		transition: rotate .2s ease;
	}
	.woocommerce-ordering select:open::picker-icon,
	.sg-shop-bar select:open::picker-icon,
.sg-pdp__info .variations select:open::picker-icon { rotate: 180deg; }
	.woocommerce-ordering select { padding-right: 1rem; gap: .6rem; }
	.woocommerce-ordering select::picker(select),
	.sg-shop-bar select::picker(select),
.sg-pdp__info .variations select::picker(select) {
		appearance: base-select;
		margin-top: 6px;
		padding: .4rem;
		border: 1px solid var(--wp--preset--color--line);
		border-radius: var(--wp--custom--radius--medium);
		background: var(--wp--preset--color--surface);
		box-shadow: var(--wp--preset--shadow--lifted);
	}
	.woocommerce-ordering option,
	.sg-shop-bar option,
.sg-pdp__info .variations option {
		padding: .55rem .9rem;
		border-radius: 10px;
		font-size: .9rem;
		color: var(--wp--preset--color--contrast);
		cursor: pointer;
	}
	.woocommerce-ordering option::checkmark,
	.sg-shop-bar option::checkmark,
.sg-pdp__info .variations option::checkmark { display: none; }
	.woocommerce-ordering option:hover,
	.woocommerce-ordering option:focus-visible,
	.sg-shop-bar option:hover,
.sg-pdp__info .variations option:hover,
	.sg-shop-bar option:focus-visible,
.sg-pdp__info .variations option:focus-visible { background: var(--wp--custom--tint--strong); outline: none; }
	.woocommerce-ordering option:checked,
	.sg-shop-bar option:checked,
.sg-pdp__info .variations option:checked {
		background: var(--wp--preset--color--primary);
		color: var(--wp--preset--color--surface);
		font-weight: 600;
	}
}

/* Podkategorie jako kapsulki */
.sg-subcats { margin-top: 0 !important; margin-bottom: var(--wp--preset--spacing--40) !important; }
.sg-subcats ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.sg-subcats a {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .45rem .95rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}
.sg-subcats a:hover { background: var(--wp--custom--tint--strong); border-color: var(--wp--preset--color--sea-foam); color: var(--wp--preset--color--primary); }
.sg-subcats__icon { display: inline-flex; line-height: 1; }
.sg-subcats__icon .sg-ico { width: 16px; height: 16px; }
.sg-subcats__count {
	min-width: 1.6em;
	padding: .05em .45em;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--custom--tint--strong);
	color: var(--wp--preset--color--primary);
	font-size: .75rem;
	text-align: center;
}

/* Siatki produktow: min. ~230 px na karte (na srednich ekranach 3 zamiast 4, przyciski w jednej linii),
   najwyzej 4 w rzedzie (22% – na szerokich ekranach auto-fill robil 5. pusta kolumne przy 4 produktach). */
@media (min-width: 601px) {
	.sg-products .wc-block-product-template.is-product-collection-layout-grid,
	.sg-products .wc-block-product-template {
		grid-template-columns: repeat(auto-fill, minmax(max(min(230px, 100%), 22%), 1fr)) !important;
	}
}
/* Dokladnie 4 produkty (Polecane, Nowosci, Podobne): zamiast 3 + 1 sierota -> 2 x 2 */
@media (min-width: 601px) and (max-width: 1060px) {
	.sg-products .wc-block-product-template:has(> li:nth-child(4):last-child) {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}
.sg-card .wc-block-components-product-button__button { white-space: nowrap; }

/* Breadcrumbs na stronie Sklep: Woo (breadcrumbs.css) ustawia tam display:block z wieksza specyficznoscia –
   wtedy strzalka-separator (pusty span) znika. Przywracamy uklad flex na kazdej stronie. */
body.woocommerce.woocommerce-shop .wc-block-breadcrumbs .woocommerce-breadcrumb,
.wc-block-breadcrumbs .woocommerce-breadcrumb { display: flex; margin: 0; }
.sg-bc-sep { display: inline-block; }

/* Obrazek naglowka kategorii (pole wtyczki Seaglass Tools) */
.sg-term-hero { margin-top: var(--wp--preset--spacing--30) !important; margin-bottom: 0 !important; }
.sg-term-hero__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 5;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--custom--tint--soft);
}
@media (max-width: 600px) {
	.sg-term-hero__img { aspect-ratio: 2 / 1; }
}

/* =========================================================
   Produkt z wariantami (np. Format: PDF / EPUB / PDF + EPUB)
   Lista w stylu sortowania, etykieta nad lista, cena wariantu nad przyciskiem.
   ========================================================= */
.sg-pdp__info form.variations_form { display: block; }
.sg-pdp__info table.variations { width: 100%; margin: 0 0 1rem; border: 0; border-collapse: collapse; }
.sg-pdp__info table.variations tr { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
.sg-pdp__info table.variations th,
.sg-pdp__info table.variations td { display: block; padding: 0; border: 0; text-align: left; }
.sg-pdp__info table.variations th.label { font-size: .85rem; font-weight: 600; color: var(--wp--preset--color--contrast); }
.sg-pdp__info table.variations td.value { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.sg-pdp__info .variations select {
	width: auto !important;
	min-width: min(100%, 260px) !important;
	max-width: 100%;
	min-height: 48px;
	margin: 0 !important;
	padding-top: .6rem !important;
	padding-bottom: .6rem !important;
	font-size: 1rem !important;
	line-height: 1.3 !important;
}
.sg-pdp__info .reset_variations { font-size: .85rem; color: var(--wp--preset--color--muted); }
.sg-pdp__info .single_variation_wrap .woocommerce-variation:not(:empty) { margin-bottom: .9rem; }
.sg-pdp__info .woocommerce-variation-price .price { font-size: 1.25rem; font-weight: 700; color: var(--wp--preset--color--contrast); }
.sg-pdp__info .woocommerce-variation-add-to-cart { display: flex; gap: .6rem; flex-wrap: wrap; align-items: stretch; }
.sg-pdp__info .woocommerce-variation-add-to-cart .single_add_to_cart_button.disabled { opacity: .55; cursor: not-allowed; }

/* =========================================================
   Filtry produktow (blok WooCommerce „Filtry produktow”)
   Motyw nie wstawia filtrow – te style dzialaja, gdy sprzedawca doda blok w edytorze witryny
   (np. w szablonie Katalog produktow). Szeroko: karta z grupami obok siebie; w waskiej kolumnie
   (panel boczny) grupy jedna pod druga; telefon (do 782 px, prog Woo): przycisk „Filtry” + wysuwany panel.
   ========================================================= */
.wc-block-product-filters {
	--wc-product-filters-background-color: var(--wp--preset--color--surface);
	--wc-product-filters-text-color: var(--wp--preset--color--contrast);
	--wc-product-filter-block-spacing: 1.25rem;
	--wc-product-filter-price-slider: var(--wp--preset--color--primary);
	--wc-product-filter-price-slider-handle: var(--wp--preset--color--surface);
	--wc-product-filter-price-slider-handle-border: var(--wp--preset--color--primary);
	--wc-product-filter-checkbox-list-option-element: var(--wp--preset--color--surface);
	--wc-product-filter-checkbox-list-option-element-border: var(--sg-field-border);
	--wc-product-filter-checkbox-list-option-element-selected: var(--wp--preset--color--surface);
	--wc-product-filter-removable-chips-background: var(--wp--custom--tint--strong);
	--wc-product-filter-removable-chips-border: transparent;
	--wc-product-filter-removable-chips-text: var(--wp--preset--color--contrast);
	font-size: .95rem;
}

/* Naglowki: „Filtry” i nazwy grup (Cena, Kategoria…) – spokojne, w stylu etykiet motywu */
.wc-block-product-filters :is(h2, h3, h4).wp-block-heading {
	margin: 0 0 .6rem !important;
	font-family: var(--wp--preset--font-family--sans);
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.wc-block-product-filters .wc-block-product-filters__overlay-content > .wp-block-heading:first-child {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.25rem;
	letter-spacing: 0;
	text-transform: none;
	color: var(--wp--preset--color--contrast);
}

/* Lista z polami wyboru */
.wc-block-product-filter-checkbox-list__items { display: grid; gap: .5rem; }
.wc-block-product-filter-checkbox-list__label { gap: .6rem; cursor: pointer; }
.wc-block-product-filter-checkbox-list__text-wrapper { font-size: .95em; }
.wc-block-product-filter-checkbox-list__count { color: var(--wp--preset--color--muted); }
.wc-block-product-filter-checkbox-list__input-wrapper::before { display: none; }
input[type="checkbox"].wc-block-product-filter-checkbox-list__input {
	width: 1.2em;
	height: 1.2em;
	border-width: 1.5px;
	border-radius: 6px;
	transition: background-color .15s ease, border-color .15s ease;
}
svg.wc-block-product-filter-checkbox-list__mark { width: 1.2em; height: 1.2em; padding: .22em; }
input[type="checkbox"].wc-block-product-filter-checkbox-list__input:checked {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}
input[type="checkbox"].wc-block-product-filter-checkbox-list__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.wc-block-product-filter-checkbox-list__label:hover input[type="checkbox"]:not(:checked):not(:disabled) {
	border-color: var(--wp--preset--color--primary);
}
.wc-block-product-filter-checkbox-list__stars { color: var(--wp--preset--color--primary); }
.wc-block-product-filter-checkbox-list__show-more-button { color: var(--wp--preset--color--primary); font-weight: 600; }

/* Kafelki (styl „Chipsy”) – jak kapsulki motywu */
.wc-block-product-filter-chips__items { gap: .4rem; }
.wc-block-product-filter-chips__item {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: var(--wp--custom--radius--pill) !important;
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--contrast) !important;
	padding: .35em .9em !important;
	font-size: .875em;
}
.wc-block-product-filter-chips__item[aria-checked="true"] {
	background: var(--wp--preset--color--primary) !important;
	border-color: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--surface) !important;
}

/* Cena: suwak + dwa pola */
.wc-block-product-filter-price-slider__content { row-gap: .4rem; }
.wc-block-product-filter-price-slider .text input[type="text"] {
	width: 5.75em;
	max-width: 100%;
	padding: .4rem .6rem;
	border: 1px solid var(--sg-field-border);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: .875rem;
	text-align: center;
}
.wc-block-product-filter-price-slider .text input[type="text"]:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 1px var(--wp--preset--color--primary), 0 0 0 4px var(--wp--custom--tint--strong);
}

/* Aktywne filtry: kapsulki z krzyzykiem + „Wyczysc filtry” */
.wc-block-product-filter-active { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.wc-block-product-filter-removable-chips__items { gap: .4rem; }
.wc-block-product-filter-removable-chips__items .wc-block-product-filter-removable-chips__item {
	border-radius: var(--wp--custom--radius--pill);
	padding: .3em .45em .3em .85em;
	font-weight: 500;
}
.wc-block-product-filter-removable-chips__remove { border-radius: 50%; }
.wc-block-product-filter-removable-chips__remove:hover { background: rgb(var(--wp--custom--ink-rgb) / .08) !important; }
.wc-block-product-filter-removable-chips__remove-icon { width: 20px; height: 20px; }
.wc-block-product-filter-clear-button .wp-block-button__link {
	padding: .35em .9em !important;
	border-width: 1px !important;
	font-size: .85rem;
}

/* Telefon: przycisk otwierajacy jak lista sortowania, panel z zaokragleniem */
.wc-block-product-filters__open-overlay {
	gap: .35rem;
	min-height: 42px;
	padding: .5rem 1.1rem !important;
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: .9rem !important;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 1px 2px rgb(var(--wp--custom--ink-rgb) / .04);
}
.wc-block-product-filters__open-overlay svg { color: var(--wp--preset--color--primary); width: 1.15em !important; height: 1.15em !important; }
.wc-block-product-filters__open-overlay:hover { border-color: var(--wp--preset--color--sea-foam) !important; }
.wc-block-product-filters__open-overlay:focus-visible,
.wc-block-product-filters__close-overlay:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.wc-block-product-filters__overlay-dialog { border-radius: 0 var(--wp--custom--radius--medium) var(--wp--custom--radius--medium) 0; }
.wc-block-product-filters.is-overlay-right .wc-block-product-filters__overlay-dialog { border-radius: var(--wp--custom--radius--medium) 0 0 var(--wp--custom--radius--medium); }
.wc-block-product-filters__overlay-header { padding: 1rem 1rem 0 !important; }
.wc-block-product-filters__close-overlay {
	width: 40px;
	height: 40px;
	justify-content: center;
	border-radius: 50%;
	background: var(--wp--custom--tint--soft) !important;
	cursor: pointer;
}
.wc-block-product-filters__overlay-content { padding: 0 1.25rem 1.25rem !important; }
.wc-block-product-filters__overlay-footer {
	padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)) !important;
	box-shadow: 0 -6px 18px rgb(var(--wp--custom--ink-rgb) / .08) !important;
}
.wc-block-product-filters__apply {
	min-height: 48px;
	border-radius: var(--wp--custom--radius--pill) !important;
	font-weight: 600;
}
.wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay { background-color: rgb(var(--wp--custom--ink-rgb) / .45) !important; }
@media (prefers-reduced-motion: reduce) {
	.wc-block-product-filters__overlay,
	.wc-block-product-filters__overlay-dialog { transition: none !important; }
}

/* Komputer: filtry na stronie (nie w panelu) jako karta; grupy obok siebie, gdy jest miejsce */
@media (min-width: 783px) {
	.wc-block-product-filters.is-mobile-overlay,
	.wc-block-product-filters.is-filter-drawer-disabled {
		display: block;
		padding: 1.25rem 1.5rem;
		border: 1px solid var(--wp--preset--color--line);
		border-radius: var(--wp--custom--radius--medium);
		background: var(--wp--preset--color--surface);
		box-shadow: var(--wp--preset--shadow--soft);
	}
	.wc-block-product-filters.is-mobile-overlay .wc-block-product-filters__overlay-dialog,
	.wc-block-product-filters.is-mobile-overlay .wc-block-product-filters__overlay-wrapper,
	.wc-block-product-filters.is-mobile-overlay .wc-block-product-filters__overlay { border-radius: 0; background: transparent; }
	.wc-block-product-filters.is-mobile-overlay .wc-block-product-filters__overlay-content,
	.wc-block-product-filters.is-filter-drawer-disabled .wc-block-product-filters__content {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
		gap: 1.25rem 2rem;
		align-items: start;
		padding: 0 !important;
	}
	.wc-block-product-filters.is-mobile-overlay .wc-block-product-filters__overlay-content > .wp-block-heading,
	.wc-block-product-filters.is-mobile-overlay .wc-block-product-filters__overlay-content > .wp-block-woocommerce-product-filter-active,
	.wc-block-product-filters.is-filter-drawer-disabled .wc-block-product-filters__content > .wp-block-heading,
	.wc-block-product-filters.is-filter-drawer-disabled .wc-block-product-filters__content > .wp-block-woocommerce-product-filter-active { grid-column: 1 / -1; }
	.wc-block-product-filters .wc-block-product-filters__overlay-content > .wp-block-heading:first-child { margin-bottom: 0 !important; }
	/* Puste bloki (np. atrybut bez wybranego atrybutu) nie zajmuja miejsca w siatce */
	.wc-block-product-filters :is(.wc-block-product-filters__overlay-content, .wc-block-product-filters__content) > :empty { display: none; }
}
/* Uchwyty suwaka wystaja poza tor – margines, zeby nie wchodzily na sasiednia grupe */
.wc-block-product-filter-price-slider__range { margin-inline: 9px !important; }
/* Aktywne filtry i „Wyczysc filtry” w jednym rzedzie */
.wc-block-product-filter-active > .wc-block-product-filter-removable-chips { flex: 0 1 auto; }
.wc-block-product-filter-active .wc-block-product-filter-removable-chips__items { width: auto !important; }
/* Grupa ceny nie moze byc szersza niz kolumna siatki (suwak wchodzil na „Ocene”) */
.wc-block-product-filters :is(.wc-block-product-filters__overlay-content, .wc-block-product-filters__content) > * { min-width: 0; }
.wc-block-product-filter-price-slider__content { grid-template-columns: minmax(0, auto) 1fr minmax(0, auto); }

/* Wzorzec „Sklep z filtrami z boku” (patterns/shop-sidebar-filters.php) */
.sg-shop-layout { margin-top: var(--wp--preset--spacing--40); align-items: flex-start; }
.sg-shop-layout .sg-shop-bar { margin-top: 0; }
@media (max-width: 781px) {
	/* Telefon: kolumny jedna pod druga – przycisk „Filtry” tuz nad paskiem sortowania */
	.sg-shop-layout { gap: .75rem !important; }
}

/* Paginacja pod lista produktow: wyrazny odstep od kart (takze w podgladzie edytora, gdzie blockGap nie dziala) */
.wp-block-woocommerce-product-collection .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50) !important;
	margin-bottom: 0;
}
.wp-block-woocommerce-product-collection .wp-block-query-pagination + * { margin-top: var(--wp--preset--spacing--40); }
