/* Board House header. Scoped to #bh-header so the Elementor kit / Martfury button and input styles don't leak in. */

#bh-header {
	--bh-navy: #00364d;
	--bh-navy-dark: #002a3c;
	--bh-accent: #ff3f00;
	--bh-accent-dark: #cb3200;
	--bh-btn: 48px;
	--bh-btn-icon: 21px;
	position: relative; /* no z-index: the drawer and the Elementor side cart must stack above the whole page */
	background: var(--bh-navy);
	color: #fff;
	font-family: "Bai Jamjuree", sans-serif;
}

#bh-header .bh-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: 1290px;
	margin: 0 auto;
	padding: 0 30px;
}

/* ---------- Top row: logo | search | account + cart ---------- */

#bh-header .bh-header__main {
	padding: 16px 0;
}

#bh-header .bh-header__grid {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas: "logo search actions";
	align-items: center;
	column-gap: 40px;
}

#bh-header .bh-logo {
	grid-area: logo;
	display: block;
	line-height: 0;
	border-radius: 50%;
	transition: transform .3s;
}

#bh-header .bh-logo:hover {
	transform: rotate(-4deg) scale(1.03);
}

#bh-header .bh-logo__img {
	display: block;
	width: 100px;
	height: 100px;
	object-fit: contain;
}

/* Search */
#bh-header .bh-search {
	grid-area: search;
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 640px;
	height: 50px;
	margin: 0 auto;
	padding: 0;
	border-radius: 999px;
	background: #fafafa;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
	transition: box-shadow .2s;
}

#bh-header .bh-search:focus-within {
	box-shadow: 0 0 0 3px rgba(255, 63, 0, .45), 0 6px 18px rgba(0, 0, 0, .18);
}

#bh-header .bh-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: 999px 0 0 999px;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: #1f2a30;
	font-family: "Bai Jamjuree", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: normal;
	-webkit-appearance: none;
	appearance: none;
}

#bh-header .bh-search__input::placeholder {
	color: #6b7378;
	opacity: 1;
}

#bh-header .bh-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

#bh-header .bh-search__submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 100%;
	margin: 0;
	padding: 0 26px 0 22px;
	border: 0;
	border-radius: 0 999px 999px 0;
	background: var(--bh-accent);
	box-shadow: none;
	color: #fff;
	font-family: "Bai Jamjuree", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .3px;
	cursor: pointer;
	transition: background-color .2s;
}

#bh-header .bh-search__submit:hover,
#bh-header .bh-search__submit:focus-visible {
	background: var(--bh-accent-dark);
	color: #fff;
}

#bh-header .bh-search__submit .bh-icon {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* Account + cart: identical round buttons */
#bh-header .bh-actions {
	grid-area: actions;
	display: flex;
	align-items: center;
	gap: 12px;
}

#bh-header .bh-iconbtn,
#bh-header .bh-cart .elementor-menu-cart__toggle_button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--bh-btn);
	min-width: 0;
	height: var(--bh-btn);
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #fff;
	line-height: 1;
	text-decoration: none;
	transition: background-color .25s, border-color .25s, color .25s, transform .25s;
}

#bh-header .bh-iconbtn:hover,
#bh-header .bh-iconbtn:focus-visible,
#bh-header .bh-cart .elementor-menu-cart__toggle_button:hover,
#bh-header .bh-cart .elementor-menu-cart__toggle_button:focus-visible {
	border-color: var(--bh-accent);
	background: var(--bh-accent);
	color: #fff;
	transform: translateY(-1px);
}

#bh-header .bh-iconbtn .bh-icon,
#bh-header .bh-cart .elementor-menu-cart__toggle_button svg {
	display: block;
	width: var(--bh-btn-icon);
	height: var(--bh-btn-icon);
	fill: currentColor;
}

/* Elementor Pro menu cart: same settings as the old header, button restyled to match the account button */
#bh-header .bh-cart .elementor-widget-woocommerce-menu-cart {
	--main-alignment: center;
	--side-cart-alignment-transform: translateX(100%);
	--side-cart-alignment-left: auto;
	--side-cart-alignment-right: 0;
	--divider-style: solid;
	--subtotal-divider-style: solid;
	--checkout-button-display: none;
	--cart-footer-layout: 1fr;
	--elementor-remove-from-cart-button: none;
	--remove-from-cart-button: block;
	--cart-border-style: none;
	--cart-padding: 0px 0px 0px 0px;
	--view-cart-button-background-color: #000000;
	--view-cart-button-hover-background-color: #000000;
	--items-indicator-background-color: var(--bh-accent);
	--items-indicator-text-color: #fff;
	--menu-cart-subtotal-color: var(--bh-navy);
	margin: 0;
}

/* The side cart sits inside the (white-text) header: give it the site's normal text colour, or "Subtotal" turns white. */
#bh-header .bh-cart .elementor-menu-cart__container {
	color: var(--bh-navy);
}

