/* CollectA Händlersuche – übernimmt Schrift und Grundfarben des Themes */
.chs {
  --chs-accent: #3d6b45;
  --chs-map-h: 560px;
  --chs-ink: currentColor;
  --chs-line: rgba(0, 0, 0, 0.14);
  --chs-soft: rgba(0, 0, 0, 0.035);
  --chs-muted: rgba(0, 0, 0, 0.62);
  margin: 1.5em 0;
  text-align: left;
}
/* Theme-Vorgaben neutralisieren (zentrierter Text, Überschriften, Listen) */
.chs .chs-list, .chs .chs-list * { text-align: left; }
.chs .chs-status { text-align: left; }
.chs *, .chs *::before, .chs *::after { box-sizing: border-box; }

.chs-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;
}

/* Suchleiste */
.chs-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin: 0 0 6px;
}
.chs .chs-input,
.chs .chs-radius {
  font: inherit; color: inherit; background: #fff;
  height: 48px; margin: 0; padding: 0 14px;
  border: 1.5px solid var(--chs-line); border-radius: 6px; box-shadow: none;
}
.chs .chs-input { flex: 1 1 240px; min-width: 0; font-size: 1.05em; }
.chs .chs-radius { flex: 0 0 auto; padding-right: 32px; cursor: pointer; }
.chs .chs-input:focus,
.chs .chs-radius:focus { outline: none; border-color: var(--chs-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chs-accent) 22%, transparent); }

.chs .chs-btn,
.chs .chs-locate {
  font: inherit; font-weight: 600; line-height: 1; height: 48px; margin: 0;
  border: 0; border-radius: 6px; cursor: pointer; text-transform: none; letter-spacing: normal;
}
.chs .chs-btn { display: inline-flex; align-items: center; justify-content: center; width: auto; padding: 0 22px; background: var(--chs-accent); color: #fff; }
.chs .chs-consent-box { text-align: center; }
.chs .chs-btn:hover { filter: brightness(1.08); }
.chs .chs-locate {
  width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--chs-accent); border: 1.5px solid var(--chs-line);
}
.chs .chs-locate:hover { border-color: var(--chs-accent); }
.chs .chs-btn:focus-visible,
.chs .chs-locate:focus-visible,
.chs .chs .chs-action:focus-visible,
.chs a:focus-visible { outline: 3px solid var(--chs-accent); outline-offset: 2px; }

.chs-status { min-height: 1.5em; margin: 4px 0 12px; color: var(--chs-muted); font-size: 0.95em; }
.chs.is-busy .chs-status::before {
  content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.5em; vertical-align: -0.1em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: chs-spin 0.8s linear infinite;
}
@keyframes chs-spin { to { transform: rotate(360deg); } }

/* Liste + Karte */
.chs-body {
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr;
  border: 1.5px solid var(--chs-line); border-radius: 8px; overflow: hidden; background: #fff;
}
.chs-list { height: var(--chs-map-h); scrollbar-width: thin; overflow-y: auto; overscroll-behavior: contain; border-right: 1.5px solid var(--chs-line); }
.chs-list:focus { outline: none; }
/* Einstieg / keine Treffer */
.chs-intro { padding: 36px 26px; text-align: center; color: var(--chs-muted); line-height: 1.55; }
.chs-intro .chs-ico { width: 34px; height: 34px; color: var(--chs-accent); opacity: 0.8; margin-bottom: 10px; }
.chs-intro p { margin: 0 auto 8px; max-width: 30ch; }
.chs-intro .chs-count { margin-top: 14px; color: inherit; font-weight: 600; }

