/** Minimal BookingWP polish for EDD's native checkout blocks. */

.bookingwp-checkout {
	--checkout-border: var(--wp--custom--color--outline-variant, #eceef1);
	--checkout-muted: var(--wp--preset--color--muted, #5b6570);
}

.bookingwp-checkout .wp-block-edd-checkout,
.bookingwp-checkout .page-content .wp-block-post-content > :not(.edd_empty_cart) {
	max-width: none;
}

/* Empty cart: stack message, CTA, renew. */
body.bookingwp-checkout--empty .edd_empty_cart {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	width: 100%;
	max-width: 100%;
	margin: 3rem auto 0;
	padding-inline: 0;
	text-align: center;
}

body.bookingwp-checkout--empty .bookingwp-checkout-empty__renew {
	color: var(--checkout-muted);
	font-size: 0.875rem;
}

/* Progress layout + connectors. Dot markers live with about-timeline in theme style.css. */
body.bookingwp-checkout:not(.bookingwp-checkout--empty) .site-header__inner {
	position: relative;
}

.bookingwp-flow {
	flex: 1 1 auto;
	min-width: 0;
}

.bookingwp-flow ol {
	display: flex;
	width: min(100%, 20rem);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.bookingwp-flow li {
	position: relative;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
	color: var(--checkout-muted);
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

.bookingwp-flow li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: calc(0.375rem - 1px);
	left: calc(50% + 0.5rem);
	right: calc(-50% + 0.5rem);
	height: 2px;
	background: var(--wp--preset--color--hairline, #d8dce1);
}

.bookingwp-flow .is-complete {
	color: var(--wp--preset--color--text, #2a3139);
}

.bookingwp-flow .is-complete:not(:last-child)::after {
	background: var(--wp--custom--color--primary, var(--wp--preset--color--accent, #f5405b));
}

.bookingwp-flow .is-current {
	color: var(--wp--custom--color--primary, var(--wp--preset--color--accent, #f5405b));
}

@media (min-width: 782px) {
	.bookingwp-flow {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	.bookingwp-flow ol {
		width: min(22rem, 55vw);
	}

	.bookingwp-flow li {
		font-size: 0.75rem;
	}
}

/* Layout and form cards */
.bookingwp-checkout .edd-blocks-form__purchase {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

/* Kill UA groove; card chrome stays on the ID selectors in system.css. */
.bookingwp-checkout fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-inline-size: 0;
}

.bookingwp-checkout .wp-block-columns {
	align-items: flex-start !important;
	gap: clamp(1.5rem, 4vw, 3rem);
}

.bookingwp-checkout .wp-block-column {
	min-width: 0;
}

/* Keep edd.css notice rail + card-column pad; only tweak stack gap and block pad. */
.bookingwp-checkout .edd-blocks__logged-in {
	margin-bottom: 1.5rem;
	padding-block: 1.15rem;
	border-radius: var(--wp--custom--shape--sm, 0.5rem);
}

/* Login sits above the card. EDD pins it over the corner from 600px up. */
.bookingwp-checkout .edd-blocks__checkout-user .edd-blocks__checkout-forms--inline {
	position: static !important;
	justify-content: flex-start;
	margin: 0 0 0.65rem;
}

.bookingwp-checkout .edd-blocks__checkout-forms .edd-button-secondary {
	min-height: 0 !important;
	height: auto !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--checkout-muted) !important;
	font-size: 0.8125rem !important;
	font-weight: 500;
	line-height: 1.4 !important;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.bookingwp-checkout .edd-blocks__checkout-forms .edd-button-secondary:hover {
	color: var(--wp--custom--color--primary, #f5405b) !important;
}

/* Floating labels: site stack gap; State|Postal share a row (see address rules below). */
.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form :is(#edd_checkout_user_info, #edd_cc_address) {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	column-gap: var(--md-field-stack-col-gap, 0.65rem);
	row-gap: var(--md-field-stack-gap, 1.25rem);
}

.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_checkout_user_info > :is(legend, #edd-email-wrap),
.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_cc_address > :is(legend, #edd-card-country-wrap, #edd-card-vat-wrap, #edd-card-company-wrap, [type="hidden"]) {
	grid-column: 1 / -1;
}

/*
 * Address line 2 sits between Address and City, so Address|City pairing leaves a
 * hole and City|State incorrectly. Keep street lines + city full-width; State|Postal
 * still pair via EDD `.cc-address--state-zip`.
 */
.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_cc_address > :is(#edd-card-address-wrap, #edd-card-address-2-wrap, #edd-card-city-wrap) {
	grid-column: 1 / -1;
}

/* Beat EDD legend weight; title tokens live in system.css. */
.bookingwp-checkout #edd_checkout_form_wrap fieldset legend {
	font-weight: var(--bwp-card-title-weight, 600);
}

.bookingwp-checkout form :is(.edd-blocks-form__group, .md-field, .edd-form-group) {
	margin: 0;
}

/* Beat EDD checkout inline `form__group > label { margin-bottom:.5rem !important }`. */
.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form .edd-blocks-form .md-field > label {
	margin: 0 !important;
}

.bookingwp-checkout :is(#edd-first-name-wrap, #edd-last-name-wrap) .edd-description {
	display: none;
}

.bookingwp-checkout .edd-description {
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--checkout-muted);
}

.bookingwp-checkout #edd-email-wrap .edd-description {
	margin: 0.5rem 0 0 !important;
	padding: 0.5rem 0.7rem;
	border-radius: var(--wp--custom--shape--xs, 0.25rem);
	background: var(--wp--custom--color--surface-container, #f6f7f8);
	font-size: 0.8125rem;
	line-height: 1.45;
}

/* Payment Method: same card chrome as Personal Info / Billing; equal gateway chips. */
.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_payment_mode_select {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--bwp-card-gap, 1.25rem);
	min-inline-size: 0;
	margin: 0 0 var(--bwp-card-stack-gap, 1.25rem);
	padding: var(--bwp-card-pad, var(--wp--custom--space--5, 1.5rem));
	border: 1px solid var(--wp--custom--color--outline-variant, #eceef1);
	border-radius: var(--wp--custom--shape--md, 0.75rem);
	background: var(--wp--custom--color--surface, #fff);
}

.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_payment_mode_select > legend {
	float: left;
	width: 100%;
	margin: 0;
	padding: 0 0 var(--bwp-card-title-gap, 0.5rem);
	border: 0;
	color: var(--wp--custom--color--on-surface, #2a3139);
	font-size: var(--bwp-card-title-size, 1.125rem);
	font-weight: var(--bwp-card-title-weight, 600);
	letter-spacing: var(--wp--custom--tracking--title, normal);
	line-height: 1.3;
}

.bookingwp-checkout .wp-block-edd-checkout #edd-payment-mode-wrap {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.4rem;
	clear: both;
}

.bookingwp-checkout .wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option {
	display: flex !important;
	align-items: center;
	justify-content: center;
	flex-grow: 0;
	gap: 0.35rem;
	min-height: 2rem;
	margin: 0 !important;
	padding: 0.4rem 0.75rem;
	border: 1px solid var(--wp--custom--color--outline-variant, #eceef1);
	border-radius: var(--wp--custom--shape--sm, 0.5rem);
	background: transparent;
	color: var(--wp--custom--color--on-surface, #2a3139);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	transform: none;
	cursor: pointer;
}

.bookingwp-checkout .wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option:hover {
	border-color: var(--wp--custom--color--outline, #8b939c);
	background: color-mix(in srgb, var(--wp--custom--color--on-surface) 4%, transparent);
	transform: none;
}

.bookingwp-checkout .wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option.edd-gateway-option-selected,
.bookingwp-checkout .wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option.edd-gateway-option-selected:hover {
	border-color: var(--wp--custom--color--on-surface, #2a3139);
	background: color-mix(in srgb, var(--wp--custom--color--on-surface) 6%, transparent);
	color: var(--wp--custom--color--on-surface, #2a3139);
	transform: none;
}

/* EDD empties this wrap while the gateway AJAX runs - show a local spinner. */
.bookingwp-checkout #edd_purchase_form_wrap:empty {
	display: flex;
	align-items: center;
	min-height: 3rem;
}

.bookingwp-checkout #edd_purchase_form_wrap:empty::before {
	content: "";
	width: 1rem;
	height: 1rem;
	border: 2px solid var(--checkout-border, #eceef1);
	border-top-color: var(--wp--custom--color--on-surface, #2a3139);
	border-radius: 50%;
	animation: bookingwp-field-spin 0.7s linear infinite;
}

/* Terms + pay: match card content inset; beat EDD #edd_checkout_form_wrap rules. */
.bookingwp-checkout #edd_checkout_form_wrap #edd_purchase_submit {
	padding-inline: var(--bwp-card-pad, var(--wp--custom--space--5, 1.5rem));
	border: 1px solid transparent; /* match card border so content lines up */
}

.bookingwp-checkout #edd_checkout_form_wrap #edd_terms_agreement {
	margin: 1.25rem 0 0;
}

.bookingwp-checkout #edd_checkout_form_wrap .edd-terms-agreement {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 0 1rem;
}

.bookingwp-checkout #edd_checkout_form_wrap #edd_agree_to_terms {
	width: 1.5rem;
	height: 1.5rem;
	margin: 0;
	accent-color: var(--wp--custom--color--primary, #f5405b);
}

.bookingwp-checkout #edd_checkout_form_wrap .edd-terms-agreement label {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
}

.bookingwp-checkout :is(.md-field, .edd-terms-agreement) {
	scroll-margin-top: var(--sticky-under-header, 5rem);
}

.bookingwp-checkout .edd-terms-agreement:is(.is-error, :has(:user-invalid)) label {
	color: var(--wp--custom--color--error, #b3261e);
}

.bookingwp-checkout #edd_checkout_form_wrap #edd_purchase_submit .edd-submit {
	width: auto;
}

@media (min-width: 782px) {
	/* Wider summary so names wrap on spaces, not mid-word at laptop widths. */
	.bookingwp-checkout .wp-block-columns > .wp-block-column:first-child {
		flex-basis: 58% !important;
		flex-grow: 1;
	}

	.bookingwp-checkout .wp-block-columns > .wp-block-column:last-child {
		position: sticky;
		top: var(--sticky-under-header);
		align-self: flex-start;
		flex-basis: min(22.5rem, 40%) !important;
		flex-grow: 0;
		max-width: 22.5rem;
	}
}

/* Summary */
.bookingwp-checkout .bookingwp-cart-title-text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.bookingwp-checkout .bookingwp-cart-name {
	font-size: 0.9375rem;
	font-weight: 650;
	line-height: 1.3;
}

.bookingwp-checkout .bookingwp-cart-plan {
	display: block;
	color: var(--checkout-muted);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.3;
}

.bookingwp-checkout .bookingwp-cart-facts,
.bookingwp-checkout-summary__facts {
	margin: 0;
	color: var(--checkout-muted);
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.35;
	word-break: normal;
	overflow-wrap: break-word;
}

.bookingwp-checkout .edd-sl-renewal-details {
	display: flex;
	align-items: baseline;
	gap: 0.35rem;
	min-width: 0;
	margin: 0.1rem 0 0;
	color: var(--checkout-muted);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.3;
}

.bookingwp-checkout .edd-sl-renewal-label {
	flex: 0 0 auto;
}

.bookingwp-checkout .edd-sl-renewal-key {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

/* Quiet trust line at the foot of the summary card. */
.bookingwp-checkout .bookingwp-checkout-guarantee {
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	margin: 0;
	padding: 1.15rem 0 0;
	border-top: 1px solid var(--checkout-border);
	color: var(--checkout-muted);
	font-size: 0.75rem;
	line-height: 1.4;
}

.bookingwp-checkout .bookingwp-checkout-guarantee svg {
	flex: 0 0 auto;
	margin-top: 0.1rem;
	color: #1f7a4d;
}

.bookingwp-checkout .bookingwp-checkout-guarantee a {
	color: var(--wp--custom--color--on-surface, #2a3139);
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

/* Line item already carries the pre-tax amount; Subtotal only repeats it. */
.bookingwp-checkout .edd_cart_subtotal_row {
	display: none !important;
}

.bookingwp-checkout :is(.edd_cart_tax, .edd_cart_discount, .edd_cart_total, .edd_sl_renewal_row) {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	color: var(--checkout-muted);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.35;
}

.bookingwp-checkout .edd_cart_total {
	margin-top: 0.15rem;
	padding-top: 0.55rem;
	border-top: 1px solid var(--checkout-border);
	color: var(--wp--preset--color--text, #2a3139);
	font-size: 0.9375rem;
	font-weight: 650;
}

.bookingwp-checkout #edd_checkout_cart {
	margin: 0;
	border: 0;
}

.bookingwp-checkout .edd-blocks-cart__row-header,
.bookingwp-checkout .eddr-cart-item-notice,
.bookingwp-checkout :is(.edd-sl-details-cart, .edd-sl-upgrade-details-cart) {
	display: none;
}

.bookingwp-checkout .edd-blocks-cart__row {
	padding: 0;
	border: 0;
}

.bookingwp-checkout .edd-blocks-cart__items {
	border: 0;
}

.bookingwp-checkout .edd-blocks-cart__row-footer {
	padding: 0.45rem 0 0;
}

/* One divider under the line item - money block border only. */
.bookingwp-checkout .edd-blocks-cart__row-footer:has(.edd_cart_total) {
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
	padding-top: 0.75rem;
}

.bookingwp-checkout .edd-blocks-cart__row-footer:has(.edd_cart_total) #edd_discount_code {
	margin: 0.1rem 0 0.15rem;
}

.bookingwp-checkout .edd-blocks-cart__row-footer:has(.edd_cart_total) #edd_show_discount {
	display: flex;
	justify-content: flex-end;
}

.bookingwp-checkout .edd_sl_renewal_row {
	padding-top: 0.75rem;
}

.bookingwp-checkout .edd_sl_renewal_row + .edd-blocks-cart__row-footer:has(.edd_cart_total) {
	padding-top: 0.35rem;
}

.bookingwp-checkout .edd-blocks-cart__row-footer:not(:has(.edd_cart_subtotal), :has(.edd_cart_tax), :has(.edd_cart_total), :has(#edd_discount_code), :has(.edd_cart_discount), .edd_sl_renewal_row) {
	display: none !important;
}

.bookingwp-checkout .edd-blocks-cart__row-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem 0.85rem;
	align-items: start;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--checkout-border);
}

.bookingwp-checkout .edd_cart_item_name {
	min-width: 0;
}

.bookingwp-checkout .edd_checkout_cart_item_title {
	display: grid;
	grid-template-columns: 2.5rem minmax(0, 1fr);
	align-items: start;
	gap: 0.65rem;
	width: 100%;
	font-size: 0.9375rem;
	font-weight: 650;
	line-height: 1.3;
	word-break: normal;
	overflow-wrap: break-word;
}

.bookingwp-checkout .edd_cart_item_image img {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	object-fit: cover;
}

.bookingwp-checkout .edd_cart_item_price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.15rem;
	min-width: 4.5rem;
	font-size: 0.9375rem;
	font-weight: 650;
	line-height: 1.3;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.bookingwp-checkout .edd_cart_item_price em {
	display: block;
	color: var(--checkout-muted);
	font-size: 0.75rem;
	font-weight: 400;
	font-style: normal;
	text-transform: capitalize;
}

.bookingwp-checkout .edd_cart_item_price .edd_cart_actions {
	margin: 0;
}

.bookingwp-checkout .edd_cart_item_price #edd_sl_cancel_renewal_form,
.bookingwp-checkout .edd_cart_item_price #edd_sl_cancel_renewal_form p {
	margin: 0;
}

/* Renewal carts: Cancel replaces Remove under the price. */
.bookingwp-checkout .edd_cart_item_price:has(#edd_sl_cancel_renewal_form) :is(
	.edd-blocks-cart__action-remove,
	.edd_cart_remove_item_btn
) {
	display: none !important;
}

.bookingwp-checkout :is(
	.edd-blocks-cart__action-remove,
	.edd_discount_remove,
	.edd_cart_item_price #edd_sl_cancel_renewal_form .edd-submit
) {
	display: inline-flex;
	align-items: center;
	width: auto !important;
	height: auto !important;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--checkout-muted) !important;
	font-size: 0.75rem !important;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: underline;
	cursor: pointer;
}

.bookingwp-checkout :is(.edd-blocks-cart__action-remove, .edd_discount_remove) .screen-reader-text {
	position: static !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	overflow: visible !important;
	clip: auto !important;
	clip-path: none !important;
	white-space: normal !important;
}

/* Beat EDD inline `flex: 1 1 110px` so Total stays a full-width line. */
.bookingwp-checkout .edd-blocks-form__cart .edd-blocks-cart__row.edd_cart_footer_row > div.edd_cart_total {
	flex: 0 0 auto !important;
}

.bookingwp-checkout .edd_cart_discount .edd_discount {
	display: flex;
	flex-direction: column;
	align-items: flex-end !important;
	gap: 0.15rem;
	margin-left: auto;
}

.bookingwp-checkout .edd_discount_rate {
	display: none;
}

.bookingwp-checkout .edd_cart_amount {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.2;
}

.bookingwp-checkout .edd_sl_renewal_row .bookingwp-money-amount,
.bookingwp-checkout .edd_cart_tax_amount,
.bookingwp-checkout .edd_cart_amount {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.bookingwp-checkout .edd_sl_renewal_row .bookingwp-money-amount {
	color: #1f7a4d;
}

/* Discount + renew show toggles (legacy #id + SL block .class). */
.bookingwp-checkout :is(
	#edd_show_discount .edd_discount_link,
	#edd_sl_show_renewal_form,
	.edd-sl-show-renewal-form
) {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	width: auto !important;
	min-height: var(--wp--custom--component--button-height, 2.5rem);
	padding: 0.15rem 0.5rem;
	margin-inline: -0.5rem;
	border: 0 !important;
	border-radius: var(--wp--custom--shape--button, 0.5rem);
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	transform: none !important;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	color: var(--checkout-muted) !important;
}

.bookingwp-checkout .edd-blocks__cart > .edd-blocks-form__cart {
	margin-bottom: 0 !important;
}

.bookingwp-checkout :is(#edd_sl_renewal_form, .wp-block-edd-sl-license-renewal, .edd-renewal-form--legacy) {
	margin: 0;
	padding: 0;
	border: 0;
}

.bookingwp-checkout :is(#edd_show_discount .edd_discount_link, #edd_sl_show_renewal_form, .edd-sl-show-renewal-form):hover {
	color: var(--wp--custom--color--on-surface) !important;
	background: color-mix(in srgb, var(--wp--custom--color--on-surface) 6%, transparent) !important;
}

.bookingwp-checkout :is(#edd_show_discount .edd_discount_link, #edd_sl_show_renewal_form, .edd-sl-show-renewal-form)::after {
	content: "" !important;
	position: static !important;
	inset: auto !important;
	width: 0.35em;
	height: 0.35em;
	margin-inline-start: 0.4em;
	border-inline-end: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	background: none !important;
	opacity: 1 !important;
	transform: translateY(-15%) rotate(45deg);
}

/* Discount / renew cancel (primary text, same quiet chrome). */
.bookingwp-checkout :is(.bookingwp-discount-cancel, #edd-cancel-license-renewal, .edd-sl-hide-renewal-form) {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	width: auto !important;
	min-height: var(--wp--custom--component--button-height, 2.5rem) !important;
	padding: 0 0.65rem !important;
	margin: 0;
	border: 0 !important;
	border-radius: var(--wp--custom--shape--button, 0.5rem);
	background: transparent !important;
	box-shadow: none !important;
	transform: none !important;
	color: var(--wp--custom--color--primary) !important;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
}

.bookingwp-checkout :is(.bookingwp-discount-cancel, #edd-cancel-license-renewal, .edd-sl-hide-renewal-form):hover {
	background: color-mix(in srgb, var(--wp--custom--color--primary) 8%, transparent) !important;
}

/* Open discount: a bit more gap above the money lines. */
.bookingwp-checkout .edd-blocks-cart__row-footer:has(#edd_show_discount[style*="display: none"]) {
	gap: 0.75rem;
}

.bookingwp-checkout :is(#edd-discount-code-wrap, #edd-license-key-container-wrap, .edd-discount-code-field-wrap, .edd-license-key-container) {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0 !important;
	background: transparent !important;
}

.bookingwp-checkout #edd-license-key-container-wrap .edd-form-group__control {
	display: block;
	width: 100%;
}

/* Legacy renew + discount inputs; SL block key stays on .md-field padding. */
.bookingwp-checkout :is(#edd-discount, #edd-license-key) {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	min-height: 2.25rem;
	padding: 0 0.75rem !important;
	border: 1px solid var(--wp--custom--color--outline);
	border-radius: var(--wp--custom--shape--xs);
	background: var(--wp--custom--color--surface);
	font-size: 1rem;
}

.bookingwp-checkout :is(#edd-discount, #edd-license-key):is(:focus, :focus-visible) {
	outline: none;
	border-color: var(--wp--custom--color--primary);
	box-shadow: none;
}

.bookingwp-checkout .wp-block-edd-sl-license-renewal .edd-license-key-container.md-field {
	margin: 0;
}

.bookingwp-checkout .wp-block-edd-sl-license-renewal .edd-license-key-container.md-field > label {
	max-width: calc(100% - 1rem);
	white-space: nowrap;
}

.bookingwp-checkout :is(.bookingwp-discount-actions, .edd-sl-renewal-actions) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.25rem 0.45rem;
	margin-top: 0.55rem;
}

.bookingwp-checkout :is(
	.bookingwp-discount-actions .edd-apply-discount,
	.edd-sl-renewal-actions .edd-submit
) {
	width: auto !important;
	min-height: var(--wp--custom--component--button-height, 2.5rem) !important;
	height: auto !important;
	padding: 0 0.75rem !important;
	font-size: 0.8125rem !important;
}

.bookingwp-checkout :is(#edd_sl_renewal_fields, #edd_sl_renewal_form_block) {
	margin: 0;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
}

.bookingwp-checkout .edd-sl-renewal-form-fields {
	margin: 0 !important;
}

.bookingwp-checkout #edd_sl_renewal_fields label[for="edd-license-key"] {
	order: -1;
	position: static !important;
	display: block;
	margin: 0 0 0.35rem !important;
	padding: 0;
	overflow: visible;
	transform: none !important;
	background: transparent !important;
	color: var(--checkout-muted);
	font-size: 0.75rem !important;
	font-weight: 400 !important;
	line-height: 1.4;
	white-space: normal;
}

.bookingwp-checkout .edd-sl-renewal-actions .edd-submit:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

/* Mobile: summary first, compact fields, sticky pay. Keep columns as row+wrap
 * (WP stacks via flex-basis:100%); column+wrap invents a second column. */
@media (max-width: 781px) {
	body.bookingwp-checkout .page-content {
		padding-block: 0.85rem 5.5rem;
	}

	.bookingwp-checkout .wp-block-columns {
		gap: 0.85rem;
	}

	.bookingwp-checkout .wp-block-columns > .wp-block-column:last-child {
		order: -1;
	}

	.bookingwp-checkout .edd-blocks__logged-in {
		margin-bottom: 0.85rem;
		padding-block: 1rem;
	}

	.bookingwp-checkout .edd-blocks__checkout-forms {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 0.35rem;
		margin: 0 0 0.85rem;
	}

	.bookingwp-checkout .edd-blocks__checkout-forms .edd-button-secondary {
		min-height: 2.5rem;
	}

	.bookingwp-checkout .edd-blocks-cart__row-item {
		padding-bottom: 0.85rem;
	}

	.bookingwp-checkout .bookingwp-cart-facts,
	.bookingwp-checkout-summary__facts {
		font-size: 0.75rem;
		line-height: 1.35;
	}

	.bookingwp-checkout #edd_purchase_submit {
		position: sticky;
		bottom: 0;
		z-index: 40;
		margin: 0.5rem 0 0;
		padding: 0.75rem var(--bwp-card-pad, 1rem) max(0.75rem, env(safe-area-inset-bottom));
		background:
			linear-gradient(
				to top,
				var(--wp--custom--color--surface, #fff) 62%,
				color-mix(in srgb, var(--wp--custom--color--surface, #fff) 0%, transparent)
			);
	}

	.bookingwp-checkout #edd_checkout_form_wrap:focus-within #edd_purchase_submit {
		position: static;
		background: none;
	}

	.bookingwp-checkout #edd_purchase_submit .edd-submit,
	.bookingwp-checkout #edd-purchase-button {
		width: 100%;
		min-height: 3rem;
		font-size: 1rem;
	}

	.bookingwp-flow ol {
		width: min(100%, 16rem);
	}

	/* Small screens: markers stay; only the active step label shows. */
	.bookingwp-flow li:not(.is-current) span {
		display: none;
	}

	.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_checkout_user_info,
	.bookingwp-checkout .wp-block-edd-checkout #edd_purchase_form #edd_cc_address {
		grid-template-columns: 1fr;
	}
}

/* Checkout field busy (taxes/VAT): hide EDD overlay, spin inside fields. */
html.bookingwp-checkout-field-busy .edd-cart-loading {
	display: none !important;
}

.bookingwp-checkout #edd-card-country-wrap.is-loading::after,
.bookingwp-checkout #edd-card-vat-wrap.is-checking .edd-vat-number-wrap::after {
	content: "";
	position: absolute;
	right: 0.85rem;
	top: 50%;
	z-index: 3;
	width: 0.95rem;
	height: 0.95rem;
	margin-top: -0.475rem;
	border: 2px solid var(--checkout-border);
	border-top-color: var(--wp--preset--color--accent, #f5405b);
	border-radius: 50%;
	animation: bookingwp-field-spin 0.7s linear infinite;
	pointer-events: none;
}

.bookingwp-checkout #edd-card-vat-wrap.is-checking #edd-vat-check-result {
	visibility: hidden;
}

@keyframes bookingwp-field-spin {
	to {
		transform: rotate(360deg);
	}
}

/* EU VAT field chrome. */
.bookingwp-checkout #edd-card-vat-wrap {
	margin: 0;
}

.bookingwp-checkout #edd-card-vat-wrap .edd-label {
	left: 2.55rem;
}

.bookingwp-checkout #edd-card-vat-wrap .edd-vat-number-wrap {
	position: relative;
	display: block;
}

.bookingwp-checkout .bookingwp-vat__prefix {
	position: absolute;
	z-index: 2;
	left: 0.9rem;
	top: 1rem;
	color: var(--checkout-muted);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.5;
	pointer-events: none;
}

.bookingwp-checkout #edd-vat-number {
	width: 100%;
	max-width: none;
	height: auto !important;
	max-height: none;
	margin: 0 !important;
	padding-left: 2.55rem !important;
	padding-right: 2.6rem !important;
}

.bookingwp-checkout #edd-vat-check-button,
.bookingwp-checkout #edd-card-vat-wrap :is(.edd-loading, .edd-loading-ajax) {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	border: 0 !important;
}

/* One-line VAT result under the field (not an icon bubble). */
.bookingwp-checkout #edd-vat-check-result {
	display: block;
	margin: 0.4rem 0 0 !important;
	padding: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bookingwp-checkout #edd-vat-check-result.edd-vat-check-success {
	color: #1f7a4d;
}

