/* BD Bundle Offer — .espt-block-bd-bundle
 * vars: --cols --gap --heading-size --qty-size --amount-size --total-size
 *       --heading-color --amount-color --selected-color --opt-bg --flag-color
 *       --cta-bg --cta-color --cta-radius
 * designs: is-design-rows (base) | cards | filled | minimal
 * selector: is-radio-style-radio (base) | check | none
 * flag: is-flag-pos-right (base) | left | center
 *
 * Selection state comes from three independent sources so the widget never
 * depends on one of them:
 *   1. the server prints .is-on on the selected tier (correct first paint),
 *   2. bd-bundle.js keeps .is-on in sync on change/click,
 *   3. `.bdp4-in:checked ~ …` styles everything after the radio inside the
 *      label — plain CSS, works in every browser, even with JS off.
 * Only the tier box itself (background/border) cannot be reached with a
 * sibling combinator; its no-JS fallback lives in the one @supports
 * selector(:has(*)) block at the bottom, kept apart on purpose — a rule
 * whose selector list contains :has() is dropped whole by browsers that do
 * not understand it, which would take the .is-on fallback down with it.
 */
.espt-block-bd-bundle .bdp4 {
	color: var(--bd-ink);
	min-width: 0;
	overflow-wrap: anywhere;
}

/* editor-only hint when every tier is still empty */
.espt-block-bd-bundle .espt-block-note {
	background: var(--bd-soft);
	border: 1px dashed var(--bd-soft-line);
	border-radius: 10px;
	color: var(--bd-muted);
	font-size: 13px;
	margin: 0;
	padding: 12px 14px;
}

.espt-block-bd-bundle .bdp4-h {
	color: var(--heading-color, var(--bd-ink));
	font-size: var(--heading-size, 16px);
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 11px;
}

.espt-block-bd-bundle .bdp4-sub {
	color: var(--bd-muted);
	font-size: calc(var(--heading-size, 16px) * 0.82);
	line-height: 1.45;
	margin: -6px 0 12px;
}

/* ---------------------------------------------------------------- tiers */
.espt-block-bd-bundle .bdp4-opts {
	display: flex;
	flex-direction: column;
	gap: var(--gap, 9px);
	min-width: 0;
}

.espt-block-bd-bundle .bdp4-opt {
	align-items: center;
	background: var(--opt-bg, var(--bd-box-bg));
	border: 1.5px solid var(--bd-line);
	border-radius: calc(var(--bd-radius) * 0.55);
	cursor: pointer;
	display: flex;
	/* wraps only when the price genuinely cannot fit next to the label
	   (very narrow phones / long custom copy) — never on a normal 360px row */
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
	min-width: 0;
	padding: 14px 15px;
	position: relative;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.espt-block-bd-bundle .bdp4-opt:hover {
	border-color: color-mix(in srgb, var(--selected-color, var(--bd-primary)) 55%, var(--bd-line));
	transform: translateY(-1px);
}

/* selected tier — JS/server class (see the @supports block for the no-JS twin) */
.espt-block-bd-bundle .bdp4-opt.is-on {
	background: var(--bd-soft);
	border-color: var(--selected-color, var(--bd-primary));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--selected-color, var(--bd-primary)) 14%, transparent);
}

.espt-block-bd-bundle .bdp4-opt:focus-within {
	outline: 2px solid color-mix(in srgb, var(--selected-color, var(--bd-primary)) 60%, transparent);
	outline-offset: 2px;
}

.espt-block-bd-bundle .bdp4-in {
	accent-color: var(--selected-color, var(--bd-primary));
	cursor: pointer;
	flex: none;
	height: 19px;
	margin: 0;
	width: 19px;
}

/* custom check circle (shown for the "check" selector) */
.espt-block-bd-bundle .bdp4-ck {
	align-items: center;
	background: var(--bd-box-bg);
	border: 2px solid var(--bd-line);
	border-radius: 50%;
	color: #fff;
	display: none;
	flex: none;
	height: 22px;
	justify-content: center;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	width: 22px;
}

