/**
 * Transnet – Konfigurator siatek.
 *
 * Kolory i typografia dziedziczą z motywu (Blocksy: --theme-palette-color-*),
 * dzięki czemu konfigurator wygląda jak natywna część sklepu.
 */

.tnc-configurator,
.tnc-modal {
	--tnc-accent: var(--theme-palette-color-1, #1f7a3d);
	--tnc-accent-soft: color-mix(in srgb, var(--tnc-accent) 8%, transparent);
	--tnc-heading: var(--theme-palette-color-3, #1a1d21);
	--tnc-text: var(--theme-palette-color-4, #56606c);
	--tnc-border: var(--theme-palette-color-5, #e2e6ea);
	--tnc-surface: var(--theme-palette-color-8, #fff);
	--tnc-surface-alt: var(--theme-palette-color-7, #f6f7f9);
	--tnc-radius: 10px;

	margin: 0 0 1.75em;
	color: var(--tnc-text);
}

.tnc-configurator * {
	box-sizing: border-box;
}

/* Atrybut [hidden] steruje tu wieloma elementami (kroki, wiersze podsumowania,
   plakietki). Część z nich ma własne `display`, które go przebija, więc bez tej
   reguły ukryte wiersze działały tylko dzięki resetowi w motywie. */
.tnc-configurator [hidden] {
	display: none !important;
}

/* --- Sekcje --------------------------------------------------------- */

.tnc-step {
	padding: 0 0 1.5em;
}

.tnc-step + .tnc-step {
	border-top: 1px solid var(--tnc-border);
	padding-top: 1.5em;
}

.tnc-configurator .tnc-step__head {
	display: flex;
	align-items: center;
	gap: 0.65em;
	margin: 0 0 1em;
	padding: 0;
}

/* Numer i tytuł muszą stać na tej samej wysokości niezależnie od motywu,
   dlatego oba mają wyzerowane marginesy i wspólną wysokość wiersza. */
.tnc-configurator .tnc-step__num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7em;
	height: 1.7em;
	margin: 0;
	border-radius: 50%;
	background: var(--tnc-accent);
	color: #fff;
	font-size: 0.85em;
	font-weight: 700;
	line-height: 1;
}

.tnc-configurator .tnc-step__title {
	margin: 0;
	padding: 0;
	font-size: 1.05em;
	line-height: 1.45;
	color: var(--tnc-heading);
}

/* Motywy blokowe potrafią dokładać marginesy logiczne nagłówkom. */
.tnc-configurator .tnc-step__head > * {
	margin-block: 0;
}

/* --- Wymiary -------------------------------------------------------- */

.tnc-dimensions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1em;
}

.tnc-field__label {
	display: block;
	margin: 0 0 0.4em;
	font-weight: 600;
	color: var(--tnc-heading);
}

.tnc-input-group {
	position: relative;
	display: flex;
	align-items: center;
}

.tnc-configurator .tnc-input {
	width: 100%;
	padding: 0.75em 3em 0.75em 0.9em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	color: var(--tnc-heading);
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tnc-configurator .tnc-input:focus {
	outline: none;
	border-color: var(--tnc-accent);
	box-shadow: 0 0 0 3px var(--tnc-accent-soft, rgba(31, 122, 61, 0.12));
}

.tnc-input-group__unit {
	position: absolute;
	right: 0.9em;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--tnc-text);
	pointer-events: none;
}

.tnc-field__hint {
	margin: 0.45em 0 0;
	font-size: 0.82em;
	opacity: 0.75;
}

.tnc-area-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
	margin-top: 1.1em;
	padding: 0.9em 1.1em;
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface-alt);
}

.tnc-area-bar__item {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.tnc-area-bar__label {
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.7;
}

.tnc-area-bar__value {
	font-size: 1.05em;
	color: var(--tnc-heading);
}

.tnc-tax,
.tnc-total__tax {
	font-size: 0.75em;
	font-weight: 400;
	opacity: 0.7;
}

/* --- Kolory --------------------------------------------------------- */

.tnc-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.6em;
}

.tnc-swatch {
	margin: 0;
	cursor: pointer;
}

.tnc-swatch__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tnc-swatch__body {
	/*
	 * Kropka zajmuje lewą kolumnę na całej wysokości, a nazwa i plakietka
	 * „polecane” układają się jedna pod drugą – tak jak tytuł i opis w kartach
	 * oczka. Plakietka nigdy nie walczy o miejsce w linii z nazwą, a kafelek
	 * bez rekomendacji nie robi się przez to wyższy (pusty wiersz ma zero
	 * wysokości).
	 */
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas:
		"dot name"
		"dot rec";
	align-content: center;
	gap: 0 0.65em;
	height: 100%;
	padding: 0.7em 0.85em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tnc-swatch:hover .tnc-swatch__body {
	border-color: var(--tnc-accent);
}

.tnc-swatch__input:checked + .tnc-swatch__body {
	border-color: var(--tnc-accent);
	box-shadow: 0 0 0 1px var(--tnc-accent);
}

.tnc-swatch__input:focus-visible + .tnc-swatch__body {
	box-shadow: 0 0 0 3px var(--tnc-accent-soft, rgba(31, 122, 61, 0.2));
}

.tnc-swatch__dot {
	grid-area: dot;
	align-self: center;
	position: relative;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--tnc-swatch-color, #ccc);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tnc-swatch__input:checked + .tnc-swatch__body .tnc-swatch__dot::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 2px solid var(--tnc-accent);
	border-radius: 50%;
}

.tnc-swatch__name {
	grid-area: name;
	font-weight: 600;
	color: var(--tnc-heading);
	line-height: 1.2;
	overflow-wrap: anywhere;
}

/* --- Wykończenie (radio cards) -------------------------------------- */

.tnc-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 0.75em;
}

.tnc-card {
	margin: 0;
	cursor: pointer;
}

.tnc-card__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tnc-card__body {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	height: 100%;
	padding: 1em 1.1em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tnc-card:hover .tnc-card__body {
	border-color: var(--tnc-accent);
}

.tnc-card__input:checked + .tnc-card__body {
	border-color: var(--tnc-accent);
	box-shadow: 0 0 0 1px var(--tnc-accent);
	background: var(--tnc-accent-soft, transparent);
}

.tnc-card__mark {
	flex: none;
	position: relative;
	width: 18px;
	height: 18px;
	margin-top: 0.15em;
	border: 2px solid var(--tnc-border);
	border-radius: 50%;
	background: var(--tnc-surface);
	transition: border-color 0.15s ease;
}

.tnc-card__input:checked + .tnc-card__body .tnc-card__mark {
	border-color: var(--tnc-accent);
}

.tnc-card__input:checked + .tnc-card__body .tnc-card__mark::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: var(--tnc-accent);
}

.tnc-card__text {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

.tnc-card__title {
	color: var(--tnc-heading);
	font-size: 0.98em;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.tnc-card__desc {
	font-size: 0.86em;
	line-height: 1.45;
}

.tnc-card__badge {
	margin-top: 0.35em;
	font-size: 0.82em;
	font-weight: 600;
	color: var(--tnc-accent);
}

/* --- Podsumowanie --------------------------------------------------- */

/* Na karcie produktu podsumowanie jest zwykłym krokiem – bez ramki i tła,
   żeby nie gryzło się z krokami powyżej. Box dostaje wyłącznie konfigurator
   na stronie, gdzie stoi w osobnej kolumnie. */
.tnc-page .tnc-summary {
	padding: 1.4em 1.5em;
	border: 1px solid var(--tnc-border);
	border-radius: calc(var(--tnc-radius) + 2px);
	background: var(--tnc-surface-alt);
}

.tnc-summary__product {
	margin: 0 0 0.9em;
	font-weight: 700;
	color: var(--tnc-heading);
}

.tnc-summary__list {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.45em;
}

.tnc-summary__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5em 1em;
	font-size: 0.94em;
}

.tnc-summary__row dt {
	margin: 0;
	font-weight: 400;
	opacity: 0.85;
}

.tnc-summary__row dd {
	margin: 0;
	font-weight: 600;
	color: var(--tnc-heading);
	text-align: right;
}

.tnc-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-top: 1.1em;
	padding-top: 1em;
	border-top: 1px solid var(--tnc-border);
}

.tnc-total__label {
	font-size: 0.85em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tnc-heading);
}

.tnc-total__value {
	font-size: 1.85em;
	font-weight: 700;
	line-height: 1.1;
	color: var(--tnc-heading);
}

/* --- Ilość / błędy -------------------------------------------------- */

.tnc-qty-label {
	display: block;
	margin: 0 0 0.6em;
	font-weight: 600;
	color: var(--tnc-heading);
}

.tnc-error {
	margin: 0.9em 0 0;
	padding: 0.7em 0.9em;
	border-radius: var(--tnc-radius);
	background: rgba(200, 40, 40, 0.08);
	color: #b02121;
	font-size: 0.9em;
}

.tnc-price-from,
.tnc-unit {
	font-size: 0.6em;
	font-weight: 600;
	opacity: 0.75;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.tnc-page .tnc-summary {
		padding: 1.1em 1em;
	}

	.tnc-total__value {
		font-size: 1.55em;
	}
}

/* =====================================================================
   Konfigurator na stronie (shortcode / widget Elementora)
   ===================================================================== */

.tnc-page {
	margin: 0;
}

.tnc-page__head {
	margin: 0 0 1.75em;
	text-align: center;
}

.tnc-page__title {
	margin: 0 0 0.3em;
	font-size: clamp(1.6em, 3vw, 2.3em);
	line-height: 1.15;
	color: var(--tnc-heading);
}

.tnc-page__subtitle {
	margin: 0;
	font-size: 1.02em;
	opacity: 0.8;
}

.tnc-page__notices {
	margin: 0 0 1.5em;
}

.tnc-page__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
	gap: 2em;
	align-items: start;
}

