/**
 * Tergimus Bulk Table – front end
 *
 * Colours come from CSS custom properties set by the settings page,
 * with the original Tergimus palette as the fallback.
 */

.tbt-wrap {
	margin: 20px 0;
}

.tbt-options {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.tbt-row {
	position: relative;
	display: block;
	padding: 16px 18px 16px 50px;
	border: 2px solid var(--tbt-border, #cfeaf6);
	border-radius: 16px;
	background: var(--tbt-bg, #f5fbff);
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}

.tbt-row:hover {
	border-color: var(--tbt-primary, #008ea9);
}

.tbt-row.tbt-selected {
	border-color: var(--tbt-primary, #008ea9);
	background: var(--tbt-bg-selected, #e3f4fb);
}

/* Radio: visually replaced by the dot, but kept focusable for keyboard users. */
.tbt-radio {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.tbt-row::before {
	content: "";
	position: absolute;
	left: 18px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid var(--tbt-border, #cfeaf6);
	border-radius: 50%;
	background: #fff;
	transition: background-color .2s ease, border-color .2s ease;
}

.tbt-row.tbt-selected::before {
	border-color: var(--tbt-primary, #008ea9);
	background: var(--tbt-primary, #008ea9);
}

.tbt-radio:focus-visible + .tbt-inner::after {
	content: "";
	position: absolute;
	inset: -8px -6px;
	border-radius: 12px;
	outline: 2px solid var(--tbt-primary, #008ea9);
	outline-offset: 2px;
}

.tbt-inner {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.tbt-left,
.tbt-right {
	display: flex;
	flex-direction: column;
}

.tbt-right {
	align-items: flex-end;
	text-align: right;
	flex-shrink: 0;
}

.tbt-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: #111827;
}

.tbt-save,
.tbt-unit,
.tbt-usage {
	font-size: 14px;
	font-weight: 600;
	color: #6b7280;
	margin-top: 4px;
}

.tbt-usage {
	color: var(--tbt-primary, #008ea9);
}

.tbt-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--tbt-primary, #008ea9);
	white-space: nowrap;
}

.tbt-old-price {
	margin-top: 4px;
	font-size: 14px;
	font-weight: 600;
	color: #9ca3af;
	text-decoration: line-through;
	white-space: nowrap;
}

/* WooCommerce injects its own markup inside price spans – keep it inline. */
.tbt-price .woocommerce-Price-amount,
.tbt-old-price .woocommerce-Price-amount,
.tbt-save .woocommerce-Price-amount,
.tbt-unit .woocommerce-Price-amount,
.tbt-usage .woocommerce-Price-amount {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	text-decoration: inherit;
}

/* Summary bar under the table: "Preis pro Anwendung: 17 ct." */
.tbt-usage-bar {
	margin-top: 14px;
	padding: 12px 18px;
	border-radius: 10px;
	background: var(--tbt-bg-selected, #e3f4fb);
	color: #0f3d4a;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.tbt-usage-bar .woocommerce-Price-amount,
.tbt-usage-bar .tbt-cents {
	color: var(--tbt-primary, #008ea9);
	font-size: inherit;
	font-weight: inherit;
}

.tbt-badge {
	position: absolute;
	right: -6px;
	top: -14px;
	z-index: 5;
	padding: 4px 12px;
	border-radius: 6px;
	background: var(--tbt-primary, #008ea9);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	transform: rotate(3deg);
}

@media (max-width: 600px) {

	.tbt-row {
		padding: 14px 14px 14px 46px;
	}

	.tbt-title {
		font-size: 14px;
	}

	.tbt-price {
		font-size: 16px;
	}
}

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

	.tbt-row,
	.tbt-row::before {
		transition: none;
	}
}
