/* Header-Zeile (WIDURO, 04.11.2026) - Header-Umbau Teil A.2
   Markup: templates/mod_html_megamenu_v2.html.twig, Doku: _HEADER-STARTSEITE.md
   Punkte (Telefon, Showroom, Beratung, Merkliste) = Elemente "Header-Punkt" (.wd-hp) im
   versteckten Artikel "header-links". Ohne Zusatzzeile: Icon oben, Text darunter.
   Mit Zusatzzeile (Telefon): Icon links, Text fett, Zusatzzeile klein darunter. */

.wd-hbar,
.wd-hbar-m {
	--wd-hbar-ink: #1d2b36;
	--wd-hbar-line: #dbe3e5;
	--wd-hbar-teal: #00969b;
	color: var(--wd-hbar-ink);
	font-weight: 400;
}

.wd-hp__icon::before {
	content: attr(data-icon);
}

.wd-hp__link[data-href],
.wd-hbar__cart,
.wd-hbar-m__item {
	cursor: pointer;
}

.wd-hbar__label {
	display: block;
	font-size: 15px;
	line-height: 1.15;
	color: var(--wd-hbar-ink);
}

/* Suchfeld (Desktop und mobil) */
.wd-hbar__search {
	display: flex;
	align-items: center;
	height: 50px;
	margin: 0;
	border: 1px solid #c9d6d8;
	border-radius: 8px;
	background: #f6f9fa;
	transition: border-color .2s, box-shadow .2s;
}

.wd-hbar__search:focus-within {
	border-color: var(--wd-hbar-teal);
	box-shadow: 0 0 0 3px rgba(0, 150, 155, .15);
	background: #fff;
}

.wd-hbar__search-btn {
	display: flex;
	align-items: center;
	padding: 0 6px 0 14px;
	border: 0;
	background: transparent;
	color: var(--wd-hbar-ink);
}

.wd-hbar__search-btn .material-icons {
	font-size: 26px;
}

.wd-hbar__search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	padding: 0 16px 0 6px;
	border: 0;
	background: transparent;
	font-size: 16px;
	color: var(--wd-hbar-ink);
	outline: none;
}

.wd-hbar__search-input::placeholder {
	color: #5d6b75;
	opacity: 1;
}

/* ---------- Desktop ---------- */

/* Abstaende per margin statt gap, damit zwischen den Icon-Spalten (Showroom, Beratung,
   Merkliste, Warenkorb) nur deren eigene, gleiche Breite zaehlt. */
.wd-hbar {
	display: flex;
	align-items: center;
	padding-top: 14px;
	padding-bottom: 10px;
	--wd-hbar-col: 96px;
}

.wd-hbar__logo {
	flex-shrink: 0;
	margin-right: 28px;
}

.wd-hbar__logo img {
	display: block;
	width: 200px;
	height: auto;
}

.wd-hbar__search {
	flex: 1 1 auto;
	max-width: 600px;
	min-width: 200px;
	margin-right: 28px;
}

.wd-hbar__links {
	display: flex;
	align-self: stretch;
	margin-left: auto;
}

.wd-hbar__links :has(> .wd-hp),
.wd-hbar-m__links :has(> .wd-hp) {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
}

/* Icon-Spalten: gleiche Breite, Icon oben buendig, Trennstrich immer gleich hoch */
.wd-hbar .wd-hp,
.wd-hbar__cart {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: var(--wd-hbar-col);
	margin: 0;
	padding: 0;
	border: 0;
}

.wd-hbar .wd-hp::before,
.wd-hbar__cart::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 1px;
	height: 48px;
	background: var(--wd-hbar-line);
	transform: translateY(-50%);
}

.wd-hbar .wd-hp:first-child::before {
	display: none;
}

.wd-hbar .wd-hp__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	color: var(--wd-hbar-ink);
	text-align: center;
	line-height: 1.15;
}

.wd-hbar .wd-hp__icon {
	font-size: 28px;
	line-height: 1;
	height: 28px;
}

