/* Better Homes: header (template-parts/header/header.php, assets/js/header.js, inc/header.php).
 * Colours come from the Customizer as CSS variables on .bh-header. */

.bh-header {
	--bh-topbar-bg: var(--wd-primary-color, #370d1d);
	--bh-topbar-color: #fff;
	--bh-header-bg: #ffffff;
	--bh-menu-bg: var(--bh-brand-soft, #f7f0f3);
	--bh-menu-color: #242424;
	--bh-ink: #242424;
	--bh-accent: var(--wd-primary-color, #370d1d);
	--bh-basket-bg: var(--btn-accented-bgcolor, var(--bh-accent));
	--bh-topbar-h: 0px;
	--bh-logo-h: 56px;
	position: sticky;
	/* The top bar scrolls away; the logo/search row and the menu stay at the top. */
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--bh-topbar-h));
	z-index: 390;
	font-family: "Poppins", "Poppins Fallback", Arial, Helvetica, sans-serif;
	color: var(--bh-ink);
}

.bh-header.has-topbar {
	--bh-topbar-h: 40px;
}

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

.bh-header__container {
	width: 100%;
	max-width: var(--wd-container-w, 1440px);
	margin: 0 auto;
	padding: 0 15px;
}

/* ---------- Top bar ---------- */
.bh-topbar {
	display: flex;
	align-items: center;
	height: var(--bh-topbar-h);
	overflow: hidden;
	background: var(--bh-topbar-bg);
	color: var(--bh-topbar-color);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .01em;
}

.bh-topbar a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bh-topbar__single {
	width: 100%;
	margin: 0;
	padding: 0 15px;
	overflow: hidden;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bh-topbar__viewport {
	width: 100%;
	overflow: hidden;
	/* Soft fade at both ends. */
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
	mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

.bh-topbar__track {
	display: flex;
	width: max-content;
}

.bh-topbar__group {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
}

.bh-topbar__msg,
.bh-topbar__sep {
	flex: 0 0 auto;
	white-space: nowrap;
}

.bh-topbar__sep {
	padding: 0 28px;
	opacity: .75;
}

/* Moves once measured (inline script after the bar, inc/header.php), from where it was on the last page. */
.bh-topbar.is-ready .bh-topbar__track {
	animation: bh-marquee var(--bh-marquee-dur, 30s) linear var(--bh-marquee-delay, 0s) infinite;
}

.bh-topbar.is-ready:hover .bh-topbar__track,
.bh-topbar.is-ready:focus-within .bh-topbar__track {
	animation-play-state: paused;
}

@keyframes bh-marquee {
	to {
		transform: translateX(-50%);
	}
}

/* ---------- Main row: logo | search | icons ---------- */
.bh-mainbar {
	background: var(--bh-header-bg);
}

.bh-mainbar__inner {
	display: grid;
	grid-template-columns: minmax(150px, 1fr) minmax(0, 680px) minmax(150px, 1fr);
	align-items: center;
	gap: 32px;
	min-height: calc(var(--bh-logo-h) + 28px);
	padding-top: 14px;
	padding-bottom: 14px;
}

.bh-logo {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	color: var(--bh-ink);
	text-decoration: none;
}

.bh-logo__img {
	display: block;
	width: auto;
	height: var(--bh-logo-h);
	max-width: 240px;
	object-fit: contain;
}

.bh-logo__text {
	font-size: 24px;
	font-weight: 700;
}

/* ---------- Search ---------- */
.bh-search {
	position: relative;
	width: 100%;
	margin: 0;
}

/* A still outline, with the same rounded corners as the basket button; the brand colour while typing. */
.bh-search {
	--bh-search-radius: var(--btn-brd-radius, 6px);
}

.bh-search__ring {
	border: 1.5px solid #d8cdd2;
	border-radius: var(--bh-search-radius);
	background: #fff;
	transition: border-color .2s ease;
}

.bh-search__ring:hover {
	border-color: #bfaeb5;
}

.bh-search:focus-within .bh-search__ring {
	border-color: var(--bh-accent);
}

.bh-search__field {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 49px;
	padding: 0 4px 0 16px;
	border-radius: var(--bh-search-radius);
	background: #fff;
}

.bh-search__icon {
	flex: 0 0 auto;
	overflow: visible;
	color: var(--bh-accent);
}

.bh-search__star {
	transform-box: fill-box;
	transform-origin: center;
	animation: bh-twinkle 2.4s ease-in-out infinite;
}

.bh-search__star--2 {
	animation-delay: 1.2s;
}

@keyframes bh-twinkle {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}

	50% {
		opacity: .35;
		transform: scale(.6);
	}
}

.bh-header .bh-search__input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bh-ink);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.2;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.bh-header .bh-search__input::placeholder {
	color: #7a7a7a;
	opacity: 1;
}

.bh-header .bh-search__input::-webkit-search-decoration,
.bh-header .bh-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.bh-header .bh-search__submit {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: max(2px, calc(var(--bh-search-radius) - 2px)); /* sits inside the field: a touch tighter */
	background: var(--bh-accent);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transition: transform .2s ease, filter .2s ease;
}

.bh-header .bh-search__submit:hover {
	filter: brightness(1.08);
	transform: translateX(2px);
}

.bh-header .bh-search__submit:focus-visible {
	outline: 2px solid var(--bh-ink);
	outline-offset: 2px;
}

/* Suggestions panel */
.bh-search__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	left: 0;
	z-index: 20;
	max-height: min(70vh, 560px);
	padding: 14px;
	overflow-y: auto;
	border: 1px solid #ebe9e1;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
	animation: bh-panel-in .18s ease;
	overscroll-behavior: contain;
}

