/**
 * Header, Desktop-Menue und Off-Canvas-Flyout.
 *
 * Das Flyout hatte gemessen: blaue Links (Desktop: orange-braun),
 * 71 px Zeilenhoehe bei 15 px Schrift, linksbuendiges Logo, CTA auf
 * 205 px in einem 343-px-Panel. Alles daran wird hier korrigiert.
 */

/* =====================================================================
   Sticky Header
   Astra Free kennt keinen Sticky Header – die Option steckt im
   Pro-Addon. Deshalb hier per position: sticky.
   ===================================================================== */
#masthead {
	position: sticky;
	top: 0;
	z-index: 999;
	background-color: var(--cz-weiss);
	transition:
		box-shadow var(--cz-dauer) var(--cz-easing),
		background-color var(--cz-dauer) var(--cz-easing);
}

/* Transparenter Header (falls eine Seite ihn nutzt): Astra setzt dort
   position: absolute mit hoeherer Spezifitaet. fixed haelt das Overlay
   ueber dem Hero und laesst den Header trotzdem mitscrollen. */
.ast-theme-transparent-header #masthead {
	position: fixed;
	left: 0;
	right: 0;
	background-color: transparent;
}

.ast-theme-transparent-header.cz-scrolled #masthead {
	background-color: var(--cz-weiss);
}

.admin-bar #masthead {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar #masthead {
		top: 46px;
	}
}

body.cz-scrolled #masthead {
	box-shadow: 0 2px 18px rgba(64, 64, 64, 0.1);
}

#masthead .site-logo-img img,
#masthead .ast-primary-header-bar {
	transition:
		max-height var(--cz-dauer) var(--cz-easing),
		padding var(--cz-dauer) var(--cz-easing);
}

body.cz-scrolled #masthead .site-logo-img img {
	max-height: 44px;
	width: auto;
}

body.cz-scrolled #masthead .ast-primary-header-bar {
	padding-block: 0.25rem;
}

/* =====================================================================
   Desktop-Menue
   ===================================================================== */
#ast-hf-menu-1 .menu-link {
	position: relative;
	font-family: "Quicksand", sans-serif;
	font-weight: 600;
	color: var(--cz-orange-braun);
	transition: color var(--cz-dauer-kurz) var(--cz-easing);
}

/* Unterstrich waechst aus der Mitte statt harter Farbwechsel. */
#ast-hf-menu-1 > .menu-item > .menu-link::after {
	content: "";
	position: absolute;
	left: 15px;
	right: 15px;
	bottom: 30%;
	height: 2px;
	border-radius: 2px;
	background: var(--cz-verlauf-orange);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--cz-dauer) var(--cz-easing);
}

#ast-hf-menu-1 .menu-link:hover {
	color: var(--cz-orange);
}

#ast-hf-menu-1 > .menu-item > .menu-link:hover::after,
#ast-hf-menu-1 > .menu-item.current-menu-item > .menu-link::after,
#ast-hf-menu-1 > .menu-item.current-menu-ancestor > .menu-link::after {
	transform: scaleX(1);
}

#ast-hf-menu-1 .sub-menu {
	border-radius: var(--cz-radius-s);
	overflow: hidden;
	box-shadow: var(--cz-schatten-m);
	border-top: 3px solid var(--cz-orange) !important;
}

#ast-hf-menu-1 .sub-menu .menu-link {
	transition: background-color var(--cz-dauer-kurz) var(--cz-easing);
}

#ast-hf-menu-1 .sub-menu .menu-item:hover > .menu-link {
	background-color: var(--cz-flaeche);
}

/* =====================================================================
   Off-Canvas / Flyout
   ===================================================================== */
#ast-mobile-popup .ast-mobile-popup-inner {
	max-width: 360px;
	width: 88vw;
	/* war Flaeche-Beige, jetzt weiss wie der Desktop-Header */
	background: var(--cz-weiss) !important;
	box-shadow: -12px 0 40px rgba(64, 64, 64, 0.2);
	overscroll-behavior: contain;
}

#ast-mobile-popup .ast-mobile-popup-overlay {
	background: rgba(58, 52, 47, 0.5);
	backdrop-filter: blur(3px);
}

/* --- Kopfzeile mit Schliessen-Kreis --------------------------------- */
#ast-mobile-popup .ast-mobile-popup-header {
	justify-content: flex-end;
	padding: 1rem 1.1rem 0;
	min-height: auto;
}

