/* Truma Product Grid – Farben hängen an den globalen Elementor-Kit-Farben (mit Fallback). */
.truma-pg {
	--tpg-primary: var(--e-global-color-21f4aaf, #005AAA);
	--tpg-text: var(--e-global-color-e7a0241, #18191C);
	--tpg-border: #C9CDD2;
	--tpg-card: #FFF;
	--tpg-cols: 6;
	--tpg-gap: 16px;
	font-family: Roboto, sans-serif;
	color: var(--tpg-text);
}

/* ---------- Filter ---------- */
.truma-pg .truma-pg__filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
}

.truma-pg .truma-pg__pills {
	display: contents;
}

.truma-pg .truma-pg__pill {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 14px;
	border: 1px solid var(--tpg-border);
	border-radius: 999px;
	background: #FFF;
	color: var(--tpg-text);
	font-family: inherit;
	font-size: 12px;
	font-weight: 400;
	line-height: 16px;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}

.truma-pg .truma-pg__pill:hover,
.truma-pg .truma-pg__pill:focus {
	background: #FFF;
	border-color: var(--tpg-primary);
	color: var(--tpg-primary);
}

.truma-pg .truma-pg__pill:focus-visible {
	outline: 2px solid var(--tpg-primary);
	outline-offset: 2px;
}

.truma-pg .truma-pg__pill.is-active,
.truma-pg .truma-pg__pill.is-active:hover,
.truma-pg .truma-pg__pill.is-active:focus {
	background: var(--tpg-primary);
	border-color: var(--tpg-primary);
	color: #FFF;
	font-weight: 700;
}

.truma-pg .truma-pg__toggle {
	border-color: var(--tpg-primary);
	color: var(--tpg-primary);
	font-weight: 700;
}

.truma-pg .truma-pg__caret {
	width: 0;
	height: 0;
	border-left: 3px solid transparent;
	border-right: 3px solid transparent;
	border-top: 4px solid currentcolor;
}

.truma-pg .truma-pg__more {
	display: none;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 14px;
}

.truma-pg .truma-pg__more[hidden] {
	display: none !important;
}

/* Dropdown */
.truma-pg .truma-pg__dropdown {
	position: relative;
}

.truma-pg .truma-pg__menu {
	position: absolute;
	z-index: 20;
	top: calc(100% + 6px);
	left: 0;
	min-width: 220px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #FFF;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.truma-pg .truma-pg__menu[hidden] {
	display: none;
}

.truma-pg .truma-pg__menu li {
	margin: 0;
	padding: 0;
}

.truma-pg .truma-pg__option {
	appearance: none;
	display: block;
	width: 100%;
	margin: 0;
	padding: 8px 16px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--tpg-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	text-align: left;
	cursor: pointer;
}

.truma-pg .truma-pg__option:hover,
.truma-pg .truma-pg__option:focus {
	background: #F2F3F4;
	color: var(--tpg-primary);
}

.truma-pg .truma-pg__option.is-active {
	color: var(--tpg-primary);
	font-weight: 700;
}

/* ---------- Grid & Cards ---------- */
.truma-pg .truma-pg__grid {
	display: grid;
	grid-template-columns: repeat(var(--tpg-cols), minmax(0, 1fr));
	gap: var(--tpg-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.truma-pg .truma-pg__item {
	position: relative;
	margin: 0;
	padding: 0;
}

.truma-pg .truma-pg__item[hidden] {
	display: none;
}

.truma-pg .truma-pg__card {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: 100%;
	padding: 24px 14px 20px;
	background: var(--tpg-card);
	color: var(--tpg-text);
	text-decoration: none;
}

.truma-pg .truma-pg__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	margin: 0 0 12px;
}

.truma-pg .truma-pg__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.truma-pg .truma-pg__title {
	display: block;
	margin: 0 0 20px;
	color: var(--tpg-text);
	font-size: 16px;
	font-weight: 400;
	line-height: 20px;
	transition: color .15s;
}

.truma-pg .truma-pg__card:hover .truma-pg__title,
.truma-pg .truma-pg__card:focus .truma-pg__title {
	color: var(--tpg-primary);
}

.truma-pg .truma-pg__bullets {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Typografie nur für die Standard-Card – bei Template-Cards kommt sie aus der Elementor-Klasse. */
.truma-pg .truma-pg__card .truma-pg__bullets {
	font-size: 12px;
	line-height: 18px;
}

/* Template-Cards: Link und Template füllen die Grid-Zelle. */
.truma-pg .truma-pg__card-link {
	display: block;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.truma-pg .truma-pg__item--template [data-elementor-type],
.truma-pg .truma-pg__item--template [data-elementor-type] > * {
	box-sizing: border-box;
	height: 100%;
}

.truma-pg .truma-pg__bullets li {
	position: relative;
	margin: 0;
	padding: 0 0 0 12px;
}

.truma-pg .truma-pg__bullets li::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--tpg-primary);
}

.truma-pg .truma-pg__empty {
	margin: 16px 0 0;
	font-size: 14px;
}

/* ---------- Tablet: 3 Spalten, 2 Pills + "+" ---------- */
@media (max-width: 1024px) {

	.truma-pg {
		--tpg-cols: 3;
	}

	.truma-pg .truma-pg__more {
		display: inline-flex;
	}

	.truma-pg:not(.is-expanded) .truma-pg__pills .truma-pg__pill:nth-child(n+3) {
		display: none;
	}
}

/* ---------- Mobile: 2 Spalten, nur Dropdown + "+" ---------- */
@media (max-width: 767px) {

	.truma-pg {
		--tpg-cols: 2;
		--tpg-gap: 14px;
	}

	.truma-pg:not(.is-expanded) .truma-pg__pills .truma-pg__pill {
		display: none;
	}

	.truma-pg .truma-pg__card {
		padding: 20px 12px 18px;
	}
}

/* ==========================================================================
   Empfehlung im Product Grid (Quiz / URL / Event)
   ========================================================================== */

/* Während einer Empfehlung keine Filter-Chips – zurück erst über „Alle Produkte anzeigen“. */
.truma-pg.has-recommendation .truma-pg__filter {
	display: none;
}

.truma-pg.has-recommendation .truma-pg__item:not(.is-recommended) {
	opacity: .25;
	transition: opacity .2s;
}

.truma-pg.has-recommendation .truma-pg__item:not(.is-recommended):hover,
.truma-pg.has-recommendation .truma-pg__item:not(.is-recommended):focus-within {
	opacity: 1;
}

.truma-pg .truma-pg__item.is-recommended {
	outline: 2px solid var(--tpg-primary);
	outline-offset: -2px;
}

/* Badges: gemeinsamer Container oben links, Badges nebeneinander. */
.truma-pg .truma-pg__badges {
	position: absolute;
	z-index: 2;
	top: 8px;
	left: 8px;
	right: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	pointer-events: none;
}

.truma-pg .truma-pg__badges:empty {
	display: none;
}

.truma-pg .truma-pg__badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--tpg-primary);
	color: #FFF;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	white-space: nowrap;
}