.bookingwp-checkout #edd-vat-check-result.edd-vat-check-error {
	color: var(--wp--custom--color--error, #b3261e);
}

.bookingwp-checkout #edd-card-vat-wrap:has(.edd-vat-check-success) #edd-vat-number {
	border-color: #1f7a4d;
	box-shadow: inset 0 0 0 1px #1f7a4d;
}

.bookingwp-checkout #edd-card-vat-wrap:has(.edd-vat-check-success) .edd-label {
	color: #1f7a4d;
}

.bookingwp-checkout #edd-card-vat-wrap:has(.edd-vat-check-error) #edd-vat-number {
	border-color: var(--wp--custom--color--error, #b3261e);
	box-shadow: inset 0 0 0 1px var(--wp--custom--color--error, #b3261e);
}

.bookingwp-checkout #edd-card-company-wrap.is-autofilled input[name="company"] {
	animation: bookingwp-company-flash 1.2s ease;
}

.bookingwp-checkout #edd-card-company-wrap.is-autofilled .edd-label {
	color: #1f7a4d;
}

@keyframes bookingwp-company-flash {
	0%,
	100% {
		border-color: var(--checkout-border);
		box-shadow: none;
	}

	25%,
	60% {
		border-color: #1f7a4d;
		box-shadow: inset 0 0 0 1px #1f7a4d;
	}
}