.wd-hbar .wd-hp__body {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.wd-hbar .wd-hp__text {
	display: block;
	font-size: 15px;
	max-width: 6em;
}

/* Telefon (mit Zusatzzeile): eigene Breite, Icon links, Nummer fett, Zeiten darunter */
.wd-hbar .wd-hp--sub {
	width: auto;
	padding-right: 24px;
}

.wd-hbar .wd-hp--sub .wd-hp__link {
	flex-direction: row;
	gap: 12px;
	text-align: left;
}

.wd-hbar .wd-hp--sub .wd-hp__icon {
	font-size: 34px;
	height: 34px;
}

.wd-hbar .wd-hp--sub .wd-hp__body {
	align-items: flex-start;
}

.wd-hbar .wd-hp--sub .wd-hp__text {
	max-width: none;
	font-size: 20px;
	font-weight: 700;
	white-space: nowrap;
}

.wd-hbar .wd-hp__sub {
	font-size: 15px;
	white-space: nowrap;
	color: #4a5862;
}

.wd-hbar .wd-hp__link[data-href]:hover .wd-hp__text,
.wd-hbar__cart:hover .wd-hbar__label {
	color: var(--wd-hbar-teal);
}

/* Warenkorb: Shopware fuellt li#sw_basket_count (Icon + Anzahl). Gleicher Aufbau wie die
   Icon-Spalten: 28 px Icon, 6 px Abstand, Beschriftung. Alles senkrecht mittig in der Zeile
   (14:45: die reservierte zweite Textzeile liess die Icons zu hoch stehen - entfernt). */
.wd-hbar__cart {
	align-self: stretch;
	gap: 6px;
	list-style: none;
}

.wd-hbar__cart > li {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Warenkorb (05.11.2026): Icon + Blase kommen aus Contao (.wd-cart), die Zahl liest ein
   kleines Skript im Header-Template aus den Shopware-Containern. Diese bleiben im DOM (das
   Shopware-CartWidget aktualisiert sie nach "In den Warenkorb"), sind aber unsichtbar.
   !important: im Shop gelten zusaetzlich die aelteren, staerker eingegrenzten Regeln aus
   header-shop.css, bis die Datei neu erzeugt ist. */
#sw_basket_count,
#basket_mobile {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
}

.wd-cart {
	position: relative;
	display: flex;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: 1;
	color: var(--wd-hbar-ink);
}

.wd-cart__icon {
	display: block;
	width: 30px;
	height: 30px;
}

.wd-cart__badge {
	position: absolute;
	top: -9px;
	left: calc(50% + 5px);
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: #00888c;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 0 0 2px #fff;
}

/* bis Shopware geantwortet hat: keine Blase */
.wd-cart__badge[data-state="loading"] {
	display: none;
}

.wd-hbar__cart:hover .wd-cart,
.wd-hbar-m__cart:hover .wd-cart {
	color: var(--wd-hbar-teal);
}

/* schmalere Desktops: Zeiten ausblenden, Spalten schmaler */
@media (max-width: 1199.98px) {
	.wd-hbar {
		--wd-hbar-col: 84px;
	}

	.wd-hbar__logo {
		margin-right: 16px;
	}

	.wd-hbar__logo img {
		width: 160px;
	}

	.wd-hbar__search {
		margin-right: 16px;
	}

	.wd-hbar .wd-hp--sub {
		padding-right: 14px;
	}

	.wd-hbar .wd-hp--sub .wd-hp__text {
		font-size: 17px;
	}

	.wd-hbar .wd-hp--sub .wd-hp__sub {
		display: none;
	}

	.wd-hbar .wd-hp__text,
	.wd-hbar__label {
		font-size: 14px;
	}
}

/* ---------- Mobil ---------- */

@media (max-width: 991.98px) {
	.wd-hp--desktop {
		display: none !important;
	}
}

.wd-hbar-m {
	position: relative;
	background: #fff;
}

.wd-hbar-m__row {
	display: flex;
	align-items: center;
	gap: 2px;
	padding-top: 10px;
	padding-bottom: 8px;
}

.wd-hbar-m__menu {
	position: static;
}

.wd-hbar-m .nav-toggler {
	height: auto;
}

.wd-hbar-m .nav-toggler-button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 52px;
	padding: 0;
	border: 0;
	background: transparent;
}

.wd-hbar-m .nav-toggler-button {
	color: var(--wd-hbar-ink);
}

/* Burger als SVG mit drei gleich langen Linien (05.11.2026, wie Entwurf; vorher burger-menu.svg) */
.wd-hbar-m .wd-burger {
	display: block;
	width: 30px;
	height: 30px;
}

/* Drawer offen: Burger weg, X aus _megamenu-mobile.scss (dort nur fuer img geregelt) */
.wd-hbar-m .nav-toggler:has(+ #menu_mobile.active) .wd-burger {
	display: none;
}

/* X statt Burger (Regel aus _megamenu-mobile.scss) auf die neue Groesse */
.wd-hbar-m .nav-toggler:has(+ #menu_mobile.active) .nav-toggler-button::after {
	width: 30px;
	height: 30px;
	font-size: 30px;
	order: -1;
}

.wd-hbar-m__logo {
	margin: 0 auto 0 6px;
}

