/* ------------------------------------------------------------ *\
	Home announcement bar — Figma "HP - BANDEAU A" (node 2468:7130).
	Maroon bar fixed above the (already fixed) v3 header, front page only.
	The header + main are pushed down by the bar's height, exposed as
	--v3-topbar-h (set by topbar.js, falls back to 56px). Everything is scoped
	to body.has-topbar so dismissing the bar (topbar.js removes the class)
	restores the default header/main layout with no leftover gap.
\* ------------------------------------------------------------ */

.v3-topbar {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 71; /* just above the resting header (z-index:70), below overlays (drawer/megamenu:80, search:90, modals) */
	width: 100%;
	background: var(--bva-canelle-400);
	color: var(--bva-white);
}

.v3-topbar[hidden] {
	display: none;
}

/* Legacy V2 views: the header is static, so the bar simply sits above it in flow.
   Admin bar offset is handled by WP's own html margin there. base.css (.shell
   gutters) isn't loaded on V2, so the inner gutters are restated here. */
.v3-topbar.v3-topbar--static,
body.admin-bar .v3-topbar.v3-topbar--static {
	position: static;
	margin-top: 0;
}

.v3-topbar--static .v3-topbar__inner {
	max-width: none; /* legacy dist/main.css has its own centred .shell (1252px) */
	margin: 0;
	padding-left: 40px;
	padding-right: 40px;
}
@media (max-width: 835px) {
	.v3-topbar--static .v3-topbar__inner {
		padding-left: 13px;
		padding-right: 13px;
	}
}

/* Horizontal gutters come from .shell--fluid (40px desktop / 13px mobile),
   matching the header so the bar's edges line up with it. */
.v3-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 56px;
	padding-top: 12px;
	padding-bottom: 12px;
	box-sizing: border-box;
}

.v3-topbar__text {
	display: flex;
	align-items: center;
	gap: 24px;
	min-width: 0;
}

.v3-topbar__title {
	margin: 0;
	font: var(--bva-t-paragraphe); /* Geist 400 18px/1.32 */
	color: var(--bva-white);
}

/* Countdown pill (scheduled promo). Typography = the link's (500 14px/1.1 Geist,
   uppercase); tabular digits keep the value at a fixed width while ticking.
   Outlined so the filled white pill stays the bar's only call to action. */
.v3-topbar__timer {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0 12px;
	height: 28px;
	border: 1px solid var(--bva-white);
	border-radius: 999px;
	box-sizing: border-box;
	font: 500 14px/1.1 var(--bva-font-sans);
	text-transform: uppercase;
	color: var(--bva-white);
	white-space: nowrap;
}

.v3-topbar__timer-value {
	font-variant-numeric: tabular-nums;
}

/* CTA pill. 32px tall + the 12px inner padding keeps the bar at its 56px. */
.v3-topbar__link {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 20px;
	border-radius: 999px;
	background: var(--bva-white);
	font: 500 14px/1.1 var(--bva-font-sans);
	color: var(--bva-canelle-400);
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease;
}

.v3-topbar__link:hover,
.v3-topbar__link:focus-visible {
	background: var(--bva-canelle-100);
	color: var(--bva-canelle-400);
	text-decoration: none;
}

.v3-topbar__link:focus-visible {
	outline: 2px solid var(--bva-white);
	outline-offset: 2px;
}

.v3-topbar__close {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.v3-topbar__close svg {
	display: block;
	width: 24px;
	height: 24px;
}

/* Offset the fixed header + page content below the bar (front page only).
   var is updated by v3.js to the bar's real height; 56px is the desktop fallback. */
body.has-topbar .header-main {
	top: var(--v3-topbar-h, 56px);
}

body.has-topbar .main {
	margin-top: var(--v3-topbar-h, 56px);
}

/* Admin bar: push the fixed bar down like the theme does for the fixed header
   (base.css), so the two stay stacked under the WP admin bar in logged-in views. */
body.admin-bar .v3-topbar {
	margin-top: 32px;
}
@media (max-width: 782px) {
	body.admin-bar .v3-topbar {
		margin-top: 46px;
	}
}

/* Mobile: no dedicated mockup for the bar yet — best-effort. Smaller type, the
   title may wrap; the real height is measured by v3.js so the offsets stay exact. */
@media (max-width: 835px) {
	.v3-topbar__inner {
		position: relative;
		display: block;
		min-height: 44px;
		padding-top: 10px;
		padding-bottom: 10px;
	}

	/* Centred stack. Symmetric side padding reserves the close button's column on
	   both sides so the text is centred on the viewport, not on the leftover space. */
	.v3-topbar__text {
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
		gap: 8px 12px;
		padding: 0 32px;
		text-align: center;
	}

	.v3-topbar__title {
		font-size: 13px;
		line-height: 1.25;
	}

	/* With a countdown: title on its own row, pill + link share the second one.
	   Without: title + link stay inline (wrap only if the copy is long). */
	.v3-topbar--countdown .v3-topbar__title {
		flex-basis: 100%;
	}

	.v3-topbar__timer {
		height: 24px;
		padding: 0 10px;
		font-size: 11px;
	}

	.v3-topbar__link {
		height: 24px;
		padding: 0 12px;
		font-size: 11px;
	}

	/* Close icon on the first text line (13px × 1.25 ≈ 16px vs 24px icon → -4px). */
	.v3-topbar__close {
		position: absolute;
		top: 6px;
		right: 13px;
	}

	body.has-topbar .header-mobile {
		top: var(--v3-topbar-h, 44px);
	}

	/* Existing mobile header offset (43px) + the bar height. */
	body.has-topbar .main {
		margin-top: calc(43px + var(--v3-topbar-h, 44px));
	}

	/* Home v3: transparent overlay header — offset by the bar height only so the
	   hero slides under the header (matches base.css home override). Higher
	   specificity than the rule above, so it wins on the front page. */
	body.has-topbar.page-template-home-v3 .main {
		margin-top: var(--v3-topbar-h, 44px);
	}
}
