/* Shared, opt-in single-purchase customer presentation. Legacy markup is untouched. */
#ca-app-root .ca-purchase { display: grid; gap: var(--ca-space-5, 1.25rem); min-width: 0; color: var(--commerce-auth-text); font-family: var(--commerce-auth-font-sans); }
#ca-app-root .ca-purchase :is(h1,h2,p,dl,dd,ul,ol,address) { margin: 0; }
#ca-app-root .ca-purchase :is(h1,h2,strong,dd) { color: var(--commerce-auth-heading); }
#ca-app-root .ca-purchase :is(h1,h2) { font-family: var(--commerce-auth-font-display, var(--commerce-auth-font-sans)); font-weight: var(--ca-weight-bold, 700); line-height: var(--ca-line-height-heading, 1.25); }
#ca-app-root .ca-purchase h1 { font-size: var(--ca-text-2xl, 1.5rem); }
#ca-app-root .ca-purchase h2 { font-size: var(--ca-text-lg, 1.125rem); }
#ca-app-root .ca-purchase :is(p,dt,dd,li,a,summary,span) { overflow-wrap: anywhere; }
#ca-app-root .ca-purchase__header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase :is(.ca-purchase__summary,.ca-purchase__panel) { padding: var(--commerce-auth-panel-space); border: var(--ca-border-width, 1px) solid var(--commerce-auth-border); border-radius: var(--commerce-auth-radius-lg); background: var(--commerce-auth-surface); min-width: 0; }
#ca-app-root .ca-purchase__summary { display: grid; gap: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase__summary > p { color: var(--commerce-auth-muted); }
#ca-app-root .ca-purchase__states { display: flex; flex-wrap: wrap; gap: var(--ca-space-4, 1rem) var(--ca-space-7, 1.75rem); }
#ca-app-root .ca-purchase__states > div { display: grid; gap: var(--ca-space-1, .25rem); min-width: 0; }
#ca-app-root .ca-purchase dt { color: var(--commerce-auth-muted); }
#ca-app-root .ca-purchase dd { font-weight: var(--ca-weight-semibold, 600); }
#ca-app-root .ca-purchase__grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: var(--commerce-auth-grid-gap); align-items: start; }
#ca-app-root .ca-purchase__grid--single { grid-template-columns: minmax(0,1fr); }
#ca-app-root .ca-purchase__stack { display: grid; gap: var(--commerce-auth-grid-gap); min-width: 0; }
#ca-app-root .ca-purchase__panel { display: grid; gap: var(--ca-space-4, 1rem); }
#ca-app-root .ca-purchase :is(.ca-purchase__eyebrow,.ca-purchase__muted,.ca-purchase__footer,.ca-purchase__timeline span,.ca-purchase__items span) { font-size: var(--ca-text-sm, .875rem); color: var(--commerce-auth-muted); }
#ca-app-root .ca-purchase__money { display: grid; gap: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase :is(.ca-purchase__money,.ca-purchase__facts) > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase__money dd { text-align: end; font-variant-numeric: tabular-nums; }
#ca-app-root .ca-purchase__facts dd { overflow-wrap: anywhere; }
#ca-app-root .ca-purchase__balance { border-top: var(--ca-border-width, 1px) solid var(--commerce-auth-border); padding-top: var(--ca-space-4, 1rem); margin-top: var(--ca-space-2, .5rem); align-items: center; }
#ca-app-root .ca-purchase__balance dd { font-size: var(--ca-text-xl, 1.25rem); }
#ca-app-root .ca-purchase__details { border-top: var(--ca-border-width, 1px) solid var(--commerce-auth-border); padding-top: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase__details summary { padding-block: var(--ca-space-2, .5rem); color: var(--commerce-auth-heading); cursor: pointer; }
#ca-app-root .ca-purchase__details[open] > :not(summary) { margin-top: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase address { font-style: normal; }
#ca-app-root .ca-purchase address span { display: block; }
#ca-app-root .ca-purchase__timeline { display: grid; gap: var(--ca-space-4, 1rem); list-style: disc; padding-inline-start: var(--ca-space-5, 1.25rem); }
#ca-app-root .ca-purchase__timeline li::marker { color: var(--commerce-auth-accent); }
#ca-app-root .ca-purchase__timeline span { display: block; }
#ca-app-root .ca-purchase__items { padding: 0; list-style: none; display: grid; gap: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase__items span { display: block; }
#ca-app-root .ca-purchase__notice { padding: var(--ca-space-3, .75rem); border-radius: var(--commerce-auth-radius); background: var(--ca-warning-soft); color: var(--ca-warning); }
#ca-app-root .ca-purchase__actions { display: flex; flex-wrap: wrap; gap: var(--ca-space-3, .75rem); }
#ca-app-root .ca-purchase__link { color: var(--commerce-auth-accent); }
#ca-app-root .ca-purchase__button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: var(--commerce-auth-control-height); padding: var(--ca-space-2, .5rem) var(--ca-space-4, 1rem); border: var(--ca-border-width, 1px) solid var(--commerce-auth-button-bg); border-radius: var(--commerce-auth-radius); background: var(--commerce-auth-button-bg); color: var(--commerce-auth-button-text); font-family: inherit; text-decoration: none; }
#ca-app-root .ca-purchase__button--secondary { border-color: var(--commerce-auth-border); background: var(--commerce-auth-surface); color: var(--commerce-auth-heading); }
#ca-app-root .ca-purchase__button:focus-visible, #ca-app-root .ca-purchase summary:focus-visible { outline: var(--ca-border-width, 1px) solid var(--commerce-auth-accent); outline-offset: var(--ca-space-1, .25rem); }
#ca-app-root .ca-purchase--unavailable { padding: var(--commerce-auth-panel-space); }
#ca-app-root .ca-purchase--row { padding: var(--commerce-auth-panel-space); border-bottom: var(--ca-border-width, 1px) solid var(--commerce-auth-border); }
#ca-app-root .ca-purchase--row:last-child { border-bottom: 0; }
@media (max-width: 760px) { #ca-app-root .ca-purchase__grid { grid-template-columns: minmax(0,1fr); } }

/**
 * Shared page/drawer foundation for encapsulated and compatibility surfaces.
 * Uses the existing settings resolver, not a second merchant option.
 */
#ca-app-root,
.commerce-auth-cart-drawer-root {
	--commerce-auth-panel-space: clamp(16px, 2vw, 24px);
	--commerce-auth-grid-gap: clamp(16px, 2vw, 24px);
	--commerce-auth-title-size: clamp(32px, calc(26.22px + 1.482vw), 44px);
	--commerce-auth-button-padding-block: clamp(8px, calc(7.037px + .247vw), 10px);
	--commerce-auth-icon-control-size: 32px;
	--ca-button-font-size: var(--commerce-auth-button-font-size, 15px);
	--ca-font-ui: var(--commerce-auth-font-interface, var(--commerce-auth-font-sans));
	--ca-font-heading: var(--commerce-auth-font-display, var(--commerce-auth-font-sans));
	font-family: var(--commerce-auth-font-sans);
	font-size: var(--commerce-auth-body-font-size, 16px);
	line-height: 1.6;
	letter-spacing: normal;
	text-transform: none;
	color: var(--commerce-auth-text);
	-webkit-text-size-adjust: 100%;
}

/* Translate the same semantic values into the existing compact drawer. */
.commerce-auth-cart-drawer-root {
	--commerce-auth-drawer-accent: var(--commerce-auth-accent);
	--commerce-auth-drawer-accent-deep: var(--commerce-auth-accent-dark);
	--commerce-auth-drawer-text: var(--commerce-auth-heading);
	--commerce-auth-drawer-muted: var(--commerce-auth-muted);
	--commerce-auth-drawer-surface: var(--commerce-auth-surface);
	--commerce-auth-drawer-surface-soft: var(--commerce-auth-surface-soft);
	--commerce-auth-drawer-border: var(--commerce-auth-border);
	--commerce-auth-drawer-radius: var(--commerce-auth-radius-lg);
}

.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer {
	font-family: var(--commerce-auth-font-sans);
	text-transform: none;
}

#ca-app-root .ca-container {
	width: min(100%, var(--commerce-auth-content-width, 1180px));
	padding: clamp(24px, 3.34vw, 40px) clamp(16px, 2vw, 24px);
}