#ast-mobile-popup .menu-toggle-close {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50%;
	background: var(--cz-orange-braun) !important;
	color: var(--cz-weiss) !important;
	font-size: 20px;
	transition: transform var(--cz-dauer) var(--cz-easing), background-color var(--cz-dauer);
}

#ast-mobile-popup .menu-toggle-close:hover {
	transform: rotate(90deg);
	background: var(--cz-orange) !important;
}

/* --- Logo oben mittig ------------------------------------------------ */
#ast-mobile-popup .ast-mobile-popup-content > .ast-builder-layout-element[data-section="title_tagline"] {
	display: flex;
	justify-content: center;
	padding: 0.25rem 1.5rem 1.4rem;
	border-bottom: 1px solid var(--cz-linie);
	margin-bottom: 0.6rem;
}

#ast-mobile-popup .site-branding,
#ast-mobile-popup .site-logo-img {
	display: flex;
	justify-content: center;
	width: 100%;
}

#ast-mobile-popup .custom-logo {
	max-width: 200px;
	height: auto;
}

/* --- Menuepunkte: kompakt, in Markenfarbe, mit Trennern ------------- */
#ast-mobile-popup .ast-mobile-popup-content .menu-link {
	padding: 0.85rem 1.5rem !important;
	font-family: "Quicksand", sans-serif;
	font-weight: 600;
	font-size: 17px !important;
	line-height: 1.35;
	/* war mittleres Blau – jetzt wie im Desktop-Menue */
	color: var(--cz-orange-braun) !important;
	border-bottom: 1px solid rgba(178, 94, 2, 0.12);
	transition: background-color var(--cz-dauer-kurz) var(--cz-easing), padding-left var(--cz-dauer-kurz) var(--cz-easing);
}

#ast-mobile-popup .ast-mobile-popup-content .menu-item:last-child > .menu-link {
	border-bottom: 0;
}

#ast-mobile-popup .ast-mobile-popup-content .menu-link:hover,
#ast-mobile-popup .ast-mobile-popup-content .current-menu-item > .menu-link {
	background: var(--cz-flaeche);
	padding-left: 1.8rem !important;
}

/* Astra gibt den Zeilen zusaetzliches Aussenmass – hier neutralisiert,
   sonst kommt die gemessene Zeilenhoehe von 71 px zurueck. */
#ast-mobile-popup .ast-mobile-popup-content .menu-item {
	margin: 0;
}

#ast-mobile-popup .ast-mobile-popup-content > * {
	padding-top: 0;
	padding-bottom: 0;
}

/* --- Untermenue ------------------------------------------------------ */
#ast-mobile-popup .sub-menu {
	background: var(--cz-flaeche) !important;
}

#ast-mobile-popup .sub-menu .menu-link {
	padding-left: 2.6rem !important;
	font-size: 15.5px !important;
	font-weight: 500;
	color: var(--cz-text) !important;
	border-bottom-color: rgba(64, 64, 64, 0.08);
}

#ast-mobile-popup .ast-menu-toggle {
	color: var(--cz-orange-braun) !important;
	transition: transform var(--cz-dauer) var(--cz-easing);
}

#ast-mobile-popup .menu-item-has-children.ast-submenu-expanded > .ast-menu-toggle {
	transform: rotate(180deg);
}

/* --- CTA auf volle Panelbreite --------------------------------------- */
/* Astra legt Padding auf zwei verschachtelte Ebenen – zusammen bleiben
   vom 343-px-Panel nur 261 px fuer den Button. Innen auf 0 setzen. */
#ast-mobile-popup .ast-builder-layout-element:has(.ast-custom-button),
#ast-mobile-popup .ast-builder-button-wrap {
	display: block;
	width: 100%;
	padding: 1.2rem 1.5rem 1.7rem !important;
}

#ast-mobile-popup .ast-builder-button-wrap {
	padding: 0 !important;
}

#ast-mobile-popup .ast-custom-button-link {
	display: block;
	width: 100%;
}

#ast-mobile-popup .ast-custom-button {
	display: flex;
	width: 100%;
	padding: 1em 1.5em;
	font-size: 1rem;
}

/* --- Trigger im Header ----------------------------------------------- */
#ast-mobile-header .menu-toggle {
	color: var(--cz-orange-braun) !important;
	transition: transform var(--cz-dauer-kurz) var(--cz-easing);
}

#ast-mobile-header .menu-toggle:active {
	transform: scale(0.92);
}
