/*
 * Checkout offers: add-to-cart popup. Theme-agnostic base styles, same approach as checkout-offers.css:
 * colours derive from the theme (currentColor, Canvas), every tunable is a custom property.
 *
 *   .checkout-offers-cart { --checkout-offers-cart-radius: 0; --checkout-offers-cart-card-width: 14em; }
 */

.checkout-offers-cart {
	--checkout-offers-cart-border-color: rgba(127, 127, 127, 0.35);
	--checkout-offers-cart-radius: var(--wd-brd-radius, 10px);
	--checkout-offers-cart-padding: 1.25em;
	--checkout-offers-cart-gap: 0.75em;
	--checkout-offers-cart-background: Canvas;
	--checkout-offers-cart-color: CanvasText;
	--checkout-offers-cart-accent: var(--wd-primary-color, currentColor);
	--checkout-offers-cart-card-width: 13em;
	--checkout-offers-cart-touch-target: 44px;
	--checkout-offers-cart-max-width: 44em;

	box-sizing: border-box;
	position: fixed;
	width: calc(100% - 1.5rem);
	max-width: var(--checkout-offers-cart-max-width);
	max-height: calc(100dvh - 1.5rem);
	margin: auto;
	padding: var(--checkout-offers-cart-padding);
	overflow: auto;
	border: 1px solid var(--checkout-offers-cart-border-color);
	border-radius: var(--checkout-offers-cart-radius);
	background: var(--checkout-offers-cart-background);
	color: var(--checkout-offers-cart-color);
	font: inherit;
	font-family: var(--wd-text-font, inherit);
	overscroll-behavior: contain;
}

.checkout-offers-cart::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.checkout-offers-cart *,
.checkout-offers-cart *::before,
.checkout-offers-cart *::after {
	box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
	.checkout-offers-cart[open] {
		animation: checkout-offers-cart-pop 0.3s ease-out both;
	}
}

@keyframes checkout-offers-cart-pop {
	from {
		opacity: 0;
		transform: translateY(1em) scale(0.97);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.checkout-offers-cart .checkout-offers-cart__close {
	position: absolute;
	inset-block-start: 0.4em;
	inset-inline-end: 0.4em;
	min-width: var(--checkout-offers-cart-touch-target);
	min-height: var(--checkout-offers-cart-touch-target);
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
}

.checkout-offers-cart .checkout-offers-cart__preview {
	display: inline-block;
	margin: 0 0 var(--checkout-offers-cart-gap);
	padding: 0.15em 0.6em;
	border-radius: 999px;
	background: #b32d2e;
	color: #fff;
	font-size: 0.75em;
	font-weight: 700;
}

.checkout-offers-cart .checkout-offers-cart__head {
	text-align: center;
}

dialog.checkout-offers-cart h2.checkout-offers-cart__title {
	margin: 0 1.5em var(--checkout-offers-cart-gap);
	padding: 0;
	font-size: 1.25em;
	line-height: 1.3;
	font-family: var(--wd-title-font, inherit);
}

.checkout-offers-cart .checkout-offers-cart__added {
	display: flex;
	gap: var(--checkout-offers-cart-gap);
	align-items: center;
	justify-content: center;
	text-align: start;
}

.checkout-offers-cart .checkout-offers-cart__added-image {
	display: block;
	flex: none;
	width: 64px;
	height: 64px;
}

.checkout-offers-cart .checkout-offers-cart__added-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
}

.checkout-offers-cart .checkout-offers-cart__added-name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.checkout-offers-cart .checkout-offers-cart__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--checkout-offers-cart-gap);
	align-items: center;
	justify-content: center;
	margin: var(--checkout-offers-cart-padding) 0 0;
}

.checkout-offers-cart .checkout-offers-cart__continue,
.checkout-offers-cart .checkout-offers-cart__to-cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--checkout-offers-cart-touch-target);
	margin: 0;
	padding: 0 1.25em;
	cursor: pointer;
	touch-action: manipulation;
}

.checkout-offers-cart .checkout-offers-cart__continue {
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
}

.checkout-offers-cart .checkout-offers-cart__more {
	margin-block-start: var(--checkout-offers-cart-padding);
	padding-block-start: var(--checkout-offers-cart-padding);
	border-block-start: 1px solid var(--checkout-offers-cart-border-color);
}

