.site-header .container {
	max-width: 100%;
	margin: 0 auto;
	padding: 0 40px;
}

/* Header Layout */
body {
	overflow-x: clip;
}

body:not(.invert-header) {
	/* padding-top: 64px; */
}

body.admin-bar:not(.invert-header) {
	/* padding-top: 116px; */
}

body.admin-bar .site-header:not(.niemi-sticky-nav) {
	/* margin-top: 32px; */
}

body.invert-header .site-header {
	position: absolute;
}

.site-header {
	background: #fff;
	/* position: absolute; */
	/* top: 0; */
	left: 0;
	width: 100%;
	z-index: 1000;
	height: 84px;
	display: flex;
	align-items: center;
	padding: 0;
	box-sizing: border-box;
}

html body .site-header .header-inner {
	display: flex;
	width: 100%;
	gap: 0 20px;
	/* Space between logo and nav if nav is large */
}

/* Logo */
.site-logo {
	width: 160px;
	flex-shrink: 0;
	margin-right: auto;
	/* Pushes everything else to the right */
	line-height: 0;
	display: block;
}

.site-logo img {
	height: auto;
	width: 100%;
	max-width: 100%;
}

/* Logo Toggling */
.logo-inverted {
	display: none;
}

body.invert-header .logo-default {
	display: none;
}

body.invert-header .logo-inverted {
	display: block;
}

body.invert-header .site-header.niemi-sticky-nav {
	.logo-default {
		display: block !important;
	}

	.logo-inverted {
		display: none !important;
	}
}

/* Inverted Header Colors */
body.invert-header .site-header:not(.niemi-sticky-nav) {
	background-color: transparent;
	--text-color: #fff;
}

body.invert-header header.site-header:not(.niemi-sticky-nav) nav > ul > li > a {
	color: #fff;
}

body.invert-header header.site-header nav > ul > li.menu-item-has-children > a::after {
	border-top-color: #fff;
}

body.invert-header header.site-header:not(.niemi-sticky-nav) nav > ul > li > a:hover,
body.invert-header header.site-header:not(.niemi-sticky-nav) nav > ul > li:hover > a {
	color: #fff;
	opacity: 0.8;
}

body.invert-header header.site-header:not(.niemi-sticky-nav) .mobile-menu-toggle span {
	background-color: #fff;
}

body.invert-header .site-header:not(.niemi-sticky-nav) {
	background-color: transparent;
	--text-color: #fff;
}

body .site-header {
	/* position: absolute; */
	left: 0;
	right: 0;
	z-index: 998;
}

/* Main Navigation */
header.site-header nav ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 16px;
}

header.site-header nav ul li {
	position: relative;
}

header.site-header nav ul li a {
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	font-family: "Aller";
	color: #000;
	position: relative;
	transition: color 0.3s;
	display: block;
	padding: 8px 0 6px 0;
	white-space: nowrap;
	text-decoration: none;
}

header.site-header nav ul li.menu-item-has-children > a::after {
	content: none;
}

.icon-caret {
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-left: 5px;
	transition: transform 0.3s ease;
}

header.site-header nav.main-navigation ul ul {
	min-width: 220px;
}

header.site-header nav ul li a:hover,
header.site-header nav ul li:hover > a {
	/* color: #d81132; */
}

header.site-header nav ul li:hover > a .icon-caret {
	transform: rotate(180deg);
}

/* Sub-menu styling */
header.site-header nav ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	padding: 10px 0;
	z-index: 999;
	flex-direction: column;
	gap: 0;
}

header.site-header nav ul li:hover > ul {
	display: flex;
}

header.site-header nav ul ul li a {
	padding: 10px 20px;
	text-transform: none;
	font-weight: 700;
	white-space: nowrap;
}

header.site-header nav ul li a svg {
	display: inline-block;
}

header.site-header nav ul ul li a:hover {
	background-color: #f9f9f9;
	/* color: #d81132; */
}

header.site-header nav.language-navigation ul ul {
	padding: 0;
	min-width: 100px;
	left: auto;
	right: 0;
}

/* Header Actions */
.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* CTA Button */
body .site-header .btn-cta {
	background-color: #d81132;
	color: #fff;
	padding: 10px 24px;
	border-radius: 4px;
	/* Slightly rounded as per design? Or standard sharp? using 4px safe */
	font-weight: 700;
	font-size: 15px;
	text-transform: none;
	transition: background-color 0.3s;
	white-space: nowrap;

	background-color: #d81132;
	font-family: "aller", Sans-serif;
	font-size: 14px;
	font-weight: 700;
	fill: #ffffff;
	color: #ffffff;
	padding: 3px 8px 3px 8px;
	border-radius: 4px 3px 3px 3px;
	min-width: 100px;
	text-align: center;
	text-decoration: none;
}

/* max-width 768px */
@media (max-width: 768px) {
	body .site-header .header-actions .btn-cta {
		padding: 3px 4px 3px 4px;
	}
	.header-actions {
		gap: 5px;
	}
}

.btn-cta:hover {
	background-color: #b00b25;
	color: #fff;
}

.language-navigation {
	order: 2;
}

/* Language Switcher */
.language-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
}

header.site-header nav.language-navigation ul li.trp-language-switcher-container > a {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-end;
	/* right align */
	flex-wrap: nowrap !important;
	/* Forces same row */
	gap: 6px;
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	position: relative;
}