/* „Neu“: hell mit blauer Kontur – unterscheidbar von „Unsere Empfehlung“. */
.truma-pg .truma-pg__badge--new {
	padding: 3px 9px;
	border: 1px solid var(--tpg-primary);
	background: #FFF;
	color: var(--tpg-primary);
}

.truma-pg .truma-pg__reco {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px 20px;
	margin: 0 0 16px;
	padding: 20px 24px;
	background: var(--tpg-primary);
	color: #FFF;
}

/* Häkchen im weißen Kreis */
.truma-pg .truma-pg__reco-icon {
	position: relative;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #FFF;
}

.truma-pg .truma-pg__reco-icon::after {
	content: "";
	position: absolute;
	top: 11px;
	left: 15px;
	width: 9px;
	height: 15px;
	border-right: 3px solid var(--tpg-primary);
	border-bottom: 3px solid var(--tpg-primary);
	transform: rotate(45deg);
}

.truma-pg .truma-pg__reco-body {
	min-width: 0;
}

.truma-pg .truma-pg__reco-text,
.truma-pg .truma-pg__reco-sub {
	margin: 0;
	color: #FFF;
}

.truma-pg .truma-pg__reco-text {
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
}

.truma-pg .truma-pg__reco-sub {
	margin-top: 2px;
	font-size: 14px;
	line-height: 20px;
	color: rgba(255, 255, 255, .85);
}

