/* Liquid Director – Cart Extensions */

.ldcx-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 10px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom));
	padding-left: calc(16px + var(--ldcx-bar-left, 0px));
	padding-right: calc(16px + var(--ldcx-bar-right, 0px));
	background: var(--ldcx-bar-bg, #ffffff);
	color: var(--ldcx-bar-fg, #1a1a1a);
	box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.14);
	transform: translateY(110%);
	transition: transform 0.25s ease;
	font-family: inherit;
}

.ldcx-bar.is-visible {
	transform: translateY(0);
}

.ldcx-bar__info {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
	min-width: 0;
}

.ldcx-bar__note {
	font-size: 12px;
	opacity: 0.7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ldcx-bar__price {
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}

.ldcx-bar__button {
	flex: 1 1 auto;
	min-height: 48px;
	padding: 12px 18px;
	border: 0;
	border-radius: var(--ldcx-btn-radius, 6px);
	background: var(--ldcx-btn-bg, #111111);
	color: var(--ldcx-btn-fg, #ffffff);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ldcx-bar__button:hover,
.ldcx-bar__button:focus-visible {
	opacity: 0.9;
}

.ldcx-bar__button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Sichtbarkeit nach Elementor-Breakpoints */
@media (min-width: 768px) {
	.ldcx-bar[data-visibility="mobile"] {
		display: none;
	}
}

@media (min-width: 1025px) {
	.ldcx-bar[data-visibility="tablet"] {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ldcx-bar {
		transition: none;
	}
}

/* ---------------------------------------------------------------------------
 * Barrierefreiheit für die Mengenauswahl des Original-Widgets.
 *
 * Das Original blendet die Radios mit display:none aus – damit sind sie per
 * Tastatur nicht mehr erreichbar und Screenreader ignorieren sie. Hier werden
 * sie stattdessen visuell versteckt, bleiben aber fokussierbar.
 * Abschaltbar über den Filter ldcx_a11y_fix.
 * ------------------------------------------------------------------------- */
body.ldcx-a11y form.cart .wld-add-to-cart-radio {
	display: inline-block;
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

body.ldcx-a11y form.cart .wld-add-to-cart-radio:focus-visible + label.wld-add-to-cart {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * Zusatzangebot (Upsell) im Add-to-Cart-Formular
 * ------------------------------------------------------------------------- */
form.cart .ldcx-upsell {
	margin: 1rem 0 1.25rem;
}

form.cart .ldcx-upsell__row {
	display: grid;
	grid-template-columns: auto auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	background: #ffffff;
	color: #1a1a1a;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

form.cart .ldcx-upsell__row:hover {
	filter: brightness(0.98);
}

/* Preise erben die Farbe des Blocks, damit Theme-Styles nicht durchschlagen. */
form.cart .ldcx-upsell__price,
form.cart .ldcx-upsell__price .woocommerce-Price-amount,
form.cart .ldcx-upsell__compare,
form.cart .ldcx-upsell__compare .woocommerce-Price-amount {
	color: inherit;
}

form.cart .ldcx-upsell__check {
	width: 22px;
	height: 22px;
	margin: 0;
	flex: none;
	accent-color: currentColor;
	cursor: pointer;
}

form.cart .ldcx-upsell__check:checked ~ .ldcx-upsell__body .ldcx-upsell__cta {
	font-weight: 700;
}

form.cart .ldcx-upsell__row.is-checked {
	border-color: currentColor;
}

form.cart .ldcx-upsell__img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 6px;
	flex: none;
}

form.cart .ldcx-upsell__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	line-height: 1.35;
}

form.cart .ldcx-upsell__line {
	font-size: 0.9em;
}

form.cart .ldcx-upsell__line--head {
	font-weight: 700;
	font-size: 1em;
}

form.cart .ldcx-upsell__prices {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 2px;
}

form.cart .ldcx-upsell__compare {
	opacity: 0.6;
}

form.cart .ldcx-upsell__price {
	font-size: 1.05em;
}

form.cart .ldcx-upsell__badge {
	padding: 2px 8px;
	border-radius: 999px;
	background: #1c7c3f;
	color: #fff;
	font-size: 0.78em;
	font-weight: 600;
	white-space: nowrap;
}

form.cart .ldcx-upsell__cta {
	margin-top: 4px;
	font-size: 0.88em;
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (max-width: 480px) {
	form.cart .ldcx-upsell__img {
		width: 52px;
		height: 52px;
	}
	form.cart .ldcx-upsell__row {
		gap: 10px;
		padding: 10px;
	}
}

/* ---------------------------------------------------------------------------
 * Gesamtpreis-Block: Preiszeile, Badges, Kleingedrucktes
 * ------------------------------------------------------------------------- */
form.cart .ldcx-total-block {
	margin: 0.75rem 0 1.25rem;
}

form.cart .ldcx-total {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
}

form.cart .ldcx-total__label {
	font-size: 0.95em;
}

form.cart .ldcx-total__compare {
	color: #8a8a8a;
	font-size: 1em;
	text-decoration-thickness: 1px;
}

form.cart .ldcx-total__value {
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.1;
	transition: opacity 0.12s ease;
}

form.cart .ldcx-total.is-updating .ldcx-total__value,
form.cart .ldcx-total.is-updating .ldcx-total__compare,
form.cart .ldcx-total.is-updating .ldcx-total__save {
	opacity: 0.3;
}

form.cart .ldcx-total__save {
	padding: 3px 10px;
	border-radius: 999px;
	background: #1c7c3f;
	color: #fff;
	font-size: 0.76em;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

/* Badges */
form.cart .ldcx-total__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

form.cart .ldcx-total__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border: 1px solid #d8d0c4;
	border-radius: 999px;
	background: #fff;
	color: #3d3d3d;
	font-size: 0.8em;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

form.cart .ldcx-total__badge-icon {
	font-size: 1.05em;
	line-height: 1;
}

/* Kleingedrucktes */
form.cart .ldcx-total__fine {
	margin: 10px 0 0;
	color: #7a7a7a;
	font-size: 0.78em;
	line-height: 1.5;
}

form.cart .ldcx-total__fine a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (max-width: 480px) {
	form.cart .ldcx-total {
		gap: 8px;
	}
	form.cart .ldcx-total__value {
		font-size: 1.25em;
	}
}

/* ---------------------------------------------------------------------------
 * Mengenauswahl: gleichmäßiges Raster statt umbrechender Flex-Zeile
 * ------------------------------------------------------------------------- */
body.ldcx-qty form.cart .wld-add-to-cart-wrapper {
	display: grid;
	grid-template-columns: repeat(var(--ldcx-qty-cols, 3), minmax(0, 1fr));
	gap: 10px;
	align-items: stretch;
	justify-content: stretch;
}

body.ldcx-qty form.cart .wld-add-to-cart-item {
	position: relative;
	margin: 0;
	display: flex;
}

body.ldcx-qty form.cart .wld-add-to-cart {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 100%;
	min-height: 62px;
	text-align: center;
	line-height: 1.25;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

body.ldcx-qty form.cart .wld-add-to-cart:hover {
	transform: translateY(-1px);
}

body.ldcx-qty form.cart .wld-add-to-cart-selected {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* Stückpreis unter der Beschriftung */
body.ldcx-qty form.cart .ldcx-qty-unit {
	display: block;
	font-size: 0.78em;
	font-weight: 400;
	opacity: 0.75;
}

/* Empfehlungs-Fahne – steht über der Kachel, ohne sie zu verkleinern */
body.ldcx-qty form.cart .wld-add-to-cart-wrapper.ldcx-has-flag {
	padding-top: 12px;
}

body.ldcx-qty form.cart .ldcx-qty-flag {
	position: absolute;
	top: -11px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	padding: 2px 10px;
	border-radius: 999px;
	background: #1c7c3f;
	color: #fff;
	font-size: 0.68em;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.6;
	white-space: nowrap;
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * Sticky-Leiste: Platz für schwebende Elemente schaffen
 *
 * Trust-Siegel und Chat-Buttons sitzen unten und würden sonst die Preisangabe
 * in der Leiste verdecken. Sie weichen um die Höhe der Leiste nach oben aus.
 * ------------------------------------------------------------------------- */
body.ldcx-bar-open {
	padding-bottom: var(--ldcx-bar-height, 0px);
}

/* Nur aktiv, wenn ausdrücklich gewünscht – Fremd-Widgets in iframes lassen
   sich nicht zuverlässig verschieben. Der Freiraum in der Leiste ist der
   robustere Weg. */
body.ldcx-bar-open.ldcx-shift-floats [id^="trustbadge-container"],
body.ldcx-bar-open.ldcx-shift-floats .trustbadge,
body.ldcx-bar-open.ldcx-shift-floats #trustbadge,
body.ldcx-bar-open.ldcx-shift-floats .tawk-min-container,
body.ldcx-bar-open.ldcx-shift-floats #tawkchat-container,
body.ldcx-bar-open.ldcx-shift-floats iframe[title*="chat" i] {
	transform: translateY(calc(-1 * var(--ldcx-bar-height, 0px)));
	transition: transform 0.25s ease;
}

/* Aktions-Hinweis unter dem Preis */
form.cart .ldcx-total__promo {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 0;
	color: #b4451f;
	font-size: 0.84em;
	font-weight: 600;
	line-height: 1.4;
}