#ca-app-root .ca-title { font-size: var(--commerce-auth-title-size); }
#ca-app-root .ca-grid,
#ca-app-root .commerce-auth-cart__layout { gap: var(--commerce-auth-grid-gap); }
#ca-app-root :is(.ca-card, .commerce-auth-cart__items-panel, .commerce-auth-cart-totals, .commerce-auth-cart-empty__card, .commerce-auth-public-track, .commerce-auth-track-card) {
	padding: var(--commerce-auth-panel-space);
}

#ca-app-root .ca-section,
#ca-app-root .ca-description,
#ca-app-root .ca-text {
	font-size: var(--commerce-auth-body-font-size, 16px);
}

#ca-app-root :is(input.input-text, select, textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"]),
.commerce-auth-cart-drawer-root input[type="number"] {
	border-radius: var(--commerce-auth-field-radius, var(--commerce-auth-radius));
}

.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer {
	box-shadow: var(--commerce-auth-shadow, 0 18px 48px rgba(15,23,42,.08));
}

#ca-app-root :is(h1, h2, h3, h4, h5, h6),
.commerce-auth-cart-drawer-root :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--commerce-auth-font-display, var(--commerce-auth-font-sans));
	text-transform: none;
}

.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer__checkout:hover,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer-suggestion__action:hover,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer__empty button:hover {
	background-color: var(--commerce-auth-button-bg-hover, var(--commerce-auth-button-bg));
	color: var(--commerce-auth-button-text-hover, var(--commerce-auth-button-text));
}