/* „Mehr erfahren“ als Textlink im Fließtext */
.truma-pg .truma-pg__reco-more,
.truma-pg .truma-pg__reco-more:hover,
.truma-pg .truma-pg__reco-more:focus {
	appearance: none;
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: #FFF;
	font-family: inherit;
	font-size: inherit;
	font-weight: 700;
	line-height: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	cursor: pointer;
}

.truma-pg .truma-pg__reco-more::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px 3px 7px;
	border-right: 2px solid currentcolor;
	border-bottom: 2px solid currentcolor;
	transform: rotate(45deg);
}

.truma-pg .truma-pg__reco-more:hover {
	text-decoration-thickness: 2px;
}

/* „Alle Produkte anzeigen“: einzige Schaltfläche, weißer Outline-Pill */
.truma-pg .truma-pg__reco-reset,
.truma-pg .truma-pg__reco-reset:hover,
.truma-pg .truma-pg__reco-reset:focus {
	appearance: none;
	margin: 0;
	padding: 9px 20px;
	border: 1px solid #FFF;
	border-radius: 999px;
	background: transparent;
	color: #FFF;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.truma-pg .truma-pg__reco-reset:hover,
.truma-pg .truma-pg__reco-reset:focus-visible {
	background: #FFF;
	color: var(--tpg-primary);
}

.truma-pg .truma-pg__reco-reset:focus-visible,
.truma-pg .truma-pg__reco-more:focus-visible {
	outline: 2px solid #FFF;
	outline-offset: 2px;
}

@media (max-width: 767px) {

	.truma-pg .truma-pg__reco {
		grid-template-columns: auto 1fr;
		align-items: start;
		padding: 16px;
	}

	.truma-pg .truma-pg__reco-icon {
		width: 32px;
		height: 32px;
	}

	.truma-pg .truma-pg__reco-icon::after {
		top: 8px;
		left: 12px;
		width: 7px;
		height: 12px;
	}

	.truma-pg .truma-pg__reco-text {
		font-size: 16px;
	}

	.truma-pg .truma-pg__reco-reset {
		grid-column: 2;
		justify-self: start;
	}
}

/* ==========================================================================
   Quiz in der Consultant Box (#truma-quiz)
   ========================================================================== */

/*
 * Nur Standardwerte: :where() hat Spezifität 0. Hintergrund, Textfarbe und
 * Padding aus Elementor gewinnen dadurch immer.
 */
:where(#truma-quiz) {
	--tq-primary: var(--e-global-color-21f4aaf, #005AAA);
	--tq-primary-dark: var(--e-global-color-38c4213, #004888);
	--tq-text: var(--e-global-color-e7a0241, #18191C);
	--tq-bg: var(--e-global-color-68b9bce, #F9F9F9);
	box-sizing: border-box;
	padding: 48px 80px;
	background: var(--tq-bg);
	color: var(--tq-text);
}

/* Im Elementor-Editor sichtbar lassen, damit man es bearbeiten kann. */
body:not(.elementor-editor-active) #truma-quiz:not(.is-open) {
	display: none;
}

/*
 * Ab 1.7.0: Beim Öffnen weicht der Inhalt der Box (.truma-quiz-intro, setzt das JS),
 * das Quiz steht an seiner Stelle. !important gegen display:flex der Elementor-Container.
 */
body:not(.elementor-editor-active) .truma-quiz-intro--hidden {
	display: none !important;
}

#truma-quiz.is-open {
	animation: truma-quiz-in .25s ease-out;
}

/* Quiz ersetzt den Box-Inhalt: Überblenden macht das JS (nur Inhalt, Fläche bleibt stehen). */
#truma-quiz.is-open.tq-replace {
	animation: none;
}

@keyframes truma-quiz-in {

	from { opacity: 0; transform: translateY(-8px); }

	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {

	#truma-quiz.is-open {
		animation: none;
	}
}

/*
 * „Quiz schließen“ oben rechts im Quiz (setzt das JS). Absolut positioniert, damit es das
 * Layout des Elementor-Containers (z. B. Richtung „Zeile“) nicht beeinflusst.
 * Farbe setzt das JS auf die Textfarbe des Formulars.
 */
#truma-quiz.tq-replace {
	position: relative;
}

#truma-quiz .truma-quiz-bar {
	position: absolute;
	z-index: 3;
	top: 24px;
	right: 24px;
	margin: 0;
}

