/**
 * Seitennavigation — Struktur wie die alte Jimdo-Sidebar, Optik wie die
 * "Mein Konto"-Navigation der Website.
 * Ziel: wp-content/themes/hello-theme-child-master/assets/css/sidebar-navigation.css
 *
 * Kein Kasten um die Eintraege: der aktive Punkt bekommt eine 2 px breite
 * Kante links, eine hellgraue Flaeche und rote Schrift; beim Ueberfahren
 * faerbt sich nur der Text. Das ist dasselbe Muster wie in
 * assets/css/woocommerce-custom.css fuer .woocommerce-MyAccount-navigation.
 *
 * Unterebenen sind eingeklappt und oeffnen sich im aktiven Ast, zusaetzlich
 * ueber die Aufklapp-Schaltflaechen (Klasse is-offen, gesetzt per JavaScript).
 */

.bah-nav-block {
	/* Farben aus dem Elementor-Kit der Website, mit denselben Rueckfallwerten
	   wie in woocommerce-custom.css. */
	--bah-nav-rot: var(--e-global-color-primary, #BF0103);
	--bah-nav-text: var(--e-global-color-text, #111111);
	--bah-nav-gedaempft: var(--e-global-color-d2cc3b0, #9D9D9D);
	--bah-nav-flaeche: #f6f6f6;
	--bah-nav-rahmen: #d4d4d4;
	--bah-nav-extra: #c2410c;

	padding: 1rem;
}

.bah-nav {
	font-size: 0.875rem;
	line-height: 1.35;
}

/*
 * Schrift der ganzen Navigation: Kit-Global „Text“ (Poppins). Das Kit setzt
 * fuer jeden Link die Buttons-Typografie (Sofia) ueber „.elementor-kit-7 a“ —
 * zwei Klassen plus Element liegen ohne !important davor.
 */
.bah-nav-block .bah-nav,
.bah-nav-block .bah-nav a,
.bah-nav-block .bah-offcanvas__titel {
	font-family: var(--e-global-typography-text-font-family, "Poppins"), sans-serif;
}

/*
 * Das Theme gestaltet button-Elemente global (farbige Flaeche, grosse
 * Innenabstaende, Versalien). Die Schaltflaechen der Navigation sind reine
 * Bedienelemente — deshalb hier zurueckgesetzt. Zwei Klassen im Selektor,
 * damit die Regel ohne !important vor der Theme-Regel liegt.
 */
.bah-nav-block .bah-nav__toggle,
.bah-nav-block .bah-nav__oeffnen,
.bah-nav-block .bah-offcanvas__schliessen {
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	background-image: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font-weight: 400;
	line-height: 1;
}

/* Feste Groessen der Bedienelemente nach dem Reset wieder setzen. */
.bah-nav-block .bah-nav__toggle {
	width: 2.2em;
	height: 2.5em;
}

.bah-nav-block .bah-nav__oeffnen {
	padding: 0.5em 0.2em;
	/* Zwei Klassen: schlaegt die Kit-Regel „.elementor-kit-7 button“ (Sofia, Buttons-Typografie).
	   Gleiche Kit-Typografie wie das Header-Menue „Inhaltsseiten“ (Akzent = Poppins 0.9rem). */
	font-family: var(--e-global-typography-accent-font-family, "Poppins"), sans-serif;
	font-size: var(--e-global-typography-accent-font-size, 0.9rem);
	font-weight: var(--e-global-typography-accent-font-weight, 400);
}

.bah-nav-block .bah-offcanvas__schliessen {
	width: 2rem;
	height: 2rem;
}

.bah-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bah-nav li {
	position: relative;
	margin: 0;
	padding: 0;
	border: none;
	border-left: 2px solid transparent;
}

.bah-nav a {
	display: block;
	padding: 10px 2.2em 10px 14px;
	border: none;
	color: var(--bah-nav-text);
	text-decoration: none;
	letter-spacing: 0.02em;
	overflow-wrap: anywhere;
}

.bah-nav a:hover,
.bah-nav a:focus-visible {
	background: none;
	color: var(--bah-nav-rot);
}

/* Einrueckung je Ebene */
.bah-nav ul ul a {
	padding-left: 30px;
}

.bah-nav ul ul ul a {
	padding-left: 46px;
}

/* --- aktiver Punkt und aktiver Ast -------------------------------------- */

.bah-nav li.current-menu-item {
	border-left-color: var(--bah-nav-rot);
	background: var(--bah-nav-flaeche);
}

.bah-nav li.current-menu-item > a {
	color: var(--bah-nav-rot);
	font-weight: 600;
}

.bah-nav li.current-menu-parent > a,
.bah-nav li.current-menu-ancestor > a {
	color: var(--bah-nav-rot);
}

/* Die Flaeche gilt nur fuer den Eintrag selbst, nicht fuer seine Unterliste. */
.bah-nav li.current-menu-item > ul {
	background: #fff;
	margin-left: -2px;
}

/* --- Aufklapp-Schaltflaeche -------------------------------------------- */

.bah-nav__toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 2.2em;
	height: 2.5em;
	padding: 0;
	border: 0;
	background: none;
	color: var(--bah-nav-gedaempft);
	cursor: pointer;
	line-height: 1;
}

.bah-nav__toggle::before {
	content: "";
	display: block;
	width: 0.42em;
	height: 0.42em;
	margin: 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.15s ease;
}

.bah-nav__toggle[aria-expanded="true"]::before {
	transform: rotate(45deg);
}

.bah-nav__toggle:hover,
.bah-nav__toggle:focus-visible {
	color: var(--bah-nav-rot);
}

/* --- Akkordeon ---------------------------------------------------------- */

.bah-nav ul ul {
	display: none;
}

.bah-nav li.current-menu-item > ul,
.bah-nav li.current-menu-parent > ul,
.bah-nav li.current-menu-ancestor > ul,
.bah-nav li.current-product_cat-ancestor > ul,
.bah-nav li.is-offen > ul {
	display: block;
}

/* Von Hand zugeklappt schlaegt den automatisch geoeffneten Ast. */
.bah-nav li.current-menu-item:not(.is-offen) > ul,
.bah-nav li.current-menu-parent:not(.is-offen) > ul,
.bah-nav li.current-menu-ancestor:not(.is-offen) > ul {
	display: none;
}

/* --- Markierungen ------------------------------------------------------- */

/*
 * Der orange Punkt hinter den Kategorien aus dem Jimdo-Import (li.menue-extra)
 * und die Legende darunter sind seit 06.11.2026 entfernt (Skript 94).
 * Die Klasse menue-extra bleibt an den Menuepunkten, hat aber keine Wirkung mehr.
 */

/* Menuepunkt aus dem Live-Menue, zu dem noch keine Seite existiert. */
.bah-nav li.menue-ohne-seite > a {
	color: var(--bah-nav-gedaempft);
	cursor: default;
}

.bah-nav li.menue-ohne-seite > a:hover {
	color: var(--bah-nav-gedaempft);
}
.bah-nav__hinweis {
	padding: 0.8em;
	border: 1px dashed var(--bah-nav-extra);
	color: var(--bah-nav-extra);
	font-size: 0.8rem;
}

/* --- Auslöser im Header ------------------------------------------------- */

.bah-nav-block--offcanvas {
	display: inline-block;
	padding: 0;
}

.bah-nav__oeffnen {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.5em 0.2em;
	border: 0;
	color: var(--bah-nav-text);
	cursor: pointer;
	line-height: 1.2;
}

/*
 * Alle Zustaende ausdruecklich setzen. Das Theme faerbt button:hover und
 * button:active weiss (dort liegt sonst eine farbige Flaeche darunter) — auf
 * dem hellen Header war der Auslöser damit zeitweise unsichtbar.
 */
.bah-nav-block .bah-nav__oeffnen:hover,
.bah-nav-block .bah-nav__oeffnen:focus,
.bah-nav-block .bah-nav__oeffnen:focus-visible,
.bah-nav-block .bah-nav__oeffnen:active,
.bah-nav-block .bah-nav__oeffnen[aria-expanded="true"] {
	background-color: transparent;
	color: var(--bah-nav-rot);
}

.bah-nav__burger,
.bah-nav__burger::before,
.bah-nav__burger::after {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
}

.bah-nav__burger {
	position: relative;
}

.bah-nav__burger::before,
.bah-nav__burger::after {
	content: "";
	position: absolute;
	left: 0;
}

.bah-nav__burger::before {
	top: -6px;
}

.bah-nav__burger::after {
	top: 6px;
}

/* --- Einfliegendes Panel ------------------------------------------------ */

.bah-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.bah-offcanvas[hidden] {
	display: none;
}

.bah-offcanvas__hintergrund {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.bah-offcanvas.is-offen .bah-offcanvas__hintergrund {
	opacity: 1;
}

.bah-offcanvas__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(370px, 88vw);
	background: #fff;
	box-shadow: 0 0 24px rgba(0, 0, 0, 0.18);
	transform: translateX(-100%);
	transition: transform 0.25s ease;
}

.bah-offcanvas.is-offen .bah-offcanvas__panel {
	transform: translateX(0);
}

.bah-offcanvas__panel:focus {
	outline: none;
}

.bah-offcanvas__kopf {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
	padding: 0.9em 1rem;
	border-bottom: 1px solid var(--bah-nav-rahmen);
}

.bah-offcanvas__titel {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--bah-nav-text);
}

.bah-offcanvas__schliessen {
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	color: var(--bah-nav-text);
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
}

.bah-nav-block .bah-offcanvas__schliessen:hover,
.bah-nav-block .bah-offcanvas__schliessen:focus,
.bah-nav-block .bah-offcanvas__schliessen:focus-visible,
.bah-nav-block .bah-offcanvas__schliessen:active {
	background-color: transparent;
	color: var(--bah-nav-rot);
}

.bah-nav-block .bah-nav__toggle:hover,
.bah-nav-block .bah-nav__toggle:focus,
.bah-nav-block .bah-nav__toggle:focus-visible,
.bah-nav-block .bah-nav__toggle:active {
	background-color: transparent;
	color: var(--bah-nav-rot);
}

.bah-offcanvas .bah-nav {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1rem 1rem 1.5rem;
	-webkit-overflow-scrolling: touch;
}

body.bah-offcanvas-offen {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.bah-offcanvas__panel,
	.bah-offcanvas__hintergrund,
	.bah-nav__toggle::before {
		transition: none;
	}
}

/* --- Uebersichtskategorien ohne eigene Produkte -------------------------
 * Dort stehen die Unterkategorie-Kacheln von WooCommerce. Nur die Filterbox
 * ist dort sinnlos und wird ausgeblendet.
 * -------------------------------------------------------------------- */

body.bah-ohne-produkte .elementor-element-df93b9f {
	display: none;
}

/*
 * Elementor gibt auf Kategorien ohne eigene Produkte seinen eigenen
 * "It seems we can't find what you're looking for."-Block aus — er laeuft
 * nicht ueber den WooCommerce-Haken woocommerce_no_products_found und laesst
 * sich deshalb nicht abhaengen. Auf den Uebersichtsseiten stehen stattdessen
 * die Unterkategorie-Kacheln, die Meldung ist dort schlicht falsch.
 */
body.bah-ohne-produkte .elementor-nothing-found,
body.bah-ohne-produkte .elementor-products-nothing-found {
	display: none;
}

/* --- Kachelraster der Unterkategorien -----------------------------------
 * WooCommerce liefert die Kacheln als <ul class="products">, aber ohne
 * eigenes Raster — die Elementor-Rasterregeln greifen nur auf der
 * Produktliste des Widgets. Ohne Vorgabe richtet sich jede Kachel nach der
 * Originalgroesse ihres Bildes, und das Ergebnis ist eine unruhige Treppe.
 * Deshalb hier ein eigenes, gleichmaessiges Raster.
 * -------------------------------------------------------------------- */

.bah-kategorie-kacheln {
	--bah-kachel-rot: var(--e-global-color-primary, #BF0103);
	--bah-kachel-text: var(--e-global-color-text, #111111);
	--bah-kachel-gedaempft: var(--e-global-color-d2cc3b0, #9D9D9D);
	--bah-kachel-rahmen: #e6e6e6;

	margin: 0 0 2.5rem;
}

.bah-kategorie-kacheln ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1.75rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bah-kategorie-kacheln ul.products::before,
.bah-kategorie-kacheln ul.products::after {
	content: none;
}

/*
 * Theme und Elementor gestalten ul.products li.product mit Regeln gleicher
 * oder hoeherer Gewichtung (Flexbox, Breiten in Prozent, Aussenabstaende).
 * Fuer die Kachelreihe setzen wir die Layout-Eigenschaften deshalb hart —
 * eng begrenzt auf .bah-kategorie-kacheln, die Produktliste des Widgets
 * bleibt davon unberuehrt.
 */
.bah-kategorie-kacheln ul.products li.product-category {
	display: block !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	text-align: left;
}

.bah-kategorie-kacheln ul.products li.product-category a {
	display: flex !important;
	flex-direction: column;
	gap: 0.7rem;
	width: 100% !important;
	height: 100%;
	text-decoration: none;
}

/* Quadratische Bildflaeche; das Motiv wird eingepasst, nicht beschnitten —
   die Beschlaege sind freigestellt und wuerden sonst angeschnitten.
   Der Selektor ist bewusst so lang: WooCommerce setzt fuer
   ul.products li.product a img ein height:auto, das sonst gewinnt. */
.bah-kategorie-kacheln ul.products li.product-category a img {
	display: block;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	max-width: none !important;
	margin: 0 !important;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--bah-kachel-rahmen);
	padding: 0.75rem;
	box-sizing: border-box;
	transition: border-color 0.15s ease;
}

.bah-kategorie-kacheln ul.products li.product-category a:hover img,
.bah-kategorie-kacheln ul.products li.product-category a:focus-visible img {
	border-color: var(--bah-kachel-rot);
}

.bah-kategorie-kacheln .woocommerce-loop-category__title {
	margin: 0;
	padding: 0;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--bah-kachel-text);
	overflow-wrap: anywhere;
}

.bah-kategorie-kacheln li.product-category a:hover .woocommerce-loop-category__title,
.bah-kategorie-kacheln li.product-category a:focus-visible .woocommerce-loop-category__title {
	color: var(--bah-kachel-rot);
}

/* Die Artikelzahl kommt als <mark> und haette sonst den gelben
   Browser-Hintergrund. */
.bah-kategorie-kacheln .woocommerce-loop-category__title .count {
	display: inline;
	background: none;
	color: var(--bah-kachel-gedaempft);
	font-size: 0.8em;
	font-weight: 400;
}

@media (max-width: 600px) {
	.bah-kategorie-kacheln ul.products {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1.25rem 1rem;
	}
}

/* --- Produktkacheln -----------------------------------------------------
 * Quadratische Bildflaeche fuer alle Produktlisten (Kategorieseiten, Shop,
 * aehnliche Produkte). Die Kachelbilder kommen unbeschnitten (Bildgroesse
 * "large", siehe functions.php) und werden eingepasst — hohe, schmale
 * Griffe stehen damit vollstaendig in der Kachel, und alle Kacheln einer
 * Reihe sind gleich hoch. !important aus demselben Grund wie oben.
 * -------------------------------------------------------------------- */

.woocommerce ul.products li.product:not(.product-category) a img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-width: none !important;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	margin: 0 0 1em !important;
}

/* --- Produktbild auf der Produktseite -----------------------------------
 * Die Galerie zieht jedes Bild auf volle Spaltenbreite; ein hohes, schmales
 * Original (139 x 335) wurde so ueber 1400 px hoch. Gleiche quadratische
 * Flaeche wie in den Kacheln — das Motiv steht vollstaendig darin, und
 * Flexslider rechnet die Hoehe der Galerie aus den Bildern.
 * Nur Bilder im Link: das Zoom-Bild (.zoomImg) liegt direkt im Container
 * und muss frei bleiben.
 * -------------------------------------------------------------------- */

.woocommerce div.product div.images .woocommerce-product-gallery__image > a img,
.woocommerce div.product div.images .flex-control-thumbs li img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-width: none !important;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
}

