/* =========================================================
   D24 Kategorie-Autovervollständigung – professionelles UI
   Markenpalette: #1E73BE -> #155A96 (Blau), #EE7C1B (Akzent)
   Schrift: Montserrat (wie die Seite). Alles unter .em24-ac-*
   gekapselt – es wird NICHTS am restlichen Theme verändert.
   ========================================================= */
.em24-ac-dropdown {
	--em24-blue: #1E73BE;
	--em24-blue-dark: #155A96;
	--em24-accent: #EE7C1B;
	--em24-ink: #1f2a37;
	--em24-muted: #6b7686;
	--em24-line: #e9edf2;
	--em24-hover: #f1f7fc;

	box-sizing: border-box;
	position: absolute;
	z-index: 2147483600;
	flex-direction: column;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid var(--em24-line);
	border-radius: 14px;
	box-shadow:
		0 2px 6px rgba(17, 24, 39, 0.06),
		0 18px 40px -12px rgba(21, 90, 150, 0.28);
	font-family: "Montserrat", "GlacialIndifference", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;

	/* Öffnungs-Animation */
	opacity: 0;
	transform: translateY(6px) scale(0.985);
	transform-origin: top center;
	transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.em24-ac-dropdown.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
}
.em24-ac-dropdown * { box-sizing: border-box; }

/* Kopfzeile */
.em24-ac-head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 9px 10px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--em24-muted);
}
.em24-ac-head::before {
	content: "";
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--em24-accent);
	flex: 0 0 auto;
}

