/*
 * Homeward & Kin Offers: the offer bar (inside Salient's Secondary Header Bar,
 * styled by the child theme's hk-chrome.css) and the product-page launch price.
 * Brand tokens come from hk-base.css (--hk-night, --hk-paper, --hk-glow …),
 * with the hex values as fallbacks.
 */

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

/* Salient slides the header up on scroll (inline translateY on #header-outer)
   to hide this strip. Keyboard focus on the strip's link or Pause/Play button
   brings it back (WCAG 2.4.11); hk-offers.js adds .hk-offer-reveal for
   browsers without :has(). */
body #header-outer.hk-offer-reveal,
body #header-outer:has(#header-secondary-outer :focus-visible) {
	transform: none !important;
}

/* Let the text column fill the strip so the items center and the button can
   sit at the end. The list clips itself; the button's focus ring must not be. */
body.hk-site #header-secondary-outer > .container > nav:has(.hk-offer-bar) {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	max-width: 100%;
}

body.hk-site #header-secondary-outer .nectar-center-text:has(> .hk-offer-bar) {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	overflow: visible;
	text-overflow: clip;
}

.hk-offer-bar {
	--hk-focus-color: var(--hk-glow, #f2a93b);
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	height: 100%;
	min-width: 0;
}

#header-secondary-outer .hk-offer-bar .hk-offer-bar__list,
.hk-offer-bar .hk-offer-bar__list {
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	float: none;
	min-width: 0;
	max-width: 100%;
	height: auto;
	margin: 0;
	padding: 5px 6px; /* Keeps the link underline and focus ring inside the clip. */
	overflow: hidden;
	list-style: none;
	white-space: nowrap;
}

#header-secondary-outer .hk-offer-bar .hk-offer-bar__item,
.hk-offer-bar .hk-offer-bar__item {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	float: none;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
	font: inherit;
	line-height: inherit;
	color: inherit;
	white-space: nowrap;
}

.hk-offer-bar .hk-offer-bar__sep {
	padding: 0 0.7em;
	opacity: 0.6;
}

.hk-offer-bar .hk-offer-bar__price {
	font-weight: 600;
	color: var(--hk-glow, #f2a93b);
}

#header-secondary-outer .hk-offer-bar a.hk-offer-bar__link,
.hk-offer-bar a.hk-offer-bar__link {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

#header-secondary-outer .hk-offer-bar a.hk-offer-bar__link:hover {
	text-decoration-thickness: 2px;
}

#header-secondary-outer .hk-offer-bar a.hk-offer-bar__link:focus-visible {
	outline: 2px solid var(--hk-glow, #f2a93b);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Visually hidden, still read (the items that aren't showing on phones). */
.hk-offer-bar .hk-offer-bar__item.is-offstage,
.hk-offer-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* One item at a time: phones before the script decides (and without it) … */
@media (max-width: 999px) {
	.hk-offer-bar:not(.is-ready) .hk-offer-bar__item:not(.is-active) {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0 0 0 0) !important;
		clip-path: inset(50%) !important;
	}

	.hk-offer-bar:not(.is-ready) .hk-offer-bar__sep {
		display: none;
	}
}

/* … and whenever the script finds the full line doesn't fit. */
#header-secondary-outer .hk-offer-bar.is-compact .hk-offer-bar__list,
.hk-offer-bar.is-compact .hk-offer-bar__list {
	padding: 0 28px; /* Room for the button (+ the item's own 5px), text stays centered. */
}

/* The launch item ("Launch price $49.95 — $59.95 after Nov 15") must fit whole on
   small phones (never "Nov …"): the text sits a little left of center there. */
@media (max-width: 419px) {
	#header-secondary-outer .hk-offer-bar.is-compact .hk-offer-bar__list,
	.hk-offer-bar.is-compact .hk-offer-bar__list {
		padding: 0 30px 0 2px;
	}
}

@media (max-width: 359px) {
	#header-secondary-outer .hk-offer-bar.is-compact .hk-offer-bar__list,
	.hk-offer-bar.is-compact .hk-offer-bar__list {
		padding: 0 28px 0 0;
		font-size: 11.5px;
	}

	#header-secondary-outer .hk-offer-bar.is-compact .hk-offer-bar__item.is-active,
	.hk-offer-bar.is-compact .hk-offer-bar__item.is-active {
		padding: 5px 2px;
	}
}

@media (max-width: 339px) {
	#header-secondary-outer .hk-offer-bar.is-compact .hk-offer-bar__list,
	.hk-offer-bar.is-compact .hk-offer-bar__list {
		font-size: 11px;
	}
}

.hk-offer-bar.is-compact .hk-offer-bar__sep {
	display: none;
}

#header-secondary-outer .hk-offer-bar.is-compact .hk-offer-bar__item.is-active,
.hk-offer-bar.is-compact .hk-offer-bar__item.is-active {
	display: block;
	box-sizing: border-box;
	max-width: 100%;
	padding: 5px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hk-offer-bar.is-compact.is-animated .hk-offer-bar__item.is-active {
	animation: hk-offer-bar-in 0.45s ease-out both;
}

@keyframes hk-offer-bar-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* Pause / Play (24 px minimum target; 28 px in the 32 px strip). */
#header-secondary-outer .hk-offer-bar .hk-offer-bar__toggle,
.hk-offer-bar .hk-offer-bar__toggle {
	position: absolute;
	top: 50%;
	right: 2px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 28px;
	height: 28px;
	min-width: 0;
	min-height: 0;
	margin: -14px 0 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	box-shadow: none;
	color: var(--hk-paper, #f6f2ea);
	opacity: 0.85;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.18s, background-color 0.18s;
}

#header-secondary-outer .hk-offer-bar .hk-offer-bar__toggle[hidden],
.hk-offer-bar .hk-offer-bar__toggle[hidden] {
	display: none;
}

#header-secondary-outer .hk-offer-bar .hk-offer-bar__toggle:hover {
	opacity: 1;
	background: rgba(246, 242, 234, 0.12);
}

#header-secondary-outer .hk-offer-bar .hk-offer-bar__toggle:focus-visible {
	opacity: 1;
	outline: 2px solid var(--hk-glow, #f2a93b);
	outline-offset: -2px;
}

.hk-offer-bar .hk-offer-bar__icon {
	display: block;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hk-offer-bar .hk-offer-bar__icon--play {
	display: none;
	fill: currentColor;
	stroke-width: 1.5;
}

.hk-offer-bar .hk-offer-bar__toggle.is-paused .hk-offer-bar__icon--pause {
	display: none;
}

.hk-offer-bar .hk-offer-bar__toggle.is-paused .hk-offer-bar__icon--play {
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.hk-offer-bar.is-compact.is-animated .hk-offer-bar__item.is-active {
		animation: none;
	}

	.hk-offer-bar .hk-offer-bar__toggle {
		transition: none;
	}
}

/* ------------------------------------------------- product-page price */

/* "Launch price $49.95" / "$59.95 after Nov 15". Font and color of the
   amount come from the page's .price rule (Besley, Lantern Brass). Class
   selectors (0,2,0) so Salient's element reset (font: inherit) doesn't win;
   area stylesheets can still override with their own, longer selectors. */
.hk-offer-price {
	display: inline-block;
}

.hk-offer-price .hk-offer-price__label {
	margin-right: 0.35em;
	font-family: var(--hk-font-body, "Libre Franklin", "Helvetica Neue", Arial, sans-serif);
	font-size: 0.5em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	vertical-align: 0.3em;
}

.hk-offer-price .hk-offer-price__after {
	display: block;
	margin-top: 8px;
	font-family: var(--hk-font-body, "Libre Franklin", "Helvetica Neue", Arial, sans-serif);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
	color: var(--hk-slate, #4d5a67);
}

.hk-offer-price .hk-offer-price__days {
	white-space: nowrap;
}
