/**
 * BoostwithMax Site Header.
 *
 * Link colours are written as `.bsh-header .bsh-...` rather than the class
 * on its own. A theme, or another plugin's stylesheet, commonly carries a
 * rule like `.some-body a { color: inherit }`, which outranks a single
 * class and would otherwise repaint the button lettering.
 *
 * Every rule is prefixed and every property is stated outright rather than
 * inherited, because this header has to sit inside whatever theme the site
 * is running: a theme rule for `header`, `nav`, `ul` or `a` must not be
 * able to reshape it. Colours come from the custom properties printed with
 * the stylesheet, so the palette is set in one place.
 */

.bsh-header {
	--bsh-height: 74px;

	position: relative;
	z-index: 999;
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0;
	background: var(--bsh-surface, #fff);
	border-bottom: 1px solid var(--bsh-border, #e5e7eb);
	font-family: inherit;
	line-height: 1.4;
	text-align: left;
}

.bsh-header *,
.bsh-header *::before,
.bsh-header *::after { box-sizing: border-box; }

.bsh-header--brand { background: var(--bsh-primary, #00696e); border-bottom-color: transparent; }
.bsh-header--shadow { box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07); }
.bsh-header--sticky { position: sticky; top: 0; }
.admin-bar .bsh-header--sticky { top: 32px; }

.bsh-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	width: min(100% - 40px, var(--bsh-container, 1200px));
	min-height: var(--bsh-height);
	margin: 0 auto;
	padding: 10px 0;
}

/* Brand ------------------------------------------------------------------- */

.bsh-header .bsh-header__brand {
	display: flex;
	flex: none;
	align-items: center;
	max-width: 54%;
	padding: 0;
	border: 0;
	text-decoration: none;
	box-shadow: none;
}

.bsh-header__logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: var(--bsh-logo-height, 46px);
	margin: 0;
	object-fit: contain;
}

.bsh-header .bsh-header__name {
	margin: 0;
	color: var(--bsh-text, #111);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none;
}

.bsh-header--brand .bsh-header__name { color: var(--bsh-on-primary, #fff); }

/* Menu -------------------------------------------------------------------- */

.bsh-header__nav {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: flex-end;
	gap: 28px;
	min-width: 0;
}

.bsh-header--menu-centre .bsh-menu { margin: 0 auto; }

.bsh-header__panelhead { display: none; }

.bsh-menu {
	display: flex;
	align-items: center;
	gap: 2px;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

.bsh-menu::-webkit-scrollbar { display: none; }

.bsh-menu__item {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bsh-menu__item::marker { content: none; }

.bsh-header .bsh-menu__link {
	display: inline-flex;
	align-items: center;
	padding: 10px 12px;
	border: 0;
	border-radius: 6px;
	color: var(--bsh-text, #111);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: none;
}

.bsh-menu__link:hover,
.bsh-header .bsh-menu__link:focus { color: var(--bsh-accent, #008186); text-decoration: none; }
.bsh-header .bsh-menu__link.is-current { color: var(--bsh-accent, #008186); font-weight: 600; }

.bsh-header .bsh-menu__link.is-current::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 4px;
	height: 2px;
	border-radius: 2px;
	background: var(--bsh-accent, #008186);
}

.bsh-header--brand .bsh-menu__link { color: var(--bsh-on-primary, #fff); opacity: 0.88; }
.bsh-header--brand .bsh-menu__link:hover,
.bsh-header--brand .bsh-menu__link:focus,
.bsh-header--brand .bsh-menu__link.is-current { color: var(--bsh-on-primary, #fff); opacity: 1; }
.bsh-header--brand .bsh-menu__link.is-current::after { background: var(--bsh-on-primary, #fff); }

.bsh-menu__toggle {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	margin: 0 0 0 -8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: inherit;
	cursor: pointer;
}

.bsh-header--brand .bsh-menu__toggle { color: var(--bsh-on-primary, #fff); }

.bsh-submenu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 5;
	min-width: 220px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--bsh-surface, #fff);
	border: 1px solid var(--bsh-border, #e5e7eb);
	border-radius: 10px;
	box-shadow: 0 12px 34px rgba(16, 24, 40, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

.bsh-menu__item:hover > .bsh-submenu,
.bsh-menu__item:focus-within > .bsh-submenu,
.bsh-menu__item.is-open > .bsh-submenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.bsh-submenu li { margin: 0; padding: 0; list-style: none; }

.bsh-header .bsh-submenu__link {
	display: block;
	padding: 9px 12px;
	border-radius: 6px;
	color: var(--bsh-text, #111);
	font-size: 14.5px;
	text-decoration: none;
}

.bsh-submenu__link:hover,
.bsh-header .bsh-submenu__link:focus { background: rgba(0, 0, 0, 0.04); color: var(--bsh-accent, #008186); }
.bsh-header .bsh-submenu__link.is-current { color: var(--bsh-accent, #008186); font-weight: 600; }

/* Actions ----------------------------------------------------------------- */

.bsh-header__actions { display: flex; flex: none; align-items: center; gap: 16px; }

.bsh-header .bsh-header__account {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--bsh-text, #111);
	font-size: 14.5px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.bsh-header .bsh-header__account:hover { color: var(--bsh-accent, #008186); }
.bsh-header--brand .bsh-header__account { color: var(--bsh-on-primary, #fff); }

.bsh-header .bsh-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 6px;
	background: var(--bsh-primary, #00696e);
	color: var(--bsh-on-primary, #fff);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.bsh-header__cta:hover,
.bsh-header .bsh-header__cta:focus { background: var(--bsh-primary-dark, #004e52); color: var(--bsh-on-primary, #fff); text-decoration: none; }

.bsh-header--brand .bsh-header__cta { background: var(--bsh-surface, #fff); color: var(--bsh-primary, #00696e); }
.bsh-header--brand .bsh-header__cta:hover { background: var(--bsh-accent, #008186); color: var(--bsh-on-accent, #fff); }

.bsh-header__burger,
.bsh-header__close {
	display: none;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0 0 0 auto;
	padding: 0;
	border: 1px solid var(--bsh-border, #e5e7eb);
	border-radius: 8px;
	background: var(--bsh-surface, #fff);
	color: var(--bsh-text, #111);
	cursor: pointer;
}

.bsh-header--brand .bsh-header__burger { background: transparent; border-color: rgba(255, 255, 255, 0.32); color: var(--bsh-on-primary, #fff); }

.bsh-header__brand:focus-visible,
.bsh-menu__link:focus-visible,
.bsh-submenu__link:focus-visible,
.bsh-menu__toggle:focus-visible,
.bsh-header__cta:focus-visible,
.bsh-header__account:focus-visible,
.bsh-header__burger:focus-visible,
.bsh-header__close:focus-visible { outline: 2px solid var(--bsh-accent, #008186); outline-offset: 2px; }

.bsh-header--brand .bsh-menu__link:focus-visible,
.bsh-header--brand .bsh-header__burger:focus-visible { outline-color: var(--bsh-on-primary, #fff); }

.bsh-header__scrim {
	position: fixed;
	inset: 0;
	z-index: 998;
	background: rgba(0, 0, 0, 0.45);
}

.bsh-header__scrim[hidden] { display: none; }

/* Drawer ------------------------------------------------------------------ */

@media (max-width: 1040px) {
	.bsh-header { --bsh-height: 64px; }
	.bsh-header__inner { gap: 12px; }
	.bsh-header__burger { display: grid; }

	.bsh-header__nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 999;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		width: min(330px, 88vw);
		padding: 0 20px 28px;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--bsh-surface, #fff);
		box-shadow: -12px 0 44px rgba(0, 0, 0, 0.2);
		visibility: hidden;
		transform: translateX(100%);
		transition: transform 0.24s ease, visibility 0s linear 0.24s;
	}

	.bsh-header__nav.is-open { visibility: visible; transform: translateX(0); transition: transform 0.24s ease; }

	.bsh-header__panelhead {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: 0 -20px 6px;
		padding: 16px 20px;
		border-bottom: 1px solid var(--bsh-border, #e5e7eb);
		color: var(--bsh-text, #111);
		font-size: 15px;
		font-weight: 600;
	}

	.bsh-header__close { display: grid; width: 40px; height: 40px; margin: 0; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.05); }

	.bsh-menu { flex-direction: column; align-items: stretch; gap: 0; overflow: visible; }
	.bsh-menu__item { flex-wrap: wrap; border-bottom: 1px solid var(--bsh-border, #e5e7eb); }

	.bsh-header .bsh-menu__link {
		flex: 1;
		min-height: 54px;
		padding: 12px 0;
		border-radius: 0;
		color: var(--bsh-text, #111);
		font-size: 16.5px;
		white-space: normal;
	}

	.bsh-header .bsh-menu__link.is-current::after { left: 0; right: auto; bottom: 12px; width: 18px; }

	.bsh-menu__toggle { width: 42px; height: 42px; margin: 0; color: var(--bsh-text, #111); opacity: 0.6; }
	.bsh-menu__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

	.bsh-submenu {
		position: static;
		display: none;
		width: 100%;
		min-width: 0;
		margin: 0 0 10px;
		padding: 2px 0 2px 14px;
		border: 0;
		border-left: 2px solid var(--bsh-border, #e5e7eb);
		border-radius: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}

	.bsh-menu__item.is-open > .bsh-submenu { display: block; }
	.bsh-header .bsh-submenu__link { padding: 12px 0; font-size: 15.5px; }

	.bsh-header__actions { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 22px; }
	.bsh-header .bsh-header__account { min-height: 44px; }
	.bsh-header .bsh-header__cta { width: 100%; min-height: 50px; }

	/* The drawer is always white, whatever colour the bar is. */
	.bsh-header--brand .bsh-menu__link,
	.bsh-header--brand .bsh-header__account { color: var(--bsh-text, #111); opacity: 1; }
	.bsh-header--brand .bsh-menu__toggle { color: var(--bsh-text, #111); }
	.bsh-header--brand .bsh-menu__link:hover,
	.bsh-header--brand .bsh-menu__link.is-current { color: var(--bsh-accent, #008186); }
	.bsh-header--brand .bsh-menu__link.is-current::after { background: var(--bsh-accent, #008186); }
	.bsh-header--brand .bsh-header__cta { background: var(--bsh-primary, #00696e); color: var(--bsh-on-primary, #fff); }
}

@media (max-width: 560px) {
	.bsh-header__inner { width: min(100% - 28px, var(--bsh-container, 1200px)); }
	.bsh-header .bsh-header__brand { max-width: 66%; }
}

@media (prefers-reduced-motion: reduce) {
	.bsh-header__nav,
	.bsh-submenu { transition: none; }
}