/* Confirmation: left stack, right order. */
body.bookingwp-checkout--success {
	.site-header__inner {
		position: relative;
	}

	/* Post-checkout only - account receipts hide this in account.css. */
	&:not(.bookingwp-account) .wp-block-post-content > .wp-block-paragraph:first-child {
		margin: 0 0 1.25rem;
		color: var(--checkout-muted);
		text-align: center;
	}

	.bookingwp-confirmation-access {
		display: flex;
		flex-direction: column;
		gap: 1rem;
		min-width: 0;
	}

	.bookingwp-confirmation-card {
		:is(.edd-blocks-receipt__items, .edd-blocks-receipt__item, .edd-blocks-receipt__row-item--license-key) {
			margin: 0;
			padding: 0;
			border: 0 !important;
		}

		.edd-blocks-receipt__items {
			padding: 0 !important;
			border-radius: 0;
			background: transparent !important;
			gap: 0;
		}

		.edd-blocks-receipt__item-price {
			display: none;
		}

		.edd-blocks-receipt__row-item--license-key {
			flex-direction: column;
			align-items: stretch;
			gap: 0.45rem;
		}

		.bookingwp-license-key {
			width: 100%;
			max-width: none;
			margin-top: 0;
		}

		&--links {
			gap: 0;
		}
	}

	.bookingwp-confirmation-next {
		display: flex;
		flex-wrap: wrap;
		gap: 0.15rem;
		margin: 0;
		margin-inline: var(--account-flush, -0.75rem);
		padding: 0;
	}

	.edd-blocks__confirmation {
		display: grid;
		gap: 1rem;
		align-items: start;

		> .edd-blocks-receipt__totals {
			> .bookingwp-checkout-summary__title {
				margin-bottom: calc(var(--bwp-card-gap, 1.25rem) - var(--bwp-card-title-gap, 0.5rem));
			}

			.edd-blocks-receipt__row-item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				gap: 1rem;
				padding: 0.35rem 0;
				border: 0;
				font-size: 0.8125rem;
				line-height: 1.4;

				.edd-blocks__row-label {
					font-weight: 500;
					color: var(--wp--preset--color--muted, #5b6570);
				}

				.edd-blocks__row-value:not(.edd_receipt_payment_status) {
					font-weight: 400;
					color: var(--wp--preset--color--text, #2a3139);
				}
			}

			.bookingwp-confirmation-total {
				margin-top: 0.35rem;
				padding-top: 0.85rem;
				border-top: 1px solid var(--wp--custom--color--outline-variant, #eceef1);

				:is(.edd-blocks__row-label, .edd-blocks__row-value) {
					font-size: 0.9375rem;
					font-weight: 650;
					color: var(--wp--preset--color--text, #2a3139);
				}
			}

			/* Keep the 40px hit area without stretching the row. */
			.edd-blocks__row-value > a {
				margin-block: calc((var(--wp--custom--component--button-height, 2.5rem) - 1.4em) / -2);
				margin-inline-end: var(--account-flush, -0.75rem);
			}

			/* Breathing room above Invoice after the Total separator. */
			.edd-blocks-receipt__row-item:has(> .edd-blocks__row-value > a) {
				margin-top: 0.65rem;
			}

			.edd_receipt_payment_status {
				margin-inline-end: 0;
			}
		}
	}

	@media (min-width: 640px) {
		.edd-blocks__confirmation {
			grid-template-columns: minmax(0, 1fr) minmax(15rem, 1fr);

			> .edd-blocks-receipt__totals {
				position: sticky;
				top: var(--sticky-under-header);
			}
		}
	}

	@media (max-width: 781px) {
		.page-content {
			padding-block: 0.85rem var(--wp--preset--spacing--70);
		}

		.edd-blocks__confirmation,
		.bookingwp-confirmation-access {
			gap: 0.75rem;
		}

		.edd-blocks__confirmation > .edd-blocks-receipt__totals .bookingwp-confirmation-total {
			margin-top: 0.25rem;
			padding-top: 0.7rem;
		}
	}
}

