/* ==========================================================================
   AM Schwebe-Button + mobiles Menü-Verhalten (2026-10-29)
   Logik in assets/js/am-frontend.js.
   ========================================================================== */

/* --- Menü mobil: beim Runterscrollen weg, beim Hochscrollen wieder da ---
   Der Header (Theme-Builder 23444) ist ein Elementor-Pro-Sticky-Container;
   aktiv traegt er .elementor-sticky--active. Nur bis 767px. */
@media (max-width: 767px) {
	.elementor-location-header .elementor-sticky--active {
		transition: transform .32s cubic-bezier(.2, .7, .2, 1);
		will-change: transform;
	}
	body.am-hdr-weg .elementor-location-header .elementor-sticky--active {
		transform: translateY(calc(-100% - 2px));
	}
}
@media (prefers-reduced-motion: reduce) {
	.elementor-location-header .elementor-sticky--active { transition: none; }
}

/* --- Schwebe-Button --- */
.am-float {
	--am-float-bg: #009EED; /* Akzentblau; Schwarz ging auf dunklen Seiten unter (02.11.) */
	--am-float-fg: #FFFFFF;
	--am-float-ak: #FFFFFF;
	--am-float-unten: 16px;
	position: fixed;
	left: 0;
	right: 0;
	margin: 0 auto;
	width: max-content;
	max-width: calc(100vw - 32px);
	bottom: calc(var(--am-float-unten) + env(safe-area-inset-bottom, 0px));
	z-index: 98; /* unter dem Header (99) */
	transform: translateY(140%);
	opacity: 0;
	visibility: hidden;
	transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease, visibility 0s linear .45s;
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	pointer-events: none;
}
.am-float.is-da {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
	transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease, visibility 0s;
	pointer-events: auto;
}

/* Rand rundherum: duenne Linie in der Flaechenfarbe mit Luft zum Button */
.am-float__ring {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 5px;
	border: 1px solid color-mix(in srgb, var(--am-float-bg) 70%, transparent);
	border-radius: 999px;
	background: rgba(10, 11, 13, .55);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .18);
}

.am-float__btn,
.am-float__btn:visited {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	white-space: nowrap;
	padding: .85rem 1.4rem .85rem 1.6rem;
	border-radius: 999px;
	background: var(--am-float-bg);
	color: var(--am-float-fg);
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	line-height: 1;
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease;
}
.am-float__pfeil {
	width: 1.05rem;
	height: 1.05rem;
	color: var(--am-float-ak);
	transition: transform .25s ease;
}
.am-float__btn:hover .am-float__pfeil,
.am-float__btn:focus-visible .am-float__pfeil { transform: translateX(3px); }
.am-float__btn:hover,
.am-float__btn:focus-visible {
	color: var(--am-float-fg);
	background: color-mix(in srgb, var(--am-float-bg) 82%, #000);
}
.am-float__btn:focus-visible {
	outline: 2px solid var(--am-float-ak);
	outline-offset: 3px;
}

.am-float__zusatz { display: none; }

/* Desktop: mehr Platz, Zusatzzeile, breiterer Rand */
@media (min-width: 1025px) {
	.am-float { --am-float-unten: 28px; }
	.am-float__ring {
		padding: 7px 7px 7px 7px;
		gap: 1.5rem;
	}
	.am-float__zusatz {
		display: block;
		padding-left: 1.4rem;
		color: var(--am-float-fg);
		opacity: .78;
		font-size: .9rem;
		letter-spacing: .3px;
		white-space: nowrap;
	}
	.am-float__btn,
	.am-float__btn:visited {
		padding: 1.05rem 1.7rem 1.05rem 2rem;
		font-size: .9rem;
		letter-spacing: 2px;
	}
}

/* Elementor-Editor: an Ort und Stelle zeigen, damit er anklickbar bleibt */
.am-float.am-float--editor {
	position: relative;
	left: auto;
	bottom: auto;
	transform: none;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	display: flex;
	justify-content: center;
	padding: 1.5rem 0;
	background: repeating-linear-gradient(45deg, rgba(155, 200, 230, .08) 0 10px, transparent 10px 20px);
}
.am-float.am-float--editor::before {
	content: 'Schwebe-Button – erscheint im Frontend unten mittig';
	position: absolute;
	top: 4px;
	left: 8px;
	font: 11px/1.2 sans-serif;
	color: #888;
}

@media (prefers-reduced-motion: reduce) {
	.am-float, .am-float.is-da { transition: opacity .2s ease, visibility 0s; }
}
