/**
 * Window Smart Home - Header
 * Top bar, site header, primary navigation and the mobile menu drawer.
 */

/* ==========================================================================
   1. Top bar
   ========================================================================== */

.wsh-topbar {
	background: var(--wsh-navy);
	color: var(--wsh-on-dark-70);
}

.wsh-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wsh-space-3) var(--wsh-space-8);
	min-height: var(--wsh-topbar-height);
	padding-block: var(--wsh-space-2);
	font-size: var(--wsh-fs-xs);
}

.wsh-topbar__item {
	display: flex;
	align-items: center;
	gap: var(--wsh-space-2);
	margin: 0;
	white-space: nowrap;
}

.wsh-topbar__item svg {
	flex: 0 0 auto;
	color: var(--wsh-blue);
}

.wsh-topbar__item a {
	color: var(--wsh-on-dark-70);
}

.wsh-topbar__item a:hover {
	color: var(--wsh-white);
}

@media (max-width: 700px) {
	.wsh-topbar__hours {
		display: none;
	}
}

/* ==========================================================================
   2. Site header
   ========================================================================== */

.wsh-header {
	position: relative;
	z-index: var(--wsh-z-header);
	background: var(--wsh-white);
	box-shadow: var(--wsh-shadow-sm);
}

.wsh-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wsh-space-6);
	height: var(--wsh-header-height);
}

/* ------------------------------------------------------------------------
   Branding
   ------------------------------------------------------------------------ */

.wsh-branding {
	display: flex;
	align-items: center;
	gap: var(--wsh-space-2);
	flex-shrink: 0;
}

.wsh-branding__logo {
	width: auto;
}

.wsh-branding__text {
	display: flex;
	align-items: center;
	gap: var(--wsh-space-2);
}

.wsh-branding__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: var(--wsh-radius-sm);
	background: var(--wsh-blue-10);
	color: var(--wsh-blue);
}

.wsh-branding__name {
	color: var(--wsh-ink);
	font-size: 1.375rem;
	font-weight: var(--wsh-fw-bold);
}

/* ------------------------------------------------------------------------
   Primary navigation
   ------------------------------------------------------------------------ */

.wsh-nav {
	display: flex;
	align-items: center;
	gap: var(--wsh-space-8);
}

.wsh-nav__list {
	display: flex;
	align-items: center;
	gap: var(--wsh-space-6);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wsh-nav__list a {
	position: relative;
	display: inline-block;
	padding-block: 4px;
	color: var(--wsh-ink);
	font-size: var(--wsh-fs-sm);
	font-weight: var(--wsh-fw-medium);
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.wsh-nav__list a:hover {
	color: var(--wsh-blue);
}

.wsh-nav__list > li {
	position: relative;
}

.wsh-nav__list > li.current-menu-item > a,
.wsh-nav__list > li.current_page_item > a {
	color: var(--wsh-blue);
}

.wsh-nav__list > li.current-menu-item > a::after,
.wsh-nav__list > li.current_page_item > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--wsh-blue);
	border-radius: 2px;
}

.wsh-nav__list > li.menu-item-has-children > a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.wsh-nav__list > li.menu-item-has-children > a::before {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform var(--wsh-transition);
}

.wsh-nav__list > li.menu-item-has-children:hover > a::before {
	transform: rotate(225deg);
}

.wsh-nav__list .sub-menu {
	position: absolute;
	top: calc(100% + 14px);
	left: 0;
	z-index: var(--wsh-z-drawer);
	min-width: 220px;
	margin: 0;
	padding: var(--wsh-space-2);
	border-radius: var(--wsh-radius-md);
	background: var(--wsh-white);
	box-shadow: var(--wsh-shadow-lg);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--wsh-transition), transform var(--wsh-transition), visibility var(--wsh-transition);
}

.wsh-nav__list > li.menu-item-has-children:hover .sub-menu,
.wsh-nav__list > li.menu-item-has-children:focus-within .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.wsh-nav__list .sub-menu a {
	display: block;
	padding: var(--wsh-space-2) var(--wsh-space-3);
	border-radius: var(--wsh-radius-sm);
	color: var(--wsh-ink);
	text-transform: none;
	white-space: nowrap;
}

.wsh-nav__list .sub-menu a::after {
	display: none;
}

.wsh-nav__list .sub-menu a:hover {
	background: var(--wsh-blue-10);
	color: var(--wsh-blue);
}

/* ------------------------------------------------------------------------
   Header actions - CTA + mobile toggle
   ------------------------------------------------------------------------ */

.wsh-header__actions {
	display: flex;
	align-items: center;
	gap: var(--wsh-space-5);
	flex-shrink: 0;
}

.wsh-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--wsh-radius-sm);
	background: transparent;
	color: var(--wsh-ink);
}

.wsh-menu-toggle__bars,
.wsh-menu-toggle__bars::before,
.wsh-menu-toggle__bars::after {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform var(--wsh-transition), opacity var(--wsh-transition);
}

.wsh-menu-toggle__bars {
	position: relative;
}

.wsh-menu-toggle__bars::before,
.wsh-menu-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.wsh-menu-toggle__bars::before {
	top: -7px;
}

.wsh-menu-toggle__bars::after {
	top: 7px;
}

.wsh-menu-toggle[aria-expanded="true"] .wsh-menu-toggle__bars {
	background: transparent;
}

.wsh-menu-toggle[aria-expanded="true"] .wsh-menu-toggle__bars::before {
	top: 0;
	transform: rotate(45deg);
}

.wsh-menu-toggle[aria-expanded="true"] .wsh-menu-toggle__bars::after {
	top: 0;
	transform: rotate(-45deg);
}

.wsh-nav__cta.is-mobile {
	display: none;
}

/* ==========================================================================
   3. Mobile navigation drawer
   ========================================================================== */

@media (max-width: 1024px) {
	.wsh-header__actions > .wsh-btn {
		display: none;
	}

	.wsh-menu-toggle {
		display: inline-flex;
	}

	.wsh-nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: var(--wsh-z-drawer);
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wsh-space-6);
		width: min(340px, 84vw);
		padding: calc(var(--wsh-header-height) + var(--wsh-space-6)) var(--wsh-space-6) var(--wsh-space-8);
		background: var(--wsh-white);
		box-shadow: var(--wsh-shadow-lg);
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform var(--wsh-transition-slow);
	}

	.wsh-nav.is-open {
		transform: translateX(0);
	}

	.wsh-nav__list {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wsh-space-4);
		width: 100%;
	}

	.wsh-nav__list .sub-menu {
		position: static;
		visibility: visible;
		opacity: 1;
		transform: none;
		box-shadow: none;
		display: none;
		margin-top: var(--wsh-space-2);
		padding-left: var(--wsh-space-4);
	}

	.wsh-nav__list > li.menu-item-has-children.is-open .sub-menu {
		display: block;
	}

	.wsh-nav__cta.is-mobile {
		display: block;
		width: 100%;
	}

	.wsh-nav__cta.is-mobile .wsh-btn {
		width: 100%;
	}
}

.wsh-nav-backdrop {
	position: fixed;
	inset: 0;
	z-index: calc(var(--wsh-z-drawer) - 1);
	background: rgba(7, 42, 68, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--wsh-transition), visibility var(--wsh-transition);
}

.wsh-nav-backdrop.is-open {
	opacity: 1;
	visibility: visible;
	display: none;
}

@media (min-width: 1025px) {
	.wsh-nav-backdrop {
		display: none;
	}
}
