/* Leo B2B – Frontend */

.leo-b2b-tiers,
.leo-b2b-units,
.leo-b2b-taxswitch {
	--leo-text: #062028;
	--leo-accent: #c47d22;
	--leo-line: #e2e8eb;
	--leo-active-bg: #fdf6ec;
	--leo-save-bg: #fdf1d8;
	--leo-save-text: #8a5414;
	--leo-accent-bg: rgba(196, 125, 34, 0.1);
}

.leo-b2b-tiers[hidden],
.leo-b2b-units[hidden] {
	display: none !important;
}

/* Staffeltabelle */
.leo-b2b-tiers {
	max-width: 440px;
	margin: 12px 0 20px;
	color: var(--leo-text);
}

.leo-b2b-tiers table.leo-b2b-tiers__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 15px;
	line-height: 1.35;
	font-variant-numeric: tabular-nums;
	color: var(--leo-text);
	background: transparent;
}

.leo-b2b-tiers .leo-b2b-tiers__title {
	margin: 0 0 6px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	text-align: left;
	color: var(--leo-text);
	caption-side: top;
}

.leo-b2b-tiers table.leo-b2b-tiers__table th,
.leo-b2b-tiers table.leo-b2b-tiers__table td {
	padding: 10px 12px;
	border: 0;
	border-bottom: 1px solid var(--leo-line);
	text-align: left;
	vertical-align: middle;
	color: var(--leo-text);
	background: transparent;
}

.leo-b2b-tiers table.leo-b2b-tiers__table th {
	padding-top: 6px;
	padding-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
	opacity: 0.7;
}

.leo-b2b-tiers table.leo-b2b-tiers__table tbody tr:last-child td {
	border-bottom: 0;
}

.leo-b2b-tiers table.leo-b2b-tiers__table .leo-b2b-tiers__num {
	text-align: right;
	white-space: nowrap;
}

.leo-b2b-tiers table.leo-b2b-tiers__table tr td {
	transition: background-color 0.15s ease;
}

/* Aktive Stufe */
.leo-b2b-tiers table.leo-b2b-tiers__table tr.is-active td {
	border-bottom-color: transparent;
	background: var(--leo-active-bg);
}

.leo-b2b-tiers table.leo-b2b-tiers__table tr.is-active td:first-child {
	border-radius: 6px 0 0 6px;
	box-shadow: inset 3px 0 0 var(--leo-accent);
}

.leo-b2b-tiers table.leo-b2b-tiers__table tr.is-active td:last-child {
	border-radius: 0 6px 6px 0;
}

.leo-b2b-tiers table.leo-b2b-tiers__table tr.is-active .leo-b2b-tiers__qtytext,
.leo-b2b-tiers table.leo-b2b-tiers__table tr.is-active .leo-b2b-tiers__price {
	font-weight: 700;
}

/* Menge */
.leo-b2b-tiers .leo-b2b-tiers__qtytext {
	font-weight: 500;
}

.leo-b2b-tiers .leo-b2b-tiers__sub {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 400;
	opacity: 0.7;
}

.leo-b2b-tiers .leo-b2b-tiers__badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 3px;
	background: #062028;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: 0.02em;
	vertical-align: 1px;
}

/* Preis + Ersparnis-Etikett */
.leo-b2b-tiers .leo-b2b-tiers__price {
	display: block;
}

.leo-b2b-tiers .leo-b2b-tiers__save {
	display: inline-block;
	margin-top: 3px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--leo-save-bg);
	color: var(--leo-save-text);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
}

.leo-b2b-tiers .leo-b2b-tiers__note {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--leo-text);
	opacity: 0.7;
}

/* Einheiten-Buttons */
.leo-b2b-units {
	display: flex;
	flex: 1 1 100%;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
	margin: 0 0 14px;
}

.leo-b2b-units .leo-b2b-units__btn {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 90px;
	min-height: 48px;
	margin: 0;
	padding: 6px 10px;
	border: 1px solid var(--leo-line);
	border-radius: 4px;
	background: #fff;
	box-shadow: none;
	color: var(--leo-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.leo-b2b-units .leo-b2b-units__btn:hover,
.leo-b2b-units .leo-b2b-units__btn:focus-visible {
	border-color: var(--leo-accent);
	background: #fff;
	color: var(--leo-text);
}

.leo-b2b-units .leo-b2b-units__btn.is-active {
	border-color: var(--leo-accent);
	background: var(--leo-accent-bg);
	color: var(--leo-text);
}

.leo-b2b-units .leo-b2b-units__meta {
	margin-top: 2px;
	font-size: 11px;
	font-weight: 400;
	opacity: 0.75;
}

/* Netto/Brutto-Schalter */
.leo-b2b-taxswitch {
	display: inline-flex;
	overflow: hidden;
	border: 1px solid var(--leo-line);
	border-radius: 999px;
	background: #fff;
	vertical-align: middle;
}

.leo-b2b-taxswitch .leo-b2b-taxswitch__opt {
	padding: 4px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--leo-text);
	text-decoration: none;
}

.leo-b2b-taxswitch .leo-b2b-taxswitch__opt:hover {
	color: var(--leo-accent);
}

.leo-b2b-taxswitch .leo-b2b-taxswitch__opt.is-active {
	background: var(--leo-text);
	color: #fff;
}

/* Auffüll-Knopf im Warenkorb-Hinweis */
.woocommerce-info .leo-b2b-fill-pallet,
.woocommerce-message .leo-b2b-fill-pallet {
	margin-left: 8px;
}

@media (max-width: 480px) {
	.leo-b2b-tiers {
		max-width: none;
	}

	.leo-b2b-tiers table.leo-b2b-tiers__table {
		font-size: 14px;
	}

	.leo-b2b-tiers table.leo-b2b-tiers__table th,
	.leo-b2b-tiers table.leo-b2b-tiers__table td {
		padding: 9px 10px;
	}

	.leo-b2b-units .leo-b2b-units__btn {
		min-width: 0;
		font-size: 13px;
	}
}