.tnc-page__main > .tnc-step:first-child {
	padding-top: 0;
}

.tnc-page__aside {
	position: sticky;
	top: 2em;
}

.tnc-page__aside .tnc-preview-section {
	padding: 0 0 1em;
}

/* Podsumowanie zachowuje własne wypełnienie także jako kolejna sekcja w kolumnie. */
.tnc-page__aside .tnc-step + .tnc-summary {
	border-top: 1px solid var(--tnc-border);
	margin-top: 0;
	padding: 1.4em 1.5em;
}

/* Wybór produktu */

/* Wyszukiwarka rodzaju siatki */

.tnc-product-filters {
	display: grid;
	grid-template-columns: minmax(200px, 1fr) minmax(190px, 0.65fr);
	gap: 0.65em;
	margin: 0 0 0.85em;
}

.tnc-search {
	position: relative;
	margin: 0 0 0.85em;
}

.tnc-product-filters .tnc-search {
	margin: 0;
}

.tnc-product-filters > :only-child {
	grid-column: 1 / -1;
}

.tnc-configurator .tnc-search__input {
	width: 100%;
	padding: 0.65em 0.9em 0.65em 2.5em;
	font-size: 0.95em;
	font-weight: 500;
}

.tnc-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

.tnc-search__icon {
	position: absolute;
	top: 50%;
	left: 0.85em;
	display: flex;
	transform: translateY(-50%);
	color: var(--tnc-text);
	opacity: 0.55;
	pointer-events: none;
}

