/* VGL – Leadbox (vgl/leadbox). Farben kommen als Variablen aus dem Block. */
.vgl-leadbox {
	--vgl-lb-overlay: #000;
	--vgl-lb-overlay-op: 0.2;
	--vgl-lb-head: #fff;
	--vgl-lb-box-w: 640px;
	--vgl-lb-box-bg: #fff;
	--vgl-lb-boxtitle-bg: #4a3b33;
	--vgl-lb-boxtitle: #fff;
	--vgl-lb-title-bg: rgba(60, 45, 38, 0.88);
	--vgl-lb-title: #fff;
	--vgl-lb-badge-bg: #ffc700;
	--vgl-lb-badge: #3b2a20;
	--vgl-lb-bar-bg: #5a4036;
	--vgl-lb-bar: #fff;
	container: vgl-lb / inline-size;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	color: var(--vgl-lb-head);
}
.vgl-leadbox__stage {
	position: relative;
	isolation: isolate;
	display: flex;
	flex: 1 1 auto;
	overflow: hidden;
	background: #3a2d27;
}

/* Leiste unten: Icon + Text */
.vgl-leadbox__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px 72px;
	margin: 0 !important;
	padding: 22px 28px !important;
	background: var(--vgl-lb-bar-bg);
	color: var(--vgl-lb-bar);
	list-style: none !important;
}
.vgl-leadbox__bar-item {
	display: flex;
	align-items: center;
	gap: 18px;
	max-width: 320px;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 17px;
	line-height: 1.5;
}
.vgl-leadbox__bar-item::before,
.vgl-leadbox__bar-item::marker {
	content: none;
}
.vgl-leadbox__bar-icon {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.3;
	stroke-linecap: round;
	stroke-linejoin: round;
}
/* Eigenes Bild statt Icon (Imagify packt es ggf. in <picture>) */
.vgl-leadbox__bar-item > picture {
	flex: 0 0 auto;
	display: block;
}
.vgl-leadbox__bar-img,
.vgl-leadbox__bar-item > picture img {
	display: block;
	flex: 0 0 auto;
	width: 46px !important;
	max-width: none;
	height: 46px !important;
	object-fit: contain;
}
.vgl-leadbox__bar-item strong {
	font-weight: 700;
}
.vgl-leadbox *,
.vgl-leadbox *::before,
.vgl-leadbox *::after {
	box-sizing: border-box;
}
.vgl-leadbox.is-full-height {
	min-height: 100vh;
	min-height: 100svh;
}

/* Hintergrund (Imagify packt Bilder ggf. in <picture>) */
.vgl-leadbox__stage > picture,
.vgl-leadbox__stage > .vgl-leadbox__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	display: block;
	width: 100%;
	height: 100%;
}
.vgl-leadbox__stage > picture img,
.vgl-leadbox img.vgl-leadbox__bg {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}
.vgl-leadbox__overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--vgl-lb-overlay);
	opacity: var(--vgl-lb-overlay-op);
	pointer-events: none;
}

.vgl-leadbox__inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 20px 28px 48px;
}

/* Kopfzeile */
.vgl-leadbox__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: 32px;
}
.vgl-leadbox__head img,
.vgl-leadbox__head picture {
	display: block;
	max-width: 100%;
	height: auto;
}
.vgl-leadbox__head-left {
	flex: 0 1 auto;
	min-width: 0;
}
.vgl-leadbox__logo {
	max-width: 45vw;
}
.vgl-leadbox__head-right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 12px 28px;
}
.vgl-leadbox__seal {
	max-width: 40vw;
}
.vgl-leadbox__phone {
	display: flex;
	flex-direction: column;
	color: var(--vgl-lb-head) !important;
	line-height: 1.3;
	text-decoration: none !important;
}
.vgl-leadbox__phone-label {
	font-size: 15px;
}
.vgl-leadbox__phone-number {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}
.vgl-leadbox__phone svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Hauptbereich: Box links, Titel rechts */
.vgl-leadbox__main {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: minmax(0, var(--vgl-lb-box-w)) minmax(240px, 1fr);
	align-items: center;
	gap: 40px;
	width: 100%;
	max-width: 1290px;
	margin: 0 auto;
}