.espt-block-bd-bundle .bdp4-ck svg {
	height: 13px;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1);
	width: 13px;
}

.espt-block-bd-bundle.is-radio-style-check .bdp4-ck { display: inline-flex; }

.espt-block-bd-bundle.is-radio-style-check .bdp4-in,
.espt-block-bd-bundle.is-radio-style-none .bdp4-in {
	clip: rect(0, 0, 0, 0);
	height: 1px;
	margin: 0;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
	width: 1px;
}

.espt-block-bd-bundle.is-radio-style-check .bdp4-in:checked ~ .bdp4-ck {
	background: var(--selected-color, var(--bd-primary));
	border-color: var(--selected-color, var(--bd-primary));
}

.espt-block-bd-bundle.is-radio-style-check .bdp4-in:checked ~ .bdp4-ck svg {
	opacity: 1;
	transform: scale(1);
}

.espt-block-bd-bundle .bdp4-qty {
	color: var(--bd-ink);
	flex: 1 1 auto;
	font-size: var(--qty-size, 16px);
	font-weight: 700;
	line-height: 1.3;
	min-width: 0;
}

.espt-block-bd-bundle .bdp4-per {
	color: var(--bd-muted);
	display: block;
	font-size: calc(var(--qty-size, 16px) * 0.8);
	font-weight: 400;
	line-height: 1.35;
	margin-top: 2px;
}

.espt-block-bd-bundle .bdp4-amt {
	flex: 0 0 auto;
	margin-left: auto;
	max-width: 60%;
	text-align: right;
}

.espt-block-bd-bundle .bdp4-amt b {
	color: var(--amount-color, var(--bd-primary-dark));
	display: block;
	font-size: var(--amount-size, 19px);
	font-weight: 800;
	line-height: 1.15;
}

.espt-block-bd-bundle .bdp4-amt s {
	color: var(--bd-muted);
	font-size: calc(var(--amount-size, 19px) * 0.66);
	line-height: 1.3;
}

.espt-block-bd-bundle .bdp4-flag {
	background: var(--flag-color, var(--bd-danger));
	border-radius: 4px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	left: auto;
	line-height: 1.5;
	max-width: calc(100% - 24px);
	overflow: hidden;
	padding: 1px 9px;
	position: absolute;
	right: 12px;
	text-overflow: ellipsis;
	top: -10px;
	white-space: nowrap;
	z-index: 1;
}

.espt-block-bd-bundle.is-flag-pos-left .bdp4-flag { left: 12px; right: auto; }
.espt-block-bd-bundle.is-flag-pos-center .bdp4-flag { left: 50%; right: auto; transform: translateX(-50%); }

/* ---------------------------------------------------------------- total */
.espt-block-bd-bundle .bdp4-tot {
	align-items: baseline;
	border-top: 1.5px solid var(--bd-ink);
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	justify-content: space-between;
	margin-top: 14px;
	padding-top: 12px;
}

.espt-block-bd-bundle .bdp4-tot span {
	color: var(--bd-ink);
	font-size: calc(var(--total-size, 22px) * 0.62);
	font-weight: 700;
}

.espt-block-bd-bundle .bdp4-tot b {
	color: var(--amount-color, var(--bd-primary-dark));
	display: inline-block;
	font-size: var(--total-size, 22px);
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	line-height: 1.1;
}

