/*
 * Free Shipping Nudge — front-end styles.
 * ~2 KB uncompressed, no dependencies (03 §13 performance budget).
 */

.tpl-fsn-mount {
	box-sizing: border-box;
}

.tpl-fsn-mount--hidden {
	display: none !important;
}

/* ---------------------------------------------------------------- Bar */

.tpl-fsn-mount--bar {
	/* Bug found on staging (2026-08-02): this was left at `position: relative`
	 * — i.e. never actually sticky — despite the z-index comment below only
	 * making sense if it were. `sticky` (not `fixed`) is deliberate: it
	 * self-compensates for its own height in normal document flow, so no
	 * body padding-top hack is needed to stop it overlapping the content
	 * that follows, and it degrades harmlessly to normal in-flow positioning
	 * if any ancestor between this and <body> ever gets an overflow
	 * property that breaks sticky (none does today, via wp_body_open). */
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5em 0.75em;
	min-height: 44px; /* fixed from first paint — no layout shift on text swap (02 §5.7) */
	padding: 10px 44px;
	text-align: center;
	font-size: 14px;
	line-height: 1.4;
	/* Confirmed on staging (2026-08-02): Blocksy's own sticky header also
	 * pins to top:0, and the two visually overlapped. tpl-fsn.js now sets
	 * Blocksy's own `--header-sticky-offset` custom property (declared in
	 * the theme, default 0px) to this bar's real measured height, so
	 * Blocksy's header offsets itself below the bar instead of colliding
	 * with it — see updateHeaderStickyOffset() in tpl-fsn.js for why that
	 * variable, specifically, was the right integration point. z-index kept
	 * as a defensive fallback: if that offset mechanism doesn't fully work,
	 * the bar staying visually on top is the safer failure mode than being
	 * hidden behind the header. Re-check this exact scenario — T14's
	 * "Blocksy sticky header: bar never overlaps navigation at any scroll
	 * position" — on the next staging pass. */
	z-index: 999;
}

.tpl-fsn-msg strong {
	font-weight: 700;
}

.tpl-fsn-cta {
	color: inherit;
	text-decoration: underline;
	white-space: nowrap;
}

.tpl-fsn-progress {
	display: none; /* revealed by tpl-fsn.js once real percent data exists */
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(0, 0, 0, 0.15);
}

.tpl-fsn-progress span {
	display: block;
	height: 100%;
	width: 0%;
	background: currentColor;
	transition: width 0.3s ease;
}

.tpl-fsn-dismiss {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.tpl-fsn-dismiss:focus-visible,
.tpl-fsn-cta:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * bar_position "below the header": the setting and this class exist, but
 * wp_body_open (this surface's only hook, per 03 §9.2) fires structurally
 * BEFORE any theme header markup — there is no CSS-only way to move it
 * after Blocksy's header without knowing Blocksy's exact header height/DOM,
 * which hasn't been verified against a live render. "Above" (the default,
 * and the store's actual chosen setting per 01 §9) works correctly.
 * "Below" is a known, documented gap — verify visually on staging before
 * relying on it; 05 roadmap flags this explicitly.
 */
.tpl-fsn-position--below {
}

/* ------------------------------------------------------------- Badge */

.tpl-fsn-mount--badge {
	display: block;
	margin: 10px 0;
	font-size: 13px;
	line-height: 1.4;
	min-height: 1.4em; /* avoid reflow when JS swaps text length */
}

.tpl-fsn-mount--badge .tpl-fsn-msg strong {
	font-weight: 600;
}

/* ---------------------------------------------------- Cart / drawer progress */

.tpl-fsn-mount--progress {
	margin: 12px 0;
	font-size: 14px;
	line-height: 1.5;
}

.tpl-fsn-mount--progress .tpl-fsn-progress {
	position: relative;
	display: block; /* always visible — this mount only exists when there's a real percent to show */
	height: 6px;
	margin-top: 6px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 3px;
	overflow: hidden;
}

.tpl-fsn-mount--progress .tpl-fsn-progress span {
	background: currentColor;
}

/* ------------------------------------------------------------- Suggestions */

.tpl-fsn-mount--suggestions {
	margin: 16px 0;
}

.tpl-fsn-suggest-heading {
	font-weight: 600;
	margin: 0 0 4px;
}

.tpl-fsn-suggest-subheading {
	margin: 0 0 10px;
	opacity: 0.8;
	font-size: 13px;
}

.tpl-fsn-suggest-list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tpl-fsn-suggest-card {
	flex: 0 0 140px;
	max-width: 140px;
	text-align: center;
	font-size: 12px;
}

.tpl-fsn-suggest-image {
	display: block;
}

.tpl-fsn-suggest-image img {
	width: 100%;
	height: auto;
	display: block;
	margin-bottom: 6px;
}

.tpl-fsn-suggest-name {
	display: block;
	color: inherit;
	text-decoration: none;
	margin-bottom: 2px;
}

.tpl-fsn-suggest-price {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.tpl-fsn-suggest-add {
	display: inline-block;
	font-size: 12px;
	padding: 6px 10px;
	text-decoration: none;
}

.tpl-fsn-suggest-add:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
