/**
 * Desktop in-app advertising layouts.
 * Carousel: same footprint as static hero (3:1 desktop); optional 4:5 mobile when posters are off.
 * Bento / immersive / side: desktop via xm-hide-mobile (+ local MQ for side).
 */

@media (min-width: 768px) {
	.xm-homepage--ads-carousel .xm-hero {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.xm-homepage--ads-carousel-mobile .xm-hero {
		display: none !important;
	}
}

/* —— Announcement bar —— */
.xm-ads-bar {
	position: relative;
	z-index: 1001;
	width: 100%;
	background: var(--xm-ads-bar-bg, #ff6700);
	color: var(--xm-ads-bar-color, #fff);
	font-size: 0.8125rem;
	line-height: 1.35;
}

.xm-ads-bar.is-dismissed {
	display: none;
}

.xm-ads-bar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	min-height: 2.25rem;
	padding: 0.4rem 2.25rem 0.4rem 1rem;
	position: relative;
}

.xm-ads-bar__message {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 0.75rem;
	color: inherit;
	text-decoration: none;
	text-align: center;
}

.xm-ads-bar__message:hover,
.xm-ads-bar__message:focus-visible {
	color: inherit;
	text-decoration: underline;
}

.xm-ads-bar__cta {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.55rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.75rem;
	white-space: nowrap;
}

.xm-ads-bar__close {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1.75rem;
	height: 1.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
}

.xm-ads-bar__close:hover,
.xm-ads-bar__close:focus-visible {
	opacity: 1;
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* —— Hero carousel — same 3:1 footprint as static .xm-hero —— */
.xm-ads-carousel {
	position: relative;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #1a1a1a;
}

.xm-ads-carousel__viewport {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 1;
	min-height: 220px;
	overflow: hidden;
}

.xm-ads-carousel__track {
	display: flex;
	flex-wrap: nowrap;
	width: 100%;
	height: 100%;
	transition: transform 0.55s ease;
	will-change: transform;
}

.xm-ads-carousel__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	min-width: 100%;
}

.xm-ads-carousel__link {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	color: #fff;
	text-decoration: none;
	overflow: hidden;
}

.xm-ads-carousel picture {
	display: block;
	width: 100%;
	height: 100%;
}

.xm-ads-carousel__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--xm-ads-pos-d, center center);
}

@media (max-width: 767px) {
	.xm-ads-carousel--mobile-ready .xm-ads-carousel__image {
		object-position: var(--xm-ads-pos-m, var(--xm-ads-pos-d, center center));
	}
}

.xm-ads-carousel__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: clamp(1rem, 3.5vw, 2.75rem);
	background: linear-gradient(
		90deg,
		rgba(0, 0, 0, 0.55) 0%,
		rgba(0, 0, 0, 0.22) 42%,
		transparent 72%
	);
	pointer-events: none;
}

.xm-ads-carousel__copy {
	max-width: min(480px, 44vw);
}

.xm-ads-carousel__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.35rem, 2.8vw, 2.35rem);
	font-weight: 700;
	line-height: 1.15;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.xm-ads-carousel__subtitle {
	margin: 0 0 1rem;
	font-size: clamp(0.9rem, 1.4vw, 1.1rem);
	line-height: 1.45;
	opacity: 0.95;
}

.xm-ads-carousel__cta {
	pointer-events: none;
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0.55rem 1.35rem;
	border-radius: 999px;
	background: #ff6700;
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(255, 103, 0, 0.35);
}

.xm-ads-carousel__nav {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 0.75rem;
	pointer-events: none;
	z-index: 2;
}

.xm-ads-carousel__btn {
	pointer-events: auto;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.88);
	color: #1a1a1a;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.xm-ads-carousel__btn:hover,