header.site-header nav.language-navigation ul li.trp-language-switcher-container > a:hover {
	cursor: pointer;
}

header.site-header nav.language-navigation .trp-menu-ls-label {
	white-space: nowrap !important;
	display: inline-block;
}

/* Language Submenu Styling */
.language-navigation ul ul {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	/* Align right since it's on the right side */
	background: #fff;
	min-width: 120px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	padding: 10px 0;
	z-index: 999;
	flex-direction: column;
	gap: 0;
	list-style: none;
}

.language-navigation li:hover > ul {
	display: flex;
}

.language-navigation ul ul li a {
	padding: 8px 15px;
	white-space: nowrap;
	color: #000;
}

.language-navigation ul ul li a:hover {
	background-color: #f9f9f9;
	color: #d81132;
}

/* Rotation for language arrow */
/* Support click toggle on mobile/tablet */
.language-navigation li.active-mobile-lang > ul {
	display: flex;
}

.language-navigation li.active-mobile-lang > a .icon-caret {
	transform: rotate(180deg);
}

.language-flag {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
	/* Mocking flag if image not present */
	background: #005293;
	background: linear-gradient(90deg, #005293 30%, #fecb00 30%, #fecb00 45%, #005293 45%);
	/* Crude SE flag */
	display: inline-block;
}

/* Mobile Toggle */
header.site-header .mobile-menu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px;
	flex-direction: column;
	gap: 5px;
}

header.site-header .mobile-menu-toggle span {
	display: block;
	width: 28px;
	height: 3px;
	background-color: #000;
	border-radius: 3px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
	position: fixed;
	top: 64px;
	left: 0;
	width: 100vw;
	height: calc(100dvh - 64px);
	background: #11151a;
	z-index: 9999;
	/* Higher z-index to be sure */
	transform: translateX(100%);
	transition: transform 0.3s ease-in-out;
	/* padding: 40px 40px;  */
	box-sizing: border-box;
	color: #fff;
	overflow-y: scroll;
	/* Force scrolling context */
	-webkit-overflow-scrolling: touch;
	/* Smooth scroll on iOS */
	padding-bottom: 150px;
}

.mobile-menu-overlay.is-active {
	transform: translateX(0);
}

.mobile-menu-overlay ul {
	list-style: none;
	padding: 12px 0 0 0;
	margin: 0;
}

/* .mobile-menu-overlay > ul > li {
			padding-left: 20px;
			padding-right: 20px;
		  } */

.mobile-menu-overlay ul.sub-menu {
	margin-top: 0;
	margin-bottom: 0;
	padding-bottom: 14px;
	background-color: #1b242f;
}

.mobile-menu-overlay ul.sub-menu > li > a {
	padding-top: 10px;
	padding-bottom: 10px;
}

.mobile-menu-overlay > ul > li > a {
	padding: 14px 14px;
}

.mobile-menu-overlay ul li a {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	/* text-transform: uppercase; */
	display: flex;
	justify-content: space-between;
	align-items: center;
	text-decoration: none;
}

.mobile-menu-overlay .menu-item-has-children > a::after {
	content: none;
}

/* Hide mobile submenus by default */
.mobile-menu-overlay ul ul {
	display: none;
	padding-left: 20px;
	padding-right: 20px;
	margin-top: 10px;
}

/* Show submenu when open */
.mobile-menu-overlay ul li.submenu-open > ul {
	display: block;
}

/* Styled toggle button injected via JS */
.mobile-submenu-toggle {
	cursor: pointer;
	padding: 0 10px;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	height: 100%;
}

.mobile-menu-overlay ul li.submenu-open > a .mobile-submenu-toggle .icon-caret {
	transform: rotate(180deg);
}

@media (max-width: 768px) {
	body .site-header .header-inner {
		gap: 10px;
		flex-wrap: nowrap;
		align-items: center;
	}

	.header-actions {
		gap: 10px;
	}

	header.site-header .mobile-menu-toggle {
		display: flex;
	}

	header.site-header nav.main-navigation {
		display: none;
	}
}

.main-navigation,
.header-actions {
	margin-top: 5px;
}

@media (max-width: 1300px) {
	.site-header .container {
		padding: 0 20px;
	}

	.main-navigation,
	.header-actions {
		margin-top: 0px;
	}
}

/* Intermediate Layout (Tablet): Wrap Menu */
@media (max-width: 1300px) {
	.site-header {
		height: auto;
		padding: 10px 0;
	}

	.site-header .header-inner {
		align-items: center;
	}

	.header-inner {
		flex-wrap: wrap;
		gap: 12px;
		row-gap: 0;
	}

	header.site-header nav.main-navigation {
		order: 99;
		width: 100%;
		/* margin-top: 10px; */
		display: block !important;
		/* Ensure visible until 768px overrides it */
	}

	header.site-header nav.main-navigation ul {
		justify-content: flex-end;
		gap: 20px;
	}
}

/* Mobile specific overrides */
@media (max-width: 768px) {
	.site-header {
		height: 64px;
	}
	.site-header .container {
		padding: 0 10px;
	}

	header.site-header nav.main-navigation {
		display: none !important;
		/* Hide again on proper mobile */
	}

	.site-logo {
		max-width: 128px;
	}
}