.espt-block-bd-bundle .bdp4-tot b.is-bump { animation: espt-bdp4-bump 0.35s ease; }
@keyframes espt-bdp4-bump {
	0% { opacity: 0.35; transform: translateY(-5px); }
	100% { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ design: cards */
.espt-block-bd-bundle.is-design-cards .bdp4-opts {
	display: grid;
	grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
}

.espt-block-bd-bundle.is-design-cards .bdp4-opt {
	align-items: center;
	flex-direction: column;
	gap: 8px;
	padding: 22px 14px 18px;
	text-align: center;
}

.espt-block-bd-bundle.is-design-cards .bdp4-qty { flex: 0 0 auto; width: 100%; }
.espt-block-bd-bundle.is-design-cards .bdp4-amt { margin-left: 0; max-width: 100%; text-align: center; }
.espt-block-bd-bundle.is-design-cards .bdp4-amt b { font-size: calc(var(--amount-size, 19px) * 1.2); }
.espt-block-bd-bundle.is-design-cards .bdp4-flag { left: 50%; right: auto; transform: translateX(-50%); }
.espt-block-bd-bundle.is-design-cards .bdp4-in { order: 99; }
.espt-block-bd-bundle.is-design-cards.is-radio-style-check .bdp4-ck { order: 99; }

/* ----------------------------------------------------------- design: filled */
.espt-block-bd-bundle.is-design-filled .bdp4-opt.is-on {
	background: var(--selected-color, var(--bd-primary));
	border-color: var(--selected-color, var(--bd-primary));
	box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--selected-color, var(--bd-primary)) 70%, transparent);
}

/* everything inside the label follows the radio itself, so these need no
   :has() and keep working with JS off */
.espt-block-bd-bundle.is-design-filled .bdp4-in:checked ~ .bdp4-qty,
.espt-block-bd-bundle.is-design-filled .bdp4-in:checked ~ .bdp4-amt b { color: #fff; }

.espt-block-bd-bundle.is-design-filled .bdp4-in:checked ~ .bdp4-qty .bdp4-per,
.espt-block-bd-bundle.is-design-filled .bdp4-in:checked ~ .bdp4-amt s { color: rgba(255, 255, 255, 0.78); }

.espt-block-bd-bundle.is-design-filled .bdp4-in:checked { accent-color: #fff; }

.espt-block-bd-bundle.is-design-filled.is-radio-style-check .bdp4-in:checked ~ .bdp4-ck {
	background: #fff;
	border-color: #fff;
	color: var(--selected-color, var(--bd-primary));
}

.espt-block-bd-bundle.is-design-filled .bdp4-in:checked ~ .bdp4-flag {
	background: var(--flag-color, var(--bd-accent));
	color: var(--bd-accent-ink);
}

/* ---------------------------------------------------------- design: minimal */
.espt-block-bd-bundle.is-design-minimal .bdp4-opts { gap: 0; }

.espt-block-bd-bundle.is-design-minimal .bdp4-opt {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--bd-line);
	border-radius: 0;
	padding: 13px 8px;
}

.espt-block-bd-bundle.is-design-minimal .bdp4-opt:first-child { border-top: 1px solid var(--bd-line); }
.espt-block-bd-bundle.is-design-minimal .bdp4-opt:hover { background: color-mix(in srgb, var(--bd-soft) 60%, transparent); transform: none; }

.espt-block-bd-bundle.is-design-minimal .bdp4-opt.is-on {
	background: var(--bd-soft);
	border-color: var(--bd-line);
	box-shadow: inset 4px 0 0 var(--selected-color, var(--bd-primary));
}

.espt-block-bd-bundle.is-design-minimal .bdp4-flag {
	border-radius: 99px;
	font-size: 10.5px;
	order: 5;
	position: static;
	transform: none;
}

.espt-block-bd-bundle.is-design-minimal .bdp4-tot { border-top-width: 2px; }

/* ---------------------------------------------------------------- CTA */
.espt-block-bd-bundle .bd-cta {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-top: 16px;
	min-width: 0;
}

.espt-block-bd-bundle .bd-cta-al-left { align-items: flex-start; }
.espt-block-bd-bundle .bd-cta-al-center { align-items: center; }
.espt-block-bd-bundle .bd-cta-al-right { align-items: flex-end; }

/* .bd-cta-solid is the base look below — it needs no rule of its own */
.espt-block-bd-bundle .bd-cta-btn {
	align-items: center;
	background: var(--cta-bg, var(--espt-btn-bg, var(--bd-primary)));
	border: 0;
	border-radius: var(--cta-radius, 9px);
	box-shadow: none;
	color: var(--cta-color, #fff);
	cursor: pointer;
	display: inline-flex;
	font-size: 16px;
	font-weight: 800;
	gap: 9px;
	justify-content: center;
	line-height: 1.2;
	max-width: 100%;
	padding: 13px 28px;
	text-align: center;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
	width: 100%;
}

.espt-block-bd-bundle .bd-cta-btn:hover { color: var(--cta-color, #fff); filter: brightness(1.06); text-decoration: none; }
.espt-block-bd-bundle .bd-cta-hover-lift:hover { box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.45); transform: translateY(-3px); }
.espt-block-bd-bundle .bd-cta-hover-scale:hover { transform: scale(1.04); }
.espt-block-bd-bundle .bd-cta-hover-glow:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cta-bg, var(--bd-primary)) 28%, transparent); }