#ca-app-root :where(button, input, select, textarea),
.commerce-auth-cart-drawer-root :where(button, input, select, textarea) {
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	font-family: var(--commerce-auth-font-sans);
	font-style: normal;
	letter-spacing: normal;
	text-transform: none;
	text-indent: 0;
}

.commerce-auth-cart-drawer-root :where(button, input, select, textarea) {
	font-size: inherit;
}

#ca-app-root :where(button, input[type="button"], input[type="submit"], input[type="reset"]),
.commerce-auth-cart-drawer-root :where(button, input[type="button"], input[type="submit"], input[type="reset"]) {
	min-height: 0;
}

#ca-app-root .ca-button,
#ca-app-root :is(button[type="submit"]:not([formnovalidate]), .commerce-auth-cart-totals__button, .commerce-auth-cart-empty__button, .woocommerce-Button, .commerce-auth-checkout-coupon__button, .commerce-auth-checkout-guest__button, .commerce-auth-checkout-empty__button, .commerce-auth-address-card__action:where(:not(.commerce-auth-address-card__action--secondary):not(.commerce-auth-address-card__action--danger)), .commerce-auth-edit-account__verify-button, .commerce-auth-location-detect__button, .commerce-auth-track-card__button:where(:not(.commerce-auth-track-card__button--secondary)), .commerce-auth-eta__button),
#ca-app-root .cross-sells .button,
#ca-app-root .commerce-auth-checkout-place-order__button,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer__checkout,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer-suggestion__action,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer__empty button {
	min-height: var(--commerce-auth-control-height);
	border-radius: var(--commerce-auth-radius);
	background-color: var(--commerce-auth-button-bg, var(--commerce-auth-heading));
	background-image: var(--commerce-auth-button-hover-layer, none);
	background-size: 0% 100%, auto;
	color: var(--commerce-auth-button-text, var(--commerce-auth-ui-button-text));
	font-family: var(--commerce-auth-font-interface, var(--commerce-auth-font-sans));
	font-size: var(--ca-button-font-size);
	line-height: 1.4;
	padding-block: var(--commerce-auth-button-padding-block);
	text-transform: none;
	transition: var(--commerce-auth-button-transition, background-color 180ms ease, color 180ms ease, transform 180ms ease);
}

#ca-app-root :is(button[type="submit"]:not([formnovalidate]), .commerce-auth-cart-totals__button, .commerce-auth-cart-empty__button, .woocommerce-Button, .commerce-auth-checkout-coupon__button, .commerce-auth-checkout-guest__button, .commerce-auth-checkout-empty__button, .commerce-auth-address-card__action:where(:not(.commerce-auth-address-card__action--secondary):not(.commerce-auth-address-card__action--danger)), .commerce-auth-edit-account__verify-button, .commerce-auth-location-detect__button, .commerce-auth-track-card__button:where(:not(.commerce-auth-track-card__button--secondary)), .commerce-auth-eta__button):hover {
	background-color: var(--commerce-auth-button-bg-hover);
	color: var(--commerce-auth-button-text-hover);
}

