/* SECPLAN Suche: Such-Layer. Maße nach dem Doofinder-Layer (docs/LAYER-REFERENZ.md),
   Akzent Shop-Navy. Alle Klassen mit Präfix sps-, damit nichts mit dem Theme kollidiert. */
.sps-layer {
  --sps-akzent: #1d3661;
  --sps-akzent-hell: #2b5090;
  --sps-text: #323334;
  --sps-grau: #6b6e72;
  --sps-rand: #cbcccd;
  --sps-flaeche: #f4f6f9;
  --sps-gruen: #14810f;
  --sps-gelb: #b8860b;
  --sps-rot: #cc0505;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #fff;
  color: var(--sps-text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sps-layer[hidden] { display: none !important; }
.sps-layer *, .sps-layer *::before, .sps-layer *::after { box-sizing: border-box; }
.sps-layer button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.sps-layer a { color: inherit; text-decoration: none; }
.sps-layer :focus-visible { outline: 2px solid var(--sps-akzent-hell); outline-offset: 2px; }
.sps-offen { overflow: hidden !important; }

/* Kopf */
.sps-kopf { display: flex; align-items: center; gap: 12px; padding: 32px 48px 0; min-height: 128px; flex: none; }
.sps-logo { flex: none; width: 171px; display: flex; align-items: center; }
/* Das Shop-Logo ist für den dunklen Kopf gemacht. Ein Filter färbt es in Shop-Navy #1d3661
   (ausgerechnet, Abweichung unter 1 %). Eine Maske ginge nur mit CORS-Freigabe des Medienservers. */
.sps-logo-bild { display: block; max-width: 100%; max-height: 96px;
  filter: brightness(0) saturate(100%) invert(10%) sepia(5%) saturate(7500%) hue-rotate(182deg) brightness(176%) contrast(95%); }
.sps-zurueck { display: none; flex: none; width: 32px; height: 32px; align-items: center; justify-content: center; }
.sps-feld { flex: 1; display: flex; align-items: center; gap: 8px; height: 48px; border-bottom: 1px solid var(--sps-akzent); min-width: 0; }
.sps-feld svg { flex: none; }
.sps-eingabe { flex: 1; min-width: 0; height: 47px; border: 0 !important; outline: none !important; box-shadow: none !important; background: transparent; font: inherit; font-size: 16px; color: #333; padding: 0 0 0 4px; }
.sps-eingabe::-webkit-search-cancel-button { display: none; }
.sps-leeren { flex: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--sps-grau); }
.sps-schliessen { flex: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; margin-left: 12px; }

/* Rumpf */
.sps-rumpf { flex: 1; overflow-y: auto; padding: 24px 48px 48px; -webkit-overflow-scrolling: touch; }
.sps-layer .sps-ueberschrift { font-family: inherit !important; font-size: 16px !important; font-weight: 500 !important; line-height: 1.4 !important; color: var(--sps-text) !important; text-transform: none !important; letter-spacing: 0 !important; margin: 8px 0 12px !important; }
.sps-chips { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 24px; }
.sps-chip { border: 1px solid var(--sps-rand) !important; border-radius: 999px; padding: 6px 16px !important; font-size: 15px; white-space: nowrap; background: #fff !important; }
.sps-chip:hover { border-color: var(--sps-akzent) !important; color: var(--sps-akzent); }
.sps-layer .sps-chip.ist-aktiv { background: var(--sps-akzent) !important; border-color: var(--sps-akzent) !important; color: #fff; }
.sps-kopfchips .sps-chips:empty { display: none; }

/* Hilfe-Kasten mit Kategorie-Karussell */
.sps-hilfe { position: relative; display: flex; align-items: center; gap: 16px; border: 1px solid var(--sps-rand); border-radius: 6px; padding: 24px 32px; margin-bottom: 40px; }
.sps-hilfe[hidden] { display: none; }
.sps-hilfe-text { flex: none; width: 160px; font-size: 14px; }
.sps-hilfe-text strong { display: block; font-size: 15px; }
.sps-hilfe-text button { margin-top: 12px; font-size: 12px; color: var(--sps-akzent); }
.sps-hilfe-zu { position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; color: var(--sps-grau); }
.sps-karussell { flex: 1; display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; min-width: 0; }
.sps-karussell::-webkit-scrollbar { display: none; }
.sps-pfeil { flex: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.sps-kachel { flex: none; display: flex; align-items: center; gap: 12px; height: 80px; padding: 0 20px 0 6px; border: 1px solid var(--sps-rand) !important; border-radius: 4px; background: #fff !important; font-size: 16px; white-space: nowrap; }
.sps-kachel img { width: 68px; height: 68px; object-fit: contain; }
.sps-kachel:hover { border-color: var(--sps-akzent) !important; }

/* Ergebnisse mit Filterspalte */
.sps-inhalt { display: flex; gap: 24px; align-items: flex-start; }
.sps-filter { flex: none; width: 360px; }
.sps-ergebnisse { flex: 1; min-width: 0; }
.sps-facette { margin-bottom: 32px; }
.sps-facette-kopf { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 32px; font-size: 20px !important; font-weight: 600 !important; text-align: left; }
.sps-facette-kopf svg { transition: transform .15s; }
.sps-facette.ist-zu .sps-facette-kopf svg { transform: rotate(180deg); }
.sps-facette.ist-zu .sps-facette-rumpf { display: none; }
.sps-facette-suche { display: flex; align-items: center; gap: 8px; border: 1px solid var(--sps-rand); border-radius: 4px; height: 32px; padding: 0 10px; margin: 12px 0 8px; }
.sps-facette-suche input { flex: 1; min-width: 0; height: 28px; border: 0 !important; outline: none !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; font: inherit; font-size: 14px; }
.sps-wert { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; font-size: 14px; text-align: left; }
.sps-wert-name { flex: 1; min-width: 0; }
.sps-wert-anzahl { flex: none; color: var(--sps-grau); }
.sps-kasten { flex: none; width: 18px; height: 18px; border: 1px solid #8a8d91; border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.sps-wert.ist-aktiv .sps-kasten { background: var(--sps-akzent); border-color: var(--sps-akzent); }
.sps-wert.ist-aktiv .sps-kasten::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.sps-mehr-info { display: block; text-align: right; font-size: 12px; color: var(--sps-grau); margin-top: 4px; }
.sps-mehr { display: block; margin: 6px auto 0; font-size: 13px; }

.sps-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; padding: 4px 0 0; height: 36px; margin-bottom: 24px; }
.sps-alle { display: none; color: var(--sps-akzent-hell); font-size: 15px; }
/* Kleine Karten wie bei Doofinder: so viele Spalten, wie mit 190 px Breite passen */
.sps-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sps-karte { display: flex; flex-direction: column; border: 1px solid var(--sps-rand); border-radius: 4px; padding: 14px; background: #fff; min-width: 0; font-size: 13px; }
.sps-karte:hover { border-color: var(--sps-akzent); }
.sps-bild { height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.sps-bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sps-titel { margin-bottom: .5rem; overflow-wrap: anywhere; }
.sps-nr { font-size: 11px; margin-bottom: .5rem; }
.sps-bestand { font-size: 11px; font-weight: 600; color: var(--sps-gruen); }
.sps-bestand.ist-extern { color: var(--sps-gelb); }
.sps-bestand.ist-leer { color: var(--sps-rot); }
.sps-hinweis { padding: 40px 0; text-align: center; color: var(--sps-grau); }
.sps-sentinel { height: 1px; }
.sps-laden { padding: 16px 0; text-align: center; color: var(--sps-grau); font-size: 14px; }

@media (max-width: 1199px) {
  .sps-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sps-filter { width: 280px; }
}

/* Mobil */
@media (max-width: 767px) {
  .sps-kopf { padding: 0 8px; min-height: 52px; border-bottom: 1px solid var(--sps-akzent); }
  .sps-logo, .sps-schliessen { display: none; }
  .sps-zurueck { display: flex; }
  .sps-feld { border-bottom: 0; height: 52px; }
  .sps-feld > svg { display: none; }
  .sps-eingabe { font-size: 17px; }
  .sps-rumpf { padding: 0 8px 32px; }
  .sps-hilfe, .sps-filter { display: none !important; }
  .sps-kopfchips { margin: 0 -8px 16px; padding: 16px 16px 8px; box-shadow: 0 8px 12px -10px rgba(0,0,0,.25); }
  .sps-kopfchips .sps-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
  .sps-kopfchips .sps-chips::-webkit-scrollbar { display: none; }
  .sps-start .sps-ueberschrift { padding: 0 4px; }
  .sps-meta { padding: 8px 4px 0; margin-bottom: 12px; }
  .sps-alle { display: inline; }
  .sps-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sps-karte { padding: 16px; }
}
@media (min-width: 768px) { .sps-kopfchips { display: none; } }
@media (prefers-reduced-motion: reduce) { .sps-karussell { scroll-behavior: auto; } }