/* Formular-Box */
.vgl-leadbox__box {
	background: var(--vgl-lb-box-bg);
	color: #1f2937;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.vgl-leadbox__box-title {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 58px;
	padding: 14px 24px 14px 40px;
	background: var(--vgl-lb-boxtitle-bg);
	color: var(--vgl-lb-boxtitle);
	font-size: 22px;
	line-height: 1.3;
}
.vgl-leadbox__box-title:has(.vgl-leadbox__box-badge) {
	padding-right: 120px;
}
.vgl-leadbox__box-title .vgl-leadbox__box-badge,
.vgl-leadbox__box-title picture {
	position: absolute;
	top: -22px;
	right: 14px;
	display: block;
	max-width: 30%;
	height: auto;
}
.vgl-leadbox__box-title picture img {
	display: block;
	max-width: 100%;
	height: auto;
}
.vgl-leadbox__box-body {
	padding: 28px 40px 24px;
}
.vgl-leadbox__box-body > :first-child {
	margin-top: 0;
}
.vgl-leadbox__box-body > :last-child {
	margin-bottom: 0;
}

/* Titel und Rabatt-Kreis */
.vgl-leadbox__aside {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	align-self: end;
	margin-bottom: clamp(0px, 8vh, 100px);
}
/* Kreis + Titel: so breit wie der Titel, Kreis rechts über dessen Ende */
.vgl-leadbox__headline {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	width: fit-content;
	max-width: 100%;
}
.vgl-leadbox__headline > .vgl-leadbox__title {
	align-self: stretch;
}
.vgl-leadbox__title,
.vgl-leadbox__subtitle {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--vgl-lb-title) !important;
	letter-spacing: normal;
}
.vgl-leadbox__title > span,
.vgl-leadbox__subtitle > span {
	display: inline-block;
	padding: 0.25em 0.45em;
	background: var(--vgl-lb-title-bg);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
.vgl-leadbox__title {
	font-size: clamp(24px, 2.4vw, 36px) !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
}
/* Optik wie H1/H2/H3 – im HTML ein <p> */
.vgl-leadbox__title.is-size-h1 {
	font-size: clamp(28px, 3.2vw, 46px) !important;
	font-weight: 700 !important;
}
.vgl-leadbox__title.is-size-h3 {
	font-size: clamp(20px, 1.9vw, 28px) !important;
}
.vgl-leadbox__subtitle {
	margin-top: 6px !important;
	font-size: clamp(17px, 1.6vw, 25px) !important;
	line-height: 1.3 !important;
}

.vgl-leadbox__badge {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	align-self: flex-end;
	width: 116px;
	height: 116px;
	margin: 0 0 -14px;
	border-radius: 50%;
	background: var(--vgl-lb-badge-bg);
	color: var(--vgl-lb-badge);
	line-height: 1.05;
	text-align: center;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.vgl-leadbox__badge.has-info {
	cursor: help;
}
.vgl-leadbox__badge:focus-visible {
	outline: 3px solid var(--vgl-lb-head);
	outline-offset: 3px;
}
.vgl-leadbox__badge-top,
.vgl-leadbox__badge-bottom {
	font-size: 18px;
	font-weight: 600;
}
.vgl-leadbox__badge-value {
	font-size: 38px;
	font-weight: 800;
}
.vgl-leadbox__info {
	position: absolute;
	top: 50%;
	right: calc(100% + 16px);
	width: 440px;
	max-width: 50vw;
	padding: 16px 20px;
	border-radius: 4px;
	background: #fff;
	color: #374151;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-50%);
	transition: opacity 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
}
.vgl-leadbox__info::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 100%;
	border: 9px solid transparent;
	border-left-color: #fff;
	transform: translateY(-50%);
}
.vgl-leadbox__badge:hover .vgl-leadbox__info,
.vgl-leadbox__badge:focus .vgl-leadbox__info,
.vgl-leadbox__badge:focus-within .vgl-leadbox__info {
	opacity: 1;
	visibility: visible;
}

/* Mittlere Breite: Abstände etwas enger */
@container vgl-lb (max-width: 1100px) {
	.vgl-leadbox__main {
		gap: 28px;
	}
	.vgl-leadbox__bar {
		gap: 16px 36px;
	}
	.vgl-leadbox__box-body {
		padding: 24px;
	}
}

/* Schmal (Handy, Tablet, Editor mit Seitenleisten): untereinander, Titel über der Box. Maßgeblich ist die Breite der Leadbox, nicht des Bildschirms. */
@container vgl-lb (max-width: 800px) {
	.vgl-leadbox__inner {
		padding: 14px 16px 28px;
	}
	.vgl-leadbox__head {
		align-items: center;
		margin-bottom: 20px;
	}
	.vgl-leadbox__main {
		grid-template-columns: minmax(0, 1fr);
		align-content: start;
		gap: 20px;
		max-width: var(--vgl-lb-box-w);
	}
	.vgl-leadbox__aside {
		order: -1;
		align-self: auto;
		margin: 0;
		padding-right: 96px;
		position: relative;
	}
	.vgl-leadbox__badge {
		position: absolute;
		top: 50%;
		right: 0;
		width: 88px;
		height: 88px;
		margin: 0;
		transform: translateY(-50%);
	}
	.vgl-leadbox__badge-top,
	.vgl-leadbox__badge-bottom {
		font-size: 14px;
	}
	.vgl-leadbox__badge-value {
		font-size: 28px;
	}
	.vgl-leadbox__info {
		top: calc(100% + 12px);
		right: 0;
		width: min(340px, calc(100vw - 32px));
		max-width: none;
		transform: none;
	}
	.vgl-leadbox__info::after {
		top: auto;
		bottom: 100%;
		left: auto;
		right: 34px;
		border-left-color: transparent;
		border-bottom-color: #fff;
		transform: none;
	}
	.vgl-leadbox__box-title {
		padding-left: 20px;
		font-size: 18px;
	}
	.vgl-leadbox__box-body {
		padding: 20px;
	}
}
@container vgl-lb (max-width: 800px) {
	.vgl-leadbox__bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding: 20px 16px !important;
	}
	.vgl-leadbox__bar-item {
		max-width: none;
		font-size: 16px;
	}
	.vgl-leadbox__bar-icon,
	.vgl-leadbox__bar-img,
	.vgl-leadbox__bar-item > picture img {
		width: 36px !important;
		height: 36px !important;
	}
}
@container vgl-lb (max-width: 600px) {
	.vgl-leadbox__phone-label {
		display: none;
	}
	.vgl-leadbox__phone-number {
		font-size: 16px;
	}
	.vgl-leadbox__seal {
		max-width: 30vw;
	}
}

