/*
 * sg_search.css (2026) - modernes Layout fuer die Typesense-Kampagnensuche.
 * Card-Design/Farbtokens bewusst 1:1 aus v6web/css/widget/widget-v2.css uebernommen
 * (--sgv2-accent/--sgv2-muted, .sgv2-card/-grid/-card-img/... Klassen), statt etwas
 * komplett Neues zu erfinden - gleiche Optik wie das Shop-Widget.
 */

:root {
	--sgv2-accent: #008CB3;
	--sgv2-muted: #767676;
	--sg-brand: #B2003B;
	--sg-radius: 12px;
}

* {
	box-sizing: border-box;
}

body {
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #222;
}

/* ---------- Karte ---------- */
#sg-maps-section {
	max-width: 1400px;
	margin: 0 auto;
	padding: 16px;
}

#map {
	border-radius: var(--sg-radius);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* ---------- Suchleiste + Filter ---------- */
#sgSearchContainer {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 16px 40px;
}

.sg-section-label {
	font-size: .8rem;
	color: var(--sgv2-muted);
	text-transform: uppercase;
	letter-spacing: .03em;
	margin-bottom: 8px;
}

/* Kategorien als Pill-Buttons statt Link-Liste */
#sg-categories .ais-RefinementList-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.sg-btn-clientCategories {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 999px;
	background: #f2f2f2;
	color: #222;
	text-decoration: none;
	font-size: .88rem;
	white-space: nowrap;
	transition: background .15s ease, color .15s ease;
}

.sg-btn-clientCategories:hover {
	background: #e6e6e6;
	color: #000;
}

.sg-selected-clientCategories {
	background: var(--sgv2-accent);
	color: #fff;
}

.sg-selected-clientCategories:hover {
	background: var(--sgv2-accent);
	color: #fff;
}

/* Suchfeld */
.ais-SearchBox-form {
	position: relative;
}

.ais-SearchBox-input {
	width: 100%;
	padding: 14px 44px 14px 16px;
	border: 1px solid #ddd;
	border-radius: var(--sg-radius);
	font-size: 1rem;
}

.ais-SearchBox-input:focus {
	outline: none;
	border-color: var(--sgv2-accent);
	box-shadow: 0 0 0 3px rgba(1, 110, 150, .15);
}

.ais-SearchBox-submit,
.ais-SearchBox-reset {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--sgv2-muted);
}

/* Filter-Dropdown */
.sg-filter-toggle {
	width: 100%;
	height: 100%;
	min-height: 52px;
	border-radius: var(--sg-radius);
	background: var(--sgv2-accent);
	border: none;
	color: #fff;
	font-weight: 600;
}

.sg-filter-toggle:hover,
.sg-filter-toggle:focus {
	background: #01597b;
	color: #fff;
}

#sg-filters-dropdown {
	border-radius: var(--sg-radius);
	border: 1px solid #eaeaea;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
	padding: 16px;
	min-width: 320px;
}

.sg-filter-panel {
	border: 1px solid #eaeaea;
	border-radius: var(--sg-radius);
	margin-bottom: 14px;
	overflow: hidden;
}

.sg-filter-panel-header {
	padding: 10px 14px;
	background: #f7f7f7;
	font-size: .85rem;
	font-weight: 600;
	margin: 0;
}

.sg-filter-panel-body {
	padding: 12px 14px;
}

.ais-RefinementList-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
}

.ais-RefinementList-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .9rem;
	margin-bottom: 6px;
	cursor: pointer;
}

.ais-RefinementList-checkbox {
	margin: 0;
}

.ais-RefinementList-count {
	color: var(--sgv2-muted);
	font-size: .8rem;
	margin-left: auto;
}

.ais-SearchBox--noResults,
.ais-RefinementList-searchBox {
	margin-bottom: 10px;
}

.ais-RefinementList-searchBox .ais-SearchBox-input {
	padding: 8px 36px 8px 10px;
	font-size: .85rem;
}

.ais-RefinementList-showMore {
	display: inline-block;
	margin-top: 6px;
	padding: 6px 12px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: var(--sgv2-accent);
	font-size: .8rem;
	font-weight: 600;
	cursor: pointer;
}

.ais-RefinementList-showMore:hover {
	background: #f2f2f2;
}