/* Ergebnisliste */
.chs .chs-items { list-style: none; margin: 0; padding: 0; }
.chs .chs-item {
  position: relative; margin: 0; padding: 16px 18px 16px 20px; list-style: none;
  border-bottom: 1px solid var(--chs-line); transition: background-color 0.15s;
}
.chs .chs-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--chs-accent); transform: scaleY(0); transition: transform 0.2s;
}
.chs .chs-item:hover { background: var(--chs-soft); }
.chs .chs-item.is-active { background: color-mix(in srgb, var(--chs-accent) 7%, #fff); }
.chs .chs-item.is-active::before { transform: scaleY(1); }

.chs-item-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.chs-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
  background: var(--chs-accent); color: #fff; font-size: 0.8em; font-weight: 700; font-variant-numeric: tabular-nums;
}
.chs .chs-list .chs-name {
  margin: 0 !important; padding: 0 !important; border: 0; background: none;
  font-family: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1.3; font-style: normal;
  color: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; word-break: normal; hyphens: auto;
}
.chs .chs-list .chs-name::before, .chs .chs-list .chs-name::after { content: none; display: none; }
.chs .chs-name:hover { color: var(--chs-accent); }
.chs .chs-dist {
  white-space: nowrap; padding: 3px 9px; border-radius: 999px; margin-top: 1px;
  background: color-mix(in srgb, var(--chs-accent) 12%, transparent); color: var(--chs-accent);
  font-size: 0.82em; font-weight: 700; font-variant-numeric: tabular-nums;
}

.chs .chs-list .chs-addr { margin: 6px 0 0 38px; padding: 0; font-style: normal; font-size: 0.95rem; line-height: 1.5; color: var(--chs-muted); }

.chs .chs-contact { list-style: none; margin: 8px 0 0 38px; padding: 0; font-size: 0.93rem; }
.chs .chs-contact li { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; min-width: 0; }
.chs .chs-contact .chs-ico { flex: 0 0 auto; color: var(--chs-accent); opacity: 0.85; }
.chs .chs-contact a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chs .chs-contact a:hover { color: var(--chs-accent); text-decoration: underline; text-underline-offset: 2px; }

.chs .chs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0 38px; }
.chs .chs-list .chs-action {
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: 32px; min-height: 0; padding: 0 11px; margin: 0;
  font-family: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; text-transform: none; letter-spacing: normal; box-shadow: none;
  color: var(--chs-accent); background: transparent; border: 1.5px solid currentColor; border-radius: 6px; cursor: pointer;
}
.chs .chs-list .chs-action .chs-ico { width: 15px; height: 15px; }
.chs .chs-list .chs-action:hover { background: var(--chs-accent); color: #fff; }
.chs .chs-list .chs-action:first-child { background: var(--chs-accent); color: #fff; }
.chs .chs-list .chs-action:first-child:hover { filter: brightness(1.1); }
.chs:not(.has-map) .chs-show { display: none; }

/* Popup in der Karte */
.chs-popup { min-width: 190px; }
.chs-popup-name { display: block; font-size: 1.05em; margin-bottom: 4px; }
.chs-popup-addr { color: var(--chs-muted); }
.chs .chs-popup-links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.chs .chs-popup-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--chs-accent); font-weight: 600; text-decoration: none; }
.chs .chs-popup-links a:hover { text-decoration: underline; }

.chs-map-wrap { position: relative; height: var(--chs-map-h); background: #eef0ec; }
.chs-map { position: absolute; inset: 0; z-index: 0; }
.chs-map-msg {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center; line-height: 1.5; color: var(--chs-muted); background: #eef0ec;
}
.chs-map-msg[hidden] { display: none; }
.chs .leaflet-container { font: inherit; font-size: 0.9em; }
.chs .leaflet-container img { max-width: none !important; max-height: none !important; } /* Theme-Konflikt mit img{max-width:100%} */
/* Schutz vor Theme-/Lazy-Load-Regeln, die Kartenkacheln verstecken oder verformen */
.chs .leaflet-container img.leaflet-tile {
  width: 256px; height: 256px; margin: 0 !important; padding: 0 !important; border: 0 !important;
  border-radius: 0 !important; box-shadow: none !important; filter: none !important; transition: none;
  visibility: inherit !important; display: block;
}
.chs .leaflet-container img.leaflet-tile.leaflet-tile-loaded { opacity: 1 !important; }
.chs .leaflet-pane, .chs .leaflet-tile-pane { visibility: visible !important; }
.chs .leaflet-popup-content { margin: 12px 16px; line-height: 1.45; }
.chs .leaflet-popup-content-wrapper { border-radius: 6px; }

.chs-pin { color: var(--chs-accent); background: none; border: 0; }
.chs-pin svg { display: block; fill: currentColor; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.chs-pin--hit { position: relative; }
.chs-pin--hit svg path { stroke: #fff; stroke-width: 2; }
.chs-pin--hit span {
  position: absolute; left: 0; right: 0; top: 7px; text-align: center;
  color: #fff; font-size: 13px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}

.chs .marker-cluster-small,
.chs .marker-cluster-medium,
.chs .marker-cluster-large { background: color-mix(in srgb, var(--chs-accent) 30%, transparent); }
.chs .marker-cluster-small div,
.chs .marker-cluster-medium div,
.chs .marker-cluster-large div { background: var(--chs-accent); color: #fff; font-weight: 700; }

/* Zwei-Klick-Hinweis */
.chs-consent {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(0,0,0,.025) 22px 23px),
    #eef0ec;
}
.chs-consent-box { max-width: 380px; text-align: center; line-height: 1.5; }
.chs-consent-box p { margin: 0 0 12px; }
.chs-consent-box a { color: var(--chs-accent); }
.chs-consent-hint { font-size: 0.85em; color: var(--chs-muted); }

/* Mobil: Karte oben, Liste darunter */
@media (max-width: 820px) {
  .chs-body { grid-template-columns: 1fr; }
  .chs-map-wrap { order: -1; height: min(60vh, var(--chs-map-h)); }
  .chs-list { height: auto; max-height: none; border-right: 0; border-top: 1.5px solid var(--chs-line); }
  .chs .chs-btn { flex: 1 1 auto; }
  .chs .chs-item { padding: 16px; }
  .chs .chs-addr, .chs .chs-contact, .chs-actions { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chs * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