@media (hover: hover) {
	#ca-app-root :is(.ca-button, .cross-sells .button, button[type="submit"]:not([formnovalidate]), .commerce-auth-cart-totals__button, .commerce-auth-cart-empty__button, .woocommerce-Button, .commerce-auth-checkout-coupon__button, .commerce-auth-checkout-guest__button, .commerce-auth-checkout-empty__button, .commerce-auth-address-card__action:where(:not(.commerce-auth-address-card__action--secondary):not(.commerce-auth-address-card__action--danger)), .commerce-auth-edit-account__verify-button, .commerce-auth-location-detect__button, .commerce-auth-track-card__button:where(:not(.commerce-auth-track-card__button--secondary)), .commerce-auth-eta__button):hover,
	.commerce-auth-cart-drawer-root :is(.commerce-auth-cart-drawer__checkout, .commerce-auth-cart-drawer-suggestion__action, .commerce-auth-cart-drawer__empty button):hover {
		background-color: var(--commerce-auth-button-bg-hover);
		color: var(--commerce-auth-button-text-hover);
		background-size: var(--commerce-auth-button-hover-background-size, 100% 100%, auto);
		transform: var(--commerce-auth-button-hover-transform, none);
	}
}
@media (hover: none) {
	#ca-app-root :is(.ca-button, .cross-sells .button, button[type="submit"]:not([formnovalidate]), .commerce-auth-cart-totals__button, .commerce-auth-cart-empty__button, .woocommerce-Button, .commerce-auth-checkout-coupon__button, .commerce-auth-checkout-guest__button, .commerce-auth-checkout-empty__button, .commerce-auth-address-card__action:where(:not(.commerce-auth-address-card__action--secondary):not(.commerce-auth-address-card__action--danger)), .commerce-auth-edit-account__verify-button, .commerce-auth-location-detect__button, .commerce-auth-track-card__button:where(:not(.commerce-auth-track-card__button--secondary)), .commerce-auth-eta__button):hover,
	.commerce-auth-cart-drawer-root :is(.commerce-auth-cart-drawer__checkout, .commerce-auth-cart-drawer-suggestion__action, .commerce-auth-cart-drawer__empty button):hover {
		background-color: var(--commerce-auth-button-bg);
		color: var(--commerce-auth-button-text);
		background-size: 0% 100%, auto;
		transform: none;
	}
}
#ca-app-root :is(.ca-button, .cross-sells .button, button[type="submit"]:not([formnovalidate]), .commerce-auth-cart-totals__button, .commerce-auth-cart-empty__button, .woocommerce-Button, .commerce-auth-checkout-coupon__button, .commerce-auth-checkout-guest__button, .commerce-auth-checkout-empty__button, .commerce-auth-address-card__action:where(:not(.commerce-auth-address-card__action--secondary):not(.commerce-auth-address-card__action--danger)), .commerce-auth-edit-account__verify-button, .commerce-auth-location-detect__button, .commerce-auth-track-card__button:where(:not(.commerce-auth-track-card__button--secondary)), .commerce-auth-eta__button):active,
.commerce-auth-cart-drawer-root :is(.commerce-auth-cart-drawer__checkout, .commerce-auth-cart-drawer-suggestion__action, .commerce-auth-cart-drawer__empty button):active {
	background-color: var(--commerce-auth-button-bg-hover);
	color: var(--commerce-auth-button-text-hover);
	transform: none;
}
#ca-app-root :is(button, a, input, select, textarea):focus-visible,
.commerce-auth-cart-drawer-root :is(button, a, input, select, textarea):focus-visible {
	outline: 2px solid var(--commerce-auth-accent);
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	#ca-app-root,
	.commerce-auth-cart-drawer-root,
	#ca-app-root[data-commerce-auth-theme-style],
	.commerce-auth-cart-drawer-root[data-commerce-auth-theme-style],
	body.commerce-auth-theme #ca-app-root,
	body.commerce-auth-theme .commerce-auth-cart-drawer-root {
		--commerce-auth-button-transition: none;
		--commerce-auth-button-hover-transform: none;
		--commerce-auth-button-lift: 0px;
	}
}

#ca-app-root :is(.ca-button, .cross-sells .button, button[type="submit"]:not([formnovalidate]), .woocommerce-Button, .commerce-auth-checkout-coupon__button, .commerce-auth-checkout-guest__button, .commerce-auth-checkout-empty__button, .commerce-auth-address-card__action:where(:not(.commerce-auth-address-card__action--secondary):not(.commerce-auth-address-card__action--danger)), .commerce-auth-edit-account__verify-button, .commerce-auth-location-detect__button, .commerce-auth-track-card__button:where(:not(.commerce-auth-track-card__button--secondary)), .commerce-auth-eta__button):disabled,
.commerce-auth-cart-drawer-root :is(.commerce-auth-cart-drawer__checkout, .commerce-auth-cart-drawer-suggestion__action, .commerce-auth-cart-drawer__empty button):disabled {
	background-color: var(--commerce-auth-button-bg);
	color: var(--commerce-auth-button-text);
	background-size: 0% 100%, auto;
	transform: none;
}
/* Preserve the existing mobile checkout bar's horizontal centering in every state. */
@media (max-width: 980px) {
	#ca-app-root button.commerce-auth-checkout-place-order__button[type="submit"],
	#ca-app-root button.commerce-auth-checkout-place-order__button[type="submit"]:is(:hover, :active, :disabled) {
		transform: translate(-50%, var(--commerce-auth-button-lift, 0px));
	}
}

