/* ── Header Nav Widget ── */
.hn-bar {
	box-sizing: border-box;
}

.hn-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 1400px;
	margin: 0 auto;
}

/* Logo */
.hn-logo {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.hn-logo img {
	display: block;
	height: auto;
}

/* Nav */
.hn-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
}

.hn-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
}

.hn-menu > li {
	position: relative;
	padding: 0;
}

.hn-menu > li > a {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	transition: color .2s;
	padding: 0;
}

.hn-menu a {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	transition: color .2s;
}

/* Dropdown arrow for items with children */
.hn-menu > li.menu-item-has-children > a::after {
	display: none;
}

.hn-dropdown-icon {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	transition: transform .2s;
	line-height: 1;
}

.hn-menu > li.menu-item-has-children:hover > a > .hn-dropdown-icon {
	transform: rotate(180deg);
}

.hn-dropdown-icon-tpl {
	display: none !important;
}

/* Sub-menu */
.hn-menu .sub-menu,
.hn-menu ul.sub-menu {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	padding-inline-start: 0 !important;
	margin-inline-start: 0 !important;
	position: absolute;
	top: calc(100% + 10px);
	left: -16px;
	min-width: 220px;
	box-shadow: 0 4px 12px rgba(0,0,0,.1);
	border-radius: 0 !important;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .25s, transform .25s, visibility .25s;
	z-index: 1000;
	background-color: #ffffff;
}

.hn-menu > li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.hn-menu .sub-menu > li + li {
	border-top: 1px solid #eeeeee;
}

.hn-menu .sub-menu li {
	background: none;
}

.hn-menu .sub-menu a {
	display: block;
	padding: 12px 16px;
	border-radius: 0;
	background: transparent;
	transition: background-color .15s, color .15s;
}

.hn-menu .sub-menu .current-menu-item > a:not(:hover),
.hn-menu .sub-menu .current-menu-ancestor > a:not(:hover),
.hn-menu .sub-menu > li:first-child > a:not(:hover) {
	background-color: transparent !important;
	color: inherit !important;
	font-weight: inherit;
}

/* 3rd-level sub-menu: fly out to the right */
.hn-menu .sub-menu li.menu-item-has-children {
	position: relative;
}

.hn-menu .sub-menu li.menu-item-has-children > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.hn-menu .sub-menu li.menu-item-has-children > a > .hn-dropdown-icon {
	margin-left: auto;
	transform: rotate(-90deg);
}

.hn-menu .sub-menu li.menu-item-has-children:hover > a > .hn-dropdown-icon {
	transform: rotate(0deg);
}

.hn-menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	transform: translateY(0) translateX(6px);
}

.hn-menu .sub-menu li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) translateX(0);
}

/* Right section */
.hn-right {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Search toggle */
.hn-search-wrap {
	position: relative;
}

.hn-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 8px;
	background: none;
	border: none;
	line-height: 1;
}

/* Full-screen search overlay */
.hn-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(10, 15, 40, 0.95);
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	clip-path: inset(50% 50% 50% 50%);
	visibility: hidden;
	transition: clip-path .5s cubic-bezier(.4, 0, .2, 1), visibility .5s;
}

.hn-search-overlay.is-open {
	clip-path: inset(0 0 0 0);
	visibility: visible;
}

.hn-search-overlay-inner {
	width: 90%;
	max-width: 720px;
}

.hn-search-overlay .hn-search-form {
	display: flex;
	align-items: center;
	margin: 0;
	border: none;
	border-bottom: 2px solid rgba(255, 255, 255, .3);
	background: transparent;
	padding: 0 0 12px;
}

.hn-search-overlay .hn-search-field {
	width: 100%;
	padding: 0;
	border: none !important;
	outline: none;
	font-size: 36px;
	font-weight: 300;
	color: #ffffff;
	background: transparent !important;
	-webkit-appearance: none;
	appearance: none;
}

.hn-search-overlay .hn-search-field::placeholder {
	color: rgba(255, 255, 255, .4);
}

/* Close button */
.hn-search-close {
	position: absolute;
	top: 30px;
	right: 40px;
	font-size: 36px;
	line-height: 1;
	color: #ffffff;
	cursor: pointer;
	opacity: .7;
	transition: opacity .2s;
}

.hn-search-close:hover {
	opacity: 1;
}

/* Hamburger, close btn, overlay – desktop hidden */
.hn-hamburger,
.hn-nav-close,
.hn-overlay {
	display: none;
}

