/**
 * Bundle & Save — frontend styles
 *
 * The card/radio/badge/price rules below are based directly on the
 * reference design supplied for this plugin (sharp corners, corner
 * "MOST POPULAR" ribbon, blue save badge, native-radio styling). Mapped
 * onto this plugin's actual markup (.wcbs-title, .wcbs-badge-discount,
 * .wcbs-price-current, etc.) rather than the generic tag selectors
 * (strong/small/del) the reference used, since that's what the PHP here
 * outputs.
 *
 * IMPORTANT (mobile): the card stays a single horizontal row at every
 * width — radio, title/badge/description on the left, price block on the
 * right. Only sizing (fonts, padding, gaps) scales down for small screens;
 * nothing is ever wrapped onto its own row. See the media query at the
 * bottom.
 */

.wcbs-wrap {
	--wcbs-border: #C8C8C8;
	--wcbs-border-selected: #111111;
	--wcbs-bg: #FFFFFF;
	--wcbs-text: #111111;
	--wcbs-text-muted: #666666;
	--wcbs-accent-discount: #2856B8;
	--wcbs-accent-discount-text: #FFFFFF;
	--wcbs-accent-save: #1F8A4C;
	--wcbs-popular-bg: #ED0000;
	--wcbs-popular-text: #FFFFFF;
	--wcbs-radius: 0;
	--wcbs-font: Arial, Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	font-family: var(--wcbs-font);
	margin: 0 0 24px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow-x: hidden; /* belt-and-braces: nothing here should ever cause page-level horizontal scroll */
}

.wcbs-wrap *,
.wcbs-wrap *::before,
.wcbs-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Section heading ---------- */

.wcbs-heading {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 16px;
}

.wcbs-heading-line {
	flex: 1 1 auto;
	height: 1px;
	background: #D4D4D8;
}

.wcbs-heading-text {
	flex: 0 0 auto;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wcbs-text);
	white-space: nowrap;
}

.wcbs-offers {
	display: flex;
	flex-direction: column;
}

/* ==========================================
   BUNDLE CARD
   ========================================== */

.wcbs-card {
	position: relative;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	width: 100%;
	min-height: 76px;

	padding: 14px 18px;
	margin: 0 0 10px;

	background: var(--wcbs-bg);
	border: 1px solid var(--wcbs-border);
	border-radius: var(--wcbs-radius);

	cursor: pointer;
	transition: border-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
	overflow: visible;
}

.wcbs-card:hover {
	border-color: #999999;
}

.wcbs-card--selected {
	border: 2px solid var(--wcbs-border-selected);
	padding: 13px 17px; /* compensate for the extra 1px of border so content doesn't shift */
}

.wcbs-card--selected:hover {
	border-color: var(--wcbs-border-selected);
}

.wcbs-card:focus-within {
	outline: 2px solid #2856B8;
	outline-offset: 2px;
}

/* ---------- MOST POPULAR ribbon (top-right corner) ---------- */

.wcbs-card--popular {
	position: relative;
}

.wcbs-popular-flag {
	position: absolute;
	top: -1px;
	right: -1px;

	height: 27px;
	min-width: 115px;

	padding: 0 10px;

	display: flex;
	align-items: center;
	justify-content: center;

	background: var(--wcbs-popular-bg);
	color: var(--wcbs-popular-text);

	font-family: var(--wcbs-font);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.2px;
	text-transform: uppercase;
	white-space: nowrap;

	z-index: 20;
}

/* ==========================================
   RADIO BUTTON
   ========================================== */

.wcbs-radio {
	position: relative;
	flex: 0 0 24px !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: 0 16px 0 0;
}

.wcbs-radio-input {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
}

.wcbs-radio-dot {
	display: block;
	position: relative;
	width: 24px;
	height: 24px;
	border: 2px solid #B8B8B8;
	border-radius: 50%;
	background: #FFFFFF;
	transition: border-color 0.15s ease;
}

.wcbs-card--selected .wcbs-radio-dot {
	border: 2px solid var(--wcbs-border-selected);
}

.wcbs-radio-dot::after {
	content: "";
	position: absolute;
	width: 12px;
	height: 12px;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(0);
	background: var(--wcbs-border-selected);
	border-radius: 50%;
	transition: transform 0.12s ease;
}

.wcbs-card--selected .wcbs-radio-dot::after {
	transform: translate(-50%, -50%) scale(1);
}

