/**
 * Site header: top bar, logo, primary navigation, search.
 *
 * Mobile-first. From 768px the bars follow the artboard (--hm-u);
 * the full horizontal menu appears from 1536px, or later if header.js
 * finds the menu too long to fit (.is-collapsed).
 */

.hm-header {
	--hm-header-inset: var(--hm-gutter);

	position: relative;
	z-index: 100;
}

.hm-header .hm-container {
	padding-inline: var(--hm-header-inset);
}

/* Low-specificity reset so component classes below win without !important. */
:where(.hm-header) button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.hm-header a:focus-visible,
.hm-header button:focus-visible {
	outline: 2px solid var(--hm-color-highlight);
	outline-offset: 3px;
	border-radius: 4px;
}

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

.hm-topbar {
	background: var(--hm-topbar-bg);
	color: var(--hm-color-white);
	font-family: var(--hm-font-heading);
	font-size: 13px;
	line-height: 1;
}

:where(.hm-topbar) a {
	color: inherit;
	text-decoration: none;
}

.hm-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 42px;
}

.hm-topbar__contact {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hm-topbar__item,
.hm-topbar__item > a {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.hm-topbar__item > a:hover .hm-topbar__label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hm-topbar__icon {
	flex: none;
	height: 14px;
	width: auto;
}

.hm-topbar__item--location,
.hm-topbar__item--email .hm-topbar__label,
.hm-social {
	display: none;
}

.hm-topbar__end {
	display: flex;
	flex: none;
	align-items: center;
}

.hm-social {
	align-items: center;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hm-social__link {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease;
}

.hm-social__link:hover {
	opacity: 0.75;
}

.hm-social__link svg {
	display: block;
	height: 16px;
	width: auto;
}

.hm-topbar__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 30px;
	padding: 0 14px;
	border-radius: var(--hm-radius-pill);
	background: var(--hm-color-white);
	color: var(--hm-color-nav);
	font-weight: 500;
	white-space: nowrap;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.hm-topbar__btn:hover {
	background: #e8f2fd;
	transform: translateY(-1px);
}

.hm-topbar__btn-icon {
	flex: none;
	width: 15px;
	height: auto;
	color: var(--hm-color-highlight);
}

@media (min-width: 768px) {
	.hm-topbar__item--email .hm-topbar__label {
		display: inline;
	}

	.hm-topbar__contact {
		gap: 0;
	}

	.hm-topbar__item + .hm-topbar__item {
		position: relative;
		margin-left: 20px;
		padding-left: 20px;
	}

	.hm-topbar__item + .hm-topbar__item::before {
		content: "";
		position: absolute;
		top: 50%;
		left: 0;
		width: 1px;
		height: 18px;
		background: rgb(255 255 255 / 0.22);
		transform: translateY(-50%);
	}
}

@media (min-width: 768px) and (max-width: 991px) {
	/* Location is hidden here, so the next item needs no divider. */
	.hm-topbar .hm-topbar__item--location + .hm-topbar__item {
		margin-left: 0;
		padding-left: 0;
	}

	.hm-topbar .hm-topbar__item--location + .hm-topbar__item::before {
		display: none;
	}
}

@media (min-width: 992px) {
	.hm-topbar__item--location,
	.hm-social {
		display: flex;
	}

	.hm-topbar__btn {
		margin-left: 26px;
	}
}

/* Artboard sizes. */
@media (min-width: 768px) {
	.hm-header {
		--hm-header-inset: calc(98 * var(--hm-u));
	}

	.hm-topbar {
		font-size: max(13px, calc(18 * var(--hm-u)));
	}

	.hm-topbar__inner {
		min-height: calc(58 * var(--hm-u));
	}

	.hm-topbar .hm-container {
		padding-right: calc(90 * var(--hm-u));
	}

	.hm-topbar__contact {
		padding-left: calc(17 * var(--hm-u));
	}

	.hm-topbar__item,
	.hm-topbar__item > a {
		gap: calc(18 * var(--hm-u));
	}

	.hm-topbar__item + .hm-topbar__item {
		margin-left: calc(34 * var(--hm-u));
		padding-left: calc(34 * var(--hm-u));
	}

	.hm-topbar__item + .hm-topbar__item::before {
		width: max(1px, calc(2 * var(--hm-u)));
		height: calc(22 * var(--hm-u));
		background: rgb(255 255 255 / 0.15);
	}

	.hm-topbar__item--location .hm-topbar__icon {
		height: max(13px, calc(19 * var(--hm-u)));
	}

	.hm-topbar__item--email .hm-topbar__icon {
		height: max(10px, calc(15 * var(--hm-u)));
	}

	.hm-topbar__item--phone .hm-topbar__icon {
		height: max(11px, calc(16.5 * var(--hm-u)));
	}

	.hm-social {
		gap: calc(29 * var(--hm-u));
	}

	.hm-social__link--facebook svg {
		height: max(15px, calc(22 * var(--hm-u)));
	}

	.hm-social__link--instagram svg,
	.hm-social__link--linkedin svg {
		height: max(14px, calc(20 * var(--hm-u)));
	}

	.hm-social__link--youtube svg {
		height: max(12px, calc(17 * var(--hm-u)));
	}

	.hm-topbar__btn {
		gap: calc(14 * var(--hm-u));
		height: max(30px, calc(42 * var(--hm-u)));
		margin-left: calc(48 * var(--hm-u));
		padding: 0 calc(31 * var(--hm-u)) 0 calc(32 * var(--hm-u));
		font-size: max(13px, calc(17.3 * var(--hm-u)));
	}

	.hm-topbar__btn-icon {
		width: max(14px, calc(21 * var(--hm-u)));
	}
}

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

.hm-header__main {
	position: relative;
	background: var(--hm-color-white);
}

.hm-header__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 72px;
}

.hm-header__brand {
	flex: none;
	margin-right: auto;
}

.hm-header__brand .custom-logo-link {
	display: block;
}

.hm-header__brand .custom-logo {
	display: block;
	width: auto;
	height: 48px;
}

.hm-header__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 6px;
}

.hm-header__search-toggle,
.hm-header__menu-toggle {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.hm-header__search-toggle {
	color: color-mix(in srgb, var(--hm-color-highlight) 80%, var(--hm-color-nav));
}

.hm-header__menu-toggle {
	color: var(--hm-color-nav);
}

.hm-header__search-toggle:hover,
.hm-header__menu-toggle:hover {
	background: #eef5fd;
}

.hm-header__search-toggle svg {
	width: 24px;
	height: 24px;
}

.hm-header__menu-toggle svg {
	width: 28px;
	height: 28px;
}

@media (min-width: 768px) {
	.hm-header__inner {
		min-height: 84px;
	}

	.hm-header__brand .custom-logo {
		height: 60px;
	}
}

@media (min-width: 768px) {
	.hm-header__inner {
		gap: 0;
		min-height: calc(110 * var(--hm-u));
		padding-top: calc(9 * var(--hm-u));
	}

	.hm-header__brand .custom-logo {
		height: max(56px, calc(var(--hm-logo-h, 97) * var(--hm-u)));
	}
}

/* ---------------------------------------------------------------------
 * Navigation – off-canvas panel (default)
 * ------------------------------------------------------------------ */

.hm-nav {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1001;
	display: flex;
	flex-direction: column;
	width: min(380px, 88vw);
	padding: 18px 24px 40px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--hm-color-white);
	box-shadow: -20px 0 40px -20px rgb(6 25 52 / 0.35);
	visibility: hidden;
	transform: translateX(100%);
	transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.admin-bar .hm-nav {
	top: 46px;
}

@media (min-width: 783px) {
	.admin-bar .hm-nav {
		top: 32px;
	}
}

.hm-header.is-menu-open .hm-nav {
	visibility: visible;
	transform: none;
	transition: transform 0.3s ease, visibility 0s;
}

.hm-nav__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.hm-nav__title {
	font-family: var(--hm-font-heading);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hm-color-text);
}

.hm-nav__close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-right: -10px;
	border-radius: 50%;
	color: var(--hm-color-nav);
}