#bh-header .bh-cart .widget_shopping_cart_content {
	--subtotal-divider-left-width: 0;
	--subtotal-divider-right-width: 0;
}

#bh-header .bh-cart .elementor-menu-cart__toggle {
	margin: 0;
	padding: 0;
}

#bh-header .bh-cart .elementor-menu-cart__toggle_button .elementor-button-text {
	display: none;
}

#bh-header .bh-cart .elementor-menu-cart__toggle_button .elementor-button-icon {
	position: static;
	display: block;
	margin: 0;
	color: inherit;
}

#bh-header .bh-cart .elementor-button-icon-qty[data-counter],
#bh-header .bh-cart-count {
	position: absolute;
	top: -5px;
	right: -5px;
	inset-inline-end: -5px;
	display: block;
	box-sizing: border-box;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border: 2px solid var(--bh-navy);
	border-radius: 999px;
	background: var(--bh-accent);
	color: #fff;
	font-family: "Bai Jamjuree", sans-serif;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}

#bh-header .bh-cart .elementor-button-icon-qty[data-counter="0"],
#bh-header .bh-cart-count[data-counter="0"] {
	display: none;
}

#bh-header .bh-iconbtn:hover .bh-cart-count,
#bh-header .bh-cart .elementor-menu-cart__toggle_button:hover .elementor-button-icon-qty {
	background: #fff;
	color: var(--bh-accent);
}

/* Burger (mobile only) */
#bh-header .bh-burger {
	grid-area: burger;
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 0 0 -8px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transition: color .2s, background-color .2s;
}

#bh-header .bh-burger:hover,
#bh-header .bh-burger:focus-visible {
	background: rgba(255, 255, 255, .08);
	color: var(--bh-accent);
}

#bh-header .bh-burger .bh-icon {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

/* ---------- Category menu ---------- */

#bh-header .bh-nav {
	border-top: 1px solid rgba(255, 255, 255, .12);
	background: var(--bh-navy);
}

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

#bh-header .bh-menu > li {
	position: relative;
	margin: 0;
	padding: 0;
}

#bh-header .bh-menu a {
	text-decoration: none;
}

#bh-header .bh-nav .bh-menu > li > a {
	position: relative;
	display: block;
	padding: 15px 0 14px;
	color: #fff;
	font-family: "Bai Jamjuree", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 1.9px;
	text-transform: uppercase;
	transition: color .25s;
}

#bh-header .bh-nav .bh-menu > li > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 8px;
	height: 2px;
	border-radius: 2px;
	background: var(--bh-accent);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform .25s;
}

#bh-header .bh-nav .bh-menu > li > a:hover,
#bh-header .bh-nav .bh-menu > li > a:focus-visible,
#bh-header .bh-nav .bh-menu > li:hover > a,
#bh-header .bh-nav .bh-menu > li.current-menu-item > a,
#bh-header .bh-nav .bh-menu > li.current-menu-ancestor > a,
#bh-header .bh-nav .bh-menu > li.current-product_cat-ancestor > a {
	color: var(--bh-accent);
}

#bh-header .bh-nav .bh-menu > li > a:hover::after,
#bh-header .bh-nav .bh-menu > li:hover > a::after,
#bh-header .bh-nav .bh-menu > li.current-menu-item > a::after,
#bh-header .bh-nav .bh-menu > li.current-menu-ancestor > a::after {
	transform: scaleX(1);
}

/* Dropdowns (only when the assigned menu has sub-items) */
#bh-header .bh-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 1000;
	min-width: 220px;
	margin: 0;
	padding: 10px 0;
	list-style: none;
	border-top: 3px solid var(--bh-accent);
	border-radius: 0 0 10px 10px;
	background: #fff;
	box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 8px);
	transition: opacity .2s, transform .2s, visibility .2s;
}

#bh-header .bh-nav li:hover > .sub-menu,
#bh-header .bh-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

#bh-header .bh-nav .sub-menu a {
	display: block;
	padding: 9px 20px;
	color: var(--bh-navy);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .5px;
	white-space: nowrap;
	transition: color .2s, background-color .2s;
}

#bh-header .bh-nav .sub-menu a:hover {
	background: #f3f5f6;
	color: var(--bh-accent);
}

/* ---------- Mobile drawer ---------- */

#bh-header .bh-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000001; /* above Martfury's mobile bottom bar (999999) */
}

#bh-header .bh-drawer[hidden] {
	display: none;
}

#bh-header .bh-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 20, 30, .55);
	opacity: 0;
	transition: opacity .3s;
}

#bh-header .bh-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(86vw, 340px);
	background: var(--bh-navy);
	box-shadow: 10px 0 40px rgba(0, 0, 0, .3);
	transform: translateX(-100%);
	transition: transform .3s ease;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

#bh-header .bh-drawer.is-open .bh-drawer__overlay {
	opacity: 1;
}

#bh-header .bh-drawer.is-open .bh-drawer__panel {
	transform: translateX(0);
}

