/**
 * Vawell Power site header.
 *
 * @package Vawell_Power
 */

.vp-site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--vp-color-white) !important;
	border-bottom: 0;
	box-shadow: none !important;
	font-family: var(--vp-font-body);
	transition: transform 240ms ease, box-shadow 240ms ease;
}

.vp-site-header.is-scrolled {
	box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 7%) !important;
}

.vp-site-header.is-hidden {
	transform: translateY(-105%);
}

.vp-mobile-menu__header,
.vp-mobile-menu__extra {
	display: none;
}

.vp-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: calc(100% - (var(--vp-content-gutter) * 2));
	max-width: none;
	min-height: 100px;
	margin-inline: auto;
	gap: var(--vp-space-6);
}

.vp-header__brand {
	display: inline-flex;
	flex: 0 0 auto;
	width: clamp(8.75rem, 15vw, 13rem);
	line-height: 0;
}

.vp-header__brand img {
	display: block;
	width: 100%;
	height: auto;
}

.vp-header__navigation {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.vp-primary-menu,
.vp-primary-menu ul {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vp-primary-menu {
	gap: 2rem;
}

.vp-primary-menu a {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: auto;
	padding: 4px 10px;
	color: var(--vp-color-text-muted);
	font-family: var(--vp-font-body) !important;
	font-size: 0.875rem;
	font-weight: 400;
	letter-spacing: 0;
	text-decoration: none;
	white-space: nowrap;
}

.vp-primary-menu a:hover,
.vp-primary-menu a:focus-visible,
.vp-primary-menu .current-menu-item > a,
.vp-primary-menu .current-menu-ancestor > a {
	color: var(--vp-color-text);
}

.vp-primary-menu > .current-menu-item > a::before,
.vp-primary-menu > .current-menu-ancestor > a::before {
	width: 0.375rem;
	height: 0.375rem;
	margin-right: 0.5rem;
	border-radius: 50%;
	background: var(--vp-color-red, #f00);
	animation: vp-nav-dot-pulse 1.8s ease-in-out infinite;
	content: "";
}

@keyframes vp-nav-dot-pulse {
	0%,
	100% { box-shadow: 0 0 0 0 rgb(255 0 0 / 0%); transform: scale(1); }
	50% { box-shadow: 0 0 0 0.25rem rgb(255 0 0 / 16%); transform: scale(1.08); }
}

.vp-primary-menu .menu-item-has-children > a::after {
	width: 0.4rem;
	height: 0.4rem;
	margin-left: 0.5rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	content: "";
}

.vp-primary-menu .sub-menu {
	position: absolute;
	display: block;
	min-width: 13rem;
	padding: 0.75rem;
	background: var(--vp-color-white);
	border: 0;
	border-radius: var(--vp-radius-sm);
	box-shadow: var(--vp-shadow-soft);
	opacity: 0;
	pointer-events: none;
	transform: translateY(0.5rem);
	transition: opacity var(--vp-duration-fast) var(--vp-ease-standard), transform var(--vp-duration-fast) var(--vp-ease-standard);
}

.vp-primary-menu .menu-item-has-children {
	position: relative;
}

.vp-primary-menu .menu-item-has-children:hover > .sub-menu,
.vp-primary-menu .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.vp-primary-menu .sub-menu a {
	display: flex;
	width: 100%;
	padding: 0.625rem 0.75rem;
	border-radius: var(--vp-radius-sm);
}

.vp-primary-menu .sub-menu a:hover,
.vp-primary-menu .sub-menu a:focus-visible,
.vp-primary-menu .sub-menu .current-menu-item > a {
	background: rgb(249 0 0 / 7%);
	color: var(--vp-color-red);
}

.vp-primary-menu .menu-item-has-children:has(.vp-product-menu-item) > .sub-menu {
	padding: 0.375rem;
	border-radius: 0.625rem;
}

.vp-primary-menu .sub-menu .vp-product-menu-item > a {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 0;
	padding: .625rem;
	color: #888;
	font-family: var(--vp-font-heading) !important;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: -.035em;
	line-height: 1.1;
	white-space: nowrap;
}

.vp-primary-menu .sub-menu .vp-product-menu-item > a::before {
	width: 1rem;
	height: 1rem;
	flex: 0 0 1rem;
	background: center / contain no-repeat;
	content: '';
}

.vp-primary-menu .menu-item-has-children:has(.vp-service-menu-item) > .sub-menu {
	padding: 0.375rem;
	border-radius: 0.625rem;
}

.vp-primary-menu .sub-menu .vp-service-menu-item > a {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 0;
	padding: .625rem;
	color: #888;
	font-family: var(--vp-font-heading) !important;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: -.035em;
	line-height: 1.1;
	white-space: nowrap;
}

.vp-primary-menu .sub-menu .vp-service-menu-item > a::before {
	width: 1rem;
	height: 1rem;
	flex: 0 0 1rem;
	background: center / contain no-repeat;
	content: '';
}

.vp-primary-menu .sub-menu .vp-service-menu-item--renewable > a::before { background-image: url('../images/services/menu-renewable.png'); }
.vp-primary-menu .sub-menu .vp-service-menu-item--metering > a::before { background-image: url('../images/services/menu-metering.png'); }
.vp-primary-menu .sub-menu .vp-service-menu-item--testing > a::before { background-image: url('../images/services/menu-testing.png'); }
.vp-primary-menu .sub-menu .vp-service-menu-item--industrial > a::before { background-image: url('../images/services/menu-industrial.png'); }
.vp-primary-menu .sub-menu .vp-service-menu-item--procurement > a::before { background-image: url('../images/services/menu-procurement.png'); }
.vp-primary-menu .sub-menu .vp-service-menu-item--turnkey > a::before { background-image: url('../images/services/menu-turnkey.png'); }
.vp-primary-menu .sub-menu .vp-service-menu-item--electrical > a::before { background-image: url('../images/services/menu-electrical.png'); }

.vp-primary-menu .sub-menu .vp-product-menu-item--low-voltage > a::before { background-image: url('../images/products/selector/low-voltage.png'); }
.vp-primary-menu .sub-menu .vp-product-menu-item--medium-voltage > a::before { background-image: url('../images/products/selector/medium-voltage.png'); }
.vp-primary-menu .sub-menu .vp-product-menu-item--busbar > a::before { background-image: url('../images/products/selector/busbar.png'); }
.vp-primary-menu .sub-menu .vp-product-menu-item--loose-components > a::before { background-image: url('../images/products/selector/loose-components.png'); }
.vp-primary-menu .sub-menu .vp-product-menu-item--green-energy > a::before { background-image: url('../images/products/selector/green-energy.png'); }
.vp-primary-menu .sub-menu .vp-product-menu-item--packaged-equipment > a::before { background-image: url('../images/products/selector/packaged-equipment.png'); }

.vp-primary-menu .vp-menu-contact > a,
.vp-primary-menu .vp-menu-store > a {
	padding: 10px 20px;
	border-radius: var(--vp-radius-pill);
	font-size: 1rem;
	font-weight: 500;
}

.vp-primary-menu .vp-menu-contact > a {
	background: rgb(249 0 0 / 5%);
	color: var(--vp-color-text);
}

.vp-primary-menu .vp-menu-store > a {
	background: var(--vp-color-red);
	color: var(--vp-color-white);
}

.vp-primary-menu .vp-menu-contact > a:hover,
.vp-primary-menu .vp-menu-contact > a:focus-visible,
.vp-primary-menu .vp-menu-store > a:hover,
.vp-primary-menu .vp-menu-store > a:focus-visible {
	transform: translateY(-2px);
}

.vp-primary-menu .vp-menu-store > a:hover,
.vp-primary-menu .vp-menu-store > a:focus-visible {
	background: #d90000;
	color: var(--vp-color-white);
	box-shadow: 0 .6rem 1.25rem rgb(249 0 0 / 22%);
}

/**
 * The two header CTAs sit closer together than the primary navigation links.
 * The parent menu gap is 32px, so this offsets the second CTA by 24px to leave
 * the intended 8px visual gap.
 */
.vp-primary-menu .vp-menu-contact + .vp-menu-store {
	margin-left: -24px;
}

.vp-menu-toggle {
	display: none;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0.6rem;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.vp-menu-toggle > span:not(.screen-reader-text) {
	display: block;
	height: 2px;
	margin: 5px 0;
	background: var(--vp-color-black);
	transition: transform var(--vp-duration-fast) var(--vp-ease-standard), opacity var(--vp-duration-fast) var(--vp-ease-standard);
}

.vp-menu-toggle:hover,
.vp-menu-toggle:focus-visible,
.vp-menu-toggle:active {
	background: transparent !important;
	color: inherit;
	box-shadow: none;
}

.vp-menu-toggle,
.vp-menu-toggle:hover,
.vp-menu-toggle:focus,
.vp-menu-toggle:focus-visible,
.vp-menu-toggle:active,
.vp-mobile-menu__close,
.vp-mobile-menu__close:hover,
.vp-mobile-menu__close:focus,
.vp-mobile-menu__close:focus-visible,
.vp-mobile-menu__close:active {
	background-color: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
}

.vp-menu-toggle:focus-visible,
.vp-mobile-menu__close:focus-visible {
	outline: 2px solid var(--vp-color-red);
	outline-offset: 3px;
}

@media (max-width: 60rem) {
	.vp-header__inner {
		min-height: 4.5rem;
	}

	.vp-menu-toggle {
		display: block;
	}

	.vp-header__navigation {
		position: absolute;
		top: 100%;
		left: 0;
		display: none;
		width: 100%;
		padding: 1rem var(--vp-content-gutter) 1.5rem;
		background: var(--vp-color-white);
		border-bottom: 1px solid var(--vp-color-border);
		box-shadow: var(--vp-shadow-soft);
	}

	.vp-header__navigation.is-open {
		display: block;
	}

	.vp-primary-menu,
	.vp-primary-menu ul {
		display: block;
	}

	.vp-primary-menu li {
		border-bottom: 1px solid rgb(26 26 26 / 7%);
	}

	.vp-primary-menu a {
		width: 100%;
		min-height: 3rem;
	}

	.vp-primary-menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 0.5rem 1rem;
		border: 0;
		box-shadow: none;
		opacity: 1;
		pointer-events: auto;
		transform: none;
	}

	.vp-primary-menu .menu-item-has-children:has(.vp-product-menu-item) > .sub-menu {
		padding: 0 0 .5rem 1rem;
	}

	.vp-primary-menu .menu-item-has-children:has(.vp-service-menu-item) > .sub-menu {
		padding: 0 0 .5rem 1rem;
	}

	.vp-primary-menu .sub-menu .vp-product-menu-item > a {
		min-height: 3rem;
		font-size: 1rem;
	}

	.vp-primary-menu .sub-menu .vp-product-menu-item > a::before {
		width: 1.5rem;
		height: 1.5rem;
		flex-basis: 1.5rem;
	}

	.vp-primary-menu .sub-menu .vp-service-menu-item > a { min-height: 3rem; font-size: 1rem; }
	.vp-primary-menu .sub-menu .vp-service-menu-item > a::before { width: 1.5rem; height: 1.5rem; flex-basis: 1.5rem; }

	.vp-primary-menu .vp-menu-contact > a,
	.vp-primary-menu .vp-menu-store > a {
		justify-content: center;
		width: 100%;
		margin-top: 0.75rem;
	}
}

/* Final mobile overlay overrides. Keep these after the desktop and mobile menu rules above. */
@media (max-width: 60rem) {
	.vp-header__navigation {
		position: fixed;
		inset: 0;
		display: flex !important;
		width: 100%;
		min-height: 100svh;
		padding: 2rem 1.25rem 2.25rem;
		box-sizing: border-box;
		flex-direction: column;
		align-items: stretch;
		background: var(--vp-color-white);
		border: 0;
		box-shadow: none;
		opacity: 0;
		pointer-events: none;
		transform: translateY(-100%);
		transition: opacity .4s ease, transform .4s cubic-bezier(.22, .61, .36, 1);
	}

	.vp-header__navigation.is-open {
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0);
	}

	.vp-mobile-menu__header {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		width: 100%;
	}
	.vp-mobile-menu__brand { display: block; width: min(9rem, 44vw); line-height: 0; }
	.vp-mobile-menu__brand img { display: block; width: 100%; height: auto; }
	.vp-mobile-menu__close {
		position: relative;
		width: 2.25rem;
		height: 2.25rem;
		padding: 0;
		border: 0;
		background: transparent;
		cursor: pointer;
	}
	.vp-mobile-menu__close span {
		position: absolute;
		top: 50%;
		left: 50%;
		display: block;
		width: 1.9rem;
		height: 1.5px;
		background: var(--vp-color-black);
		transform: translate(-50%, -50%) rotate(45deg);
	}
	.vp-mobile-menu__close span + span { transform: translate(-50%, -50%) rotate(-45deg); }

	.vp-primary-menu {
		display: flex !important;
		flex: 1;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 1.75rem;
	}

	.vp-primary-menu li { border: 0; }
	.vp-primary-menu a {
		width: auto;
		min-height: 0;
		padding: 0;
		font-size: 1.5rem;
		font-weight: 400;
	}
	.vp-primary-menu .sub-menu { display: none !important; }
	.vp-primary-menu > .current-menu-item > a::before,
	.vp-primary-menu > .current-menu-ancestor > a::before,
	.vp-primary-menu .menu-item-has-children > a::after { display: none; }

	.vp-primary-menu .vp-menu-contact,
	.vp-primary-menu .vp-menu-store { width: min(100%, 40rem); }
	.vp-primary-menu .vp-menu-contact,
	.vp-primary-menu .vp-menu-store {
		align-self: center;
		margin-left: 0 !important;
	}
	.vp-primary-menu .vp-menu-contact > a,
	.vp-primary-menu .vp-menu-store > a {
		justify-content: center;
		width: 100%;
		padding: .75rem 1rem;
		font-size: 1rem;
	}
	.vp-primary-menu .vp-menu-contact > a { margin-top: 1rem; }
	.vp-primary-menu .vp-menu-contact + .vp-menu-store > a { margin-top: -1rem; }
	body.vp-mobile-menu-is-open { overflow: hidden; }
}
