/*!
 * Universal Checkout Experience 4.0
 */
.ucx40 {
	display: grid;
	gap: 1rem;
	padding-top: 0.5rem;
	padding-bottom: 1rem;
}

.ucx40-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ucx40-title {
	margin: 0.2rem 0 0;
	font-size: clamp(1.35rem, 2.6vw, 1.75rem);
	font-weight: 750;
	color: #fff;
}

.ucx40-subtitle {
	margin: 0.35rem 0 0;
	max-width: 42rem;
	color: var(--dxp-color-text-secondary, #c7d0e0);
	line-height: 1.5;
}

.ucx40-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.5rem;
}

.ucx40-steps li {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.55rem 0.65rem;
	border-radius: 12px;
	border: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.12));
	color: var(--dxp-color-text-secondary, #c7d0e0);
	font-size: 0.85rem;
}

.ucx40-steps li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 999px;
	background: #0f172a;
	color: #fff;
	font-weight: 700;
}

.ucx40-steps li.is-active,
.ucx40-steps li.is-complete {
	border-color: color-mix(in srgb, var(--dxp-color-accent, #f59e0b) 55%, transparent);
	color: #fff;
}

.ucx40-steps li.is-complete span {
	background: var(--dxp-color-accent, #f59e0b);
	color: #111;
}

.ucx40-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.75fr);
	gap: 1rem;
	align-items: start;
}

.ucx40-main {
	display: grid;
	gap: 0.85rem;
}

.ucx40-card,
.ucx40-summary {
	padding: 1rem 1.05rem;
	border-radius: var(--dxp-radius-lg, 18px);
	border: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.12));
	background: color-mix(in srgb, var(--dxp-color-background-elevated, #15233b) 82%, transparent);
}

.ucx40-summary {
	position: sticky;
	top: 1rem;
	display: grid;
	gap: 0.75rem;
}

.ucx40-card h3,
.ucx40-summary h3 {
	margin: 0;
	font-size: 1.05rem;
	color: #fff;
}

.ucx40-help {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.ucx40-form,
.ucx40-grid {
	display: grid;
	gap: 0.7rem;
	margin-top: 0.75rem;
}

.ucx40-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ucx40-field {
	display: grid;
	gap: 0.3rem;
	margin: 0;
}

.ucx40-field > span {
	font-size: 0.88rem;
	font-weight: 600;
	color: #fff;
}

.ucx40-field input,
.ucx40-field select,
.ucx40-field textarea {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.55rem 0.75rem;
	border-radius: 12px;
	border: 1px solid var(--dxp-color-border-default, #334155);
	background: var(--dxp-color-background-elevated, #0f172a);
	color: inherit;
	box-sizing: border-box;
}

.ucx40-field input.is-invalid,
.ucx40-field select.is-invalid {
	border-color: #f87171;
}

.ucx40-check {
	display: flex;
	gap: 0.55rem;
	align-items: flex-start;
	color: var(--dxp-color-text-secondary, #c7d0e0);
	font-size: 0.9rem;
}

.ucx40-method-list {
	list-style: none;
	margin: 0.65rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.ucx40-method {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 2.75rem;
	padding: 0.35rem 0.65rem;
	border-radius: 12px;
	border: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.12));
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.ucx40-review-meta,
.ucx40-summary ul {
	list-style: none;
	margin: 0.65rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.ucx40-review-meta li,
.ucx40-summary li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	color: var(--dxp-color-text-secondary, #c7d0e0);
	font-size: 0.92rem;
}

.ucx40-review-meta strong,
.ucx40-summary strong {
	color: #fff;
}

.ucx40-sum-total {
	padding-top: 0.4rem;
	border-top: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.12));
	font-weight: 700;
}

.ucx40-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
}

.ucx40-actions .dxp-btn,
.ucx40-sticky .dxp-btn {
	min-height: 2.75rem;
}

.ucx40-actions .dxp-btn:focus-visible,
.ucx40-field input:focus-visible,
.ucx40-field select:focus-visible,
.ucx40-method input:focus-visible,
.ucx40-check input:focus-visible,
.ucx40-sticky .dxp-btn:focus-visible {
	outline: 2px solid var(--dxp-color-accent, #f59e0b);
	outline-offset: 2px;
}

.ucx40-errors:not([hidden]) {
	margin-top: 0.65rem;
	padding: 0.7rem 0.85rem;
	border-radius: 12px;
	border: 1px solid rgba(248, 113, 113, 0.45);
	background: rgba(127, 29, 29, 0.35);
	color: #fecaca;
}

.ucx40-confirmation {
	border-color: color-mix(in srgb, #8dffb0 35%, transparent);
}

.ucx40-confirm-lede {
	margin: 0.4rem 0 0;
	color: #8dffb0;
	font-weight: 650;
}

.ucx40-sticky {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 45;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.7rem 1rem;
	background: color-mix(in srgb, #0b1220 94%, transparent);
	border-top: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.14));
	backdrop-filter: blur(8px);
}

.ucx40-sticky strong {
	color: #fff;
	font-size: 1.1rem;
}

/* Prefer UCX sticky over cart sticky on the same page */
.dxp-checkout[data-ucx40="4.0"] .cx40-sticky {
	display: none !important;
}

.dxp-checkout[data-ucx40="4.0"] .dxp-chx-stage-payment {
	scroll-margin-top: 1.25rem;
}

.dxp-checkout[data-ucx40="4.0"] .ucx40-card {
	transition: border-color 160ms ease, opacity 160ms ease;
}

@media (prefers-reduced-motion: reduce) {
	.dxp-checkout[data-ucx40="4.0"] .ucx40-card,
	.ucx40-sticky {
		transition: none !important;
		backdrop-filter: none;
	}
}

@media (max-width: 1024px) {
	.ucx40-layout {
		grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.9fr);
	}
}

@media (max-width: 720px) {
	.ucx40-steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ucx40-layout,
	.ucx40-grid {
		grid-template-columns: 1fr;
	}

	.ucx40-summary {
		position: static;
	}

	.ucx40-actions {
		flex-direction: column;
	}

	.ucx40-actions .dxp-btn {
		width: 100%;
	}

	.ucx40-sticky {
		padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
	}
}

@media print {
	.ucx40-sticky,
	.ucx40-actions,
	.ucx40-steps {
		display: none !important;
	}
}