.hm-nav__close svg {
	width: 24px;
	height: 24px;
}

.hm-nav__list,
.hm-nav__list .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hm-nav__list > li {
	border-bottom: 1px solid #e6edf5;
}

.hm-nav__list li {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
}

.hm-nav__list a {
	display: block;
	padding: 14px 0;
	font-family: var(--hm-font-heading);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--hm-color-nav);
	text-decoration: none;
}

.hm-nav__list .current-menu-item > a,
.hm-nav__list .current-menu-ancestor > a {
	color: var(--hm-color-highlight);
}

.hm-nav__sub-toggle {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-right: -12px;
	color: var(--hm-color-nav);
}

.hm-nav__chevron {
	width: 12px;
	height: auto;
	transition: transform 0.2s ease;
}

.hm-nav__sub-toggle[aria-expanded="true"] .hm-nav__chevron {
	transform: rotate(180deg);
}

.hm-nav__list .sub-menu {
	display: none;
	grid-column: 1 / -1;
	padding: 0 0 10px 14px;
	border-left: 2px solid #e6edf5;
	margin-bottom: 12px;
}

.hm-nav__list li.is-open > .sub-menu {
	display: block;
}

.hm-nav__list .sub-menu a {
	padding: 9px 0;
	font-size: 15px;
	font-weight: 400;
}

