/* MBW Popup – Frontend Styles */

.mbw-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.mbw-popup {
	background: #fff;
	border-radius: 8px;
	padding: 48px 44px;
	max-width: 560px;
	width: 100%;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	font-family: "Source Sans Pro", sans-serif;
	box-sizing: border-box;
	margin: auto;
}

.mbw-popup h2,
#mbw-popup-title {
	margin: 0 0 12px;
	color: #6b8e3f;
	font-size: 20px;
	font-weight: bold;
	line-height: 1.3;
	font-family: "Source Sans Pro", sans-serif;
}

.mbw-popup-subtitle {
	margin: 0 0 28px;
	color: #333;
	font-family: "Source Sans Pro", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 25.8833px;
}

.mbw-popup-field {
	margin-bottom: 28px;
}

.mbw-popup-field input {
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: "Source Sans Pro", sans-serif;
	font-size: 16px;
	line-height: 25.8833px;
	box-sizing: border-box;
}

.mbw-popup-field input:focus {
	outline: none;
	border-color: #567f35;
}

/* Im Dokumentenfluss → kein Überdecken der Buttons */
.mbw-popup-suggestions {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	border: 1px solid #ddd;
	border-radius: 4px;
	max-height: 200px;
	overflow-y: auto;
	position: static;
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}

.mbw-popup-suggestions:empty {
	display: none;
	border: none;
	margin: 0;
}

.mbw-popup-suggestions li {
	padding: 12px 16px;
	cursor: pointer;
	font-family: "Source Sans Pro", sans-serif;
	font-size: 16px;
	line-height: 25.8833px;
}

.mbw-popup-suggestions li:hover,
.mbw-popup-suggestions li:active {
	background: #f2f2f2;
}

.mbw-popup-actions {
	display: flex;
	justify-content: space-between;
	gap: 16px;
}

.mbw-btn {
	flex: 1;
	display: block;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-family: "Source Sans Pro", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 40px;
	text-align: center;
	transition: all 0.1s;
	box-sizing: border-box;
}

.mbw-btn--primary {
	background-color: #567f35;
	color: #fff;
}

.mbw-btn--primary:hover:not(:disabled) {
	background-color: #567f35;
}

.mbw-btn--primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.mbw-btn--secondary {
	background-color: transparent;
	color: #000;
	/* inset shadow statt border, damit Größe mit Primary identisch bleibt */
	box-shadow: inset 0 0 0 1px #000;
}

.mbw-btn--secondary:hover {
	background-color: transparent;
	color: #000;
	box-shadow: inset 0 0 0 1px #000;
}

/* Hinweis-Shortcode */
.mbw-hinweis {
	display: inline-block;
	max-width: 90vw;
	font-family: "Source Sans Pro", sans-serif;
	font-size: 16px;
	line-height: 25.8833px;
	color: #fff;
	text-align: center;
}

.mbw-hinweis .mbw-status,
.mbw-hinweis .mbw-status--reached,
.mbw-hinweis .mbw-status--pending,
.mbw-hinweis .mbw-status--unknown,
.mbw-hinweis .mbw-sep,
.mbw-hinweis .amount,
.mbw-hinweis .woocommerce-Price-amount {
	color: #fff;
}

/* Links (Warenkorb + Adresse) bleiben als Block zusammen */
.mbw-hinweis .mbw-change {
	white-space: nowrap;
}

.mbw-hinweis .mbw-sep {
	margin: 0 0.35em;
}

.mbw-hinweis .mbw-change--wrapped .mbw-sep:first-child {
	display: none;
}

/* Bei zwei Links: Pipe zwischen den Links nie ausblenden */
.mbw-hinweis .mbw-change--wrapped .mbw-link + .mbw-sep {
	display: inline;
}

.mbw-hinweis .mbw-link,
.mbw-hinweis a {
	color: #fff;
	text-decoration: underline;
	cursor: pointer;
}

.mbw-hinweis .mbw-link:hover,
.mbw-hinweis a:hover {
	color: #fff;
	opacity: 0.85;
}

/* Cart/Checkout: Mindestbestellwert-Hinweis im Versand-Block */
.mbw-shipping-minimum-msg {
	display: block;
	font-weight: 600;
	font-size: 19px;
	line-height: 28px;
	text-wrap: balance;
}

/* Preise im MBW-Hinweis nicht floaten (Theme-Override) */
#order_review .shop_table tr.shipping td .mbw-shipping-minimum-msg .woocommerce-Price-amount,
.cart_totals .shop_table tr.shipping td .mbw-shipping-minimum-msg span.woocommerce-Price-amount,
.cart_totals .shop_table tr.shipping td .mbw-shipping-minimum-msg .woocommerce-Price-amount,
ul#shipping_method li .mbw-shipping-minimum-msg span.amount,
.mbw-shipping-minimum-msg .woocommerce-Price-amount,
.mbw-shipping-minimum-msg .amount,
.mbw-minimum-popup-msg .woocommerce-Price-amount,
.mbw-minimum-popup-msg .amount {
	float: none !important;
}

.mbw-popup--minimum #mbw-minimum-popup-title {
	margin: 0 0 12px;
	color: #6b8e3f;
	font-size: 20px;
	font-weight: bold;
	line-height: 1.3;
	font-family: "Source Sans Pro", sans-serif;
}

.mbw-minimum-popup-msg {
	margin: 0 0 28px;
	font-weight: 600;
	font-size: 19px;
	line-height: 28px;
	font-family: "Source Sans Pro", sans-serif;
	color: #333;
}

.mbw-minimum-popup-msg .mbw-shipping-minimum-msg {
	text-wrap: unset;
}

a.checkout-button.mbw-checkout-disabled,
.woocommerce a.checkout-button.mbw-checkout-disabled {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: auto;
}

/* WC-Versandrechner-Formular ausblenden – Adresse nur über MBW-Popup */
.woocommerce-shipping-calculator .shipping-calculator-form {
	display: none !important;
}

@media (max-width: 480px) {
	.mbw-popup-overlay {
		padding: 12px;
	}

	.mbw-popup-overlay.mbw-keyboard-open {
		align-items: flex-start;
	}

	.mbw-popup {
		padding: 24px 20px;
	}

	.mbw-popup-overlay.mbw-keyboard-open .mbw-popup {
		margin-top: 8px;
		margin-bottom: 12px;
	}

	.mbw-popup-subtitle {
		margin-bottom: 16px;
	}

	.mbw-popup-field {
		margin-bottom: 16px;
	}

	.mbw-popup-suggestions {
		max-height: 140px;
	}

	.mbw-popup-actions {
		flex-direction: column;
	}

	/* Erreicht: Adresse | Warenkorb – Warenkorb rechts (näher am Daumen) */
	.mbw-hinweis .mbw-change--dual {
		display: inline-flex;
		flex-direction: row-reverse;
	}
}
