:root {
	--text-color: #000000;
}

body {
	/* Todo, base this on the height of the menu. */
	margin-top: 99px;
}

html,
body {
	scroll-behavior: smooth;
	scroll-padding-top: 99px;
}

body>header {
	background: #fff;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: 1000;
	box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.1) !important;
}

body>header .site-nav,
body>header>nav {
	width: 1592px;
	max-width: 95%;
	padding-top: 20px;
	padding-bottom: 20px;
	margin: 0 auto;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 7vw;
}

body>header .site-nav .menu-primary {
	flex: 1
}

body>header .site-nav .menu,
body>header>nav .menu {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	align-items: center;
}

body #mobile-sidebar .menu a,
body>header .site-nav .menu a,
body>header>nav .menu a {
	font-size: 16px !important;
	line-height: 1.4em !important;
	text-decoration: none;
	color: var(--text-color);
	font-weight: 600;
}

/* Sub-menu styles */
body>header .site-nav .menu li,
body>header>nav .menu li {
	position: relative;
}

/* Toggle button for menu items with children */
body>header .site-nav .menu .menu-item-has-children>a,
body>header>nav .menu .menu-item-has-children>a {
	position: relative;
	padding-right: 25px;
	cursor: pointer;
}

body>header .site-nav .menu .menu-item-has-children>a::after,
body>header>nav .menu .menu-item-has-children>a::after {
	content: '';
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%) rotate(90deg);
	width: 10px;
	height: 20px;
	background-color: var(--text-color);
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E");
	mask-repeat: no-repeat;
	mask-size: contain;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	-webkit-mask-position: center;
	transition: transform 0.3s ease-in-out;
	pointer-events: none;
}

body>header .site-nav .menu .menu-item-has-children.sub-menu-open>a::after,
body>header>nav .menu .menu-item-has-children.sub-menu-open>a::after,
body>header .site-nav .menu .menu-item-has-children:hover>a::after,
body>header>nav .menu .menu-item-has-children:hover>a::after {
	transform: translateY(-50%) rotate(270deg);
}

/* Mobile sidebar toggle button */
body #mobile-sidebar .menu .menu-item-has-children>a {
	position: relative;
	padding-right: 35px;
	cursor: pointer;
	box-sizing: border-box;
}

body #mobile-sidebar .menu .menu-item-has-children>a::after {
	content: '';
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%) rotate(90deg);
	width: 1em;
	height: 1em;
	background-color: var(--text-color);
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E");
	mask-repeat: no-repeat;
	mask-size: contain;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	-webkit-mask-position: center;
	transition: transform 0.3s ease-in-out;
	pointer-events: none;
}

body #mobile-sidebar .menu .menu-item-has-children.sub-menu-open>a::after {
	transform: translateY(-50%) rotate(270deg);
}

body>header .site-nav .menu .sub-menu,
body>header>nav .menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: #ffffff;
	box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	padding: 10px 0;
	margin-top: 10px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease-in-out;
	z-index: 1001;
	list-style: none;
	margin-left: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

body>header .site-nav .menu li:hover>.sub-menu,
body>header>nav .menu li:hover>.sub-menu,
body>header .site-nav .menu li.menu-item-has-children:hover>.sub-menu,
body>header>nav .menu li.menu-item-has-children:hover>.sub-menu,
body>header .site-nav .menu li.sub-menu-open>.sub-menu,
body>header>nav .menu li.sub-menu-open>.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

body>header .site-nav .menu .sub-menu li,
body>header>nav .menu .sub-menu li {
	width: 100%;
	padding: 0;
	margin: 0;
}

body>header .site-nav .menu .sub-menu a,
body>header>nav .menu .sub-menu a {
	display: block;
	padding: 10px 20px;
	font-size: 16px !important;
	line-height: 1.5em !important;
	color: var(--text-color);
	text-decoration: none;
	transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

body>header .site-nav .menu .sub-menu a:hover,
body>header>nav .menu .sub-menu a:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

body>header .site-nav .menu .sub-menu .sub-menu,
body>header>nav .menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	margin-top: 0;
	margin-left: 10px;
}

body>header .site-nav .logo-link {
	line-height: 0;
}

/* Todo, optimize mobile. */
/* Mobile-first: collapsed nav */
body>header .mobile-menu-buttons {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: flex-end;
}

body>header .nav-toggle {
	background: none;
	border: 0;
	width: 40px;
	height: 40px;
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	cursor: pointer;
}

body>header .nav-toggle .nav-toggle-bar {
	display: block;
	width: 100%;
	height: 4px;
	background: #440099;
}

body>header .site-nav {
	position: relative;
	flex-wrap: wrap;
}