dialog.checkout-offers-cart h3.checkout-offers-cart__more-title,
.checkout-offers-cart--inline h3.checkout-offers-cart__more-title {
	margin: 0 0 var(--checkout-offers-cart-gap);
	padding: 0;
	font-size: 1.05em;
	text-align: center;
	font-family: var(--wd-title-font, inherit);
}

/* Inline on the checkout page: the same strip, not a dialog. */
.checkout-offers-cart.checkout-offers-cart--inline {
	position: static;
	width: auto;
	max-width: none;
	max-height: none;
	margin: 0 0 var(--checkout-offers-cart-padding);
	padding: 0;
	overflow: visible;
	border: 0;
	background: none;
}

.checkout-offers-cart--inline .checkout-offers-cart__more {
	margin-block-start: 0;
	padding-block-start: 0;
	border-block-start: 0;
}

/* The strip: one row, scrolls sideways, snaps to cards. */
.checkout-offers-cart .checkout-offers-cart__scroller {
	position: relative;
}

.checkout-offers-cart .checkout-offers-cart__track {
	display: flex;
	gap: var(--checkout-offers-cart-gap);
	margin: 0;
	padding: 0.25em 0.1em 0.75em;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x proximity;
	scroll-padding-inline: 0.1em;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.checkout-offers-cart .checkout-offers-cart__card {
	display: flex;
	flex: 0 0 var(--checkout-offers-cart-card-width);
	flex-direction: column;
	justify-content: space-between;
	margin: 0;
	padding: 0.6em;
	border: 1px solid var(--checkout-offers-cart-border-color);
	border-radius: var(--checkout-offers-cart-radius);
	scroll-snap-align: start;
}

.checkout-offers-cart .checkout-offers-cart__card-link {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	color: inherit;
	text-decoration: none;
}

.checkout-offers-cart .checkout-offers-cart__card-image {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
}

.checkout-offers-cart .checkout-offers-cart__card-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
}

.checkout-offers-cart .checkout-offers-cart__card-name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	min-height: 2.6em;
	overflow: hidden;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.3;
}

.checkout-offers-cart .checkout-offers-cart__card-foot {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	margin-block-start: 0.5em;
}

.checkout-offers-cart .checkout-offers-cart__card-price {
	font-weight: 700;
	white-space: nowrap;
}

.checkout-offers-cart .checkout-offers-cart__add {
	width: 100%;
	min-height: var(--checkout-offers-cart-touch-target);
	margin: 0;
	padding: 0 0.5em;
	border-radius: var(--btn-accented-brd-radius, var(--checkout-offers-cart-radius));
	cursor: pointer;
	touch-action: manipulation;
}

.checkout-offers-cart .checkout-offers-cart__add[disabled] {
	opacity: 0.6;
	cursor: default;
}

.checkout-offers-cart .checkout-offers-cart__add--done {
	opacity: 1;
	background: #2e9f5b;
	color: #fff;
}

.checkout-offers-cart .checkout-offers-cart__arrow {
	position: absolute;
	inset-block-start: 35%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: var(--checkout-offers-cart-touch-target);
	height: var(--checkout-offers-cart-touch-target);
	margin: 0;
	padding: 0;
	border: 1px solid var(--checkout-offers-cart-border-color);
	border-radius: 50%;
	background: var(--checkout-offers-cart-background);
	color: var(--checkout-offers-cart-accent);
	font-size: 1.6em;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: pointer;
}

.checkout-offers-cart .checkout-offers-cart__arrow[hidden] {
	display: none;
}

.checkout-offers-cart .checkout-offers-cart__arrow--prev {
	inset-inline-start: -0.4em;
}

.checkout-offers-cart .checkout-offers-cart__arrow--next {
	inset-inline-end: -0.4em;
}