.tnc-category-filter {
	display: block;
	margin: 0;
}

.tnc-configurator .tnc-category-filter__select {
	height: 100%;
	min-height: 44px;
	padding: 0.65em 2.4em 0.65em 0.9em;
	font-size: 0.95em;
	font-weight: 500;
}

.tnc-search__empty {
	margin: 0 0 0.85em;
	padding: 0.75em 0.9em;
	border: 1px dashed var(--tnc-border);
	border-radius: var(--tnc-radius);
	font-size: 0.9em;
	text-align: center;
}

.tnc-search__empty[hidden] {
	display: none;
}

/* Lista rodzajów siatki – przy większej liczbie pozycji przewija się pionowo,
   zamiast rozpychać stronę. */
.tnc-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 0.75em;
	max-height: min(58vh, 420px);
	overflow-y: auto;
	overscroll-behavior: contain;
	/* Miejsce na obramowanie zaznaczenia, żeby nie było ucinane przez overflow. */
	padding: 3px;
	margin: -3px;
	scrollbar-width: thin;
	scrollbar-color: var(--tnc-border) transparent;
}

.tnc-products[hidden] {
	display: none;
}

.tnc-products::-webkit-scrollbar {
	width: 8px;
}

.tnc-products::-webkit-scrollbar-track {
	background: transparent;
}

.tnc-products::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: var(--tnc-border);
}

.tnc-products::-webkit-scrollbar-thumb:hover {
	background: var(--tnc-text);
}

.tnc-product[hidden] {
	display: none;
}

.tnc-product {
	margin: 0;
	cursor: pointer;
}

