/**
 * Perfamix site-wide promotional marquee.
 *
 * The visual loop is CSS-only. Goldsmith's fixed mobile header is promoted to
 * its existing height wrapper so the announcement keeps real layout space.
 */

.perfamix-promotional-marquee {
	position: relative;
	z-index: 99;
	isolation: isolate;
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
	min-height: var(--pmx-mobile-height, 42px);
	overflow: hidden;
	color: var(--pmx-text, #fff);
	background: var(--pmx-background, #264e36);
	font-family: inherit;
	font-size: var(--pmx-mobile-font-size, 13px);
	font-weight: var(--pmx-font-weight, 600);
	line-height: 1.25;
	letter-spacing: 0.035em;
	-webkit-font-smoothing: antialiased;
}

.perfamix-promotional-marquee::after {
	position: absolute;
	inset: auto 0 0;
	z-index: 3;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--pmx-accent, #c8a05a) 50%, transparent);
	content: "";
	opacity: 0.62;
	pointer-events: none;
}

.perfamix-promotional-marquee--uppercase {
	text-transform: uppercase;
	letter-spacing: 0.075em;
}

.perfamix-promotional-marquee__viewport {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: hidden;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 48px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 48px), transparent 100%);
}

.perfamix-promotional-marquee__viewport::-webkit-scrollbar {
	display: none;
}

.perfamix-promotional-marquee__track {
	display: flex;
	width: max-content;
	min-width: 100%;
	transform: translate3d(0, 0, 0);
	direction: ltr;
	animation: perfamix-promotional-marquee-scroll var(--pmx-duration, 28s) linear infinite;
	will-change: transform;
}

.perfamix-promotional-marquee--direction-right .perfamix-promotional-marquee__track {
	animation-direction: reverse;
}

.perfamix-promotional-marquee__group {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-around;
	min-width: 100vw;
	min-height: var(--pmx-mobile-height, 42px);
	box-sizing: border-box;
	gap: var(--pmx-item-gap, 46px);
	padding: 0 max(24px, calc(var(--pmx-item-gap, 46px) / 2));
}

.perfamix-promotional-marquee__item {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: var(--pmx-item-gap, 46px);
	white-space: nowrap;
	text-align: start;
	unicode-bidi: isolate;
}

.perfamix-promotional-marquee__item::after {
	position: relative;
	flex: 0 0 auto;
	display: block;
	color: var(--pmx-accent, #c8a05a);
	background: currentColor;
	content: "";
	opacity: 0.95;
}

.perfamix-promotional-marquee--separator-diamond .perfamix-promotional-marquee__item::after {
	width: 6px;
	height: 6px;
	border-radius: 1px;
	transform: rotate(45deg);
}

.perfamix-promotional-marquee--separator-dot .perfamix-promotional-marquee__item::after {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.perfamix-promotional-marquee--separator-line .perfamix-promotional-marquee__item::after {
	width: 20px;
	height: 1px;
}

.perfamix-promotional-marquee--separator-none .perfamix-promotional-marquee__item::after {
	display: none;
}

.perfamix-promotional-marquee__sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	border: 0 !important;
	white-space: nowrap !important;
}

/*
 * Goldsmith nests its fixed mobile header inside a same-height flow wrapper.
 * Making that wrapper sticky, while returning the inner header to flow, keeps
 * the marquee above it at every configured bar height and avoids scroll jumps.
 */
@media (max-width: 1280px) {
	body.perfamix-has-promotional-marquee.has-sticky-header .goldsmith-header-mobile-top-height {
		position: -webkit-sticky;
		position: sticky;
		top: 0;
		z-index: 100;
	}

	body.perfamix-has-promotional-marquee.has-sticky-header .goldsmith-header-mobile-top-height > .goldsmith-header-mobile-top {
		position: relative;
		top: 0;
	}

	/* Goldsmith's alternate sidebar-header layout uses separate siblings. */
	body.perfamix-has-promotional-marquee .goldsmith-mobile-header-spacer {
		display: none;
	}

	body.perfamix-has-promotional-marquee .goldsmith-mobile-header {
		position: -webkit-sticky;
		position: sticky;
		top: 0;
		z-index: 100;
	}

	body.admin-bar.perfamix-has-promotional-marquee.has-sticky-header .goldsmith-header-mobile-top-height,
	body.admin-bar.perfamix-has-promotional-marquee .goldsmith-mobile-header {
		top: 32px;
	}
}

@media (max-width: 782px) {
	body.admin-bar.perfamix-has-promotional-marquee.has-sticky-header .goldsmith-header-mobile-top-height,
	body.admin-bar.perfamix-has-promotional-marquee .goldsmith-mobile-header {
		top: 46px;
	}
}

@media (max-width: 600px) {
	body.admin-bar.scroll-start.perfamix-has-promotional-marquee.has-sticky-header .goldsmith-header-mobile-top-height,
	body.admin-bar.scroll-start.perfamix-has-promotional-marquee .goldsmith-mobile-header {
		top: 0;
	}
}

@media (hover: hover) and (pointer: fine) {
	.perfamix-promotional-marquee--pause-on-interaction:hover .perfamix-promotional-marquee__track {
		animation-play-state: paused;
	}
}

@keyframes perfamix-promotional-marquee-scroll {
	from {
		transform: translate3d(0, 0, 0);
	}

	to {
		transform: translate3d(-50%, 0, 0);
	}
}

@media (min-width: 768px) {
	.perfamix-promotional-marquee {
		min-height: var(--pmx-desktop-height, 44px);
		font-size: var(--pmx-desktop-font-size, 14px);
	}

	.perfamix-promotional-marquee__group {
		min-height: var(--pmx-desktop-height, 44px);
	}

	.perfamix-promotional-marquee__viewport {
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 56px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 56px), transparent 100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.perfamix-promotional-marquee__viewport {
		overflow-x: auto !important;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.perfamix-promotional-marquee__track {
		animation: none !important;
		transform: none !important;
		will-change: auto !important;
	}

	.perfamix-promotional-marquee__group--clone,
	.perfamix-promotional-marquee__item--repeat {
		display: none !important;
	}
}

@media (forced-colors: active) {
	.perfamix-promotional-marquee {
		border-block: 1px solid CanvasText;
	}
}

@media print {
	.perfamix-promotional-marquee__track {
		animation: none !important;
		transform: none !important;
	}

	.perfamix-promotional-marquee__group--clone,
	.perfamix-promotional-marquee__item--repeat {
		display: none !important;
	}
}