.xm-ads-carousel__btn:focus-visible {
	background: #fff;
	outline: 2px solid var(--xm-color-primary, #ff6700);
	outline-offset: 2px;
}

.xm-ads-carousel__dots {
	position: absolute;
	left: 50%;
	bottom: 0.85rem;
	transform: translateX(-50%);
	display: flex;
	gap: 0.4rem;
	z-index: 2;
}

.xm-ads-carousel__dot {
	width: 0.55rem;
	height: 0.55rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
}

.xm-ads-carousel__dot.is-active,
.xm-ads-carousel__dot:hover,
.xm-ads-carousel__dot:focus-visible {
	background: #fff;
}

@media (max-width: 767px) {
	.xm-ads-carousel--mobile-ready {
		margin-bottom: 0;
	}

	.xm-ads-carousel--mobile-ready .xm-ads-carousel__viewport {
		aspect-ratio: 4 / 5;
		min-height: 0;
	}

	.xm-ads-carousel--mobile-ready .xm-ads-carousel__copy {
		max-width: 88%;
	}

	.xm-ads-carousel--mobile-ready .xm-ads-carousel__overlay {
		align-items: flex-end;
		background: linear-gradient(
			180deg,
			transparent 0%,
			rgba(0, 0, 0, 0.35) 45%,
			rgba(0, 0, 0, 0.75) 100%
		);
		padding-bottom: 2.75rem;
	}

	.xm-ads-carousel--mobile-ready .xm-ads-carousel__nav {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.xm-ads-carousel__track {
		transition: none;
	}
}

/* —— Bento grid (compact cart placement) —— */
.xm-ads-bento {
	width: 100%;
	padding: 0;
	background: var(--xm-color-bg, #fff);
}

/* Hidden until ≥1400px AND media fully loaded (no layout steal while products paint) */
.xm-ads-bento--compact {
	display: none;
}

@media (min-width: 1400px) {
	.xm-ads-bento--compact.is-media-ready {
		display: block;
		padding: 1.5rem 0 2rem;
		margin-top: 0.5rem;
		animation: xm-ads-fade-in 0.4s ease;
	}
}

@keyframes xm-ads-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.xm-ads-bento--compact.is-media-ready {
		animation: none;
	}
}

.xm-ads-bento__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: minmax(12rem, 1fr) minmax(12rem, 1fr) minmax(10rem, auto);
	grid-template-areas:
		"large large tall tall"
		"large large med1 med2"
		"wide wide wide wide";
	gap: 1.25rem;
	min-height: 30rem;
}

.xm-ads-bento--compact .xm-ads-bento__grid {
	min-height: 0;
	max-height: 320px;
	grid-template-rows: minmax(5.5rem, 1fr) minmax(5.5rem, 1fr) minmax(4.5rem, auto);
	gap: 0.75rem;
}

.xm-ads-bento__cell--large { grid-area: large; }
.xm-ads-bento__cell--tall { grid-area: tall; }
.xm-ads-bento__cell--med1 { grid-area: med1; }
.xm-ads-bento__cell--med2 { grid-area: med2; }
.xm-ads-bento__cell--wide { grid-area: wide; min-height: 10.5rem; }

.xm-ads-bento--compact .xm-ads-bento__cell--wide {
	min-height: 4.5rem;
}

.xm-ads-bento__cell {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 16px;
	background: #111;
	color: #fff;
	text-decoration: none;
	min-height: 11rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.xm-ads-bento--compact .xm-ads-bento__cell {
	min-height: 5rem;
	border-radius: 12px;
}

.xm-ads-bento__cell:hover .xm-ads-bento__image,
.xm-ads-bento__cell:focus-visible .xm-ads-bento__image {
	transform: scale(1.03);
}

.xm-ads-bento__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.35s ease;
}

.xm-ads-bento__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 1.15rem 1.25rem;
	background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.72) 100%);
	pointer-events: none;
}

.xm-ads-bento--compact .xm-ads-bento__overlay {
	padding: 0.65rem 0.75rem;
}

.xm-ads-bento__cell--sale .xm-ads-bento__overlay {
	align-items: center;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 55%, transparent 100%);
}

.xm-ads-bento__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	max-width: 100%;
}

.xm-ads-bento--compact .xm-ads-bento__copy {
	gap: 0.15rem;
}

.xm-ads-bento__title {
	font-size: clamp(1.05rem, 1.6vw, 1.5rem);
	font-weight: 700;
	line-height: 1.2;
}

.xm-ads-bento--compact .xm-ads-bento__title {
	font-size: 0.95rem;
}

.xm-ads-bento__subtitle {
	font-size: 0.875rem;
	line-height: 1.35;
	opacity: 0.92;
}

