/**
 * Flash Promo - banner styles.
 *
 * Colours arrive as custom properties set inline by the script, so the shop
 * owner controls them from the settings without touching this file.
 *
 * Selectors are namespaced and specificity is kept low so a theme can
 * override anything without !important wars.
 */

.flash-promo-mount[hidden] {
	display: none;
}

.flash-promo {
	--flash-promo-bg: #111827;
	--flash-promo-text: #ffffff;
	--flash-promo-accent: #f59e0b;

	background: var(--flash-promo-bg);
	color: var(--flash-promo-text);
	border-radius: 12px;
	font-size: 15px;
	line-height: 1.4;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}

.flash-promo__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
}

.flash-promo__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.flash-promo__main {
	font-weight: 600;
}

.flash-promo__sub {
	font-size: 13px;
	opacity: 0.75;
}

.flash-promo__discount,
.flash-promo__timer {
	color: var(--flash-promo-accent);
	font-weight: 700;
}

/* Tabular figures stop the countdown from jittering as digits change. */
.flash-promo__timer {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
	white-space: nowrap;
}

.flash-promo__cta {
	flex: 0 0 auto;
	background: var(--flash-promo-accent);
	color: #111827;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	padding: 9px 18px;
	border-radius: 999px;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.flash-promo__cta:hover,
.flash-promo__cta:focus {
	filter: brightness(1.08);
	color: #111827;
	text-decoration: none;
}

.flash-promo__close {
	flex: 0 0 auto;
	background: none;
	border: 0;
	color: inherit;
	opacity: 0.6;
	font-size: 22px;
	line-height: 1;
	padding: 4px 6px;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.flash-promo__close:hover,
.flash-promo__close:focus {
	opacity: 1;
}

/* --- Inline placements ------------------------------------------------ */

.flash-promo--archive,
.flash-promo--product,
.flash-promo--cart,
.flash-promo--checkout {
	margin: 0 0 20px;
}

.flash-promo--product {
	margin: 12px 0 18px;
}

/* --- Sticky bar ------------------------------------------------------- */

.flash-promo--sticky {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	width: calc(100% - 32px);
	max-width: 760px;
	animation: flash-promo-in 0.35s ease both;
}

.flash-promo--sticky.flash-promo--bottom {
	bottom: 16px;
}

.flash-promo--sticky.flash-promo--top {
	top: 16px;
}

@keyframes flash-promo-in {
	from {
		opacity: 0;
		transform: translate(-50%, 12px);
	}
	to {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

.flash-promo--sticky.flash-promo--top {
	animation-name: flash-promo-in-top;
}

@keyframes flash-promo-in-top {
	from {
		opacity: 0;
		transform: translate(-50%, -12px);
	}
	to {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

/* --- States ----------------------------------------------------------- */

.flash-promo.is-urgent .flash-promo__timer {
	animation: flash-promo-pulse 1s ease-in-out infinite;
}

@keyframes flash-promo-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.45;
	}
}

.flash-promo.is-expired {
	opacity: 0.75;
}

.flash-promo.is-expired .flash-promo__inner {
	justify-content: center;
	font-weight: 500;
}

/* --- Mobile ----------------------------------------------------------- */

@media (max-width: 600px) {
	.flash-promo {
		font-size: 14px;
	}

	.flash-promo__inner {
		flex-wrap: wrap;
		gap: 10px 12px;
		padding: 12px 14px;
	}

	.flash-promo__text {
		flex: 1 1 100%;
		order: 1;
	}

	.flash-promo__cta {
		flex: 1 1 auto;
		order: 2;
		text-align: center;
	}

	.flash-promo__close {
		order: 0;
		position: absolute;
		top: 6px;
		right: 6px;
	}

	.flash-promo--sticky {
		width: calc(100% - 20px);
	}

	.flash-promo--sticky.flash-promo--bottom {
		bottom: 10px;
	}
}

/* Respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
	.flash-promo--sticky,
	.flash-promo.is-urgent .flash-promo__timer {
		animation: none;
	}
}