/* CTA Button */
.hn-cta {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	font-weight: 600;
	transition: background-color .2s, color .2s;
	white-space: nowrap;
}

/* ── Mobile ≤ 767px ── */
@media (max-width: 767px) {

	/* Grid: row1 = logo centered, row2 = hamburger+search … CTA */
	.hn-inner {
		flex-wrap: wrap;
		column-gap: 12px;
		row-gap: 8px;
	}

	/* Row 1: Logo full-width centered */
	.hn-logo {
		width: 100%;
		justify-content: center;
		order: 1;
	}

	/* Row 2 left: hamburger */
	.hn-hamburger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		padding: 4px;
		background: none;
		border: none;
		color: inherit;
		order: 2;
	}

	.hn-hamburger svg {
		width: 24px;
		height: 24px;
	}

	/* Break open .hn-right so children order independently */
	.hn-right {
		display: contents;
	}

	/* Row 2 left: search next to hamburger */
	.hn-search-wrap {
		order: 3;
	}

	/* Row 2 right: CTA */
	.hn-cta {
		order: 4;
		margin-left: auto;
	}

	/* ── Sidebar nav ── */
	.hn-nav {
		position: fixed;
		top: 0;
		left: 0;
		width: 280px;
		height: 100vh;
		background: #fff;
		box-shadow: 2px 0 12px rgba(0,0,0,.15);
		z-index: 10000;
		transform: translateX(-100%);
		transition: transform .3s ease;
		overflow-y: auto;
		padding: 20px;
		display: block;
	}

	.hn-bar.menu-open .hn-nav {
		transform: translateX(0);
	}

	/* Close button */
	.hn-nav-close {
		display: flex;
		justify-content: flex-end;
		font-size: 28px;
		line-height: 1;
		cursor: pointer;
		padding: 0 0 16px;
		color: #333;
	}

	/* Overlay */
	.hn-overlay {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,.4);
		z-index: 9999;
	}

	.hn-bar.menu-open .hn-overlay {
		display: block;
	}

	/* Vertical menu */
	.hn-menu {
		flex-direction: column;
		align-items: stretch;
	}

	.hn-menu > li + li {
		margin-left: 0 !important;
		border-top: 1px solid #eee;
	}

	.hn-menu a {
		padding: 12px 0;
		padding-left: 16px;
		white-space: normal;
	}

	/* Mobile: disable hover color, only current page shows selected */
	.hn-menu a:hover {
		color: inherit !important;
	}

	.hn-menu .current-menu-item > a,
	.hn-menu .current-menu-ancestor > a {
		font-weight: 600;
	}

	/* Accordion: parent link with icon as toggle */
	.hn-menu li.menu-item-has-children > a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		-webkit-tap-highlight-color: transparent;
	}

	.hn-menu li.menu-item-has-children > a > .hn-dropdown-icon {
		padding: 8px 12px;
		margin-right: -12px;
		cursor: pointer;
		transition: transform .25s;
	}

	.hn-menu li.menu-item-has-children.accordion-open > a > .hn-dropdown-icon {
		transform: rotate(180deg);
	}

	/* Sub-menus: hidden by default, accordion expand */
	.hn-menu .sub-menu {
		position: static;
		left: auto;
		top: auto;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		min-width: auto;
		padding: 0;
		border-radius: 0;
		max-height: 0;
		overflow: hidden;
		transition: max-height .3s ease;
		z-index: auto;
	}

	.hn-menu li.menu-item-has-children.accordion-open > .sub-menu {
		max-height: 500px;
	}

	/* Override desktop hover – higher specificity */
	.hn-menu li:hover > .sub-menu,
	.hn-menu li > .sub-menu {
		position: static;
		left: auto;
		top: auto;
		transform: none;
		box-shadow: none;
	}

	/* 3rd-level sub-menu icon reset for mobile */
	.hn-menu .sub-menu li.menu-item-has-children > a > .hn-dropdown-icon {
		transform: none;
	}

	/* 3rd-level items deeper indent */
	.hn-menu .sub-menu .sub-menu a {
		padding-left: 48px;
	}

	/* Override desktop sub-menu link padding */
	.hn-menu .sub-menu a {
		padding: 12px 0;
		padding-left: 32px;
	}

	.hn-menu li.menu-item-has-children > a::after {
		display: none;
	}

	/* Mobile search overlay adjustments */
	.hn-search-overlay .hn-search-field {
		font-size: 24px;
	}

	.hn-search-close {
		top: 20px;
		right: 20px;
		font-size: 30px;
	}
}