.wd-hbar-m__logo img {
	display: block;
	width: clamp(108px, 31vw, 140px);
	height: auto;
}

.wd-hbar-m__item,
.wd-hbar-m .wd-hp__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 50px;
	margin: 0;
	color: var(--wd-hbar-ink);
	text-align: center;
}

.wd-hbar-m .wd-hp {
	margin: 0;
	padding: 0;
}

.wd-hbar-m__item .material-icons,
.wd-hbar-m .wd-hp__icon {
	font-size: 28px;
	line-height: 1;
}

.wd-hbar-m .wd-hbar__label,
.wd-hbar-m .wd-hp__text {
	font-size: 13px;
	line-height: 1.15;
}

.wd-hbar-m .wd-hp__sub {
	display: none;
}

.wd-hbar-m__searchrow {
	padding-bottom: 10px;
}

.wd-hbar-m .wd-hbar__search {
	height: 46px;
	border-radius: 23px;
}

/* Drawer unter der Suchzeile statt fest bei 90 px */
.wd-hbar-m #menu_mobile.active {
	top: 100% !important;
	height: calc(100dvh - 190px) !important;
}

/* ---------- Navigation: erster Menuepunkt als Knopf (Teil A.3, 04.11.2026) ----------
   Der erste Eintrag des Megamenues ("Alle Konfiguratoren") erscheint als Teal-Knopf mit
   Burger-Icon, ohne Pfeil. Greift fuer beide Varianten aus megamenu.html.twig:
   li.dropdown-toggle (mit Aufklappbereich) und li > a.sublevel-none (ohne).
   Reihenfolge im Backend (Inhalte -> Megamenue) bestimmt, welcher Punkt das ist. */
#menu_desktop > li:first-child {
	padding-left: 0 !important;
	margin-right: 12px;
}

#menu_desktop > li:first-child::after {
	display: none !important;
}

#menu_desktop > li:first-child > a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 9px 22px 9px 18px;
	border-radius: 6px;
	background: #00888c;
	color: #fff !important;
	font-weight: 500;
	text-decoration: none;
	transition: background-color .2s;
}

#menu_desktop > li:first-child > a::before {
	content: 'menu';
	font-family: 'Material Icons';
	font-feature-settings: 'liga';
	font-weight: normal;
	font-size: 24px;
	line-height: 1;
}

#menu_desktop > li:first-child > a:hover,
#menu_desktop > li:first-child.active > a,
#menu_desktop > li:first-child > a.active {
	background: #006f72;
	color: #fff !important;
}

/* Keine Linie unter dem Menue (Entscheidung David 04.11.2026, wie SOLL-Entwurf).
   custom.scss auf live setzt #header.header .mainnav { border-bottom: 3px solid #008d91 };
   gleiche Spezifitaet, diese Datei laedt spaeter -> gewinnt. So bleibt custom.scss unberuehrt. */
#header.header .mainnav {
	border-bottom: 0;
}

/* ---------- "Alle Konfiguratoren": schmale Liste statt Vollbreiten-Panel (05.11.2026) ----------
   Gilt fuer den ERSTEN Megamenue-Punkt (wie der Knopf oben). Pflege im Backend: Kategorie mit
   EINER Spalte, Darstellung "Bild", Spaltentitel leer - die Eintraege erscheinen als Kacheln
   (Bild, Titel, Pfeil) untereinander, direkt unter dem Knopf.
   Der weisse Vollbreiten-Hintergrund (.dropdown-background) bleibt bei diesem Punkt aus. */
#menu_desktop > li:first-child {
	position: relative;
}

#menu_desktop > li:first-child > .mm-panel {
	top: 100% !important;
	left: 0 !important;
	width: 440px !important;
	max-width: calc(100vw - 32px) !important;
	padding: 12px !important;
	border-radius: 0 0 8px 8px;
	background: #fff;
	box-shadow: 0 12px 24px rgba(18, 48, 58, .14);
}

#menu_desktop > li:first-child .mm-grid {
	grid-template-columns: minmax(0, 1fr) !important;
	padding: 0 !important;
}

#menu_desktop > li:first-child .mm-col {
	gap: 10px;
	padding: 0 !important;
	border-left: 0 !important;
}

#menu_desktop > li:first-child .mm-head,
#menu_desktop > li:first-child .mm-promo,
#menu_desktop > li:first-child .mm-advice {
	display: none !important;
}

#menu_desktop > li:first-child .mm-card {
	min-height: 72px;
}

.mainnav:has(#menu_desktop > li:first-child.active) .dropdown-background {
	opacity: 0 !important;
	visibility: hidden !important;
}