.espt-block-bd-bundle .bd-cta-note {
	color: var(--bd-muted);
	font-size: 12.5px;
	line-height: 1.5;
	text-align: center;
}

.espt-block-bd-bundle .bd-cta-al-left .bd-cta-note { text-align: left; }
.espt-block-bd-bundle .bd-cta-al-right .bd-cta-note { text-align: right; }

.espt-block-bd-bundle .bd-cta-pill .bd-cta-btn { border-radius: 999px; }
.espt-block-bd-bundle .bd-cta-gradient .bd-cta-btn { background-image: linear-gradient(135deg, var(--cta-bg, var(--bd-primary)), var(--bd-primary-dark)); }
.espt-block-bd-bundle .bd-cta-outline .bd-cta-btn { background: transparent; border: 2px solid var(--cta-bg, var(--bd-primary)); color: var(--cta-color, var(--cta-bg, var(--bd-primary))); }
.espt-block-bd-bundle .bd-cta-outline .bd-cta-btn:hover { background: var(--bd-soft); color: var(--cta-color, var(--cta-bg, var(--bd-primary))); }
.espt-block-bd-bundle .bd-cta-soft .bd-cta-btn { background: var(--cta-bg, var(--bd-soft)); color: var(--cta-color, var(--bd-primary-dark)); }
.espt-block-bd-bundle .bd-cta-soft .bd-cta-btn:hover { color: var(--cta-color, var(--bd-primary-dark)); }
.espt-block-bd-bundle .bd-cta-3d .bd-cta-btn { box-shadow: 0 4px 0 var(--bd-primary-dark); }
.espt-block-bd-bundle .bd-cta-3d .bd-cta-btn:active { box-shadow: 0 0 0 var(--bd-primary-dark); transform: translateY(4px); }
.espt-block-bd-bundle .bd-cta-glow .bd-cta-btn { box-shadow: 0 8px 26px -8px var(--cta-bg, var(--bd-primary)); }
.espt-block-bd-bundle .bd-cta-elevated .bd-cta-btn { box-shadow: 0 12px 26px -12px rgba(15, 23, 42, 0.5); }
.espt-block-bd-bundle .bd-cta-shine .bd-cta-btn { overflow: hidden; position: relative; }
.espt-block-bd-bundle .bd-cta-shine .bd-cta-btn::after {
	background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	bottom: 0;
	content: '';
	left: -80%;
	position: absolute;
	top: 0;
	transform: skewX(-20deg);
	transition: left 0.5s ease;
	width: 50%;
}
.espt-block-bd-bundle .bd-cta-shine .bd-cta-btn:hover::after { left: 130%; }
.espt-block-bd-bundle .bd-cta-ghost .bd-cta-btn { background: transparent; color: var(--cta-color, var(--bd-primary-dark)); padding: 6px 12px; text-decoration: underline; width: auto; }
.espt-block-bd-bundle .bd-cta-ghost .bd-cta-btn:hover { color: var(--cta-color, var(--bd-primary-dark)); }