.tnc-product__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tnc-product__body {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.9em;
	height: 100%;
	padding: 0.8em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tnc-product--featured .tnc-product__body {
	border-color: color-mix(in srgb, #d7a319 55%, var(--tnc-border));
	background: color-mix(in srgb, #fff6d8 38%, var(--tnc-surface));
}

.tnc-product:hover .tnc-product__body {
	border-color: var(--tnc-accent);
}

.tnc-product__input:checked + .tnc-product__body {
	border-color: var(--tnc-accent);
	box-shadow: 0 0 0 1px var(--tnc-accent);
}

.tnc-product__input:focus-visible + .tnc-product__body {
	box-shadow: 0 0 0 3px var(--tnc-accent-soft, rgba(31, 122, 61, 0.2));
}

.tnc-product__media {
	flex: none;
	width: 64px;
	height: 64px;
	overflow: hidden;
	border-radius: calc(var(--tnc-radius) - 3px);
	background: var(--tnc-surface-alt);
}

.tnc-product__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tnc-product__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.25em;
	min-width: 0;
}

.tnc-product__name {
	overflow-wrap: anywhere;
}

.tnc-product__featured-badge {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	padding: 0.18em 0.5em;
	border-radius: 999px;
	background: #fff1bd;
	color: #765000;
	font-size: 0.7em;
	font-weight: 700;
	line-height: 1.35;
	text-transform: uppercase;
	letter-spacing: 0.035em;
}

.tnc-product__name {
	font-weight: 600;
	font-size: 0.95em;
	line-height: 1.3;
	color: var(--tnc-heading);
}

.tnc-product__price {
	font-size: 0.9em;
	font-weight: 700;
	color: var(--tnc-accent);
}

.tnc-product__unit {
	font-weight: 400;
	opacity: 0.8;
}

/* Znacznik wyboru jest normalnym elementem układu – dzięki temu nigdy
   nie nachodzi na tytuł produktu, niezależnie od jego długości. */
.tnc-product__check {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-left: auto;
	border: 2px solid var(--tnc-border);
	border-radius: 50%;
	background: var(--tnc-surface);
	transition: border-color 0.15s ease;
}

.tnc-product__check-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: transparent;
	transition: background-color 0.15s ease;
}

.tnc-product__input:checked + .tnc-product__body .tnc-product__check {
	border-color: var(--tnc-accent);
}

.tnc-product__input:checked + .tnc-product__body .tnc-product__check-dot {
	background: var(--tnc-accent);
}

/* Akcje w podsumowaniu */

.tnc-page__actions {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 0.6em;
	align-items: center;
	margin-top: 1.2em;
}

.tnc-page__actions .tnc-qty-label {
	grid-column: 1 / -1;
	margin: 0;
}

.tnc-configurator .tnc-input--qty {
	padding-right: 0.9em;
	text-align: center;
}

.tnc-page .tnc-submit {
	width: 100%;
	margin: 0;
	padding: 0.85em 1.2em;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.tnc-page__cart-link {
	margin: 0.9em 0 0;
	text-align: center;
	font-size: 0.88em;
}

.tnc-page--empty {
	padding: 1.2em;
	border: 1px dashed var(--tnc-border, #e2e6ea);
	border-radius: 10px;
	text-align: center;
}

/* =====================================================================
   Wizualizacja siatki
   ===================================================================== */

.tnc-preview {
	margin: 1.2em 0 0;
	padding: 0.8em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface-alt);
	/* Kolor musi być ustawiony tutaj, a nie odziedziczony – dziedziczona jest
	   wartość wyliczona, więc podmiana tokenu w wariancie ciemnym nie zadziałałaby
	   na tekst wewnątrz panelu (opis pod rysunkiem, notka o redukcji oczek). */
	color: var(--tnc-text);
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.tnc-page__aside .tnc-preview {
	margin-top: 0;
}

/* Wariant ciemny: przy jasnej siatce (biała, kremowa) cały panel podglądu
   przełącza się na ciemne tło, bo inaczej białych oczek po prostu nie widać.
   Wystarczy podmienić tokeny na samym panelu – dziedziczą je wszystkie elementy
   w środku: linie wymiarowe, etykiety, plakietki i powiększenie fragmentu. */
.tnc-preview--light-color {
	--tnc-border: rgba(255, 255, 255, 0.18);
	--tnc-surface: rgba(255, 255, 255, 0.09);
	--tnc-surface-alt: #262b31;
	--tnc-heading: #f3f5f7;
	--tnc-text: #ccd2d9;

	background: #262b31;
	border-color: rgba(255, 255, 255, 0.14);
}

.tnc-preview--light-color .tnc-preview__dot {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.tnc-preview__svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 260px;
	overflow: visible;
}

.tnc-preview__dims line {
	stroke: var(--tnc-text);
	stroke-width: 1;
	opacity: 0.45;
}

.tnc-preview__dims text {
	fill: var(--tnc-heading);
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
}

.tnc-preview__caption {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4em;
	margin-top: 0.6em;
}

.tnc-preview__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.28em 0.7em;
	border: 1px solid var(--tnc-border);
	border-radius: 999px;
	background: var(--tnc-surface);
	font-size: 0.8em;
	font-weight: 600;
	color: var(--tnc-heading);
	line-height: 1.5;
}

.tnc-preview__chip[hidden] {
	display: none;
}

.tnc-preview__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	/* Wartość zastępcza do czasu, aż JS wstawi kolor wybranej siatki –
	   token, żeby wyglądała sensownie także w wariancie ciemnym. */
	background: var(--tnc-border);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.tnc-preview__detail {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.7em;
	margin-top: 0.75em;
	padding-top: 0.75em;
	border-top: 1px dashed var(--tnc-border);
}

.tnc-preview__detail[hidden] {
	display: none;
}

.tnc-preview__detail-svg {
	flex: none;
	width: 58px;
	height: 58px;
}

.tnc-preview__detail-text {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	font-size: 0.82em;
	line-height: 1.35;
}

.tnc-preview__detail-text strong {
	color: var(--tnc-heading);
}

.tnc-preview__detail-hint {
	opacity: 0.7;
}

.tnc-preview__note {
	margin: 0.55em 0 0;
	text-align: center;
	font-size: 0.78em;
	opacity: 0.7;
}

.tnc-preview__note[hidden] {
	display: none;
}

@media (max-width: 900px) {
	.tnc-page__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tnc-page__aside {
		position: static;
	}
}

@media (max-width: 560px) {
	.tnc-product-filters {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.tnc-preview__svg rect,
	.tnc-preview__dims line,
	.tnc-preview__dims text {
		transition: all 0.18s ease;
	}
}

/* --- Typy siatek (ogólny konfigurator) ------------------------------ */

.tnc-step__lead {
	margin: -0.4em 0 1em;
	font-size: 0.92em;
	line-height: 1.5;
}

.tnc-types {
	/* Responsywna liczba kolumn: kilka kafelków obok siebie od razu pokazuje,
	   że zastosowań jest więcej do wyboru (pełna szerokość sugerowała jedną opcję). */
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.8em;
}

.tnc-type {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.tnc-type:hover {
	border-color: var(--tnc-accent);
}

.tnc-type--open {
	border-color: var(--tnc-accent);
	box-shadow: 0 0 0 1px var(--tnc-accent);
	background: var(--tnc-accent-soft, rgba(31, 122, 61, 0.06));
}

.tnc-type__head {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.75em;
	margin: 0;
	padding: 0.9em;
	cursor: pointer;
}

.tnc-type__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tnc-type:focus-within {
	box-shadow: 0 0 0 3px var(--tnc-accent-soft, rgba(31, 122, 61, 0.2));
}

/* Wskaźnik wyboru w rogu kafelka: pusty okrąg, a dla wybranego – z ptaszkiem. */
.tnc-type__check {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	z-index: 1;
	width: 22px;
	height: 22px;
	border: 2px solid var(--tnc-border);
	border-radius: 50%;
	background: var(--tnc-surface);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tnc-type--open .tnc-type__check {
	border-color: var(--tnc-accent);
	background: var(--tnc-accent);
}

.tnc-type--open .tnc-type__check::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 6px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.tnc-type__media {
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: calc(var(--tnc-radius) - 3px);
	background: var(--tnc-surface-alt);
}

.tnc-type__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tnc-type__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.3em;
	min-width: 0;
}

/* Bez zdjęcia tytuł zaczyna się w rogu, gdzie siedzi wskaźnik wyboru. */
.tnc-type__check + .tnc-type__text .tnc-type__name-row {
	padding-right: 1.9em;
}

.tnc-type__name-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em;
}

.tnc-type__name {
	font-weight: 600;
	font-size: 1em;
	line-height: 1.3;
	color: var(--tnc-heading);
	overflow-wrap: anywhere;
}

.tnc-type__badge {
	display: inline-flex;
	padding: 0.18em 0.5em;
	border-radius: 999px;
	background: var(--tnc-accent-soft, rgba(31, 122, 61, 0.1));
	color: var(--tnc-accent);
	font-size: 0.7em;
	font-weight: 700;
	line-height: 1.35;
	text-transform: uppercase;
	letter-spacing: 0.035em;
}

/* Opis w kafelku skracamy – pełny tekst jest w panelu wybranego zastosowania. */
.tnc-type__desc {
	display: -webkit-box;
	overflow: hidden;
	font-size: 0.87em;
	line-height: 1.45;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.tnc-type__price {
	margin-top: auto;
	font-size: 0.9em;
	font-weight: 700;
	color: var(--tnc-accent);
	white-space: nowrap;
}

.tnc-type__price-from,
.tnc-type__unit {
	font-weight: 500;
	font-size: 0.85em;
	color: var(--tnc-text);
}

/* Przycisk „Przejdź dalej” siedzi w samym kafelku, pod tekstem, i tylko przy wybranym. */
.tnc-type .tnc-type__cta {
	justify-content: center;
	width: calc(100% - 1.8em);
	margin: 0 0.9em 0.9em;
	padding: 0.65em 1em;
	font-size: 0.92em;
}

.tnc-type:not(.tnc-type--open) .tnc-type__cta {
	display: none;
}

/* Szczegóły wybranego zastosowania: jeden panel pod siatką kafelków. */
.tnc-type-details {
	margin-top: 1em;
}

.tnc-type__panel {
	padding: 1.1em 1.25em;
	border: 1px solid var(--tnc-accent);
	border-radius: var(--tnc-radius);
	background: var(--tnc-accent-soft, rgba(31, 122, 61, 0.05));
}

.tnc-configurator .tnc-type__panel:not(.tnc-type__panel--open) {
	display: none;
}

.tnc-type__panel-label {
	margin: 0 0 0.15em;
	font-size: 0.74em;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.75;
}

.tnc-type__panel-title {
	margin: 0 0 0.5em;
	font-size: 1.1em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tnc-heading);
}

.tnc-type__panel-desc {
	margin: 0 0 0.9em;
	line-height: 1.55;
}

.tnc-type__recs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 1em 0 0;
	padding: 0;
	list-style: none;
}

.tnc-type__rec {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	padding: 0.5em 0.75em;
	border-radius: calc(var(--tnc-radius) - 3px);
	background: var(--tnc-surface-alt);
}

.tnc-type__rec-label {
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.tnc-type__rec-value {
	color: var(--tnc-heading);
	font-size: 0.95em;
}

.tnc-type__note {
	margin: 0.8em 0 0;
	font-size: 0.9em;
	line-height: 1.55;
}

.tnc-type__hint {
	margin: 0.6em 0 0;
	font-size: 0.82em;
	font-style: italic;
	opacity: 0.85;
}

/* Kafelek niedostępny przy obecnym wyborze (wykluczenia kombinacji). */
.tnc-tile--off {
	opacity: 0.38;
	cursor: not-allowed;
	filter: grayscale(1);
}

.tnc-tile--off .tnc-card__body,
.tnc-tile--off .tnc-swatch__body {
	pointer-events: none;
}

/* Plakietka wartości polecanej w krokach oczka, linki i koloru. */
.tnc-card__rec,
.tnc-swatch__rec {
	display: inline-flex;
	margin-left: 0.45em;
	padding: 0.12em 0.45em;
	border-radius: 999px;
	background: var(--tnc-accent-soft, rgba(31, 122, 61, 0.1));
	color: var(--tnc-accent);
	font-size: 0.68em;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	vertical-align: middle;
}

.tnc-swatch__rec {
	grid-area: rec;
	justify-self: start;
	margin: 0.15em 0 0;
	padding: 0;
	background: none;
	font-size: 0.7em;
}

@media (max-width: 760px) {
	/* Węższe ekrany: dwie kolumny zamiast trzech, żeby kafelki nie były ciasne. */
	.tnc-types {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.tnc-types {
		gap: 0.6em;
	}

	.tnc-type .tnc-type__cta {
		width: calc(100% - 1.4em);
		margin: 0 0.7em 0.7em;
		padding: 0.6em 0.5em;
		font-size: 0.85em;
	}

	.tnc-type__head {
		gap: 0.55em;
		padding: 0.7em;
	}

	.tnc-type__name {
		font-size: 0.95em;
	}

	.tnc-type__desc {
		font-size: 0.82em;
		-webkit-line-clamp: 2;
	}

	.tnc-type__panel {
		padding: 1em;
	}
}

@media (max-width: 340px) {
	.tnc-types {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* =====================================================================
   Kreator krok po kroku (ogólny konfigurator zastosowań)

   Działa tylko po stronie JS (klasa .tnc-wizard-on). Bez JS wszystkie
   sekcje zostają widoczne, a elementy kreatora mają atrybut [hidden].
   ===================================================================== */

/* Etapy chowamy klasą, a nie [hidden] – tym drugim steruje już logika
   konfiguratora (np. brak kroku oczka przy jednej wartości). */
.tnc-wizard-on .tnc-wz-off {
	display: none !important;
}

/* Numery sekcji liczyłyby sekcje, a pasek – etapy; dwie numeracje by myliły. */
.tnc-wizard-on .tnc-step__num {
	display: none;
}

/* Pierwszy etap to sama lista zastosowań – bez kolumny z podglądem. */
.tnc-wizard-on[data-tnc-stage="type"] .tnc-page__grid {
	grid-template-columns: minmax(0, 1fr);
}

.tnc-wizard {
	margin: 0 0 1.6em;
	/* Przy przewijaniu pasek ma zostawać pod ewentualnym lepkim nagłówkiem motywu. */
	scroll-margin-top: var(--tnc-scroll-offset, 80px);
}

.tnc-wizard[hidden],
.tnc-wizard__nav[hidden],
.tnc-wizard__finish[hidden],
.tnc-wizard__type[hidden],
.tnc-pricebar[hidden],
.tnc-wizard__btn[hidden],
.tnc-type__cta[hidden] {
	display: none;
}

.tnc-wizard__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	margin: 0 0 0.55em;
}

.tnc-wizard__progress {
	margin: 0;
	font-weight: 700;
	color: var(--tnc-heading);
}

.tnc-wizard__bar {
	display: block;
	height: 6px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--tnc-border);
}

.tnc-wizard__bar > span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--tnc-accent);
	transition: width 0.25s ease;
}

.tnc-wizard__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 0.85em 0 0;
	padding: 0;
	list-style: none;
}

.tnc-wizard__step {
	margin: 0;
}

.tnc-wizard__step button {
	padding: 0.35em 0.85em;
	border: 1px solid var(--tnc-border);
	border-radius: 999px;
	background: var(--tnc-surface);
	color: var(--tnc-text);
	font: inherit;
	font-size: 0.85em;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tnc-wizard__step--done button {
	border-color: var(--tnc-accent);
	color: var(--tnc-accent);
}

.tnc-wizard__step--done button:hover {
	background: var(--tnc-accent-soft, rgba(31, 122, 61, 0.08));
}

.tnc-wizard__step--current button {
	border-color: var(--tnc-accent);
	background: var(--tnc-accent);
	color: #fff;
	font-weight: 600;
	cursor: default;
}

.tnc-wizard__step--todo button {
	opacity: 0.5;
	cursor: default;
}

.tnc-wizard__step button:focus-visible,
.tnc-wizard__link:focus-visible,
.tnc-wizard__btn:focus-visible,
.tnc-type__cta:focus-visible {
	outline: 2px solid var(--tnc-accent);
	outline-offset: 2px;
}

.tnc-wizard__type {
	margin: 0.85em 0 0;
	font-size: 0.9em;
}

.tnc-wizard__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--tnc-accent);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* Nawigacja pod aktualnym krokiem. */
.tnc-wizard__nav {
	margin-top: 1.6em;
	padding-top: 1.2em;
	border-top: 1px solid var(--tnc-border);
}

.tnc-wizard__nav .tnc-error {
	margin: 0 0 0.9em;
}

.tnc-wizard__buttons {
	display: flex;
	justify-content: space-between;
	gap: 0.8em;
}

.tnc-wizard__btn,
.tnc-type__cta {
	padding: 0.8em 1.5em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	color: var(--tnc-heading);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.15s ease, border-color 0.15s ease;
}

.tnc-wizard__btn--next,
.tnc-type__cta {
	border-color: var(--tnc-accent);
	background: var(--tnc-accent);
	color: #fff;
}

/* „Dalej” zawsze po prawej, także gdy „Wstecz” jest schowane. */
.tnc-wizard__btn--next {
	margin-left: auto;
}

.tnc-wizard__btn--next:hover,
.tnc-type__cta:hover {
	filter: brightness(1.08);
}

.tnc-wizard__btn--back:hover {
	border-color: var(--tnc-accent);
}

/* Przycisk w panelu wybranego typu – tuż pod parametrami polecanymi. */
.tnc-type__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	margin: 1em 0 0;
}

