/*
 * Navigation (template-parts/site-header.php)
 */

/* Navigation: at the top of the page, it scrolls away with it (the page starts below it: padding of .main-body, css/base.css)
 * Over a hero image it is transparent with white text. The open mobile menu is fixed (the page does not scroll then) */
header.nav-header {
	position: absolute;
	top: 0; /* In .main-body, below the admin bar already */
	left: 0;
	width: 100%;
	padding-top: env(safe-area-inset-top); /* Below the status bar when the page is drawn under it (viewport-fit=cover) */
	background-color: var(--color-white);
	color: var(--color-dark);
	z-index: 100;
	transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out;
}
header.nav-header.nav-on-background:not(.open:not(.closing)) {
	background-color: transparent;
}
@media (min-width: 992px) {
	header.nav-header.nav-on-background {
		color: var(--color-white);
	}
}
html.scrollbar body:is(.nav-open, .popup-open) header.nav-header {
	padding-right: var(--window-scrollbar-width);
}
header.nav-header.open {
	position: fixed;
	top: var(--admin-bar-height);
	z-index: 1000;
}

.nav-holder {
	position: relative;
	justify-content: space-between;
	align-content: flex-start;
	align-items: center;
	position: relative;
	margin-bottom: 0;
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
}

.nav-logo-wrapper {
	justify-self: flex-start;
	align-self: center;
	margin-bottom: 0;
	width: auto;
	z-index: 2;
}
a.nav-logo {
	display: block;
	width: 1.5rem;
	max-width: 100%;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	a.nav-logo {
		width: 6.25rem;
	}
	}

.nav-toggler-wrapper {
	justify-self: flex-end;
	align-self: center;
	margin-left: auto;
	margin-bottom: 0;
	width: auto;
	z-index: 4;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	.nav-toggler-wrapper {
		display: none;
		z-index: 2;
	}
}
button.nav-toggler {
	display: block;
	position: relative;
	width: 1.5em;
	height: 1.5em;
	color: inherit;
	font-size: 1rem;
}
button.nav-toggler > span {
	display: block;
	position: absolute;
	top: calc(50% - 0.0625rem);
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
	width: 100%;
	height: 0.125rem;
	background-color: currentColor;
	border-radius: 0;
}
button.nav-toggler > span:nth-of-type(1) {
	top: calc(50% - 0.3125rem - 0.0625rem);
	transition: transform 0.25s ease, top 0.25s ease 0.25s;
}
button.nav-toggler > span:nth-of-type(2) {
	top: calc(50% + 0.3125rem - 0.0625rem);
	transition: transform 0.25s ease, top 0.25s ease 0.25s;
}
button.nav-toggler > span:nth-of-type(3) {
	transition: opacity 0s ease 0.25s;
}
button.nav-toggler.open > span:nth-of-type(1) {
	top: calc(50% - 0.0625rem);
	transform: rotate(-45deg);
	transition: transform 0.25s ease 0.25s, top 0.25s ease;
}
button.nav-toggler.open > span:nth-of-type(2) {
	top: calc(50% - 0.0625rem);
	transform: rotate(45deg);
	transition: transform 0.25s ease 0.25s, top 0.25s ease;
}
button.nav-toggler.open > span:nth-of-type(3) {
	opacity: 0;
}

.nav-lists-wrapper {
	margin-bottom: 0;
	width: 100%;
	z-index: 1;
}
/*
 * Mobile menu: a panel below the navigation bar to the bottom of the screen (--nav-bar-height: js/components/navigation.js), so the navigation and the page do not change
 * Its height opens and closes (js/components/navigation.js), the list scrolls inside it (the logo and the close button stay)
 */