/* ==========================================
   TEXT (title / badge / description)
   ========================================== */

.wcbs-card-body {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 4px;
	padding-right: 12px;
}

.wcbs-card-heading {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.wcbs-title {
	color: var(--wcbs-text);
	font-family: var(--wcbs-font);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
}

.wcbs-description {
	display: block;
	color: var(--wcbs-text-muted);
	font-family: var(--wcbs-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
}

/* ---------- Save / discount badge ---------- */

.wcbs-badge-discount {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	padding: 5px 9px;

	background: var(--wcbs-accent-discount);
	color: var(--wcbs-accent-discount-text);

	font-family: var(--wcbs-font);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

/* ==========================================
   PRICE (right-aligned, stacked)
   ========================================== */

.wcbs-card-pricing {
	flex: 0 0 auto !important;
	margin-left: auto !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-end;
	text-align: right;
}

.wcbs-price-current {
	color: var(--wcbs-text);
	font-family: var(--wcbs-font);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.1;
	white-space: nowrap;
}

.wcbs-price-current .woocommerce-Price-amount {
	font-weight: 600;
}

.wcbs-price-original {
	display: block;
	margin-top: 5px;
	color: var(--wcbs-text-muted);
	font-family: var(--wcbs-font);
	font-size: 13px;
	font-weight: 400;
	text-align: right;
	text-decoration: line-through;
	text-decoration-color: #999999;
	white-space: nowrap;
}

.wcbs-savings {
	display: block;
	margin-top: 4px;
	color: var(--wcbs-accent-save);
	font-family: var(--wcbs-font);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

/* ==========================================
   NATIVE WOOCOMMERCE QTY INPUT — controlled, not user-facing
   ========================================== */

.wcbs-wrap ~ .quantity {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Locked quantity shown in the cart table for bundled line items */
.wcbs-locked-qty {
	display: inline-block;
	padding: 4px 10px;
	font-weight: 600;
	color: #111111;
	background: #F4F4F4;
}

/* ==========================================
   MOBILE
   Same horizontal row structure as desktop — only sizing shrinks.
   Nothing wraps onto a second row.
   ========================================== */

@media (max-width: 600px) {

	.wcbs-card {
		min-height: 72px;
		padding: 12px 14px;
		margin-bottom: 9px;
		gap: 10px;
		flex-wrap: nowrap !important;
	}

	.wcbs-card--selected {
		padding: 11px 13px;
	}

	.wcbs-radio {
		flex-basis: 22px !important;
		width: 22px;
		height: 22px;
		margin-right: 12px;
	}

	.wcbs-radio-dot {
		width: 22px;
		height: 22px;
	}

	.wcbs-radio-dot::after {
		width: 10px;
		height: 10px;
	}

	.wcbs-card-body {
		gap: 2px;
		padding-right: 8px;
	}

	.wcbs-card-heading {
		flex-wrap: nowrap;
		gap: 6px;
		min-width: 0;
	}

	.wcbs-title {
		font-size: 14.5px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		min-width: 0;
	}

	.wcbs-description {
		font-size: 11.5px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.wcbs-badge-discount {
		flex: 0 0 auto;
		padding: 3px 7px;
		font-size: 10px;
	}

	.wcbs-price-current {
		font-size: 15.5px;
	}

	.wcbs-price-original {
		font-size: 11px;
		margin-top: 3px;
	}

	.wcbs-savings {
		font-size: 10.5px;
	}

	.wcbs-popular-flag {
		min-width: 92px;
		height: 22px;
		font-size: 9px;
		padding: 0 8px;
	}
}

/* Very narrow phones: shrink a little further, still one row */
@media (max-width: 360px) {

	.wcbs-card {
		padding: 10px 10px;
		gap: 8px;
		flex-wrap: nowrap !important;
	}

	.wcbs-card--selected {
		padding: 9px 9px;
	}

	.wcbs-radio {
		flex-basis: 20px;
		width: 20px;
		height: 20px;
		margin-right: 9px;
	}

	.wcbs-radio-dot {
		width: 20px;
		height: 20px;
	}

	.wcbs-title {
		font-size: 13px;
	}

	.wcbs-description {
		display: none; /* first thing to give way once space truly runs out */
	}

	.wcbs-badge-discount {
		font-size: 9.5px;
		padding: 3px 6px;
	}

	.wcbs-price-current {
		font-size: 14px;
	}

	.wcbs-price-original {
		font-size: 10px;
	}
}