.hm-nav-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgb(6 25 52 / 0.45);
}

.hm-nav-backdrop[hidden] {
	display: none;
}

html.hm-menu-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------
 * Navigation – desktop bar
 * ------------------------------------------------------------------ */

@media (min-width: 1536px) {
	.hm-header:not(.is-collapsed) .hm-header__brand {
		margin-right: 0;
	}

	.hm-header:not(.is-collapsed) .hm-nav {
		position: static;
		z-index: auto;
		display: flex;
		flex-direction: row;
		align-items: stretch;
		align-self: stretch;
		width: auto;
		margin-left: auto;
		padding: 0;
		overflow: visible;
		background: none;
		box-shadow: none;
		visibility: visible;
		transform: none;
		transition: none;
	}

	.hm-header:not(.is-collapsed) .hm-nav__head,
	.hm-header:not(.is-collapsed) .hm-header__menu-toggle,
	.hm-header:not(.is-collapsed) .hm-nav-backdrop {
		display: none;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list {
		display: flex;
		align-items: stretch;
		gap: calc(36 * var(--hm-u));
	}

	.hm-header:not(.is-collapsed) .hm-nav__list > li {
		position: relative;
		display: flex;
		align-items: center;
		border: 0;
		margin-top: calc(-3 * var(--hm-u));
	}

	.hm-header:not(.is-collapsed) .hm-nav__list > li > a {
		position: relative;
		padding: 0;
		font-size: max(13px, calc(16.6 * var(--hm-u)));
		line-height: calc(24 * var(--hm-u));
		white-space: nowrap;
		transition: color 0.2s ease;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list > li > a::after {
		content: "";
		position: absolute;
		top: calc(100% + 3.5 * var(--hm-u));
		left: calc(-3 * var(--hm-u));
		right: calc(-2 * var(--hm-u));
		height: max(2px, calc(3 * var(--hm-u)));
		border-radius: 2px;
		background: var(--hm-color-highlight);
		transform: scaleX(0);
		transition: transform 0.2s ease;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list > li > a:hover {
		color: var(--hm-color-highlight);
	}

	.hm-header:not(.is-collapsed) .hm-nav__list > .current-menu-item > a,
	.hm-header:not(.is-collapsed) .hm-nav__list > .current-menu-ancestor > a {
		color: var(--hm-color-highlight);
	}

	.hm-header:not(.is-collapsed) .hm-nav__list > .current-menu-item > a::after,
	.hm-header:not(.is-collapsed) .hm-nav__list > .current-menu-ancestor > a::after,
	.hm-header:not(.is-collapsed) .hm-nav__list > li > a:hover::after {
		transform: none;
	}

	.hm-header:not(.is-collapsed) .hm-nav__sub-toggle {
		width: calc(10 * var(--hm-u));
		height: calc(24 * var(--hm-u));
		min-width: 9px;
		margin: 0 0 0 calc(12 * var(--hm-u));
	}

	.hm-header:not(.is-collapsed) .hm-nav__chevron {
		width: 100%;
	}

	/* Dropdowns */
	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu {
		position: absolute;
		top: 100%;
		left: -18px;
		z-index: 10;
		display: block;
		min-width: 240px;
		margin: 0;
		padding: 10px;
		border: 0;
		border-radius: 14px;
		background: var(--hm-color-white);
		box-shadow: 0 24px 48px -16px rgb(10 47 96 / 0.28), 0 0 0 1px rgb(10 47 96 / 0.06);
		opacity: 0;
		visibility: hidden;
		transform: translateY(10px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu .sub-menu {
		top: -10px;
		left: 100%;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list li:hover > .sub-menu,
	.hm-header:not(.is-collapsed) .hm-nav__list li:focus-within > .sub-menu,
	.hm-header:not(.is-collapsed) .hm-nav__list li.is-open > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu li {
		position: relative;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu a {
		padding: 10px 14px;
		border-radius: 8px;
		font-size: 15px;
		white-space: nowrap;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu a:hover {
		background: #eef5fd;
		color: var(--hm-color-highlight);
	}

	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu .hm-nav__sub-toggle {
		width: 36px;
		height: 36px;
		margin: 0;
	}

	.hm-header:not(.is-collapsed) .hm-nav__list .sub-menu .hm-nav__chevron {
		width: 10px;
		transform: rotate(-90deg);
	}

	/* Divider + search */
	.hm-header:not(.is-collapsed) .hm-header__actions {
		gap: 0;
		margin-top: calc(-3 * var(--hm-u));
	}

	.hm-header:not(.is-collapsed) .hm-header__actions::before {
		content: "";
		width: 1px;
		height: calc(32 * var(--hm-u));
		margin: 0 calc(39 * var(--hm-u));
		background: #e3e7ec;
	}

	.hm-header:not(.is-collapsed) .hm-header__search-toggle {
		width: calc(30 * var(--hm-u));
		height: calc(30 * var(--hm-u));
		min-width: 22px;
		min-height: 22px;
		border-radius: 0;
	}

	.hm-header:not(.is-collapsed) .hm-header__search-toggle:hover {
		background: none;
		color: var(--hm-color-highlight);
	}

	.hm-header:not(.is-collapsed) .hm-header__search-toggle svg {
		width: 100%;
		height: 100%;
	}
}

/* ---------------------------------------------------------------------
 * Search panel
 * ------------------------------------------------------------------ */

.hm-search {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 20;
	padding: 18px 0;
	border-top: 1px solid #edf1f6;
	background: var(--hm-color-white);
	box-shadow: 0 24px 40px -24px rgb(10 47 96 / 0.35);
}

.hm-search[hidden] {
	display: none;
}

.hm-search-form {
	display: flex;
	gap: 10px;
	max-width: 760px;
	margin-inline: auto;
}

.hm-search-form__field {
	flex: 1;
	min-width: 0;
	height: 52px;
	padding: 0 22px;
	border: 1.5px solid #d3deea;
	border-radius: var(--hm-radius-pill);
	background: #f7fafd;
	font: inherit;
	font-size: 16px;
	color: var(--hm-color-text);
}

.hm-search-form__field:focus {
	outline: none;
	border-color: var(--hm-color-highlight);
	background: var(--hm-color-white);
	box-shadow: 0 0 0 4px rgb(14 102 195 / 0.15);
}

.hm-search-form__submit {
	display: grid;
	flex: none;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--hm-color-primary);
	color: var(--hm-color-white);
}

.hm-search-form__submit svg {
	width: 20px;
	height: 20px;
}