/* Landingpage ohne Theme-Kopfzeile (Blocksy schaltet sie serverseitig ab, hier für andere Themes) */
.vgl-leadbox-landing #masthead,
.vgl-leadbox-landing header.site-header,
.vgl-leadbox-landing .site-main > article > .entry-header,
.vgl-leadbox-landing .site-main > .page-header,
.vgl-leadbox-notitle .site-main > article > .entry-header,
.vgl-leadbox-notitle .site-main > .page-header {
	display: none !important;
}

/* Leisten/Hinweis erst zeigen, wenn das Skript sie ans Ende von <body> gesetzt hat
   (sonst blitzen sie innerhalb der Leadbox auf, z. B. solange WP Rocket das Skript verzögert). */
.vgl-leadbox .vgl-leadbox__floating,
.vgl-lbs .vgl-leadbox__floating {
	display: none;
}

/* Button „Jetzt vergleichen“ (Leisten und Hinweis) */
.vgl-leadbox__go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 22px;
	border-radius: 4px;
	background: var(--vgl-lb-cta-bg, #ffc700);
	color: var(--vgl-lb-cta, #3b2a20) !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	transition: filter 0.2s ease;
}
.vgl-leadbox__go:hover,
.vgl-leadbox__go:focus-visible {
	filter: brightness(0.92);
}
.vgl-leadbox__go svg,
.vgl-leadbox__topbar-phone svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Desktop: schmale Leiste oben */
.vgl-leadbox__topbar {
	display: none;
}
@media (min-width: 961px) {
	.vgl-leadbox__topbar {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		z-index: 99990;
		display: block;
		background: var(--vgl-lb-tb-bg, #4a3b33);
		color: var(--vgl-lb-tb, #fff);
		box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
		transform: translateY(-110%);
		transition: transform 0.25s ease;
	}
	.admin-bar .vgl-leadbox__topbar {
		top: 32px;
	}
	.vgl-leadbox__topbar.is-visible {
		transform: none;
	}
	/* Mitlaufendes Inhaltsverzeichnis unter die Leiste schieben */
	.vgl-leadbox-topbar-on .vgl-stoc-side {
		top: calc(var(--vgl-stoc-top, 20px) + 64px);
	}
	.vgl-stoc-side {
		transition: top 0.25s ease;
	}
	.vgl-leadbox__topbar-inner {
		display: flex;
		align-items: center;
		gap: 28px;
		max-width: 1290px;
		margin: 0 auto;
		padding: 10px 28px;
	}
	.vgl-leadbox__topbar-logo-wrap img,
	.vgl-leadbox__topbar-logo-wrap picture,
	.vgl-leadbox__topbar-logo {
		display: block;
		width: auto !important;
		max-width: 180px;
		height: auto;
		max-height: 40px;
	}
	.vgl-leadbox__topbar-title {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		font-size: 18px;
		font-weight: 600;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.vgl-leadbox__topbar-phone {
		display: flex;
		align-items: center;
		gap: 10px;
		color: inherit !important;
		font-size: 17px;
		font-weight: 700;
		line-height: 1.2;
		text-decoration: none !important;
		white-space: nowrap;
	}
	.vgl-leadbox__topbar-phone small {
		display: block;
		font-size: 12px;
		font-weight: 400;
		opacity: 0.85;
	}
}

/* Desktop: Hinweis beim Verlassen */
.vgl-leadbox__exit {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.5);
	animation: vgl-lb-fade 0.2s ease;
}
.vgl-leadbox__exit[hidden] {
	display: none !important;
}
@keyframes vgl-lb-fade {
	from {
		opacity: 0;
	}
}
.vgl-leadbox__exit-box {
	position: relative;
	width: 480px;
	max-width: 100%;
	padding: 40px 36px 28px;
	border-radius: 8px;
	background: #fff;
	color: #1f2937;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	text-align: center;
}
.vgl-leadbox__exit-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #6b7280;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.vgl-leadbox__exit-badge {
	display: inline-block;
	margin-bottom: 14px;
	padding: 4px 14px;
	border-radius: 999px;
	background: var(--vgl-lb-badge-bg, #ffc700);
	color: var(--vgl-lb-badge, #3b2a20);
	font-size: 15px;
	font-weight: 700;
}
.vgl-leadbox__exit-title {
	margin: 0 0 10px !important;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}
.vgl-leadbox__exit-text {
	margin: 0 0 22px !important;
	font-size: 16px;
	line-height: 1.6;
}
.vgl-leadbox__exit .vgl-leadbox__go {
	width: 100%;
	min-height: 50px;
	font-size: 17px;
}
.vgl-leadbox__exit-later {
	margin: 14px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: #6b7280;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

/* Handy: feste Leiste „Jetzt vergleichen“ */
.vgl-leadbox__cta {
	display: none;
}
@media (max-width: 960px) {
	.vgl-leadbox__cta {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 99990;
		display: flex;
		gap: 10px;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, 0.96);
		box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
		transform: translateY(110%);
		transition: transform 0.25s ease;
	}
	.vgl-leadbox__cta.is-visible {
		transform: none;
	}
	.vgl-leadbox__cta a {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 48px;
		border-radius: 4px;
		background: var(--vgl-lb-cta-bg, var(--vgl-lb-badge-bg, #ffc700));
		color: var(--vgl-lb-cta, var(--vgl-lb-badge, #3b2a20)) !important;
		font-size: 17px;
		font-weight: 700;
		text-decoration: none !important;
	}
	.vgl-leadbox__cta-btn {
		flex: 1 1 auto;
		gap: 10px;
	}
	.vgl-leadbox__cta-phone {
		flex: 0 0 56px;
	}
	.vgl-leadbox__cta svg {
		width: 22px;
		height: 22px;
		fill: none;
		stroke: currentColor;
		stroke-width: 2;
		stroke-linecap: round;
		stroke-linejoin: round;
	}
	/* Cookie-Knopf über die Leiste schieben */
	.vgl-leadbox-cta-on .ccn-revoke {
		bottom: calc(84px + env(safe-area-inset-bottom));
	}
}

.vgl-leadbox.is-page-top {
	margin-top: 0;
	margin-bottom: 0;
}

/* Editor: Platzhalter für das Leadformular (Shortcode) */
.vgl-leadbox__form-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 220px;
	padding: 20px;
	border: 2px dashed #c3c4c7;
	color: #50575e;
	font-size: 14px;
	text-align: center;
}
.vgl-leadbox__form-placeholder code {
	background: #f0f0f1;
	color: #1f2937;
}
.vgl-leadbox__box-body .block-editor-inner-blocks {
	color: #1f2937;
}