@media (max-width: 991.98px) {
	.nav-holder {
		position: static;
	}
	.nav-lists-wrapper {
		display: none;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: calc(var(--window-height) - var(--admin-bar-height));
		padding: 0;
		pointer-events: none;
	}
	.nav-lists-outer-holder {
		height: 100%;
		background-color: var(--color-white);
		color: var(--color-dark);
		overflow: hidden;
		pointer-events: auto;
	}
	.nav-lists-inner-holder {
		max-height: 100%;
		padding: calc(var(--nav-bar-height, 4.5rem) + 1.5rem) var(--container-gutter-width) 1.5rem;
		overflow: hidden;
	}
	header.nav-header.open:not(.opening):not(.closing) .nav-lists-inner-holder {
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}
@media (min-width: 992px) { /* When will the Navigation expand */
	.nav-lists-wrapper {
		display: block;
		align-self: flex-start;
		width: calc(100% - (6.25rem + var(--row-gutter-width) * 2));
	}
}
.nav-lists {
	margin-bottom: 0;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	.nav-lists {
		flex-wrap: nowrap;
		justify-content: flex-end;
		align-items: center;
		margin-left: -0.375rem;
		margin-right: -0.375rem;
	}
}
.nav-list-wrapper {
	position: static;
	margin-bottom: 0;
}
.nav-list-wrapper + .nav-list-wrapper {
	margin-top: 0.875rem;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	.nav-list-wrapper {
		width: auto;
		padding-left: 0.375rem;
		padding-right: 0.375rem;
	}
	.nav-list-wrapper + .nav-list-wrapper {
		margin-top: 0;
	}
}

ul.nav-list {
	padding-left: 0;
	font-size: 0.875em;
	font-weight: 500;
	line-height: 1.5;
	list-style: none;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	ul.nav-list {
		display: flex;
		justify-content: flex-end;
		margin-left: -0.375rem;
		margin-right: -0.375rem;
	}
}
ul.nav-list li.menu-item.is-hidden-mobile {
	display: none;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	ul.nav-list li.menu-item.is-hidden-desktop {
		display: none;
	}
	ul.nav-list li.menu-item.is-hidden-mobile {
		display: block;
	}
}
ul.nav-list > li.menu-item {
	display: block;
	margin-bottom: 0.875rem;
}
ul.nav-list > li.menu-item:last-of-type {
	margin-bottom: 0;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	ul.nav-list > li.menu-item {
		padding-left: 0.375rem;
		padding-right: 0.375rem;
	}
	ul.nav-list > li.menu-item,
	ul.nav-list > li.menu-item:last-of-type {
		margin-bottom: 0;
	}
}
ul.nav-list > li.menu-item.menu-item-has-children {
	position: relative;
}
ul.nav-list li.menu-item > a,
ul.nav-list li.menu-item > button {
	display: inline-block;
}
ul.nav-list li.menu-item.current-menu-item:not(.menu-item-has-children) > a,
ul.nav-list li.menu-item.current-menu-item:not(.menu-item-has-children) > button {
	opacity: 0.5;
	pointer-events: none;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	ul.nav-list > li.menu-item > a,
	ul.nav-list > li.menu-item > button {
		display: block;
		white-space: nowrap;
	}
}

ul.nav-list ul.sub-menu {
	display: none;
	padding-left: 1rem;
	overflow: hidden;
	list-style: none;
}
@media (min-width: 992px) { /* When will the Navigation expand */
	ul.nav-list ul.sub-menu {
		padding-left: 0;
	}
	ul.nav-list > li.menu-item > ul.sub-menu {
		position: absolute;
		top: 100%;
		right: 0.375rem;
		text-align: right;
	}
}

button.currency-change.active {
	opacity: 0.5;
	pointer-events: none;
}

/* Navigation: new logo (color from the navigation), on the left on all devices */
a.nav-logo {
	width: 5.25rem;
	color: inherit;
}
a.nav-logo span.logo {
	display: block;
	width: 100%;
	height: auto;
}
a.nav-logo span.logo > svg {
	height: auto;
}
@media (max-width: 991.98px) {
	a.nav-logo {
		width: 4.25rem;
	}
	/* White navigation over the header background image */
	header.nav-header.nav-on-background:not(.open:not(.closing)) {
		color: var(--color-white);
	}
}
header.nav-header.open:not(.closing) {
	color: var(--color-dark);
}