.espt-block-bd-bundle .bd-cta-attn .bd-cta-btn { animation: espt-bdp4-pop 1.8s ease-in-out infinite; }
@keyframes espt-bdp4-pop {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.045); }
}

/* button icon */
.espt-block-bd-bundle .bd-bico { display: inline-flex; line-height: 0; transition: transform 0.2s ease; }
.espt-block-bd-bundle .bd-bico svg { height: 1em; width: 1em; }
.espt-block-bd-bundle .bd-cta-btn:hover .bd-bico-slide { transform: translateX(4px); }
.espt-block-bd-bundle .bd-bico-bounce { animation: espt-bdp4-ico-bounce 1.6s ease-in-out infinite; }
.espt-block-bd-bundle .bd-bico-pulse { animation: espt-bdp4-ico-pulse 1.8s ease-in-out infinite; }
@keyframes espt-bdp4-ico-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}
@keyframes espt-bdp4-ico-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.18); }
}

/* ------------------------------------------------------------- tablet + */
@media (min-width: 768px) {
	.espt-block-bd-bundle .bdp4-opt { padding: 15px 18px; }
	.espt-block-bd-bundle .bd-cta-btn { width: auto; }
	.espt-block-bd-bundle .bd-cta-full .bd-cta-btn { width: 100%; }
	.espt-block-bd-bundle .bd-cta-ghost .bd-cta-btn { width: auto; }
	.espt-block-bd-bundle.is-design-cards .bdp4-opt { padding: 24px 16px 20px; }
}

@media (min-width: 1024px) {
	.espt-block-bd-bundle .bdp4-h { margin-bottom: 14px; }
	.espt-block-bd-bundle .bdp4-tot { margin-top: 18px; padding-top: 14px; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
	.espt-block-bd-bundle .bdp4-opt,
	.espt-block-bd-bundle .bdp4-ck,
	.espt-block-bd-bundle .bdp4-ck svg,
	.espt-block-bd-bundle .bd-cta-btn,
	.espt-block-bd-bundle .bd-cta-shine .bd-cta-btn::after,
	.espt-block-bd-bundle .bd-bico { transition: none; }
	.espt-block-bd-bundle .bdp4-opt:hover { transform: none; }
	.espt-block-bd-bundle .bdp4-tot b.is-bump,
	.espt-block-bd-bundle .bd-cta-attn .bd-cta-btn,
	.espt-block-bd-bundle .bd-bico-bounce,
	.espt-block-bd-bundle .bd-bico-pulse { animation: none; }
}

/* ------------------------------------------------ no-JS tier-box fallback
 * The tier box is the one thing a sibling combinator cannot reach. These
 * mirror the .is-on rules above and live alone in @supports so that a
 * browser without :has() simply skips them instead of dropping the .is-on
 * rules with them.
 */
@supports selector(:has(*)) {
	.espt-block-bd-bundle .bdp4-opt:has(.bdp4-in:checked) {
		background: var(--bd-soft);
		border-color: var(--selected-color, var(--bd-primary));
		box-shadow: 0 0 0 3px color-mix(in srgb, var(--selected-color, var(--bd-primary)) 14%, transparent);
	}

	.espt-block-bd-bundle.is-design-filled .bdp4-opt:has(.bdp4-in:checked) {
		background: var(--selected-color, var(--bd-primary));
		border-color: var(--selected-color, var(--bd-primary));
		box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--selected-color, var(--bd-primary)) 70%, transparent);
	}

	.espt-block-bd-bundle.is-design-minimal .bdp4-opt:has(.bdp4-in:checked) {
		background: var(--bd-soft);
		border-color: var(--bd-line);
		box-shadow: inset 4px 0 0 var(--selected-color, var(--bd-primary));
	}
}
