/* Sticky Header — kein backdrop-filter (verhindert die bekannte Containing-Block-
   Falle mit fixierten Mobile-Drawern), stattdessen solide Fläche + Grid-Linie. */
.site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: rgba(250, 249, 247, 0.96);
	border-bottom: 1px solid var(--line);
	transition: box-shadow var(--dur-base) var(--ease-out);
}

.site-header.is-scrolled {
	box-shadow: var(--shadow-sm);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	height: var(--header-h);
	transition: height var(--dur-base) var(--ease-out);
}

.site-header.is-scrolled .header-inner {
	height: var(--header-h-shrunk);
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex: 0 0 auto;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--ink);
	white-space: nowrap;
}

.brand-logo {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	display: flex;
	transition: width var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out);
}

.brand-logo .custom-logo-link {
	display: flex;
	width: 100%;
	height: 100%;
}

.brand-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.site-header.is-scrolled .brand-logo {
	width: 34px;
	height: 34px;
}

.primary-nav {
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
}

.primary-nav > ul {
	display: flex;
	align-items: center;
	gap: clamp(1.5rem, 2.4vw, 2.6rem);
}

.primary-nav > ul > li {
	position: relative;
}

.primary-nav > ul > li > a {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.96rem;
	font-weight: 500;
	padding: 0.5rem 0.1rem;
	position: relative;
}

.primary-nav > ul > li > a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 100%;
	bottom: 0;
	height: 2px;
	background: var(--accent);
	transition: right var(--dur-base) var(--ease-out);
}

.primary-nav > ul > li > a:hover::after,
.primary-nav > ul > li.current-menu-item > a::after,
.primary-nav > ul > li.current_page_parent > a::after {
	right: 0;
}

.primary-nav .icon.chevron {
	width: 14px;
	height: 14px;
	transition: transform var(--dur-fast) var(--ease-out);
}

.primary-nav li:hover .icon.chevron,
.primary-nav li:focus-within .icon.chevron {
	transform: rotate(180deg);
}

.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translate(-50%, 6px);
	min-width: 260px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	padding: 0.5rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.primary-nav .sub-menu a {
	display: block;
	padding: 0.6rem 0.75rem;
	border-radius: var(--radius);
	font-size: 0.92rem;
}

.primary-nav .sub-menu a:hover {
	background: var(--surface-sunken);
	color: var(--accent);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 1.4rem;
	flex: 0 0 auto;
}

.header-phone {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.88rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.header-phone .icon {
	flex-shrink: 0;
	color: var(--accent);
}

.burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	flex: 0 0 auto;
	color: var(--ink);
	transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.burger:active {
	transform: scale(0.96);
}

.burger .icon {
	width: 22px;
	height: 22px;
}

.burger .icon-close {
	display: none;
}

.burger[aria-expanded='true'] .icon-menu {
	display: none;
}

.burger[aria-expanded='true'] .icon-close {
	display: block;
}

/* Mobile-Drawer: Sibling von <header>, NICHT verschachtelt — sonst fängt der
   sticky Header per Containing-Block-Regel den fixierten Drawer ein. */
.drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(16, 25, 46, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base);
	z-index: 600;
}

.drawer-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.mobile-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(360px, 86vw);
	background: var(--surface);
	z-index: 700;
	transform: translateX(100%);
	transition: transform var(--dur-base) var(--ease-out);
	overflow-y: auto;
	padding: 1.5rem 1.5rem 2.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
}

.mobile-drawer.is-open {
	transform: translateX(0);
}

.mobile-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.mobile-nav ul {
	display: flex;
	flex-direction: column;
}

.mobile-nav > ul > li {
	border-bottom: 1px solid var(--line);
}

.mobile-nav > ul > li > a {
	display: block;
	padding: 0.95rem 0.1rem;
	font-size: 1.05rem;
	font-weight: 500;
	min-height: 44px;
	display: flex;
	align-items: center;
}

.mobile-nav .sub-menu {
	padding: 0 0 0.75rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.mobile-nav .sub-menu a {
	display: flex;
	align-items: center;
	min-height: 44px;
	font-size: 0.94rem;
	color: var(--ink-soft);
}

.mobile-drawer-contact {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.mobile-drawer-contact a {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-size: 0.95rem;
	min-height: 44px;
}

.mobile-drawer-contact .icon {
	color: var(--accent);
	flex-shrink: 0;
}

/* Breakpoint bewusst bei 1199px statt 900px: Markenname + volle Nav-Labels +
   Telefonnummer + CTA-Button passen im Bereich 900-1199px nicht mehr nebeneinander
   (bekannte Navbar-Squeeze-Zone) — Burger deckt diesen Bereich mit ab, was die
   Pflicht-Grenze "Burger < 900px" einschließt statt verletzt. */
@media (max-width: 1199px) {
	.primary-nav,
	.header-actions {
		display: none;
	}

	.burger {
		display: flex;
	}
}

@media (max-width: 900px) {
	.header-inner {
		height: 76px;
	}

	.site-header.is-scrolled .header-inner {
		height: 62px;
	}
}
