/* ==========================================================
   B2 GLOBAL HEADER
   Grundlage: finaler Header-Stand der B2-Startseite
   ========================================================== */

:root {
	--b2-green: #56862d;
	--b2-green-dark: #426a21;
}

/* GeneratePress-Standardheader überall deaktivieren. */
body.b2-global-header-active #masthead,
body.b2-global-header-active .site-header:not(.b2-global-header) {
	display: none !important;
}

/*
 * Globaler Header: bewusst FIXED statt STICKY.
 * So bleibt er unabhängig von overflow-/transform-Regeln des Themes
 * auf Desktop, Tablet und Smartphone sicher im Viewport.
 * Breite/Höhe des eigentlichen Header-Inhalts bleiben unverändert.
 */
.b2-global-header {
	position: fixed;
	z-index: 2147483000;
	top: 0;
	right: 0;
	left: 0;
	width: 100%;
	margin: 0;
	background: #ffffff;
	border: 0;
	box-shadow: none;
	box-sizing: border-box;
}

/* Auf normalen Unterseiten ersetzt der Spacer exakt den Platz,
 * den der Header vorher im Dokumentfluss eingenommen hat. */
.b2-global-header-spacer {
	display: block;
	height: 66px;
}

/* Auf der Startseite lag der Header schon vorher über dem Hero.
 * Deshalb dort keinen zusätzlichen Platz erzeugen. */
body.home.b2-global-header-overlay-home .b2-global-header-spacer {
	height: 0;
}

/* Verhindert doppelte Header, falls der alte Homepage-Header noch im Seiten-HTML steckt. */
body.b2-global-header-active .b2-custom-header:not(.b2-global-header) {
	display: none !important;
}

.b2-custom-header__inner {
	display: flex;
	align-items: center;
	width: min(calc(100% - 64px), 1280px);
	min-height: 66px;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
	background: transparent;
}

.b2-custom-header__brand {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 10px;
	color: #111111;
	text-decoration: none;
}

.b2-custom-header__brand:hover {
	color: #111111;
}

.b2-custom-header__logo {
	display: block;
	flex: 0 0 auto;
	width: 58px;
	max-width: 58px;
	height: auto;
	margin: 0;
	object-fit: contain;
}

.b2-custom-header__brand-copy {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.b2-custom-header__brand-copy strong {
	margin: 0;
	color: #111111;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.12;
	white-space: nowrap;
}

.b2-custom-header__brand-copy small {
	margin-top: 2px;
	color: #555555;
	font-size: 10px;
	font-weight: 400;
	line-height: 1.15;
	white-space: nowrap;
}

.b2-custom-header__nav {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 28px;
	margin-left: auto;
	transform: translateY(1px);
}

.b2-custom-header__nav a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0;
	color: #111111;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.b2-custom-header__nav a:hover,
.b2-custom-header__nav a:focus-visible {
	color: var(--b2-green);
}

.b2-custom-header__toggle {
	display: none;
	width: 42px;
	height: 42px;
	margin-left: auto;
	padding: 7px;
	background: transparent;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}

.b2-custom-header__toggle span {
	display: block;
	width: 25px;
	height: 2px;
	margin: 5px auto;
	background: #111111;
}

.b2-custom-header__mobile-nav {
	display: none;
}

#b2-global-header.b2-global-header.is-open > .b2-custom-header__mobile-nav {
	display: grid !important;
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

@media (max-width: 1180px) {
	.b2-custom-header__inner {
		width: min(calc(100% - 40px), 1050px);
	}

	.b2-custom-header__nav {
		gap: 20px;
	}

	.b2-custom-header__nav a {
		font-size: 10px;
	}

	.b2-custom-header__brand-copy strong {
		font-size: 15px;
	}

	.b2-custom-header__brand-copy small {
		font-size: 9px;
	}
}

@media (max-width: 900px) {
	.b2-custom-header__inner {
		width: calc(100% - 30px);
		min-height: 64px;
	}

	.b2-custom-header__logo {
		width: 50px;
		max-width: 50px;
	}

	.b2-custom-header__brand-copy strong {
		font-size: 14px;
	}

	.b2-custom-header__brand-copy small {
		font-size: 9px;
	}

	.b2-custom-header__nav {
		display: none;
		transform: none;
	}

	#b2-global-header .b2-custom-header__toggle {
		display: block !important;
		position: relative;
		z-index: 3;
		pointer-events: auto;
		touch-action: manipulation;
	}

	#b2-global-header > .b2-custom-header__mobile-nav {
		position: absolute;
		z-index: 2;
		top: 100%;
		right: 0;
		left: 0;
		grid-template-columns: 1fr;
		padding: 8px 18px;
		background: #ffffff;
		border-top: 1px solid #eeeeee;
		box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
	}

	.b2-custom-header__mobile-nav a {
		display: block;
		padding: 13px 0;
		color: #111111;
		font-size: 12px;
		font-weight: 700;
		line-height: 1.2;
		text-decoration: none;
		text-transform: uppercase;
		border-bottom: 1px solid #eeeeee;
	}

	.b2-custom-header__mobile-nav a:last-child {
		border-bottom: 0;
	}
}

@media (max-width: 560px) {
	.b2-custom-header__brand {
		gap: 8px;
	}

	.b2-custom-header__logo {
		width: 44px;
		max-width: 44px;
	}

	.b2-custom-header__brand-copy strong {
		font-size: 13px;
	}

	.b2-custom-header__brand-copy small {
		display: none;
	}
}


/* WordPress-Adminleiste bei eingeloggten Benutzern berücksichtigen. */
body.admin-bar .b2-global-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .b2-global-header {
		top: 46px;
	}
}

@media (max-width: 900px) {
	.b2-global-header-spacer {
		height: 64px;
	}

	body.home.b2-global-header-overlay-home .b2-global-header-spacer {
		height: 0;
	}
}