#bh-header .bh-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 16px 18px 22px;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}

#bh-header .bh-drawer__title {
	color: #fff;
	font-family: "Bangers", sans-serif;
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 2px;
}

#bh-header .bh-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, .5);
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transition: border-color .2s, background-color .2s;
}

#bh-header .bh-drawer__close:hover,
#bh-header .bh-drawer__close:focus-visible {
	border-color: var(--bh-accent);
	background: var(--bh-accent);
}

#bh-header .bh-drawer__close .bh-icon {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

#bh-header .bh-drawer__nav {
	flex: 1 0 auto;
	padding: 8px 0;
}

#bh-header .bh-drawer__nav .bh-menu {
	display: block;
}

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

#bh-header .bh-drawer__nav a {
	position: relative;
	display: block;
	padding: 14px 56px 14px 22px;
	border-bottom: 1px solid rgba(255, 255, 255, .07);
	color: #fff;
	font-family: "Bai Jamjuree", sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	text-decoration: none;
	transition: color .2s, background-color .2s, padding-left .2s;
}

#bh-header .bh-drawer__nav a::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	bottom: 10px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--bh-accent);
	transform: scaleY(0);
	transition: transform .2s;
}

#bh-header .bh-drawer__nav a:hover,
#bh-header .bh-drawer__nav a:focus-visible,
#bh-header .bh-drawer__nav .current-menu-item > a {
	background: rgba(255, 255, 255, .04);
	color: var(--bh-accent);
	padding-left: 26px;
}

#bh-header .bh-drawer__nav a:hover::before,
#bh-header .bh-drawer__nav .current-menu-item > a::before {
	transform: scaleY(1);
}

#bh-header .bh-drawer__nav .sub-menu {
	display: none;
	margin: 0;
	padding: 0;
	background: var(--bh-navy-dark);
}

#bh-header .bh-drawer__nav li.is-open > .sub-menu {
	display: block;
}

#bh-header .bh-drawer__nav .sub-menu a {
	padding-left: 36px;
	font-size: 14px;
	letter-spacing: .8px;
	text-transform: none;
}

#bh-header .bh-subtoggle {
	position: absolute;
	top: 4px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
}

#bh-header .bh-subtoggle .bh-icon {
	width: 12px;
	height: 12px;
	fill: currentColor;
	transition: transform .2s;
}

#bh-header li.is-open > .bh-subtoggle .bh-icon {
	transform: rotate(180deg);
}

#bh-header .bh-drawer__account {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 22px calc(24px + env(safe-area-inset-bottom));
	padding: 12px 18px;
	border: 2px solid #fff;
	border-radius: 999px;
	color: #fff;
	font-family: "Bai Jamjuree", sans-serif;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .5px;
	text-decoration: none;
	transition: background-color .2s, border-color .2s;
}

#bh-header .bh-drawer__account:hover,
#bh-header .bh-drawer__account:focus-visible {
	border-color: var(--bh-accent);
	background: var(--bh-accent);
	color: #fff;
}

#bh-header .bh-drawer__account .bh-icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

html.bh-drawer-open,
html.bh-drawer-open body {
	overflow: hidden;
}

/* ---------- Tablet + mobile: menu button | centred logo | account + cart, search below ---------- */

@media (max-width: 1024px) {
	#bh-header {
		--bh-btn: 44px;
		--bh-btn-icon: 19px;
	}

	#bh-header .bh-wrap {
		padding: 0 20px;
	}

	#bh-header .bh-header__main {
		padding: 14px 0 18px;
	}

	#bh-header .bh-header__grid {
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		grid-template-areas:
			"burger logo actions"
			"search search search";
		column-gap: 12px;
		row-gap: 14px;
	}

	#bh-header .bh-burger {
		display: inline-flex;
		justify-self: start;
	}

	#bh-header .bh-logo {
		justify-self: center;
	}

	#bh-header .bh-actions {
		justify-self: end;
		gap: 8px;
	}

	#bh-header .bh-search {
		max-width: none;
		height: 48px;
		box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
	}

	#bh-header .bh-nav {
		display: none;
	}
}

@media (max-width: 767px) {
	#bh-header .bh-wrap {
		padding: 0 16px;
	}

	#bh-header .bh-search__input {
		padding: 0 18px;
		font-size: 16px; /* 16px stops iOS zooming in on focus */
	}

	#bh-header .bh-search__submit {
		padding: 0 20px 0 18px;
		font-size: 15px;
	}
}

@media (max-width: 380px) {
	#bh-header {
		--bh-btn: 42px;
		--bh-btn-icon: 18px;
	}
}

@media (max-width: 340px) {
	#bh-header .bh-logo__img {
		width: 88px;
		height: 88px;
	}

	#bh-header .bh-search__label {
		display: none;
	}

	#bh-header .bh-search__submit {
		padding: 0 20px 0 16px;
	}

	#bh-header .bh-search__submit .bh-icon {
		width: 18px;
		height: 18px;
	}
}

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