.bh-search__panel[hidden] {
	display: none;
}

@keyframes bh-panel-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

.bh-search__hint {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 2px 4px;
	color: #555;
	font-size: 13px;
	line-height: 1.4;
}

.bh-search__badge {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 999px;
	background: linear-gradient(120deg, var(--bh-brand, #370d1d), #a8586f);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
}

.bh-search__results:not(:empty) {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #f0eee7;
}

.bh-search__heading {
	margin: 0 4px 8px;
	color: #8a8a8a;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.bh-search__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

.bh-search__cats li {
	margin: 0;
	list-style: none;
}

.bh-search__cat {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 0 14px;
	border: 1px solid #e3e1d8;
	border-radius: 999px;
	background: var(--bh-brand-soft, #f7f0f3);
	color: var(--bh-ink);
	font-size: 13px;
	text-decoration: none;
	transition: border-color .15s ease, background .15s ease;
}

.bh-search__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bh-search__list li {
	margin: 0;
	list-style: none;
}

.bh-search__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 10px;
	color: var(--bh-ink);
	text-decoration: none;
	transition: background .15s ease;
}

.bh-search__cat:hover,
.bh-search__cat.is-active {
	border-color: var(--bh-accent);
	background: #fff;
}

.bh-search__item:hover,
.bh-search__item.is-active {
	background: var(--bh-brand-soft, #f7f0f3);
}

.bh-search__thumb {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 8px;
	background: var(--bh-brand-soft, #f7f0f3);
	object-fit: cover;
}

.bh-search__name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.bh-search__price {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 600;
	text-align: end;
	white-space: nowrap;
}

.bh-search__price del {
	display: block;
	color: #8a8a8a;
	font-size: 12px;
	font-weight: 400;
}

.bh-search__all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
	padding: 12px;
	border-radius: 10px;
	background: var(--bh-brand-soft, #f7f0f3);
	color: var(--bh-ink);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.bh-search__all:hover,
.bh-search__all.is-active {
	background: var(--bh-brand-soft-2, #f1e4ea);
}

.bh-search__msg {
	margin: 4px;
	color: #666;
	font-size: 14px;
}

.bh-search__loading {
	height: 3px;
	margin: 4px;
	overflow: hidden;
	border-radius: 3px;
	background: var(--bh-brand-soft-2, #f1e4ea);
}

.bh-search__loading::before {
	content: "";
	display: block;
	width: 35%;
	height: 100%;
	border-radius: inherit;
	background: var(--bh-accent);
	animation: bh-loading 1s ease-in-out infinite;
}

@keyframes bh-loading {
	from {
		transform: translateX(-100%);
	}

	to {
		transform: translateX(300%);
	}
}

/* ---------- Icons: account, wishlist, basket ---------- */
.bh-tools {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 6px;
}

.bh-tool {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	color: var(--bh-ink);
	text-decoration: none;
	transition: background .2s ease;
}

.bh-tool:hover {
	background: rgba(0, 0, 0, .06);
	color: var(--bh-ink);
}

.bh-tool:focus-visible,
.bh-basket:focus-visible {
	outline: 2px solid var(--bh-ink);
	outline-offset: 2px;
}

.bh-tool__count,
.bh-basket__count {
	position: absolute;
	top: 3px;
	right: 2px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--bh-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.bh-tool__count[data-count="0"],
.bh-tool__count:empty {
	display: none;
}

.bh-basket {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 46px;
	margin-left: 6px;
	padding: 0 20px 0 16px;
	border-radius: var(--btn-brd-radius, 6px);
	background: var(--bh-basket-bg);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: filter .2s ease, transform .2s ease;
}

.bh-basket:hover {
	color: #fff;
	filter: brightness(1.08);
}

.bh-basket:active {
	transform: scale(.98);
}

.bh-basket__icon {
	position: relative;
	display: inline-flex;
}

.bh-basket__count {
	top: -8px;
	right: -10px;
	border: 2px solid var(--bh-basket-bg);
	background: #fff;
	color: var(--bh-ink);
}

.bh-basket.has-items .bh-basket__label {
	animation: bh-pop .35s ease;
}

@keyframes bh-pop {
	50% {
		transform: scale(1.08);
	}
}

/* ---------- Menu row ---------- */
.bh-menubar {
	border-top: 1px solid rgba(0, 0, 0, .06);
	background: var(--bh-menu-bg);
}

.bh-header .bh-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bh-header .bh-menu li {
	position: relative;
	margin: 0;
	list-style: none;
}

.bh-header .bh-menu > li > a {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 50px;
	padding: 0 14px;
	color: var(--bh-menu-color);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

/* Underline that grows on hover / for the current page. */
.bh-header .bh-menu > li > a::before {
	content: "";
	position: absolute;
	right: 14px;
	bottom: 10px;
	left: 14px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s ease;
}

.bh-header .bh-menu > li:hover > a::before,
.bh-header .bh-menu > li:focus-within > a::before,
.bh-header .bh-menu > .current-menu-item > a::before,
.bh-header .bh-menu > .current-menu-ancestor > a::before {
	transform: scaleX(1);
}

.bh-header .bh-menu .menu-item-has-children > a::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -3px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s ease;
}

.bh-header .bh-menu > .menu-item-has-children:hover > a::after,
.bh-header .bh-menu > .menu-item-has-children.is-open > a::after {
	transform: translateY(3px) rotate(225deg);
}

/* Dropdowns */
.bh-header .bh-menu .sub-menu {
	position: absolute;
	top: calc(100% - 4px);
	left: 0;
	z-index: 30;
	min-width: 230px;
	margin: 0;
	padding: 8px;
	border: 1px solid #ebe9e1;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 36px rgba(0, 0, 0, .12);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.bh-header .bh-menu .sub-menu .sub-menu {
	top: -9px;
	left: 100%;
	margin-left: 6px;
}

.bh-header .bh-menu li:hover > .sub-menu,
.bh-header .bh-menu li:focus-within > .sub-menu,
.bh-header .bh-menu li.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

.bh-header .bh-menu li.is-closed > .sub-menu {
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
}

.bh-header .bh-menu .sub-menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--bh-ink);
	font-size: 14px;
	font-weight: 400;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s ease;
}

.bh-header .bh-menu .sub-menu a:hover,
.bh-header .bh-menu .sub-menu a:focus-visible,
.bh-header .bh-menu .sub-menu .current-menu-item > a {
	background: var(--bh-brand-soft, #f7f0f3);
}

.bh-header .bh-menu .sub-menu .menu-item-has-children > a::after {
	margin-top: 0;
	transform: rotate(-45deg);
}

.bh-header .bh-menu a:focus-visible {
	outline: 2px solid var(--bh-ink);
	outline-offset: -2px;
	border-radius: 6px;
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1200px) {
	.bh-mainbar__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: 24px;
	}
}

/* ---------- Phones and tablets (up to 1024px) ----------
 *   [menu] [logo]             [heart] [account] [basket]
 *   [search ................................................]
 * The menu row is reached from the menu button instead. */
.bh-burger {
	display: none;
}

@media (max-width: 1024px) {
	.bh-header.has-topbar {
		--bh-topbar-h: 36px;
	}

	.bh-topbar {
		font-size: 12px;
	}

	.bh-topbar__sep {
		padding: 0 20px;
	}

	.bh-mainbar__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas:
			"burger logo tools"
			"search search search";
		gap: 10px 8px;
		min-height: 0;
		padding-top: 10px;
		padding-bottom: 12px;
	}

	.bh-burger {
		grid-area: burger;
	}

	.bh-logo {
		grid-area: logo;
	}

	.bh-logo__img {
		height: 40px; /* the Customizer logo height is for desktop */
		max-width: 150px;
	}

	.bh-tools {
		grid-area: tools;
		gap: 2px;
	}

	.bh-search {
		grid-area: search;
	}

	.bh-search__field {
		height: 45px;
		padding-left: 14px;
	}

	.bh-header .bh-search__input {
		font-size: 16px; /* 16px stops iPhones zooming in when the search is tapped */
	}

	.bh-header .bh-search__submit {
		width: 36px;
		min-width: 36px;
		height: 36px;
		min-height: 36px;
	}

	/* Menu button */
	.bh-header .bh-burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 42px;
		min-width: 42px;
		height: 42px;
		min-height: 42px;
		margin: 0 0 0 -8px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: transparent;
		box-shadow: none;
		color: var(--bh-ink);
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.bh-header .bh-burger:hover,
	.bh-header .bh-burger:focus {
		background: transparent;
		color: var(--bh-ink);
	}

	.bh-header .bh-burger:active {
		background: rgba(0, 0, 0, .06);
	}

	.bh-header .bh-burger:focus-visible {
		outline: 2px solid var(--bh-ink);
		outline-offset: 2px;
	}

	/* Icons in the order: heart, account, basket */
	.bh-tool {
		width: 42px;
		height: 42px;
	}

	.bh-tool.wd-header-wishlist {
		order: 1;
	}

	.bh-tool--account {
		order: 2;
	}

	/* Basket: the full button as on desktop (icon + "Basket" or the basket total), a little smaller. */
	.bh-basket {
		order: 3;
		gap: 8px;
		height: 42px;
		margin-left: 4px;
		padding: 0 14px 0 12px;
		font-size: 14px;
	}

	.bh-basket__icon svg {
		width: 20px;
		height: 20px;
	}

	.bh-basket__count {
		top: -9px;
		right: -10px;
	}

	.bh-menubar {
		display: none;
	}

	.bh-search__panel {
		max-height: 65vh;
	}
}

@media (max-width: 380px) {
	.bh-logo__img {
		height: 34px;
	}

	.bh-tool,
	.bh-header .bh-burger {
		width: 38px;
		min-width: 38px;
		height: 38px;
	}

	.bh-basket {
		gap: 6px;
		height: 38px;
		padding: 0 10px;
		font-size: 13px;
	}
}

/* ---------- Menu panel for phones and tablets (template-parts/header/mobile-menu.php) ---------- */
/* Only the page root is locked (locking body moves sticky parts of the page behind the panel). */
html.bh-mnav-lock {
	overflow: hidden !important;
	scrollbar-gutter: stable;
}

.bh-mnav {
	--bh-ink: #242424;
	--bh-accent: var(--wd-primary-color, #370d1d);
	position: fixed;
	inset: 0;
	z-index: 100001;
	font-family: "Poppins", "Poppins Fallback", Arial, Helvetica, sans-serif;
	color: var(--bh-ink);
}

.bh-mnav[hidden] {
	display: none;
}

.bh-mnav *,
.bh-mnav *::before,
.bh-mnav *::after {
	box-sizing: border-box;
}

.bh-mnav__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity .3s ease;
}

.bh-mnav__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(360px, 88vw);
	background: #fff;
	box-shadow: 10px 0 30px rgba(0, 0, 0, .15);
	transform: translateX(-100%);
	transition: transform .35s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.bh-mnav.is-open .bh-mnav__overlay {
	opacity: 1;
}

.bh-mnav.is-open .bh-mnav__panel {
	transform: none;
}

.bh-mnav.is-dragging .bh-mnav__panel {
	transition: none;
}

.bh-mnav__head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px 12px 18px;
	border-bottom: 1px solid #ecebe5;
	background: var(--bh-brand-soft, #f7f0f3);
}

.bh-mnav__logo {
	display: inline-flex;
}

.bh-mnav__logo img {
	display: block;
	width: auto;
	height: 38px;
}

.bh-mnav .bh-mnav__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--bh-ink);
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	color: var(--bh-ink);
	cursor: pointer;
}

.bh-mnav__body {
	flex: 1 1 auto;
	padding: 6px 0 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.bh-mnav__list,
.bh-mnav__list .sub-menu,
.bh-mnav__links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bh-mnav__list li,
.bh-mnav__links li {
	margin: 0;
	list-style: none;
}

.bh-mnav__list > li {
	border-bottom: 1px solid #f0efe9;
}

/* A row: the link, plus an open/close button when it has a sub-menu. */
.bh-mnav__row {
	display: flex;
	align-items: stretch;
}

.bh-mnav__list a {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-height: 52px;
	padding: 0 18px;
	color: var(--bh-ink);
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
}

.bh-mnav__list .sub-menu a {
	min-height: 46px;
	padding-left: 32px;
	font-size: 15px;
	font-weight: 400;
}

.bh-mnav__list .sub-menu .sub-menu a {
	padding-left: 46px;
}

.bh-mnav__list .current-menu-item > .bh-mnav__row > a,
.bh-mnav__list .current-menu-item > a {
	color: var(--bh-accent);
	font-weight: 600;
}

.bh-mnav__list a:active {
	background: var(--bh-brand-soft, #f7f0f3);
}

.bh-mnav .bh-mnav__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 52px;
	min-width: 52px;
	height: auto;
	min-height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 1px solid #f0efe9;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bh-ink);
	cursor: pointer;
}

.bh-mnav__plus {
	transform-origin: center;
	transform-box: fill-box;
	transition: transform .25s ease;
}

/* + becomes - when open */
.bh-mnav__toggle[aria-expanded="true"] .bh-mnav__plus {
	transform: scaleY(0);
}

/* Sub-menus open with a height animation (grid row 0fr -> 1fr). */
.bh-mnav__sub {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	background: var(--bh-brand-tint, #fbf7f9);
	transition: grid-template-rows .3s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .3s;
}

.bh-mnav__sub > .sub-menu {
	min-height: 0;
	overflow: hidden;
}

li.is-open > .bh-mnav__sub {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows .3s cubic-bezier(.22, .61, .36, 1), visibility 0s;
}

.bh-mnav__links {
	flex: 0 0 auto;
	padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
	border-top: 1px solid #ecebe5;
	background: var(--bh-brand-soft, #f7f0f3);
}

.bh-mnav__links a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 0 18px;
	color: var(--bh-ink);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.bh-mnav a:focus-visible,
.bh-mnav button:focus-visible {
	outline: 2px solid var(--bh-ink);
	outline-offset: -2px;
}

/* The panel is only for phones and tablets. */
@media (min-width: 1025px) {
	.bh-mnav {
		display: none !important;
	}
}

/* ---------- Side panels (account): from the right on desktop, from the bottom on phones ---------- */
/* Only the page root is locked (locking body moves sticky parts of the page behind the panel). */
html.bh-panel-lock {
	overflow: hidden !important;
	scrollbar-gutter: stable; /* the page does not shift sideways */
}

.bh-panel {
	--bh-ink: #242424;
	--bh-accent: var(--wd-primary-color, #370d1d);
	position: fixed;
	inset: 0;
	z-index: 100001;
	font-family: "Poppins", "Poppins Fallback", Arial, Helvetica, sans-serif;
	color: var(--bh-ink);
}

.bh-panel[hidden] {
	display: none;
}

.bh-panel *,
.bh-panel *::before,
.bh-panel *::after {
	box-sizing: border-box;
}

.bh-panel__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity .3s ease;
}

.bh-panel__box {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(420px, 100%);
	background: #fff;
	box-shadow: -10px 0 30px rgba(0, 0, 0, .15);
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.bh-panel.is-open .bh-panel__overlay {
	opacity: 1;
}

.bh-panel.is-open .bh-panel__box {
	transform: none;
}

.bh-panel.is-dragging .bh-panel__box {
	transition: none;
}

.bh-panel__head {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 20px 18px 24px;
	border-bottom: 1px solid #ecebe5;
}

.bh-panel__grip {
	display: none;
}

.bh-panel__title {
	margin: 0;
	overflow: hidden;
	color: var(--bh-ink);
	font-family: inherit;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.25;
	text-overflow: ellipsis;
	text-transform: none;
	white-space: nowrap;
}

.bh-panel .bh-panel__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	min-width: 40px;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--bh-ink);
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	color: var(--bh-ink);
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.bh-panel .bh-panel__close:hover {
	background: var(--bh-ink);
	color: #fff;
}

.bh-panel__body {
	flex: 1 1 auto;
	padding: 6px 0 calc(16px + env(safe-area-inset-bottom));
	overflow-y: auto;
	overscroll-behavior: contain;
}

.bh-acc__group {
	margin: 0;
	padding: 8px 12px;
	list-style: none;
}

.bh-acc__group + .bh-acc__group {
	border-top: 1px solid #ecebe5;
}

.bh-acc__group li {
	margin: 0;
	list-style: none;
}

.bh-acc__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 48px;
	padding: 0 12px;
	overflow: hidden;
	border-radius: 10px;
	color: var(--bh-ink);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: background .15s ease;
}

.bh-acc__link:hover,
.bh-acc__link:focus-visible {
	background: var(--bh-brand-soft, #f7f0f3);
	color: var(--bh-ink);
}

.bh-acc__link:focus-visible,
.bh-panel .bh-panel__close:focus-visible {
	outline: 2px solid var(--bh-ink);
	outline-offset: -2px;
}

.bh-acc__icon {
	flex: 0 0 auto;
	color: var(--bh-ink);
	transition: transform .2s ease, color .2s ease;
}

.bh-acc__link:hover .bh-acc__icon {
	color: var(--bh-accent);
	transform: scale(1.08);
}

.bh-acc__link--signout {
	color: #b0001a;
}

.bh-acc__link--signout .bh-acc__icon {
	color: currentColor;
}

/* Items appear one after the other as the panel opens. */
.bh-panel.is-open .bh-acc__group li {
	animation: bh-acc-in .35s cubic-bezier(.22, .61, .36, 1) both;
}

.bh-panel.is-open .bh-acc__group li:nth-child(2) { animation-delay: .03s; }
.bh-panel.is-open .bh-acc__group li:nth-child(3) { animation-delay: .06s; }
.bh-panel.is-open .bh-acc__group li:nth-child(4) { animation-delay: .09s; }
.bh-panel.is-open .bh-acc__group li:nth-child(5) { animation-delay: .12s; }
.bh-panel.is-open .bh-acc__group li:nth-child(6) { animation-delay: .15s; }

@keyframes bh-acc-in {
	from {
		opacity: 0;
		transform: translateX(14px);
	}
}

/* Phones: a sheet from the bottom, swipe down to close. */
@media (max-width: 767px) {
	.bh-panel__box {
		top: auto;
		left: 0;
		width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
		transform: translateY(100%);
	}

	.bh-panel__head {
		padding: 24px 16px 14px 20px;
		touch-action: none;
	}

	.bh-panel__grip {
		position: absolute;
		top: 8px;
		left: 50%;
		display: block;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		border-radius: 4px;
		background: #d6d6d6;
	}

	.bh-panel__title {
		font-size: 20px;
	}

	@keyframes bh-acc-in {
		from {
			opacity: 0;
			transform: translateY(10px);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.bh-header *,
	.bh-header *::before,
	.bh-header *::after,
	.bh-mnav *,
	.bh-mnav *::before,
	.bh-mnav *::after,
	.bh-panel *,
	.bh-panel *::before,
	.bh-panel *::after {
		animation: none !important;
		transition: none !important;
	}

	.bh-topbar__viewport {
		-webkit-mask-image: none;
		mask-image: none;
	}

	.bh-topbar__track {
		justify-content: center;
		width: 100%;
	}
}