/* Own Woo's suggested-product elements inside the page boundary as well. */
#ca-app-root:not([data-commerce-auth-layout^="shared-"]) .ca-cart-page__extras .cross-sells ul.products {
	display: flex;
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 12px 0 20px;
	overflow-x: auto;
	align-items: stretch;
}

#ca-app-root:not([data-commerce-auth-layout^="shared-"]) .cross-sells ul.products::before,
#ca-app-root:not([data-commerce-auth-layout^="shared-"]) .cross-sells ul.products::after {
	display: none;
}

#ca-app-root:not([data-commerce-auth-layout^="shared-"]) .cross-sells li.product {
	display: flex;
	flex-direction: column;
	flex: 0 0 210px;
	float: none;
	width: 210px;
	max-width: 100%;
	margin: 0;
	padding: 16px;
	box-sizing: border-box;
	border: 1px solid var(--commerce-auth-border);
	border-radius: var(--commerce-auth-radius-lg);
	background: var(--commerce-auth-surface);
	font-family: var(--commerce-auth-font-sans);
}

#ca-app-root:not([data-commerce-auth-layout^="shared-"]) .cross-sells :is(h2, h3, .price) {
	font-family: var(--commerce-auth-font-sans);
	text-transform: none;
}

#ca-app-root:not([data-commerce-auth-layout^="shared-"]) .cross-sells .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	line-height: 1.4;
	text-decoration: none;
	border: 0;
}

/* Discovery cards and reward surfaces consume the same merchant values. */
#ca-app-root .commerce-auth-cart-experience,
.commerce-auth-cart-drawer-root .commerce-auth-cart-experience {
	--commerce-auth-cart-accent: var(--commerce-auth-accent);
	--commerce-auth-cart-border: var(--commerce-auth-border);
	--commerce-auth-cart-surface: var(--commerce-auth-surface);
	border-radius: var(--commerce-auth-radius-lg);
	font-family: var(--commerce-auth-font-sans);
	color: var(--commerce-auth-heading);
}

.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer-suggestion {
	border-radius: var(--commerce-auth-radius-lg);
}

.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer-suggestion__action.loading {
	opacity: .65;
	cursor: progress;
}

/* Canvas is a viewport overlay beside the owned root, outside scroll panels. */
:host .commerce-auth-cart-experience__confetti-canvas {
	display: block;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	box-sizing: border-box;
	background: transparent;
	pointer-events: none;
	z-index: 10021;
}

#ca-app-root .commerce-auth-cart-item__remove-button,
#ca-app-root .commerce-auth-cart-item__remove-link,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer__close,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer-item__remove,
.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer-summary__head button {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: var(--commerce-auth-icon-control-size);
	min-width: var(--commerce-auth-icon-control-size);
	max-width: var(--commerce-auth-icon-control-size);
	height: var(--commerce-auth-icon-control-size);
	min-height: var(--commerce-auth-icon-control-size);
	max-height: var(--commerce-auth-icon-control-size);
	aspect-ratio: 1;
	padding: 0;
	border-radius: 50%;
	line-height: 1;
}

.commerce-auth-cart-drawer-root .commerce-auth-cart-drawer__close {
	--commerce-auth-icon-control-size: 40px;
}

#ca-app-root .commerce-auth-control-icon,
#ca-app-root .commerce-auth-cart-item__remove-button .commerce-auth-control-icon,
#ca-app-root .commerce-auth-cart-item__remove-link .commerce-auth-control-icon,
.commerce-auth-cart-drawer-root .commerce-auth-control-icon {
	width: 16px;
	height: 16px;
}

#ca-app-root :where([hidden]),
.commerce-auth-cart-drawer-root :where([hidden]) {
	display: none;
}

/* The drawer is its own fixed overlay, including when wrapped in a host. */
:host([data-commerce-auth-ui-host="drawer"]) {
	position: fixed;
	inset: 0;
	z-index: 10020;
	pointer-events: none;
}

.commerce-auth-cart-drawer-root .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
