/*!
 * Cart Experience 4.0 — universal commerce cart chrome
 */
.cx40-overview {
	display: grid;
	gap: 1rem;
	padding-top: 1.25rem;
	padding-bottom: 0.75rem;
}

.cx40-title {
	margin: 0.2rem 0 0;
	font-size: clamp(1.55rem, 3vw, 2.1rem);
	font-weight: 750;
	color: #fff;
}

.cx40-subtitle {
	max-width: 40rem;
	margin: 0.35rem 0 0;
	line-height: 1.5;
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.cx40-chips {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cx40-chips li {
	display: inline-flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 6.5rem;
	padding: 0.55rem 0.75rem;
	border-radius: 999px;
	border: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.14));
	background: color-mix(in srgb, var(--dxp-color-background-elevated, #15233b) 80%, transparent);
}

.cx40-chips span {
	font-size: 0.72rem;
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.cx40-chips strong {
	font-size: 0.95rem;
	color: #fff;
}

.cx40-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.75fr);
	gap: 1rem;
	align-items: start;
}

.cx40-main {
	display: grid;
	gap: 0.85rem;
}

.cx40-card,
.cx40-summary-panel {
	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);
}

.cx40-summary-panel {
	position: sticky;
	top: 1rem;
	display: grid;
	gap: 0.75rem;
}

.cx40-card h2,
.cx40-summary-panel h2 {
	margin: 0;
	font-size: 1.05rem;
	color: #fff;
}

.cx40-help {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.cx40-fulfill-list {
	list-style: none;
	margin: 0.65rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.cx40-fulfill-option {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 2.75rem;
	padding: 0.35rem 0.55rem;
	border-radius: 12px;
	border: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.12));
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.cx40-field {
	display: grid;
	gap: 0.35rem;
	margin-top: 0.75rem;
}

.cx40-field > span {
	font-size: 0.88rem;
	font-weight: 600;
	color: #fff;
}

.cx40-field input,
.cx40-field select,
.cx40-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;
}

.cx40-field textarea {
	min-height: 5rem;
	resize: vertical;
}

.cx40-promo-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.5rem;
}

.cx40-summary-rows {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.cx40-summary-rows li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	font-size: 0.92rem;
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.cx40-summary-rows strong {
	color: #fff;
}

.cx40-summary-total {
	padding-top: 0.45rem;
	border-top: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.12));
	font-weight: 700;
}

.cx40-actions {
	display: grid;
	gap: 0.45rem;
	margin: 0;
}

.cx40-actions .dxp-btn,
.cx40-sticky .dxp-btn,
.cx40-promo-row .dxp-btn {
	min-height: 2.75rem;
}

.cx40-actions--secondary {
	grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.cx40-actions .dxp-btn:focus-visible,
.cx40-sticky .dxp-btn:focus-visible,
.cx40-field input:focus-visible,
.cx40-field select:focus-visible,
.cx40-field textarea:focus-visible,
.cx40-fulfill-option input:focus-visible {
	outline: 2px solid var(--dxp-color-accent, #f59e0b);
	outline-offset: 2px;
}

.cx40-sticky {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 42;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.7rem 1rem;
	background: color-mix(in srgb, #0b1220 92%, transparent);
	border-top: 1px solid var(--dxp-color-border-subtle, rgba(255, 255, 255, 0.14));
	backdrop-filter: blur(8px);
}

.cx40-sticky-label {
	display: block;
	font-size: 0.75rem;
	color: var(--dxp-color-text-secondary, #c7d0e0);
}

.cx40-sticky strong {
	color: #fff;
	font-size: 1.1rem;
}

/* Soften legacy CHX hero when cart chrome is present */
.dxp-checkout[data-cx40="4.0"] .dxp-chx-hero {
	display: none;
}

.dxp-checkout[data-cx40="4.0"] .dxp-chx-stage-payment {
	scroll-margin-top: 1.5rem;
}

.dxp-checkout[data-cx40="4.0"] .dxp-chx-lines li {
	display: grid;
	gap: 0.45rem;
	transition: opacity 160ms ease, transform 160ms ease;
}

.cx40-line-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.cx40-line-actions .dxp-btn {
	min-height: 2.5rem;
	font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
	.dxp-checkout[data-cx40="4.0"] .dxp-chx-lines li,
	.cx40-sticky {
		transition: none !important;
		backdrop-filter: none;
	}
}

@media (max-width: 1024px) {
	.cx40-layout {
		grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.9fr);
	}
}

@media (max-width: 720px) {
	.cx40-layout {
		grid-template-columns: 1fr;
	}

	.cx40-summary-panel {
		position: static;
	}

	.cx40-sticky {
		padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
	}
}

@media print {
	.cx40-sticky,
	.cx40-actions {
		display: none !important;
	}
}