#truma-quiz .truma-quiz-close,
#truma-quiz .truma-quiz-close:hover,
#truma-quiz .truma-quiz-close:focus {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 8px 14px 8px 18px;
	border: 1px solid currentcolor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-family: Roboto, sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s ease;
}

#truma-quiz .truma-quiz-close:hover {
	background: color-mix(in srgb, currentcolor 12%, transparent);
}

#truma-quiz .truma-quiz-close:focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 2px;
}

#truma-quiz .truma-quiz-close__icon {
	position: relative;
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
}

#truma-quiz .truma-quiz-close__icon::before,
#truma-quiz .truma-quiz-close__icon::after {
	content: "";
	position: absolute;
	top: 5px;
	left: -1px;
	width: 14px;
	height: 2px;
	border-radius: 1px;
	background: currentcolor;
	transform: rotate(45deg);
}

#truma-quiz .truma-quiz-close__icon::after {
	transform: rotate(-45deg);
}

/* Ergebnis: doppelte Überschrift aus der Bestätigung ausblenden, Bild begrenzen */
#truma-quiz .gform_confirmation_message > h2:first-child {
	display: none;
}

/* Ergebnistexte folgen der Textfarbe des Quiz-Containers (in Elementor einstellbar). */
#truma-quiz .gform_confirmation_message h3,
#truma-quiz .gform_confirmation_message h4,
#truma-quiz .gform_confirmation_message p {
	color: inherit !important;
}

/*
 * Ergebnis-Inhalte je nach Seite (Klasse setzt das JS am Bestätigungstext):
 * .truma-quiz-extra      nur ohne Grid-Treffer (Inhaltsseiten: Bild, weitere Infos)
 * .truma-quiz-grid-only  nur mit Grid-Treffer (Kategorieseiten)
 * .truma-quiz-grid-only ist vorab verborgen, damit nichts aufblitzt.
 * !important, damit es auch direkt auf Bildern greift (#truma-quiz … img ist spezifischer).
 */
.truma-quiz--with-grid .truma-quiz-extra,
.truma-quiz-grid-only:not(.truma-quiz--with-grid .truma-quiz-grid-only) {
	display: none !important;
}

#truma-quiz .gform_confirmation_message img {
	display: block;
	max-width: 220px;
	height: auto;
	margin: 0 auto 16px;
}

#truma-quiz .truma-quiz-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 24px;
	margin: 24px 0 0;
}

#truma-quiz .truma-quiz-cta,
#truma-quiz .truma-quiz-cta:focus {
	appearance: none;
	margin: 0;
	padding: 16px 40px;
	border: 0;
	border-radius: 999px;
	background: var(--tq-primary);
	color: #FFF;
	font-family: Roboto, sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 20px;
	cursor: pointer;
}

#truma-quiz .truma-quiz-cta:hover {
	background: var(--tq-primary-dark);
	color: #FFF;
}

#truma-quiz .truma-quiz-restart {
	color: inherit;
	font-size: 14px;
	font-weight: 700;
	text-decoration: underline;
}

@media (max-width: 1024px) {

	:where(#truma-quiz) {
		padding: 32px 40px;
	}
}

@media (max-width: 767px) {

	:where(#truma-quiz) {
		padding: 24px 20px;
	}

	#truma-quiz .truma-quiz-bar {
		top: 12px;
		right: 12px;
	}

	/* Mobil nur das ×, Text bleibt für Screenreader. */
	#truma-quiz .truma-quiz-close,
	#truma-quiz .truma-quiz-close:hover,
	#truma-quiz .truma-quiz-close:focus {
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
	}

	#truma-quiz .truma-quiz-close__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}
