/* Becos Menü – vertikales Akkordeon (Popup "Menü Mobil") */

.becos-menu {
	--bm-text: #fff;
	--bm-line: rgba(255, 255, 255, 0.18);
	--bm-marker: #fff;
	--bm-row-pad: 0.95rem;
	--bm-indent: 1rem;
	--bm-speed: 280ms;

	width: 100%;
	color: var(--bm-text);
	font-family: var(--e-global-typography-secondary-font-family, "Inter"), sans-serif;
}

.becos-menu .bm-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---------- Hauptpunkte ---------- */

.becos-menu > .bm-list > .bm-item {
	border-bottom: 1px solid var(--bm-line);
}

.becos-menu > .bm-list > .bm-item:first-child {
	border-top: 1px solid var(--bm-line);
}

.becos-menu .bm-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	color: var(--bm-text);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition: opacity 160ms ease;
}

/* Gegen das Elementor-Kit (.elementor-kit-N a:hover = Akzent/Schwarz): Farbe für alle
   Link-Zustände festnageln. iOS Safari setzt :hover nach einem Tipp und lässt es stehen. */
.becos-menu .bm-link,
.becos-menu .bm-link:link,
.becos-menu .bm-link:visited,
.becos-menu .bm-link:hover,
.becos-menu .bm-link:focus,
.becos-menu .bm-link:active {
	color: var(--bm-text);
}

.becos-menu > .bm-list > .bm-item > .bm-link {
	padding-block: var(--bm-row-pad);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.005em;
}

/* Hover nur auf Geräten mit Maus – auf Touch bliebe er nach dem Tippen "kleben". */
@media (hover: hover) {
	.becos-menu .bm-link:hover {
		color: var(--bm-text);
		opacity: 0.75;
	}

	.becos-menu .bm-list--sub .bm-link:hover {
		opacity: 1;
	}
}

.becos-menu .bm-link:focus-visible {
	outline: 2px solid var(--bm-text);
	outline-offset: 2px;
	border-radius: 2px;
	opacity: 1;
}

/* ---------- Pfeil: zu = nach unten, offen = nach rechts ("zur Seite") ---------- */

.becos-menu .bm-chev {
	flex: none;
	position: relative;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	transition: background-color 160ms ease;
}

.becos-menu .bm-chev::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-20%) rotate(45deg);
	transition: transform var(--bm-speed) ease;
}

.becos-menu .bm-item.is-open > .bm-link > .bm-chev {
	background-color: rgba(255, 255, 255, 0.14);
}

.becos-menu .bm-item.is-open > .bm-link > .bm-chev::before {
	transform: translateX(-20%) rotate(-45deg);
}

/* ---------- Untermenü: Höhe animieren über Grid 0fr → 1fr ---------- */

.becos-menu .bm-sub {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--bm-speed) ease;
}

.becos-menu .bm-item.is-open > .bm-sub {
	grid-template-rows: 1fr;
}

.becos-menu .bm-sub-inner {
	min-height: 0;
	overflow: hidden;
}

.becos-menu .bm-list--sub {
	margin: 0 0 0.85rem;
	padding-left: var(--bm-indent);
	border-left: 1px solid var(--bm-line);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity var(--bm-speed) ease, transform var(--bm-speed) ease;
}

.becos-menu .bm-item.is-open > .bm-sub .bm-list--sub {
	opacity: 1;
	transform: none;
}

.becos-menu .bm-list--sub .bm-link {
	position: relative;
	padding-block: 0.45rem;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.35;
	opacity: 0.85;
}

.becos-menu .bm-list--sub .bm-link:focus-visible {
	opacity: 1;
}

/* ---------- Aktive Seite: Balken auf der Linie statt Farbwechsel ---------- */

.becos-menu .bm-list--sub .bm-item.is-current > .bm-link {
	opacity: 1;
	font-weight: 600;
}

.becos-menu .bm-list--sub .bm-item.is-current > .bm-link::before {
	content: "";
	position: absolute;
	left: calc(-1 * var(--bm-indent) - 1px);
	top: 0.4rem;
	bottom: 0.4rem;
	width: 3px;
	border-radius: 0 2px 2px 0;
	background: var(--bm-marker);
}

.becos-menu > .bm-list > .bm-item.is-current > .bm-link .bm-label,
.becos-menu > .bm-list > .bm-item.is-ancestor > .bm-link .bm-label {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.3em;
}

@media (prefers-reduced-motion: reduce) {
	.becos-menu {
		--bm-speed: 0ms;
	}
}
