/* Produktfinder – Datenblatt-Karten mit Stichwortfilter */
.tr-produktfinder {
	--pf-linie: var(--wp--preset--color--linie, #d9d5d0);
	--pf-akzent: var(--wp--preset--color--akzent, #b3141b);
	--pf-leise: var(--wp--preset--color--text-leise, #5e5853);
	display: grid;
	gap: var(--wp--preset--spacing--40, 1.5rem);
}

.tr-produktfinder__filter {
	display: grid;
	gap: 0.375rem;
	max-width: 40rem;
	padding-block-end: var(--wp--preset--spacing--30, 1rem);
	border-block-end: var(--wp--custom--linie--fein, 1px) solid var(--pf-linie);
}

.tr-produktfinder__filter[hidden],
.tr-produktfinder__eintrag[hidden],
.tr-produktfinder__leer[hidden] {
	display: none;
}

.tr-produktfinder__label {
	font-weight: 600;
	font-size: var(--wp--preset--font-size--basis, 1rem);
}

.tr-produktfinder__feld {
	min-height: var(--wp--custom--zielgroesse, 44px);
	padding: 0.5rem 0.75rem;
	font: inherit;
	color: var(--wp--preset--color--text, #231f20);
	background: var(--wp--preset--color--flaeche, #fff);
	border: var(--wp--custom--linie--kraeftig, 2px) solid var(--wp--preset--color--linie-stark, #8c8580);
	border-radius: var(--wp--custom--radius--klein, 2px);
}

.tr-produktfinder__feld:focus-visible {
	outline: 3px solid var(--pf-akzent);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--text, #231f20);
}

.tr-produktfinder__hinweis,
.tr-produktfinder__zaehler {
	margin: 0;
	font-size: var(--wp--preset--font-size--klein, 0.875rem);
	color: var(--pf-leise);
}

.tr-produktfinder__zaehler:empty {
	display: none;
}

.tr-produktfinder__liste {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	border-block-start: var(--wp--custom--linie--fein, 1px) solid var(--pf-linie);
	border-inline-start: var(--wp--custom--linie--fein, 1px) solid var(--pf-linie);
}

.tr-produktfinder__eintrag {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: var(--wp--preset--spacing--30, 1rem) var(--wp--preset--spacing--30, 1rem) var(--wp--preset--spacing--40, 1.5rem);
	background: var(--wp--preset--color--flaeche, #fff);
	border-inline-end: var(--wp--custom--linie--fein, 1px) solid var(--pf-linie);
	border-block-end: var(--wp--custom--linie--fein, 1px) solid var(--pf-linie);
	transition: background-color var(--wp--custom--bewegung--dauer, 180ms) var(--wp--custom--bewegung--kurve, ease);
}

.tr-produktfinder__eintrag:hover,
.tr-produktfinder__eintrag:focus-within {
	background: var(--wp--preset--color--flaeche-alt, #f4f3f1);
}

.tr-produktfinder__eintrag::before {
	content: "";
	position: absolute;
	inset-block-start: -1px;
	inset-inline: -1px;
	height: 3px;
	background: var(--pf-akzent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--wp--custom--bewegung--dauer, 180ms) var(--wp--custom--bewegung--kurve, ease);
}

.tr-produktfinder__eintrag:hover::before,
.tr-produktfinder__eintrag:focus-within::before {
	transform: scaleX(1);
}

.tr-produktfinder__bildrahmen {
	position: relative;
	margin: 0 0 0.5rem;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--wp--preset--color--flaeche-alt, #f4f3f1);
}

/* Kleine Quellbilder (oft 320 px) nicht über ihre Breite hinaus aufblasen: Rahmen deckt, Bild bleibt scharf genug */
.tr-produktfinder__bild {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 420ms var(--wp--custom--bewegung--kurve, ease);
}

.tr-produktfinder__eintrag:hover .tr-produktfinder__bild {
	transform: scale(1.03);
}

/* Pfeil-Marke unten rechts am Bild: wandert bei Zeigen/Fokus nach rechts */
.tr-produktfinder__bildrahmen::after {
	content: "";
	position: absolute;
	inset-inline-end: 0;
	bottom: 0;
	width: 2.75rem;
	height: 2.75rem;
	background: var(--wp--preset--color--text, #231f20) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
	transition: background-color var(--wp--custom--bewegung--dauer, 180ms) var(--wp--custom--bewegung--kurve, ease), background-position var(--wp--custom--bewegung--dauer, 180ms) var(--wp--custom--bewegung--kurve, ease);
}

.tr-produktfinder__eintrag:hover .tr-produktfinder__bildrahmen::after,
.tr-produktfinder__eintrag:focus-within .tr-produktfinder__bildrahmen::after {
	background-color: var(--wp--preset--color--primaer, #d71920);
	background-position: calc(50% + 0.25rem) center;
}

.tr-produktfinder__titel {
	margin: 0;
	font-size: var(--wp--preset--font-size--mittel, 1.25rem);
	line-height: 1.25;
}

.tr-produktfinder__link {
	color: var(--wp--preset--color--text, #231f20);
	text-decoration: none;
}

/* Gesamte Karte klickbar, Linkname bleibt der Titel */
.tr-produktfinder__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.tr-produktfinder__link:hover,
.tr-produktfinder__link:focus-visible {
	color: var(--pf-akzent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.tr-produktfinder__link:focus-visible {
	outline: none;
}

.tr-produktfinder__eintrag:has(.tr-produktfinder__link:focus-visible) {
	outline: 3px solid var(--pf-akzent);
	outline-offset: -3px;
}

.tr-produktfinder__text {
	margin: 0;
	font-size: var(--wp--preset--font-size--klein, 0.9375rem);
	color: var(--pf-leise);
}

.tr-produktfinder__leer {
	margin: 0;
	padding: var(--wp--preset--spacing--30, 1rem);
	border-inline-start: 4px solid var(--pf-akzent);
	background: var(--wp--preset--color--flaeche-alt, #f4f3f1);
}

.tr-produktfinder__cta {
	display: inline-block;
	font-weight: 600;
	color: var(--pf-akzent);
	text-underline-offset: 0.2em;
}

.tr-produktfinder__cta:focus-visible {
	outline: 3px solid var(--pf-akzent);
	outline-offset: 2px;
}

/* Schmal: kompakte Zeilenkarte mit kleinem Bild links statt hochskaliertem Großbild */
@media (max-width: 34rem) {
	.tr-produktfinder__eintrag {
		display: grid;
		grid-template-columns: 6.5rem minmax(0, 1fr);
		column-gap: 1rem;
		align-items: start;
	}

	.tr-produktfinder__bildrahmen {
		grid-row: 1;
		margin: 0;
	}

	.tr-produktfinder__titel {
		align-self: center;
	}

	.tr-produktfinder__text {
		grid-column: 1 / -1;
	}

	.tr-produktfinder__eintrag:not(:has(.tr-produktfinder__bildrahmen)) {
		grid-template-columns: minmax(0, 1fr);
	}

	.tr-produktfinder__bildrahmen::after {
		width: 1.75rem;
		height: 1.75rem;
		background-size: 1rem;
	}

	.tr-produktfinder__titel {
		font-size: var(--wp--preset--font-size--basis, 1rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tr-produktfinder__eintrag,
	.tr-produktfinder__eintrag::before,
	.tr-produktfinder__bild,
	.tr-produktfinder__bildrahmen::after {
		transition: none;
	}

	.tr-produktfinder__eintrag:hover .tr-produktfinder__bild {
		transform: none;
	}
}