body #mobile-sidebar .mobile-sidebar-inner .mobile-sidebar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

body #mobile-sidebar .mobile-sidebar-inner .logo-link {
	line-height: 0;
	width: 80%;
	max-width: 220px;
}

body #mobile-sidebar .mobile-sidebar-inner .logo-link img {
	width: 100%;
	height: auto;
}

body #mobile-sidebar .mobile-sidebar-inner .mobile-sidebar-header-close svg {
	cursor: pointer;
	width: 25px;
	height: 25px;
}

body #mobile-sidebar {
	position: fixed;
	top: 0px;
	right: 0px;
	bottom: 0px;

	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 20px;
	padding: 20px;
	width: 90%;
	max-width: 400px;

	z-index: 9999;
	background: #ffffff;
	box-sizing: border-box;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease-in-out;
	box-shadow: 0 0 #0000, 0 0 #0000, 0 4px 10px 0 rgba(0, 0, 0, .2);
}

body #mobile-sidebar .mobile-sidebar-inner a {
	display: block;
	width: 100%;
}

body #mobile-sidebar .mobile-sidebar-inner li {
	padding: 3px 0;
}

body #mobile-sidebar .menu .sub-menu {
	display: none;
	list-style: none;
	margin-left: 0;
	padding-left: 20px;
	margin-top: 5px;
}

body #mobile-sidebar .menu li.menu-item-has-children.sub-menu-open>.sub-menu,
body #mobile-sidebar .menu .sub-menu.sub-menu-open {
	display: block;
}

body #mobile-sidebar .menu .sub-menu li {
	padding: 3px 0;
}

body #mobile-sidebar .menu .sub-menu a {
	font-size: 14px !important;
	padding: 5px 0;
}

/* WPML Language Switcher - Mobile: Horizontal flags */
body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item > a {
	width: auto;
	padding-right: 0 !important;
}

/* Remove dropdown arrow from WPML items on mobile */
body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item.menu-item-has-children > a::after {
	display: none;
}

/* Show WPML sub-menu inline as horizontal flags */
body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item > .sub-menu {
	display: flex !important;
	flex-direction: row;
	align-items: center;
	gap: 12px;
	padding: 0;
	margin: 0;
	position: static;
}

body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item .sub-menu li {
	padding: 0;
}

body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item .sub-menu a {
	padding: 0;
	width: auto;
}

/* Style the flag images */
body #mobile-sidebar .menu li.menu-item-type-wpml_ls_menu_item img.wpml-ls-flag {
	width: 24px;
	height: auto;
	display: block;
}

body #mobile-sidebar .mobile-sidebar-footer h3 {
	font-size: 25px;
	font-weight: 800;
	text-transform: uppercase;
	line-height: 1.1em;
	margin-bottom: 10px;
}

body #mobile-sidebar .mobile-sidebar-footer a {
	color: #000 !important;
}

body.mobile-sidebar-open {
	overflow: hidden;
}

body.mobile-sidebar-open #mobile-sidebar {
	opacity: 1;
	pointer-events: auto;
}

body>header .mobile-menu-buttons .menu-buttons li:first-child {
	display: none;
}

body.mobile-sidebar-open::after {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
}

/* Stack menus on small screens */
@media (max-width: 1129px) {

	body>header .site-nav:not(.is-open) .menu:not(.menu-buttons),
	body>header .site-nav:not(.is-open) .header-flags {
		display: none;
	}

	/* Hide sub-menus on mobile header (they'll be in mobile sidebar) */
	body>header .site-nav .menu .sub-menu,
	body>header>nav .menu .sub-menu {
		display: none;
	}

	body .menu li.menu-logo a {
		display: none !important;
	}
}

@media (max-width: 475px) {
	body>header .site-nav .logo {
		max-width: 120px;
		height: auto;
	}

	body>header .site-nav,
	body>header>nav {
		gap: 0.5%;
	}
}

/* Desktop: show everything inline; hide toggle */
@media (min-width: 1130px) {

	body>header .site-nav,
	body>header>nav {
		gap: 2vw;
	}

	body>header .site-nav .menu a,
	body>header>nav .menu a {
		font-size: 20px !important;
		line-height: 1.4em !important;
	}

	body #mobile-sidebar,
	body>header .nav-toggle {
		display: none;
	}

	body>header .site-nav .menu {
		flex-direction: row;
	}

	body>header .site-nav .logo-link {
		display: none !important;
	}

	body>header .site-nav .menu li.menu-logo,
	body>header .site-nav .menu li.menu-logo a {
		font-size: 0 !important;
		line-height: 0 !important;
	}
}

@media (min-width: 768px) {
	body>header .mobile-menu-buttons .menu-buttons li:first-child {
		display: block;
	}
}