/* Preis-Regler (react-rheostat, vom rangeSlider-Widget gerendert) */
.ais-RangeSlider {
	padding: 20px 10px 6px;
}

.rheostat {
	position: relative;
	height: 4px;
	background: #e6e6e6;
	border-radius: 2px;
	margin: 0 4px;
}

.rheostat-background {
	height: 100%;
	border-radius: 2px;
}

.rheostat-progress {
	position: absolute;
	top: 0;
	height: 100%;
	background: var(--sgv2-accent);
	border-radius: 2px;
}

.rheostat-handle {
	position: absolute;
	top: 50%;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	margin-left: -9px;
	background: #fff;
	border: 2px solid var(--sgv2-accent);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	cursor: pointer;
	outline: none;
}

.rheostat-tooltip {
	position: absolute;
	top: -22px;
	left: 50%;
	transform: translateX(-50%);
	font-size: .75rem;
	color: var(--sgv2-muted);
	white-space: nowrap;
}

.rheostat-marker {
	display: none;
}

/* aktuelle Filter als Pills */
.ais-CurrentRefinements-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ais-CurrentRefinements-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(1, 110, 150, .1);
	color: var(--sgv2-accent);
	border-radius: 999px;
	padding: 6px 10px;
	font-size: .82rem;
}

.ais-CurrentRefinements-delete {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	font-weight: 700;
}

.sg-btn-clientCategories1 {
	color: var(--sgv2-accent);
	text-decoration: none;
	font-size: .88rem;
	font-weight: 600;
}

/* Stats + Pagination */
#sg-stats {
	color: var(--sgv2-muted);
	font-size: .9rem;
	display: flex;
	align-items: center;
}

.ais-Pagination-list {
	display: flex;
	justify-content: center;
	gap: 4px;
	list-style: none;
	padding: 0;
}

.ais-Pagination-item a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	border-radius: 8px;
	text-decoration: none;
	color: #222;
	font-size: .85rem;
}

.ais-Pagination-item--selected a {
	background: var(--sgv2-accent);
	color: #fff;
}

/* ---------- Kampagnen-Cards (1:1 sgv2-Design aus dem Shop-Widget) ---------- */
#sg-hits .ais-Hits-list {
	display: grid;
	/* auto-fill statt auto-fit: bei wenigen/einem Treffer bleiben die Karten bei ihrer normalen
	   Groesse, statt sich auf die volle Zeilenbreite zu strecken (klassischer auto-fit-Effekt
	   bei nicht komplett gefuellten Zeilen). */
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Das <a> traegt die eigentliche Card-Optik (Flex/Rahmen/Radius/Schatten) - NICHT das aeussere
   <article class="sg-hit">, das ist nur ein neutraler Wrapper. Wichtig fuer text-decoration:none:
   die Unterstreichung eines <a> "faerbt" visuell allen umschlossenen Inhalt, ein Reset auf einem
   AEUSSEREN Element (dem article) reicht dafuer nicht - er muss auf dem <a> selbst sitzen. */
.sg-hit {
	display: block;
}

.sg-hit a {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--sg-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid #eaeaea;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
	transition: transform .15s ease, box-shadow .15s ease;
}

.sg-hit a:hover,
.sg-hit a:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
}

.sg-hit-img {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f0f0f0;
}

.sg-hit-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--sg-brand);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .02em;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.sg-hit-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sg-hit-price {
	padding: 6px 14px;
	background: var(--sgv2-accent);
	color: #fff;
	font-weight: 700;
	font-size: .85rem;
}

.sg-hit-price--deal {
	background: var(--sg-brand);
}

.sg-hit-body {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.sg-hit-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
	font-weight: 600;
}

.sg-hit-text {
	margin: 0;
	font-size: .85rem;
	color: var(--sgv2-muted);
	line-height: 1.4;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sg-hit-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 6px;
	padding-top: 10px;
	border-top: 1px solid #f0f0f0;
}

.sg-hit-location {
	font-size: .78rem;
	color: var(--sgv2-muted);
	line-height: 1.3;
}

.sg-hit-logo {
	max-height: 28px;
	max-width: 64px;
	object-fit: contain;
	flex-shrink: 0;
}

/* keine Ergebnisse */
#no-results-message {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 16px;
	color: var(--sgv2-muted);
}

@media (prefers-reduced-motion: reduce) {
	.sg-hit a {
		transition: none;
	}
}
