/**
 * Cash. Live-Search – Dropdown Styles
 * -------------------------------------------------------------
 * Instant-Search-Vorschläge unter dem Suchfeld im Header.
 * Design an das restliche Cash.-Theme angelehnt: Navy #10214c,
 * Logo-Rot #C51A1B als Akzent, Open Sans, durchgehend eckig
 * (keine abgerundeten Ecken).
 */

:root {
	--candy-ls-navy: #10214c;
	--candy-ls-red: #c51a1b;
	--candy-ls-navy-soft: rgba(16, 33, 76, 0.06);
	--candy-ls-navy-mid: rgba(16, 33, 76, 0.12);
	--candy-ls-hl: #ffe27a;
}

/* Anker: Suchfeld-Box wird zum Positionierungskontext */
.candy-ls {
	position: relative;
}

/* ---------------------------------------------------------------
 * Dropdown-Container (rechtsbündig zum Suchfeld, eckig)
 * ------------------------------------------------------------- */
.candy-ls-dropdown {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	left: auto;
	width: min(440px, calc(100vw - 24px));
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: 0 18px 48px rgba(16, 33, 76, 0.22), 0 2px 6px rgba(16, 33, 76, 0.1);
	border-top: 3px solid var(--candy-ls-red);
	z-index: 100000;
	font-family: "Open Sans", sans-serif;
	color: var(--candy-ls-navy);
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
	transition: opacity 0.16s ease, transform 0.16s ease;
	/* max-height wird per JS an den verfügbaren Platz angepasst */
}

.candy-ls-dropdown.is-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* roter Punkt zum Suchfeld – Anlehnung an den Punkt im Cash.-Logo */
.candy-ls-dropdown::before {
	content: "";
	position: absolute;
	top: -8px;
	right: 22px;
	width: 16px;
	height: 16px;
	background: var(--candy-ls-red);
	border-radius: 50%;
}

/* ---------------------------------------------------------------
 * Statuszeilen (Laden / keine Treffer / Hinweis)
 * ------------------------------------------------------------- */
.candy-ls-status {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 18px;
	font-size: 0.82rem;
	color: rgba(16, 33, 76, 0.7);
}

.candy-ls-status strong {
	color: var(--candy-ls-navy);
}

.candy-ls-spinner {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border: 2px solid var(--candy-ls-navy-mid);
	border-top-color: var(--candy-ls-red);
	border-radius: 50%; /* Ladespinner bleibt rund (funktional) */
	animation: candy-ls-spin 0.6s linear infinite;
}

@keyframes candy-ls-spin {
	to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------
 * Ergebnisliste (scrollt innerhalb der gedeckelten Höhe)
 * ------------------------------------------------------------- */
.candy-ls-list {
	margin: 0;
	padding: 0;
	list-style: none;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.candy-ls-item {
	display: flex;
	gap: 12px;
	padding: 12px 16px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--candy-ls-navy-soft);
	transition: background 0.12s ease;
	outline: none;
}

.candy-ls-item:last-child {
	border-bottom: none;
}

.candy-ls-item:hover,
.candy-ls-item.is-active {
	background: var(--candy-ls-navy-soft);
}

.candy-ls-item.is-active {
	box-shadow: inset 3px 0 0 var(--candy-ls-red);
}

/* quadratisches Cover-Bild (eckig) */
.candy-ls-thumb {
	flex: 0 0 68px;
	width: 68px;
	height: 68px;
	overflow: hidden;
	background: var(--candy-ls-navy-soft);
	position: relative;
}

.candy-ls-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.candy-ls-thumb.is-empty::after {
	content: "Cash.";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	font-weight: 700;
	color: rgba(16, 33, 76, 0.35);
}

.candy-ls-body {
	flex: 1 1 auto;
	min-width: 0;
}

/* Kopfzeile: Kategorie + Datum */
.candy-ls-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 3px;
	font-size: 0.66rem;
	line-height: 1.2;
}

.candy-ls-cat {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--candy-ls-navy);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 60%;
}

.candy-ls-date {
	color: rgba(16, 33, 76, 0.5);
	white-space: nowrap;
}

.candy-ls-title {
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.28;
	margin: 0 0 3px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.candy-ls-excerpt {
	font-size: 0.76rem;
	line-height: 1.4;
	color: rgba(16, 33, 76, 0.72);
	margin: 0 0 6px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Treffer-Hervorhebung (eckig) */
.candy-ls-hl {
	background: var(--candy-ls-hl);
	color: var(--candy-ls-navy);
	padding: 0 1px;
	font-weight: 700;
}

/* ---------------------------------------------------------------
 * „Warum vorgeschlagen?" – Begründungs-Pills (eckig)
 * ------------------------------------------------------------- */
.candy-ls-reasons {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.candy-ls-reason {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.63rem;
	line-height: 1;
	font-weight: 600;
	padding: 4px 7px;
	background: var(--candy-ls-navy-soft);
	color: var(--candy-ls-navy);
	white-space: nowrap;
}

.candy-ls-reason b {
	font-weight: 700;
}

.candy-ls-reason--title {
	background: var(--candy-ls-navy-mid);
}

.candy-ls-reason--top {
	background: var(--candy-ls-red);
	color: #fff;
}

.candy-ls-reason--fresh {
	background: var(--candy-ls-navy);
	color: #fff;
}

.candy-ls-reason .candy-ls-dot {
	width: 6px;
	height: 6px;
	background: currentColor;
	opacity: 0.85;
}

/* ---------------------------------------------------------------
 * Fußzeile: „Alle Ergebnisse anzeigen"
 * ------------------------------------------------------------- */
.candy-ls-footer {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 16px;
	background: var(--candy-ls-navy);
	color: #fff;
	text-decoration: none;
	font-size: 0.78rem;
	font-weight: 700;
	border-top: 2px solid var(--candy-ls-red);
	transition: background 0.12s ease;
}

.candy-ls-footer:hover,
.candy-ls-footer.is-active {
	background: var(--candy-ls-red);
	color: #fff;
}

.candy-ls-footer .candy-ls-arrow {
	transition: transform 0.14s ease;
}

.candy-ls-footer:hover .candy-ls-arrow,
.candy-ls-footer.is-active .candy-ls-arrow {
	transform: translateX(3px);
}

.candy-ls-kbd {
	font-size: 0.6rem;
	font-weight: 600;
	opacity: 0.75;
	border: 1px solid rgba(255, 255, 255, 0.4);
	padding: 1px 5px;
}

/* ---------------------------------------------------------------
 * Mobile / schmale Viewports
 * ------------------------------------------------------------- */
@media (max-width: 640px) {
	.candy-ls-dropdown {
		width: calc(100vw - 16px);
	}

	.candy-ls-thumb {
		flex-basis: 58px;
		width: 58px;
		height: 58px;
	}

	.candy-ls-item {
		padding: 11px 13px;
	}

	.candy-ls-title {
		font-size: 0.9rem;
	}

	.candy-ls-excerpt {
		font-size: 0.8rem;
	}
}
