/* ---------- karta produktu w siatce ---------- */
	.tp-wrap ul.products li.product .tp-card__media {
		position: relative; display: block; margin: 0 0 14px; aspect-ratio: 1;
		border-radius: 10px; background: #faf9f7; overflow: hidden;
	}
	/* multiply: białe tło zdjęcia "znika" w kafelku, więc wszystkie zdjęcia
	   leżą na tym samym jasnym tle, niezależnie od tego, jak je zrobiono */
	.tp-wrap ul.products li.product .tp-card__media img {
		position: absolute; inset: 0; box-sizing: border-box;
		width: 100% !important; height: 100% !important; margin: 0 !important; padding: 9%;
		object-fit: contain; mix-blend-mode: multiply; background: transparent !important;
		border-radius: 0 !important; aspect-ratio: auto;
	}
	.tp-wrap ul.products li.product:hover .tp-card__media img { opacity: 1; }
	.tp-wrap ul.products li.product .tp-card__media .onsale {
		position: absolute; top: 10px; left: 10px; right: auto; z-index: 1;
		min-width: 0; min-height: 0; margin: 0; padding: 4px 10px; border-radius: 99px;
		background: #fff; color: var(--tp-accent-text); font-size: .75rem; font-weight: 700; line-height: 1.3;
	}
	.tp-wrap ul.products li.product .tp-card__media .tp-card__var {
		position: absolute; left: 10px; bottom: 10px; z-index: 1;
		padding: 4px 10px; border-radius: 99px; background: #fff;
		color: var(--tp-ink); font-size: .75rem; font-weight: 600; line-height: 1.3;
		box-shadow: 0 1px 4px rgba(31, 29, 26, .1);
	}
	.tp-wrap ul.products li.product .price .tp-from { margin-right: 2px; font-size: .75em; font-weight: 500; color: var(--tp-muted); }
	.tp-wrap ul.products li.product .woocommerce-loop-product__title {
		margin: 0 0 6px; padding: 0; font-size: .9375rem; font-weight: 500; line-height: 1.4; color: var(--tp-ink);
	}
	.tp-wrap ul.products li.product a.woocommerce-LoopProduct-link:hover .woocommerce-loop-product__title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--tp-line); }
	.tp-wrap ul.products li.product .star-rating { margin: 0 0 8px; }
	.tp-wrap ul.products li.product .price { margin: 0 0 14px; font-size: 1.125rem; font-weight: 700; color: var(--tp-ink); }
	.tp-wrap ul.products li.product .price del { margin-right: 6px; font-size: .8em; font-weight: 400; color: var(--tp-muted); opacity: 1; }
	.tp-wrap ul.products li.product .price ins { color: var(--tp-sale, #d92d20); text-decoration: none; }
	.tp-wrap ul.products li.product .button {
		display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 12px;
		border: 1px solid var(--tp-line); border-radius: 8px; background: #fff;
		color: var(--tp-ink); font-size: .875rem; font-weight: 600;
	}
	.tp-wrap ul.products li.product .button:hover { border-color: var(--tp-accent); background: var(--tp-accent); color: var(--tp-on-accent); }
	.tp-wrap ul.products li.product .button.loading { opacity: .6; }
	.tp-wrap ul.products li.product .button.added { border-color: var(--tp-ok); color: var(--tp-ok); }
	.tp-wrap ul.products li.product .button.added::after { content: none; }
	.tp-wrap ul.products li.product .added_to_cart { display: block; margin-top: 8px; font-size: .8125rem; font-weight: 600; text-align: center; color: var(--tp-ink); text-decoration: underline; text-underline-offset: 3px; }
	@media (max-width: 559px) {
		.tp-wrap ul.products li.product .tp-card__media { margin-bottom: 10px; border-radius: 8px; }
		.tp-wrap ul.products li.product .woocommerce-loop-product__title { font-size: .875rem; line-height: 1.35; }
		.tp-wrap ul.products li.product .price { margin-bottom: 10px; font-size: 1rem; }
		.tp-wrap ul.products li.product .button { min-height: 40px; font-size: .8125rem; }
	}

		/* ---------- UKŁAD (od pierwszej klatki, bez czekania na skrypt) ----------
	   Wcześniej siatkę ustawiał dopiero skrypt w stopce, więc przez ułamek
	   sekundy było widać układ WooCommerce: karty o szerokości 22% wciśnięte
	   w kolumny = małe produkty. Teraz ten sam układ jest od razu w CSS. */
	body.tp-archive .tp-shop { display: grid; grid-template-columns: minmax(0, 1fr); }
	body.tp-archive .tp-shop__main { display: block; min-width: 0; width: auto; float: none; }
	@media (min-width: 900px) {
		body.tp-archive .tp-shop { grid-template-columns: 240px minmax(0, 1fr); column-gap: 48px; }
		body.tp-archive .tp-shop > .tp-shop__filters { grid-column: 1; grid-row: 1; }
		body.tp-archive .tp-shop > .tp-shop__main { grid-column: 2; grid-row: 1; }
	}
	body.tp-archive .tp-wrap ul.products {
		display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px;
		margin: 0 !important; padding: 0 !important; list-style: none;
	}
	/* "clearfix" WooCommerce stawałby się pustą kratką w siatce */
	body.tp-archive .tp-wrap ul.products::before,
	body.tp-archive .tp-wrap ul.products::after { content: none !important; display: none !important; }
	body.tp-archive .tp-wrap ul.products li.product {
		display: flex; flex-direction: column;
		width: auto !important; margin: 0 !important; float: none !important; clear: none !important;
	}
	body.tp-archive .tp-wrap ul.products li.product .button { margin-top: auto; }
	/* liczba kolumn zależy od szerokości KOLUMNY z produktami, nie ekranu:
	   węższa niż 720 px = 2 kolumny (także telefon), szersza = 3 */
	body.tp-archive .tp-shop__main { container-type: inline-size; }
	@container (min-width: 560px) { body.tp-archive .tp-wrap ul.products { gap: 44px 24px; } }
	@container (min-width: 720px) { body.tp-archive .tp-wrap ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

	/* ---------- nagłówek: okruszki, tytuł, podkategorie ---------- */
	body.tp-archive .tp-arch { padding-top: 16px; }
	body.tp-archive .woocommerce-products-header { margin: 0 0 8px; padding: 0; }
	body.tp-archive .woocommerce-products-header__title {
		margin: 6px 0 18px; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
		font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--tp-ink);
	}
	.tp-chips-wrap { position: relative; margin: 0 0 32px; }
	body.tp-archive .tp-chips { gap: 8px; margin: 0; padding: 2px 0; scroll-behavior: smooth; }
	/* delikatne wygaszenie krawędzi, gdy pigułki uciekają poza ekran */
	.tp-chips-wrap.can-next .tp-chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent); }
	.tp-chips-wrap.can-prev .tp-chips { -webkit-mask-image: linear-gradient(90deg, transparent, #000 72px); mask-image: linear-gradient(90deg, transparent, #000 72px); }
	.tp-chips-wrap.can-prev.can-next .tp-chips { -webkit-mask-image: linear-gradient(90deg, transparent, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(90deg, transparent, #000 72px, #000 calc(100% - 72px), transparent); }
	.tp-chips__arrow {
		position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
		width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
		padding: 0 !important; border: 1px solid var(--tp-line) !important; border-radius: 50% !important;
		background: #fff !important; color: var(--tp-ink) !important; box-shadow: 0 2px 10px rgba(31, 29, 26, .1); cursor: pointer;
	}
	.tp-chips__arrow[hidden] { display: none; }
	.tp-chips__arrow svg { width: 18px; height: 18px; }
	.tp-chips__arrow:hover { border-color: var(--tp-ink) !important; }
	.tp-chips__arrow--prev { left: -6px; }
	.tp-chips__arrow--next { right: -6px; }
	@media (hover: none) { .tp-chips__arrow { display: none !important; } }
	body.tp-archive .tp-chip {
		padding: 9px 16px; border: 1px solid var(--tp-line); border-radius: 99px; background: #fff;
		color: var(--tp-ink); font-size: .875rem; font-weight: 500; line-height: 1.2; text-decoration: none;
	}
	body.tp-archive .tp-chip:hover { border-color: var(--tp-ink); color: var(--tp-ink); }
	body.tp-archive .tp-chip.is-active { border-color: var(--tp-ink); background: var(--tp-ink); color: #fff; }
	body.tp-archive .tp-chip--back { border-color: transparent; background: var(--tp-soft); color: var(--tp-muted); }
	body.tp-archive .tp-chip--back:hover { border-color: transparent; color: var(--tp-ink); }

	/* ---------- pasek narzędzi ---------- */
	.tp-toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--tp-line); }
	.tp-count { margin: 0 auto 0 0; font-size: .875rem; color: var(--tp-muted); }
	body.tp-archive .tp-toolbar .woocommerce-ordering { margin: 0 !important; float: none; }
	body.tp-archive .tp-toolbar select.orderby {
		height: 40px; padding: 0 38px 0 16px; border: 1px solid var(--tp-line); border-radius: 99px;
		background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f1d1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 14px;
		-webkit-appearance: none; appearance: none; color: var(--tp-ink); font: inherit; font-size: .875rem; cursor: pointer;
	}
	.tp-filter-btn {
		display: none; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
		border: 1px solid var(--tp-ink) !important; border-radius: 99px !important;
		background: #fff !important; color: var(--tp-ink) !important; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
	}
	.tp-filter-btn svg { width: 18px; height: 18px; }
	.tp-filter-btn__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--tp-ink); color: #fff; font-size: .75rem; line-height: 20px; text-align: center; }

	/* ---------- wybrane filtry ---------- */
	.tp-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 24px; }
	.tp-active__chip {
		display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px 7px 14px; border-radius: 99px;
		background: var(--tp-soft); color: var(--tp-ink); font-size: .8125rem; font-weight: 500; text-decoration: none;
	}
	.tp-active__chip svg { width: 14px; height: 14px; color: var(--tp-muted); }
	.tp-active__chip:hover { background: var(--tp-line); color: var(--tp-ink); }
	.tp-active__clear { margin-left: 4px; font-size: .8125rem; color: var(--tp-muted); text-decoration: underline; text-underline-offset: 3px; }

	/* ---------- panel filtrów ---------- */
	body.tp-archive .tp-f-block { margin: 0 0 24px; padding-bottom: 24px; }
	body.tp-archive .tp-f-label { margin: 0 0 12px; font-size: .9375rem; font-weight: 700; color: var(--tp-ink); }
	body.tp-archive .tp-f-row { gap: 10px; padding: 6px 0; font-size: .875rem; color: var(--tp-ink); }
	body.tp-archive .tp-f-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--tp-ink); }
	body.tp-archive .tp-f-cnt, body.tp-archive .tp-cattree__cnt { font-size: .75rem; color: var(--tp-muted); }
	body.tp-archive .tp-cattree { font-size: .875rem; }
	body.tp-archive .tp-cattree li { margin: 8px 0; }
	body.tp-archive .tp-cattree a[aria-current] { color: var(--tp-ink); font-weight: 700; }
	body.tp-archive .tp-cattree a:hover { color: var(--tp-accent-text); }
	.tp-cattree__root { display: block; margin: 0 0 4px; font-size: .875rem; font-weight: 600; color: var(--tp-ink); text-decoration: none; }
	.tp-cattree__root[aria-current] { font-weight: 700; }
	body.tp-archive .tp-price__fill { background: var(--tp-ink); }
	body.tp-archive .tp-price input[type="range"]::-webkit-slider-thumb { border-color: var(--tp-ink); }
	body.tp-archive .tp-price input[type="range"]::-moz-range-thumb { border-color: var(--tp-ink); }
	body.tp-archive .tp-f-apply { height: 48px; border-radius: 8px; }
	.tp-filters__head { display: none; }
	/* na komputerze filtry działają od razu — przycisk "Pokaż wyniki" niepotrzebny */
	.tp-filters.is-auto .tp-f-apply { display: none; }
	.tp-f-actions { padding-top: 4px; }

	/* ---------- telefon: filtry w wysuwanym panelu ---------- */
	@media (max-width: 899px) {
		.tp-filter-btn { display: inline-flex; }
		html body #main .tp-wrap .tp-shop > .tp-shop__filters {
			position: fixed !important; top: 0; bottom: 0; left: 0; z-index: 100001;
			width: min(380px, 88vw) !important; display: block !important;
			background: #fff; overflow-y: auto; overscroll-behavior: contain;
			transform: translateX(-100%); visibility: hidden;
			transition: transform .25s ease, visibility .25s;
			box-shadow: 8px 0 32px rgba(31, 29, 26, .18);
		}
		html body #main .tp-wrap .tp-shop > .tp-shop__filters.is-open { transform: none; visibility: visible; }
		body.tp-archive .tp-filters { position: static; padding: 0 20px; }
		.tp-filters__head {
			position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center;
			margin: 0 -20px 20px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--tp-line);
		}
		.tp-filters__title { margin: 0; font-size: 1.125rem; font-weight: 700; }
		.tp-filters__x {
			width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
			padding: 0 !important; border: 0 !important; border-radius: 50% !important;
			background: var(--tp-soft) !important; color: var(--tp-ink) !important; cursor: pointer;
		}
		.tp-filters__x svg { width: 18px; height: 18px; }
		.tp-f-actions {
			position: sticky; bottom: 0; z-index: 2; margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
			background: #fff; box-shadow: 0 -1px 0 var(--tp-line);
		}
		.tp-filters-backdrop { position: fixed; inset: 0; z-index: 100000; background: rgba(31, 29, 26, .45); }
		.tp-filters-backdrop[hidden] { display: none; }
		body.tp-no-scroll { overflow: hidden; }
	}
	@media (min-width: 900px) { .tp-filters-backdrop { display: none !important; } }

	/* ---------- stronicowanie ---------- */
	body.tp-archive .tp-shop__main .woocommerce-pagination { display: flex; justify-content: center; margin-top: 48px; }
	body.tp-archive .tp-shop__main .woocommerce-pagination ul { border: 0 !important; }
	body.tp-archive .tp-shop__main .woocommerce-pagination ul li { border: 0 !important; }
	body.tp-archive .tp-shop__main .woocommerce-pagination a,
	body.tp-archive .tp-shop__main .woocommerce-pagination span { min-width: 40px; height: 40px; border-radius: 99px; border-color: var(--tp-line); }
	body.tp-archive .tp-shop__main .woocommerce-pagination .current { border-color: var(--tp-ink); background: var(--tp-ink); color: #fff; }

	/* ---------- opis kategorii ---------- */
	body.tp-archive .tp-shop__desc { max-width: 760px; margin: 72px 0 0; padding-top: 40px; border-top: 1px solid var(--tp-line); color: var(--tp-ink); }
	body.tp-archive .tp-shop__desc h2 { font-size: 1.25rem; font-weight: 700; }
	body.tp-archive .tp-shop__desc h3 { font-size: 1.0625rem; font-weight: 700; }
	body.tp-archive .tp-shop__desc p, body.tp-archive .tp-shop__desc li { font-size: .9375rem; color: #45413b; }
	.tp-shop__desc-body { position: relative; }
	.tp-shop__desc { scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 140px); }
	@media (max-width: 1024px) { .tp-shop__desc { scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 84px); } }
	.tp-shop__desc.is-clamped:not(.is-open) .tp-shop__desc-body { max-height: 340px; overflow: hidden; }
	.tp-shop__desc.is-clamped:not(.is-open) .tp-shop__desc-body::after {
		content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px;
		background: linear-gradient(rgba(255, 255, 255, 0), #fff); pointer-events: none;
	}
	.tp-shop__desc-more {
		margin-top: 16px; min-height: 44px; padding: 0 24px;
		border: 1px solid var(--tp-ink) !important; border-radius: 8px !important;
		background: #fff !important; color: var(--tp-ink) !important;
		font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
	}
	.tp-shop__desc-more:hover { background: var(--tp-ink) !important; color: #fff !important; }
	.tp-shop__desc-more[hidden] { display: none; }
	@media (prefers-reduced-motion: reduce) { html body #main .tp-wrap .tp-shop > .tp-shop__filters { transition: none; } }