.xm-ads-bento--compact .xm-ads-bento__subtitle {
	font-size: 0.75rem;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.xm-ads-bento__price {
	color: #ff6700;
	font-size: 0.95rem;
	font-weight: 700;
}

.xm-ads-bento--compact .xm-ads-bento__price {
	font-size: 0.8125rem;
}

.xm-ads-bento__cta {
	pointer-events: none;
	display: inline-flex;
	align-items: center;
	margin-top: 0.35rem;
	min-height: 2.25rem;
	padding: 0.45rem 1.1rem;
	border-radius: 999px;
	background: #ff6700;
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
}

.xm-ads-bento--compact .xm-ads-bento__cta {
	min-height: 1.75rem;
	margin-top: 0.2rem;
	padding: 0.3rem 0.85rem;
	font-size: 0.75rem;
}

.xm-ads-bento__cell--sale .xm-ads-bento__cta {
	background: #fff;
	color: #ff6700;
}

.xm-ads-bento__cell--med1 .xm-ads-bento__title,
.xm-ads-bento__cell--med2 .xm-ads-bento__title {
	font-size: 1rem;
}

.xm-ads-bento--compact .xm-ads-bento__cell--med1 .xm-ads-bento__title,
.xm-ads-bento--compact .xm-ads-bento__cell--med2 .xm-ads-bento__title {
	font-size: 0.875rem;
}

/* —— Immersive highlight —— */
.xm-ads-immersive {
	width: 100%;
	max-width: none;
	margin: 0 0 60px;
	padding: 0;
	overflow: hidden;
}

.xm-ads-immersive__frame {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	color: #fff;
	text-decoration: none;
	overflow: hidden;
	background: #111;
}

.xm-ads-immersive__media {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	transform: translateZ(0);
}

.xm-ads-immersive__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	pointer-events: none;
}

.xm-ads-immersive__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: clamp(1.5rem, 4vw, 3.5rem) 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.05) 0%,
		rgba(0, 0, 0, 0.35) 45%,
		rgba(0, 0, 0, 0.72) 100%
	);
}

.xm-ads-immersive__copy {
	max-width: 36rem;
}

.xm-ads-immersive__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.15;
}

.xm-ads-immersive__subtitle {
	margin: 0 0 1rem;
	font-size: clamp(0.95rem, 1.5vw, 1.15rem);
	line-height: 1.45;
	opacity: 0.95;
}

.xm-ads-immersive__cta {
	display: inline-flex;
}

@media (min-width: 1024px) {
	.xm-ads-immersive__media {
		background-attachment: fixed;
	}
}

@media (prefers-reduced-motion: reduce) {
	.xm-ads-immersive__media {
		background-attachment: scroll;
	}
}

/* —— Side skyscraper 1:4 — only when ≥1400px gutter exists —— */
.xm-ads-side {
	display: none;
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
	transition: opacity 0.2s ease;
}

@media (min-width: 1400px) {
	.xm-ads-side {
		display: block;
		position: fixed;
		top: 50%;
		right: max(0.75rem, calc((100vw - var(--xm-container-max, 1200px)) / 2 - 6.5rem));
		z-index: 850;
		width: 6.25rem;
		max-height: min(70vh, 28rem);
		transform: translateY(-50%);
		margin-bottom: 6rem;
	}

	.xm-ads-side.is-gutter-ready.is-media-ready {
		opacity: 1;
		pointer-events: auto;
		visibility: visible;
	}

	.xm-ads-side.is-gutter-hidden,
	.xm-ads-side:not(.is-media-ready) {
		opacity: 0;
		pointer-events: none;
		visibility: hidden;
	}
}

.xm-ads-side__item {
	display: none;
	width: 100%;
	aspect-ratio: 1 / 4;
	overflow: hidden;
	border-radius: var(--xm-radius-sm, 4px);
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.18);
	background: #fff;
	text-decoration: none;
}

.xm-ads-side__item.is-active {
	display: block;
}

.xm-ads-side__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.xm-ads-side__item:hover,
.xm-ads-side__item:focus-visible {
	outline: 2px solid var(--xm-color-primary, #ff6700);
	outline-offset: 2px;
}