.tnc-wizard__finish {
	display: flex;
	align-items: flex-start;
	gap: 1em;
	padding: 1.2em 1.3em;
	border: 1px solid var(--tnc-border);
	border-left: 4px solid var(--tnc-accent);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
}

.tnc-wizard__finish-icon {
	position: relative;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--tnc-accent);
}

.tnc-wizard__finish-icon::after {
	content: "";
	position: absolute;
	top: 8px;
	left: 15px;
	width: 9px;
	height: 17px;
	border: solid #fff;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.tnc-wizard__finish-body {
	min-width: 0;
}

.tnc-wizard__finish .tnc-step__title {
	margin: 0 0 0.3em;
	font-size: 1.1em;
}

.tnc-wizard__finish-text {
	margin: 0;
}

.tnc-wizard__finish-sub {
	margin: 0.5em 0 0;
	font-size: 0.88em;
	opacity: 0.8;
}

@media (max-width: 640px) {
	/* Na telefonie wystarczy „Krok 2 z 5” i pasek – pastylki z nazwami się nie mieszczą. */
	.tnc-wizard__steps {
		display: none;
	}

	.tnc-wizard__buttons {
		flex-direction: row;
	}

	.tnc-wizard__btn {
		flex: 1 1 0;
		padding-right: 0.8em;
		padding-left: 0.8em;
	}

	.tnc-wizard__type {
		margin-top: 0.6em;
	}

	.tnc-type__cta {
		width: 100%;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tnc-wizard__bar > span {
		transition: none;
	}
}

/* Pasek ceny przyklejony do dołu okna (kreator, od kroku 2). Kwota ma ten sam
   wygląd co „Razem” w podsumowaniu – używa tych samych klas .tnc-total*. */
.tnc-pricebar {
	position: sticky;
	bottom: 0;
	z-index: 20;
	margin-top: 1.2em;
	padding: 0.75em 1em;
	border: 1px solid var(--tnc-accent);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
}

/* W podsumowaniu „Razem” ma odstęp i linię nad sobą – tu ich nie potrzeba. */
.tnc-pricebar .tnc-total {
	margin: 0;
	padding: 0;
	border: 0;
}

.tnc-pricebar__lines {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3em 0.45em;
	margin: 0.5em 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.82em;
}

.tnc-pricebar__lines:empty {
	display: none;
}

.tnc-pricebar__lines li {
	margin: 0;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	background: var(--tnc-surface-alt, rgba(0, 0, 0, 0.05));
}

@media (max-width: 560px) {
	.tnc-pricebar {
		padding: 0.6em 0.8em;
	}

	/* Składniki w jednym rzędzie z przewijaniem – pasek nie zjada ekranu telefonu. */
	.tnc-pricebar__lines {
		flex-wrap: nowrap;
		overflow-x: auto;
		white-space: nowrap;
	}
}

/* =====================================================================
   Zestaw montażowy do piłkochwytu
   ===================================================================== */

.tnc-kit__peek {
	display: inline-block;
	margin: 0.9em 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--tnc-accent);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.tnc-kit__peek:focus-visible {
	outline: 2px solid var(--tnc-accent);
	outline-offset: 3px;
}

.tnc-kit__details {
	margin-top: 1em;
	padding: 1em 1.1em;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
}

.tnc-kit__title {
	margin: 0 0 0.5em;
	font-weight: 700;
	color: var(--tnc-heading);
}

.tnc-kit__list {
	margin: 0;
	padding-left: 1.1em;
}

.tnc-kit__list li {
	margin: 0.15em 0;
}

.tnc-kit__price {
	margin: 0.8em 0 0;
	font-size: 1.05em;
}

.tnc-kit__price strong {
	color: var(--tnc-accent);
}

.tnc-kit__note {
	margin: 0.6em 0 0;
	font-size: 0.85em;
	opacity: 0.8;
}

/* Okno modalne „Co jest w zestawie” (żyje w <body>, więc nie dziedziczy z konfiguratora). */
.tnc-modal[hidden] {
	display: none;
}

.tnc-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1em;
	color: var(--tnc-text);
}

