/**
 * Checkout offers block.
 *
 * Theme tokens (theme.json) with fallbacks, so the block still reads
 * without the theme. The buttons take the design system's btn-secondary /
 * btn-tertiary classes (Global Classes).
 */

.bandai-offers-block {
	display: grid;
	gap: var(--wp--preset--spacing--60, 1.75rem);
	margin-block: var(--wp--preset--spacing--60, 1.75rem);
}

.bandai-offers {
	margin: 0;
	padding: 0; /* The theme pads every <section> (64px top and bottom). */
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border-primary, #000);
	border-radius: var(--wp--custom--radius--m, 0.5rem);
	background: var(--wp--preset--color--bg-body-primary, #f7f7ee);
}

.bandai-offers__header {
	margin: 0;
	padding: var(--wp--preset--spacing--35, 0.75rem) var(--wp--preset--spacing--50, 1.25rem);
	background: var(--wp--preset--color--bg-blue, #006fa8);
	color: var(--wp--preset--color--text-inverse, #fff);
	font-family: var(--wp--preset--font-family--source-sans-pro, sans-serif);
	font-size: var(--wp--preset--font-size--x-large, 1.125rem);
	line-height: 1.3;
	text-align: center;
}

.bandai-offers__header strong,
.bandai-offers__header b {
	font-weight: 700;
}

.bandai-offers__body {
	margin: 0;
	padding: var(--wp--preset--spacing--50, 1.25rem);
	container-type: inline-size;
}

.bandai-offers > * + * {
	margin-block-start: 0;
}

.bandai-offers__list {
	--bandai-offers-gap: var(--wp--preset--spacing--40, 1rem);
	--bandai-offers-visible: 2;

	/*
	 * Containing block of the cards' absolutely positioned bits (the prices'
	 * screen-reader-text). Without it they belong to an ancestor outside the
	 * scroller, overflow does not clip them and the off-screen cards widened
	 * the whole page.
	 */
	position: relative;
	display: grid;
	grid-auto-columns: calc((100% - (var(--bandai-offers-visible) - 1) * var(--bandai-offers-gap)) / var(--bandai-offers-visible));
	grid-auto-flow: column;
	gap: var(--bandai-offers-gap);
	margin: 0;
	padding: 0 0 var(--wp--preset--spacing--20, 0.25rem);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	list-style: none;
}

.bandai-offers__list::-webkit-scrollbar {
	display: none;
}

.bandai-offers__list:focus-visible {
	outline: 2px solid var(--wp--preset--color--border-focus, #006fa8);
	outline-offset: 2px;
}

/* Cards per view by the box's own width (the checkout column is narrow). */
@container (min-width: 34rem) {

	.bandai-offers__list {
		--bandai-offers-visible: 3;
	}
}

.bandai-offers__card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30, 0.5rem);
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
}

.bandai-offers__image {
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--m, 0.5rem);
	background: var(--wp--preset--color--bg-body-secondary, #fff);
}

.bandai-offers__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.bandai-offers__name {
	display: -webkit-box;
	margin: var(--wp--preset--spacing--20, 0.25rem) 0 0;
	overflow: hidden;
	color: var(--wp--preset--color--text-primary, #000);
	font-family: var(--wp--preset--font-family--gotham, sans-serif);
	font-size: var(--wp--preset--font-size--large, 1rem);
	font-weight: 500;
	line-height: 1.25;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	/* Always 3 lines tall, so prices and buttons line up across cards. */
	min-height: calc(3 * 1.25em);
}

.bandai-offers__prices {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--wp--preset--spacing--30, 0.5rem);
	align-items: baseline;
	margin: auto 0 0;
	font-size: var(--wp--preset--font-size--large, 1rem);
}

.bandai-offers__regular {
	color: var(--wp--preset--color--text-primary, #000);
	font-size: var(--wp--preset--font-size--medium, 0.875rem);
}

.bandai-offers__price {
	color: var(--wp--preset--color--text-support, #555a65);
	font-size: var(--wp--preset--font-size--xx-large, 1.25rem);
	text-decoration: none;
}

.bandai-offers__price.is-free {
	color: var(--wp--preset--color--text-accent, #e30613);
	font-weight: 700;
}

.bandai-offers__button {
	width: 100%;
	margin-top: var(--wp--preset--spacing--20, 0.25rem);
}

.bandai-offers__button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.bandai-offers__added {
	margin: 0;
	color: var(--wp--preset--color--success, #16a34a);
	font-size: var(--wp--preset--font-size--medium, 0.875rem);
	text-align: center;
}

.bandai-offers__nav {
	display: flex;
	gap: var(--wp--preset--spacing--50, 1.25rem);
	align-items: center;
	justify-content: space-between;
	margin-top: var(--wp--preset--spacing--50, 1.25rem);
}

/*
 * Progress bar, as the site's sliders draw it (theme: slider-progress-track /
 * slider-progress-thumb, product-slider.scss): a 2px track and a 6px accent
 * thumb sized to the visible share, following the scroll; it can be dragged.
 */
.bandai-offers__track {
	position: relative;
	flex: 1 1 auto;
	max-width: 18rem;
	height: 6px;
	cursor: pointer;
	touch-action: none;
}

.bandai-offers__track::before {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 10px;
	background: var(--wp--preset--color--icon-primary, #000);
	content: "";
	transform: translateY(-50%);
}

.bandai-offers__thumb {
	position: absolute;
	top: 0;
	height: 100%;
	border-radius: 10px;
	background: var(--wp--preset--color--bg-accent, #e30613);
	cursor: grab;
}

/* Larger grab area than the 6px bar. */
.bandai-offers__thumb::after {
	position: absolute;
	inset: -0.5rem 0;
	content: "";
}

.bandai-offers__thumb:active {
	cursor: grabbing;
}

.bandai-offers__arrows {
	display: flex;
	flex: none;
	gap: 0.75rem;
}

/* Theme's slider-arrow-button: 48px, 1px border, white, inverted on hover. */
.bandai-offers__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 1px solid var(--wp--preset--color--bg-inverse, #000);
	border-radius: var(--wp--custom--radius--full, 9999px);
	background: var(--wp--preset--color--bg-body-secondary, #fff);
	color: var(--wp--preset--color--bg-inverse, #000);
	cursor: pointer;
	transition: all 0.3s ease-in-out;
}

.bandai-offers__arrow:disabled {
	cursor: default;
	opacity: 0.35;
}

.bandai-offers__arrow:focus-visible {
	outline: 2px solid var(--wp--preset--color--border-focus, #006fa8);
	outline-offset: 2px;
}

.bandai-offers__arrow:hover:not(:disabled),
.bandai-offers__arrow:active:not(:disabled) {
	background: var(--wp--preset--color--bg-inverse, #000);
	color: var(--wp--preset--color--bg-body-secondary, #fff);
}

.bandai-offers__note,
.bandai-offers__error {
	margin: var(--wp--preset--spacing--40, 1rem) 0 0;
	font-size: var(--wp--preset--font-size--medium, 0.875rem);
}

.bandai-offers__error {
	color: var(--wp--preset--color--error, #dc2626);
}

/* Editor placeholder. */
.bandai-offers-placeholder {
	padding: var(--wp--preset--spacing--40, 1rem);
	border: 1px dashed var(--wp--preset--color--border-muted, #cdcfcb);
	border-radius: var(--wp--custom--radius--m, 0.5rem);
}

.bandai-offers-placeholder p {
	margin: var(--wp--preset--spacing--30, 0.5rem) 0 0;
}

@media (prefers-reduced-motion: reduce) {

	.bandai-offers__list {
		scroll-behavior: auto;
	}

	.bandai-offers__arrow {
		transition: none;
	}
}
