/**
 * Public styles for Quantity Breaks & Bundle Discount for WooCommerce.
 */

/* =========================================================
 * Card wrapper
 * ========================================================= */
.quantity-card.qb-card {
	--qb-card-bg: #fdecec;
	--qb-card-border: #f3caca;
	--qb-card-active-bg: #fff;
	--qb-card-active-border: #8b0020;
	--qb-text: #2b2b2b;
	--qb-primary: #8b0020;
	--qb-price: #2b2b2b;
	--qb-discount: #8b0020;
	--qb-strike: #999;
	--qb-badge-bg: #8b0020;
	--qb-badge-text: #fff;
	--qb-radius: 14px;
	--qb-padding: 16px;
	--qb-gap: 12px;
	--qb-header-size: 22px;
	--qb-title-size: 14px;
	--qb-price-size: 18px;
	--qb-discount-size: 20px;
	--qb-badge-size: 12px;
	--qb-footer-size: 16px;
	--qb-total-size: 14px;

	margin-bottom: 20px;
	font-family: inherit;
	color: var(--qb-text);
	box-sizing: border-box;
}
.quantity-card.qb-card *,
.quantity-card.qb-card *::before,
.quantity-card.qb-card *::after { box-sizing: border-box; }

/* Header */
.qb-card-header {
	text-align: center;
	color: var(--qb-primary);
	font-weight: 700;
	font-size: var(--qb-header-size);
	line-height: 1.25;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--qb-primary);
	margin-bottom: 16px;
}
.qb-card-header.no-separator {
	border-bottom: none;
	padding-bottom: 6px;
}

/* Options container */
.qb-options {
	display: grid;
	gap: var(--qb-gap);
	margin: 0;
	padding: 0;
}
.qb-layout-vertical .qb-options { grid-template-columns: 1fr; }
.qb-layout-horizontal .qb-options { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Single option */
.qb-option {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	border: 2px solid var(--qb-card-border);
	background: var(--qb-card-bg);
	border-radius: var(--qb-radius);
	padding: var(--qb-padding);
	cursor: pointer;
	transition: border-color .15s, background .15s, box-shadow .15s;
	margin: 0;
}
.qb-option:hover {
	border-color: var(--qb-card-active-border);
}
.qb-option.selected {
	border-color: var(--qb-card-active-border);
	background: var(--qb-card-active-bg);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}
.qb-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	margin: 0;
}
.qb-option-content { flex: 1; min-width: 0; }

/* Badge */
.qb-badge {
	position: absolute;
	top: -9px;
	right: 12px;
	background: var(--qb-badge-bg);
	color: var(--qb-badge-text);
	padding: 2px 8px;
	border-radius: 5px;
	font-size: var(--qb-badge-size);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .01em;
	white-space: nowrap;
}

/* Option title row */
.qb-option-title {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	color: var(--qb-text);
	font-size: var(--qb-title-size);
	font-weight: 600;
}
.qb-option-units { color: var(--qb-text); }
.qb-option-discount {
	color: var(--qb-discount);
	font-weight: 700;
	font-size: var(--qb-discount-size);
	line-height: 1;
}

/* Price */
.qb-option-price {
	color: var(--qb-price);
	font-weight: 700;
	font-size: var(--qb-price-size);
	line-height: 1.2;
	margin-top: 4px;
}
.qb-option-price .woocommerce-Price-amount,
.qb-option-price bdi { color: inherit; font-weight: inherit; font-size: inherit; }

/* Strike-through original */
.qb-option-strike {
	color: var(--qb-strike);
	font-size: calc(var(--qb-price-size) * 0.72);
	text-decoration: line-through;
	margin-top: 2px;
}
.qb-option-strike .woocommerce-Price-amount,
.qb-option-strike bdi { color: inherit; font-weight: inherit; font-size: inherit; }

/* Footer custom text */
.qb-footer-text {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 2px solid var(--qb-primary);
	color: var(--qb-primary);
	font-size: var(--qb-footer-size);
	font-weight: 700;
	text-align: center;
	line-height: 1.3;
}
.qb-footer-text.no-separator {
	border-top: none;
	padding-top: 6px;
}

/* Total row */
.qb-total-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed rgba(0, 0, 0, .12);
	font-size: var(--qb-total-size);
	color: var(--qb-text);
}
.qb-total-row strong { font-weight: 700; }
.qb-total-row .woocommerce-Price-amount,
.qb-total-row bdi { color: inherit; font-weight: inherit; font-size: inherit; }

/* Variable wrapper — nothing until variation chosen */
.qb-variable-card-root:empty { display: none; }

/* Responsive */
@media (max-width: 600px) {
	.qb-layout-horizontal .qb-options {
		grid-template-columns: 1fr;
	}
	.qb-option { padding: 14px; }
}