/**
 * ServerFellows sticky offer bar.
 *
 * @package Astra
 */

.sf-offer-bar {
	--sf-offer-bg: #8d1517;
	--sf-offer-fg: #ffffff;
	--sf-offer-muted: #f0cdce;
	/* CTA reads as white-on-red; the badge uses gold so the two don't flatten
	   into each other against the deep red ground. */
	--sf-offer-accent: #ffffff;
	--sf-offer-accent-fg: #8d1517;
	--sf-offer-accent-hover: #ffe9e9;
	--sf-offer-badge: #f7c948;
	--sf-offer-badge-fg: #4a2800;

	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999;
	background: var(--sf-offer-bg);
	color: var(--sf-offer-fg);
	box-shadow: 0 -2px 20px rgba(45, 6, 7, 0.35);
	transform: translateY(100%);
	transition: transform 0.28s ease;
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.sf-offer-bar.is-visible {
	transform: translateY(0);
}

.sf-offer-bar__inner {
	display: flex;
	align-items: center;
	gap: 1.25em;
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.2em 3em 1.2em 1.25em;
	position: relative;
}

/* Copy ------------------------------------------------------------------- */

.sf-offer-bar__copy {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	min-width: 0;
	flex: 1 1 auto;
}

.sf-offer-bar__eyebrow {
	align-self: flex-start;
	background: var(--sf-offer-badge);
	color: var(--sf-offer-badge-fg);
	font-size: 0.65em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.2em 0.6em;
	border-radius: 999px;
	line-height: 1.6;
}

.sf-offer-bar__plan {
	font-size: 1em;
	font-weight: 700;
	line-height: 1.3;
}

.sf-offer-bar__pitch {
	font-size: 0.8em;
	color: var(--sf-offer-muted);
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Price ------------------------------------------------------------------ */

.sf-offer-bar__price {
	flex: 0 0 auto;
	display: flex;
	align-items: baseline;
	gap: 0.4em;
	white-space: nowrap;
}

.sf-offer-bar__was {
	font-size: 0.8em;
	color: var(--sf-offer-muted);
	text-decoration: line-through;
}

.sf-offer-bar__now {
	font-size: 1.15em;
	font-weight: 700;
}

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

.sf-offer-bar__timer {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.5em;
	white-space: nowrap;
}

.sf-offer-bar__timer[hidden] {
	display: none;
}

.sf-offer-bar__timer-label {
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sf-offer-muted);
}

.sf-offer-bar__clock {
	display: flex;
	gap: 0.3em;
	/* Digits change every second; a tabular figure stops the bar jittering. */
	font-variant-numeric: tabular-nums;
}

.sf-offer-bar__unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 5px;
	padding: 0.2em 0.45em;
	min-width: 2.6em;
}

.sf-offer-bar__unit-value {
	font-size: 0.95em;
	font-weight: 700;
	line-height: 1.2;
}

.sf-offer-bar__unit-label {
	font-size: 0.58em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--sf-offer-muted);
}

/* CTA and dismiss -------------------------------------------------------- */

.sf-offer-bar__cta,
.sf-offer-bar__cta:visited {
	flex: 0 0 auto;
	background: var(--sf-offer-accent);
	color: var(--sf-offer-accent-fg);
	font-weight: 700;
	font-size: 0.9em;
	line-height: 1.2;
	padding: 0.8em 1.4em;
	border-radius: 6px;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.2s ease, transform 0.2s ease;
}

.sf-offer-bar__cta:hover,
.sf-offer-bar__cta:focus {
	background: var(--sf-offer-accent-hover);
	color: var(--sf-offer-accent-fg);
	transform: translateY(-1px);
}

.sf-offer-bar__close {
	position: absolute;
	top: 50%;
	right: 0.5em;
	transform: translateY(-50%);
	background: none;
	border: 0;
	color: var(--sf-offer-muted);
	font-size: 1.4em;
	line-height: 1;
	padding: 0.25em 0.45em;
	cursor: pointer;
	border-radius: 4px;
}

.sf-offer-bar__close:hover,
.sf-offer-bar__close:focus {
	color: var(--sf-offer-fg);
	background: rgba(255, 255, 255, 0.1);
}

.sf-offer-bar__cta:focus-visible,
.sf-offer-bar__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Keep the bar clear of page content and of Astra's scroll-to-top button. */
body.sf-offer-bar-active {
	padding-bottom: var(--sf-offer-bar-height, 0px);
}

body.sf-offer-bar-active #ast-scroll-top {
	bottom: calc(var(--sf-offer-bar-height, 0px) + 30px);
}

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

@media (max-width: 921px) {
	.sf-offer-bar__pitch {
		display: none;
	}

	.sf-offer-bar__inner {
		gap: 0.9em;
	}
}

@media (max-width: 600px) {
	.sf-offer-bar__inner {
		flex-wrap: wrap;
		gap: 0.5em 0.75em;
		padding: 1em 2.5em 1em 0.9em;
	}

	.sf-offer-bar__copy {
		flex: 1 1 100%;
		flex-direction: row;
		align-items: center;
		gap: 0.5em;
	}

	.sf-offer-bar__eyebrow {
		align-self: center;
	}

	.sf-offer-bar__plan {
		font-size: 0.9em;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.sf-offer-bar__timer-label {
		display: none;
	}

	.sf-offer-bar__cta {
		flex: 1 1 auto;
		text-align: center;
		padding: 0.7em 1em;
	}

	.sf-offer-bar__unit {
		min-width: 2.3em;
		padding: 0.15em 0.35em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sf-offer-bar {
		transition: none;
	}

	.sf-offer-bar__cta:hover,
	.sf-offer-bar__cta:focus {
		transform: none;
	}
}

@media print {
	.sf-offer-bar {
		display: none;
	}
}