/* Touch: swiping is the way; the arrows only get in the way. */
@media (hover: none) {
	.checkout-offers-cart .checkout-offers-cart__arrow {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.checkout-offers-cart .checkout-offers-cart__track {
		scroll-behavior: auto;
	}
}

/*
 * Refined look, same language as the offer modal: soft surfaces, pill actions, one accent.
 */
.checkout-offers-cart {
	--checkout-offers-cart-radius: var(--wd-brd-radius, 16px);
	--checkout-offers-cart-surface: color-mix(in srgb, currentColor 4%, Canvas);
	--checkout-offers-cart-hairline: color-mix(in srgb, currentColor 12%, transparent);

	border: 0;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 24px 60px -12px rgba(15, 23, 42, 0.45);
	line-height: 1.5;
}

.checkout-offers-cart::backdrop {
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(3px);
}

/* The added product: a confirmation row with a green check. */
.checkout-offers-cart .checkout-offers-cart__added {
	padding: 0.75em 1em;
	border: 1px solid color-mix(in srgb, #2e9f5b 30%, transparent);
	border-radius: 12px;
	background: color-mix(in srgb, #2e9f5b 7%, Canvas);
}

.checkout-offers-cart .checkout-offers-cart__added-image {
	border-radius: 8px;
	background: #fff;
}

dialog.checkout-offers-cart h2.checkout-offers-cart__title {
	font-size: 1.3em;
	font-weight: 700;
	letter-spacing: -0.015em;
}

.checkout-offers-cart .checkout-offers-cart__close {
	border-radius: 50%;
	background: var(--checkout-offers-cart-surface);
}

.checkout-offers-cart .checkout-offers-cart__to-cart,
.checkout-offers-cart .checkout-offers-cart__add {
	border-radius: 999px;
	font-weight: 700;
	transition: transform 0.12s, box-shadow 0.15s;
}

.checkout-offers-cart .checkout-offers-cart__to-cart:hover,
.checkout-offers-cart .checkout-offers-cart__add:hover:not([disabled]) {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px -8px var(--checkout-offers-cart-accent);
}

.checkout-offers-cart .checkout-offers-cart__card {
	background: var(--checkout-offers-cart-surface);
	border-color: var(--checkout-offers-cart-hairline);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.checkout-offers-cart .checkout-offers-cart__card:hover {
	border-color: color-mix(in srgb, var(--checkout-offers-cart-accent) 45%, transparent);
	box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.25);
}

.checkout-offers-cart .checkout-offers-cart__card-image {
	border-radius: 8px;
	background: #fff;
}

.checkout-offers-cart .checkout-offers-cart__card-price {
	color: var(--checkout-offers-cart-accent);
}

.checkout-offers-cart :is(button, a):focus-visible {
	outline: 2px solid var(--checkout-offers-cart-accent);
	outline-offset: 2px;
}

/*
 * Polish. Primary actions use a deepened accent so white text stays readable on any theme colour;
 * the theme's own button rules (uppercase, square corners, grey fill) are overridden on purpose.
 */
.checkout-offers-cart {
	--checkout-offers-cart-accent-strong: color-mix(in srgb, var(--checkout-offers-cart-accent) 62%, #000);
	--checkout-offers-cart-radius: 20px;
	--checkout-offers-cart-padding: 1.75em;
	--checkout-offers-cart-max-width: 46em;
	font-size: 15px;
}

dialog.checkout-offers-cart h2.checkout-offers-cart__title {
	margin-inline: 2em;
	font-size: 1.5em;
	text-transform: none;
}

/* Added product: check badge + name, left-aligned like a receipt line. */
.checkout-offers-cart .checkout-offers-cart__added {
	justify-content: flex-start;
	gap: 1em;
	padding: 0.7em 1.1em 0.7em 0.7em;
	border-radius: 14px;
	text-align: start;
}

.checkout-offers-cart .checkout-offers-cart__added-image {
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: 10px;
	box-shadow: 0 0 0 1px var(--checkout-offers-cart-hairline);
}

.checkout-offers-cart .checkout-offers-cart__added-name {
	flex: 1;
	min-width: 0;
	font-size: 1.02em;
	font-weight: 700;
}

.checkout-offers-cart .checkout-offers-cart__added::after {
	content: "\2713";
	display: grid;
	flex: none;
	place-items: center;
	order: 3;
	width: 1.9em;
	height: 1.9em;
	border-radius: 50%;
	background: #2e9f5b;
	color: #fff;
	font-weight: 700;
}

.checkout-offers-cart .checkout-offers-cart__actions {
	margin-block-start: 1.1em;
}

.checkout-offers-cart .checkout-offers-cart__continue,
.checkout-offers-cart .checkout-offers-cart__to-cart {
	text-transform: none;
	letter-spacing: 0;
}

.checkout-offers-cart .checkout-offers-cart__continue {
	color: color-mix(in srgb, currentColor 70%, transparent);
	font-weight: 600;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.checkout-offers-cart .checkout-offers-cart__continue:hover {
	color: inherit;
}

.checkout-offers-cart .checkout-offers-cart__to-cart.checkout-offers-cart__to-cart {
	padding-inline: 1.75em;
	border: 0;
	background: var(--checkout-offers-cart-accent-strong);
	color: #fff;
	box-shadow: 0 10px 22px -10px var(--checkout-offers-cart-accent-strong);
}

.checkout-offers-cart .checkout-offers-cart__to-cart.checkout-offers-cart__to-cart:hover {
	background: color-mix(in srgb, var(--checkout-offers-cart-accent-strong) 85%, #000);
	color: #fff;
}

.checkout-offers-cart .checkout-offers-cart__more {
	border-block-start: 0;
	padding-block-start: 0;
	margin-block-start: 1.5em;
}

dialog.checkout-offers-cart h3.checkout-offers-cart__more-title,
.checkout-offers-cart--inline h3.checkout-offers-cart__more-title {
	margin-block-end: 0.9em;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.65;
}

/* Cards: tall image tile, two-line name, price and a full-width pill. */
.checkout-offers-cart .checkout-offers-cart__card {
	padding: 0.5em 0.5em 0.65em;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.checkout-offers-cart .checkout-offers-cart__card-image {
	border-radius: 11px;
	box-shadow: inset 0 0 0 1px var(--checkout-offers-cart-hairline);
}

.checkout-offers-cart .checkout-offers-cart__card-name {
	padding-inline: 0.3em;
	text-transform: none;
}

.checkout-offers-cart .checkout-offers-cart__card-foot {
	padding-inline: 0.3em;
}

.checkout-offers-cart .checkout-offers-cart__card-price {
	font-size: 1.05em;
	color: var(--checkout-offers-cart-accent-strong);
}

.checkout-offers-cart .checkout-offers-cart__add.checkout-offers-cart__add {
	min-height: 40px;
	border: 1.5px solid var(--checkout-offers-cart-accent-strong);
	background: transparent;
	color: var(--checkout-offers-cart-accent-strong);
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
	transition: background-color 0.15s, color 0.15s, transform 0.12s;
}

.checkout-offers-cart .checkout-offers-cart__add.checkout-offers-cart__add:hover:not([disabled]) {
	background: var(--checkout-offers-cart-accent-strong);
	color: #fff;
}

.checkout-offers-cart .checkout-offers-cart__add.checkout-offers-cart__add--done {
	border-color: #2e9f5b;
	background: #2e9f5b;
	color: #fff;
}

.checkout-offers-cart .checkout-offers-cart__arrow {
	box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
	.checkout-offers-cart .checkout-offers-cart__card {
		animation: checkout-offers-cart-rise 0.4s ease-out both;
	}

	.checkout-offers-cart .checkout-offers-cart__card:nth-child(2) { animation-delay: 0.05s; }
	.checkout-offers-cart .checkout-offers-cart__card:nth-child(3) { animation-delay: 0.1s; }
	.checkout-offers-cart .checkout-offers-cart__card:nth-child(n+4) { animation-delay: 0.15s; }
}

@keyframes checkout-offers-cart-rise {
	from {
		opacity: 0;
		transform: translateY(0.6em);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Checkout page: the strip sits on a soft panel of its own. */
.checkout-offers-cart.checkout-offers-cart--inline {
	padding: 1.25em 1.25em 0.5em;
	border: 1px solid var(--checkout-offers-cart-hairline);
	border-radius: 20px;
	background: var(--checkout-offers-cart-surface);
}

.checkout-offers-cart--inline .checkout-offers-cart__card {
	background: Canvas;
}

.checkout-offers-cart .checkout-offers-cart__card-price,
.checkout-offers-cart .checkout-offers-cart__card-price .amount,
.checkout-offers-cart .checkout-offers-cart__card-price ins {
	color: var(--checkout-offers-cart-accent-strong);
	text-decoration: none;
}

.checkout-offers-cart .checkout-offers-cart__card-price del {
	margin-inline-end: 0.3em;
	color: inherit;
	font-size: 0.85em;
	font-weight: 400;
	opacity: 0.5;
}

.checkout-offers-cart .checkout-offers-cart__close.checkout-offers-cart__close {
	display: grid;
	place-items: center;
	border: 0;
	box-shadow: none;
}

.checkout-offers-cart .checkout-offers-cart__close:focus:not(:focus-visible) {
	outline: 0;
}

.checkout-offers-cart.checkout-offers-cart--inline {
	box-shadow: none;
	padding-block-start: 1.1em;
}

.checkout-offers-cart--inline .checkout-offers-cart__more {
	margin-block-start: 0;
}

.checkout-offers-cart .checkout-offers-cart__close:focus-visible {
	outline-color: var(--checkout-offers-cart-hairline);
	outline-offset: 0;
}
