/**
 * XABCD SEO — Last Buy fly-in callout.
 *
 * Colors come from per-rule CSS custom properties set inline on the container
 * (--xlb-bg, --xlb-fg, --xlb-radius), so one stylesheet serves
 * every rule.
 */

.xabcd-lb {
	position: fixed;
	z-index: 99990;
	max-width: 360px;
	min-width: 260px;
	box-sizing: border-box;
	background: var(--xlb-bg, #ffd426);
	color: var(--xlb-fg, #1a1a1a);
	border-radius: var(--xlb-radius, 4px);
	padding: 16px 40px 16px 20px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	font-size: 15px;
	line-height: 1.45;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.xabcd-lb[hidden] {
	display: none;
}

/* ---------- Celebration burst ---------- */

/*
 * Sits just above the card's top edge and outside its painted box, so the
 * sparks read as bursting from behind the card. Purely decorative and
 * removed from the DOM once it has played.
 */
/*
 * Spans the top edge so individual shells can be placed anywhere across it.
 * Zero height keeps it out of the card's layout entirely.
 */
.xabcd-lb-fireworks {
	position: absolute;
	top: 2px;
	left: 0;
	right: 0;
	height: 0;
	pointer-events: none;
	z-index: 0;
}

/* One explosion. Its own origin point; sparks radiate from here. */
.xabcd-lb-burst {
	position: absolute;
	top: 0;
	width: 0;
	height: 0;
}

.xabcd-lb-burst i {
	position: absolute;
	top: 0;
	left: 0;
	width: 6px;
	height: 6px;
	margin: -3px 0 0 -3px;
	border-radius: 50%;
	background: var(--xlb-spark, #ffffff);
	opacity: 0;
	box-shadow: 0 0 6px 0 var(--xlb-spark, #ffffff);
	animation: xabcd-lb-spark var(--xlb-dur, 1200ms) cubic-bezier(0.18, 0.7, 0.3, 1) var(--xlb-delay, 0ms) forwards;
}

@keyframes xabcd-lb-spark {
	0% {
		opacity: 0;
		transform: rotate(var(--xlb-angle, 0deg)) translateY(0) scale(0.35);
	}

	12% {
		opacity: 1;
	}

	70% {
		opacity: 1;
	}

	100% {
		opacity: 0;
		transform: rotate(var(--xlb-angle, 0deg)) translateY(calc(var(--xlb-dist, 40px) * -1)) scale(0.5);
	}
}

/* ---------- Positions ---------- */

.xabcd-lb--bottom-left {
	left: 20px;
	bottom: 20px;
	transform: translateY(16px);
}

.xabcd-lb--bottom-right {
	right: 20px;
	bottom: 20px;
	transform: translateY(16px);
}

.xabcd-lb--top-left {
	left: 20px;
	top: 20px;
	transform: translateY(-16px);
}

.xabcd-lb--top-right {
	right: 20px;
	top: 20px;
	transform: translateY(-16px);
}

.xabcd-lb--bottom-center {
	left: 50%;
	bottom: 20px;
	transform: translate(-50%, 16px);
}

/* ---------- Visible state ---------- */

.xabcd-lb.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.xabcd-lb--bottom-left.is-visible,
.xabcd-lb--bottom-right.is-visible,
.xabcd-lb--top-left.is-visible,
.xabcd-lb--top-right.is-visible {
	transform: translateY(0);
}

.xabcd-lb--bottom-center.is-visible {
	transform: translate(-50%, 0);
}

/* Fade-only animation option. */
.xabcd-lb--fade,
.xabcd-lb--fade.is-visible {
	transform: none;
}

.xabcd-lb--bottom-center.xabcd-lb--fade,
.xabcd-lb--bottom-center.xabcd-lb--fade.is-visible {
	transform: translateX(-50%);
}

/* ---------- Countdown bar ---------- */

.xabcd-lb-progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	overflow: hidden;
	border-radius: var(--xlb-radius, 4px) var(--xlb-radius, 4px) 0 0;
	pointer-events: none;
}

.xabcd-lb-progress-fill {
	display: block;
	width: 100%;
	height: 100%;
	/* Tint of the text color, so it reads on any background choice. */
	background: currentColor;
	opacity: 0.28;
	transform: scaleX(1);
	transform-origin: left center;
	will-change: transform;
}

/* ---------- Content ---------- */

.xabcd-lb-link {
	color: inherit;
	text-decoration: none !important;
	background: none !important;
	border-bottom: 0 !important;
	box-shadow: none !important;
	display: block;
}

.xabcd-lb-name {
	font-weight: 700;
	font-size: 1.05em;
	margin: 0 0 2px;
}

.xabcd-lb-action {
	margin: 0 0 4px;
}

/*
 * The product name reads as bold text in the card's own color rather than a
 * second color. The underline is drawn as a background gradient rather than
 * text-decoration so it can animate in from the left, and so page-builder
 * link styling cannot override it.
 */
.xabcd-lb-product {
	font-weight: 700;
	color: inherit;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 2px;
	transition: background-size 0.28s ease;
	padding-bottom: 1px;
}

.xabcd-lb:hover .xabcd-lb-product,
.xabcd-lb-link:focus-visible .xabcd-lb-product {
	background-size: 100% 2px;
}

@media (prefers-reduced-motion: reduce) {
	.xabcd-lb-product {
		transition: none;
	}
}

.xabcd-lb-meta {
	font-size: 0.85em;
	opacity: 0.85;
	margin: 0;
}

/*
 * Bundled flag artwork. The source SVGs are square (36x36) with the flag
 * drawn across the middle ~72%, so a square box lines the flag up with the
 * cap height of the text beside it.
 */
.xabcd-lb-flag {
	display: inline-block;
	width: 1.35em;
	height: 1.35em;
	vertical-align: -0.4em;
	margin: 0 0.1em;
	/* Page-builder image rules love to add borders and shadows. */
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
}

.xabcd-lb-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.5;
	border-radius: 3px;
}

.xabcd-lb-close:hover,
.xabcd-lb-close:focus {
	opacity: 1;
}

/* Admin-only preview marker. */
.xabcd-lb-badge {
	display: inline-block;
	margin-bottom: 6px;
	padding: 1px 6px;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
	.xabcd-lb {
		left: 12px;
		right: 12px;
		bottom: 12px;
		max-width: none;
		min-width: 0;
		font-size: 14px;
	}

	.xabcd-lb--bottom-center {
		transform: translateY(16px);
	}

	.xabcd-lb--bottom-center.is-visible {
		transform: translateY(0);
	}
}

/* ---------- Motion preference ---------- */

@media (prefers-reduced-motion: reduce) {
	.xabcd-lb {
		transition: opacity 0.01ms linear;
		transform: none !important;
	}
}