/* Liste */
.em24-ac-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 4px 6px 6px;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.em24-ac-list::-webkit-scrollbar { width: 10px; }
.em24-ac-list::-webkit-scrollbar-thumb {
	background: #d7dee6; border-radius: 8px; border: 3px solid #fff;
}
.em24-ac-list::-webkit-scrollbar-thumb:hover { background: #c2ccd6; }

/* Eintrag */
.em24-ac-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	cursor: pointer;
	color: var(--em24-ink);
	font-size: 15px;
	line-height: 1.25;
	transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.em24-ac-item:hover,
.em24-ac-item.is-active {
	background-color: var(--em24-hover);
	box-shadow: inset 3px 0 0 var(--em24-blue);
}

.em24-ac-ic {
	flex: 0 0 32px;
	width: 32px; height: 32px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 9px;
	background: #eaf3fb;
	color: var(--em24-blue);
	transition: background-color 0.12s ease, color 0.12s ease;
}
.em24-ac-item:hover .em24-ac-ic,
.em24-ac-item.is-active .em24-ac-ic {
	background: var(--em24-blue);
	color: #fff;
}
.em24-ac-ic svg { width: 17px; height: 17px; display: block; }

/* Echte Kategorie-Icons (Bild/Font) auf der Markenfarbe der Kategorie */
.em24-ac-ic--brand { color: #fff; }
.em24-ac-img { width: 20px; height: 20px; object-fit: contain; display: block; }
.em24-ac-glyph { font-size: 17px; line-height: 1; }
/* Markenfarbige Kacheln behalten ihre Farbe auch beim Hover (Inline-Style gewinnt) */

.em24-ac-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.em24-ac-name {
	display: block;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
}

/* Untertitel (z. B. Kategorie des Unternehmens) */
.em24-ac-sub {
	display: block;
	font-size: 12px;
	color: var(--em24-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.em24-ac-name strong { color: var(--em24-blue); font-weight: 700; }

.em24-ac-count {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #eef2f6;
	color: var(--em24-muted);
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.em24-ac-item:hover .em24-ac-count,
.em24-ac-item.is-active .em24-ac-count {
	background: #e1eefa;
	color: var(--em24-blue-dark);
}

/* Zustände: Laden / leer */
.em24-ac-state {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	color: var(--em24-muted);
	font-size: 14px;
}
.em24-ac-state svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.7; }
.em24-ac-spin {
	width: 16px; height: 16px;
	border: 2px solid #d7dee6;
	border-top-color: var(--em24-blue);
	border-radius: 50%;
	animation: em24-spin 0.7s linear infinite;
	flex: 0 0 auto;
}
@keyframes em24-spin { to { transform: rotate(360deg); } }

/* Fußzeile mit Tastatur-Hinweisen */
.em24-ac-foot {
	flex: 0 0 auto;
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 8px 14px;
	border-top: 1px solid var(--em24-line);
	background: #fbfcfe;
	font-size: 11px;
	color: var(--em24-muted);
}
.em24-ac-foot span { display: inline-flex; align-items: center; gap: 5px; }
.em24-ac-foot kbd {
	font-family: inherit;
	font-size: 11px;
	line-height: 1;
	padding: 2px 5px;
	border: 1px solid #dbe2ea;
	border-bottom-width: 2px;
	border-radius: 5px;
	background: #fff;
	color: #51607a;
}

@media (max-width: 600px) {
	.em24-ac-item { font-size: 16px; padding: 12px; }
	.em24-ac-foot { display: none; }       /* Touch braucht keine Tastatur-Hinweise */
}
@media (prefers-reduced-motion: reduce) {
	.em24-ac-dropdown { transition: opacity 0.12s ease; transform: none; }
	.em24-ac-dropdown.is-open { transform: none; }
	.em24-ac-spin { animation-duration: 1.2s; }
}


/* ---- Gruppen & Unternehmensprofile ---- */
.em24-ac-head--sep {
	margin-top: 4px;
	border-top: 1px solid var(--em24-line);
	padding-top: 10px;
}

/* Firmenlogo: vollständig sichtbar, mittig, nie beschnitten */
.em24-ac-ic--photo {
	background: #ffffff;
	border: 1px solid var(--em24-line);
	padding: 3px;
	overflow: hidden;
}
.em24-ac-img--logo {
	width: 100%;
	height: 100%;
	object-fit: contain;        /* skaliert das Logo hinein statt es zu beschneiden */
	object-position: center;
	border-radius: 4px;
}
/* Beim Hover nur der Rahmen – der Logo-Hintergrund bleibt sauber weiß */
.em24-ac-item:hover .em24-ac-ic--photo,
.em24-ac-item.is-active .em24-ac-ic--photo {
	background: #ffffff;
	border-color: var(--em24-blue);
}

/* Pfeil zeigt: öffnet das Profil */
.em24-ac-go {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	color: #c3ccd8;
	transition: color 0.12s ease, transform 0.12s ease;
}
.em24-ac-go svg { width: 16px; height: 16px; display: block; }
.em24-ac-item:hover .em24-ac-go,
.em24-ac-item.is-active .em24-ac-go {
	color: var(--em24-blue);
	transform: translateX(2px);
}

/* ---- v2: Leer-Zustand, Ergebnis-Zeile, Barrierefreiheit ---- */

/* Neutrale Kachel (Verlauf / "alle Ergebnisse") */
.em24-ac-ic--muted {
	background: #f1f4f8;
	color: var(--em24-muted);
}
.em24-ac-item:hover .em24-ac-ic--muted,
.em24-ac-item.is-active .em24-ac-ic--muted {
	background: #e6edf5;
	color: var(--em24-blue-dark);
}

/* Abschlusszeile "Alle Ergebnisse anzeigen für ..." */
.em24-ac-item--all {
	margin-top: 4px;
	border-top: 1px solid var(--em24-line);
	border-radius: 0 0 10px 10px;
	padding-top: 12px;
}
.em24-ac-item--all .em24-ac-name {
	font-weight: 600;
	color: var(--em24-blue-dark);
}

/* Inline-Ladehinweis, während Unternehmen nachgeladen werden */
.em24-ac-state--inline {
	padding: 10px 12px;
	font-size: 13px;
	border-top: 1px dashed var(--em24-line);
	margin-top: 4px;
}

/* Nur für Screenreader */
.em24-ac-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- v2.2: Unterkategorie-Navigation ---- */
.em24-ac-item--back {
	border-bottom: 1px solid var(--em24-line);
	border-radius: 10px 10px 0 0;
	margin-bottom: 4px;
	padding-bottom: 12px;
}
.em24-ac-item--back .em24-ac-name {
	font-weight: 600;
	color: var(--em24-muted);
	font-size: 13px;
}
/* Pfeil der Zurück-Zeile zeigt nach links */
.em24-ac-ic--back svg { transform: rotate(180deg); }