.tnc-modal * {
	box-sizing: border-box;
}

.tnc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 20, 25, 0.6);
}

.tnc-modal__panel {
	position: relative;
	width: min(100%, 720px);
	max-height: 100%;
	padding: 1.4em 1.5em 1.5em;
	overflow-y: auto;
	border-radius: var(--tnc-radius);
	background: var(--tnc-surface);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	outline: 0;
}

.tnc-modal__close {
	position: absolute;
	top: 0.6em;
	right: 0.6em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--tnc-surface-alt);
	color: var(--tnc-heading);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.tnc-modal__close:hover {
	background: var(--tnc-border);
}

.tnc-modal__close:focus-visible {
	outline: 2px solid var(--tnc-accent);
	outline-offset: 2px;
}

.tnc-modal__title {
	margin: 0 2.2em 0.8em 0;
	font-size: 1.2em;
	line-height: 1.3;
	color: var(--tnc-heading);
}

.tnc-modal__image {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--tnc-border);
	border-radius: var(--tnc-radius);
	background: #fff;
}

.tnc-modal__list {
	margin: 1em 0 0;
	padding-left: 1.2em;
}

.tnc-modal__list li {
	margin: 0.2em 0;
}

.tnc-modal__note {
	margin: 0.9em 0 0;
	font-size: 0.88em;
	opacity: 0.85;
}

/* Tło pod oknem się nie przewija. */
html.tnc-modal-open {
	overflow: hidden;
}