/* Handy: Bis Flexslider startet, rechnet Chrome die Höhe der Bildspalte aus der
 * Originalbreite des Bildes (z. B. 179 px) statt aus 100 % – das Widget war
 * 266 px hoch, die Galerie 525 px, Titel und Warenkorb lagen über dem Bild und
 * sprangen dann um ~300 px nach unten (CLS 0,33). Mit fester Breite stimmt die
 * Höhe von Anfang an; Desktop und Tablet unverändert. */
.elementor-widget-woocommerce-product-images {
	width: 100%;
}

/* --- Kategorietext unter den Kacheln ------------------------------------
 * Der Text laeuft sonst ueber die volle Breite von 1200 px — bei 16 px
 * Schrift sind das weit ueber 150 Zeichen je Zeile und damit unlesbar.
 * -------------------------------------------------------------------- */

.elementor-widget-woocommerce-archive-description .term-description {
	max-width: 78ch;
}

.elementor-widget-woocommerce-archive-description .term-description > * + * {
	margin-top: 1em;
}

.elementor-widget-woocommerce-archive-description .term-description h2,
.elementor-widget-woocommerce-archive-description .term-description h3 {
	margin-top: 1.8em;
	margin-bottom: 0.4em;
	line-height: 1.25;
}

.elementor-widget-woocommerce-archive-description .term-description h2 {
	font-size: 1.5rem;
}

.elementor-widget-woocommerce-archive-description .term-description h3 {
	font-size: 1.15rem;
}

.elementor-widget-woocommerce-archive-description .term-description > *:first-child {
	margin-top: 0;
}

.elementor-widget-woocommerce-archive-description .term-description p {
	line-height: 1.65;
}

.elementor-widget-woocommerce-archive-description .term-description ul,
.elementor-widget-woocommerce-archive-description .term-description ol {
	margin-left: 1.2em;
	line-height: 1.65;
}

.elementor-widget-woocommerce-archive-description .term-description li + li {
	margin-top: 0.3em;
}

.elementor-widget-woocommerce-archive-description .term-description a {
	color: var(--e-global-color-primary, #BF0103);
	text-decoration: underline;
}
