/* DP Suche – Vollbild-Overlay im dpconnect-CI, gescoped unter #dps-overlay */

#dps-overlay {
  --dps-ink: #1e1e1e;
  --dps-ink-soft: #4b5563;
  --dps-ink-faint: #8b95a1;
  --dps-bg: #f6f7f8;
  --dps-card: #ffffff;
  --dps-line: #e5e7eb;
  --dps-accent: #f68622;        /* dpconnect Orange */
  --dps-accent-dark: #c2620f;   /* Orange für Text auf hellem Grund */
  --dps-accent-soft: #fdeedd;
  --dps-green: #38761d;         /* dpconnect Grün */
  --dps-radius: 10px;
  --dps-radius-btn: 8px;
  --dps-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --dps-font-head: "Work Sans", "Open Sans", -apple-system, sans-serif;

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  padding: 40px;
  overflow: hidden;
  background: rgba(15, 17, 20, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  color: var(--dps-ink);
  font-family: var(--dps-font);
  font-size: 16px;
  line-height: 1.45;
  opacity: 0;
  transition: opacity .18s ease;
}
#dps-overlay.dps-open { opacity: 1; }
#dps-overlay[hidden] { display: none; }
body.dps-locked { overflow: hidden !important; }

#dps-overlay .dps-modal {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--dps-bg);
  border-radius: 16px;
  overflow: hidden; /* clippt die Ecken – gescrollt wird im inneren .dps-body */
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
  transform: translateY(12px) scale(.985);
  transition: transform .22s cubic-bezier(.2, .7, .3, 1);
}
#dps-overlay.dps-open .dps-modal { transform: none; }

#dps-overlay .dps-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#dps-overlay *, #dps-overlay *::before, #dps-overlay *::after { box-sizing: border-box; }
#dps-overlay img { max-width: 100%; display: block; border: 0; }
#dps-overlay button { font: inherit; cursor: pointer; }
#dps-overlay a { color: inherit; text-decoration: none; }
#dps-overlay ul, #dps-overlay ol { margin: 0; padding: 0; }
#dps-overlay h2, #dps-overlay h3 { margin: 0; }

/* ---------- Header ---------- */
#dps-overlay .dps-top {
  flex-shrink: 0;
  position: relative;
  background: #fff;
  border-bottom: 1px solid var(--dps-line);
}
#dps-overlay .dps-top-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 12px 20px;
}
#dps-overlay .dps-searchbox-wrap { flex: 1; max-width: 640px; }
#dps-overlay .dps-close {
  display: flex; align-items: center; justify-content: center;
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: var(--dps-radius-btn); flex-shrink: 0;
  border: none; background: var(--dps-accent);
  color: #fff; font-size: 15px; line-height: 1;
}
#dps-overlay .dps-close:hover { background: #e07714; }

#dps-overlay .ais-SearchBox-form { position: relative; display: flex; margin: 0; }
#dps-overlay .ais-SearchBox-input {
  width: 100%;
  padding: 12px 44px 12px 44px;
  font-size: 16px; font-family: var(--dps-font); color: var(--dps-ink);
  border: 1.5px solid var(--dps-line);
  border-radius: var(--dps-radius-btn);
  background: var(--dps-card);
  outline: none; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
#dps-overlay .ais-SearchBox-input::-webkit-search-cancel-button,
#dps-overlay .ais-SearchBox-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
#dps-overlay .ais-SearchBox-input:focus {
  border-color: var(--dps-accent);
  box-shadow: 0 0 0 4px var(--dps-accent-soft);
}
#dps-overlay .ais-SearchBox-submit {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; width: 20px; height: 20px; padding: 0;
  color: var(--dps-ink-faint);
}
#dps-overlay .ais-SearchBox-submit svg { width: 18px; height: 18px; fill: currentColor; }
#dps-overlay .ais-SearchBox-reset {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: #f0f2f4; border: none; border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  color: var(--dps-ink-soft); padding: 0;
}
#dps-overlay .ais-SearchBox-reset svg { width: 10px; height: 10px; fill: currentColor; }
#dps-overlay .ais-SearchBox-reset[hidden] { display: none; }
#dps-overlay .ais-SearchBox-loadingIndicator { display: none; }

/* ---------- Layout ---------- */
#dps-overlay .dps-shell {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 264px 1fr; gap: 28px;
  padding: 20px;
}
#dps-overlay .dps-main { min-width: 0; }

#dps-overlay .dps-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
#dps-overlay .dps-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#dps-overlay #dps-stats { font-size: 14px; color: var(--dps-ink-soft); }
#dps-overlay #dps-stats strong { color: var(--dps-ink); }

#dps-overlay .ais-SortBy-select {
  font-family: var(--dps-font); font-size: 13px; font-weight: 600; color: var(--dps-ink);
  padding: 8px 30px 8px 12px; margin: 0;
  border: 1.5px solid var(--dps-line); border-radius: var(--dps-radius-btn);
  background: var(--dps-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%234b5563' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>") no-repeat right 12px center;
  -webkit-appearance: none; appearance: none; cursor: pointer; outline: none;
}
#dps-overlay .ais-SortBy-select:focus { border-color: var(--dps-accent); }

#dps-overlay .ais-CurrentRefinements-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
}
#dps-overlay .ais-CurrentRefinements-item {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
#dps-overlay .ais-CurrentRefinements-label { display: none; }
#dps-overlay .ais-CurrentRefinements-category {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--dps-accent-soft); color: var(--dps-accent-dark);
  font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
#dps-overlay .ais-CurrentRefinements-delete {
  background: none; border: none; color: inherit; font-size: 15px; line-height: 1;
  padding: 0 0 1px;
}
#dps-overlay .dps-chips-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
#dps-overlay .dps-chips-row:empty { display: none; }
#dps-overlay .ais-ClearRefinements-button {
  background: none; border: none; color: var(--dps-ink-faint);
  font-size: 13px; text-decoration: underline; padding: 4px;
}
#dps-overlay .ais-ClearRefinements-button--disabled { display: none; }

/* ---------- Filter ---------- */
#dps-overlay .dps-filters-head { display: none; }
#dps-overlay .dps-panel {
  background: var(--dps-card); border: 1px solid var(--dps-line);
  border-radius: var(--dps-radius); padding: 16px;
  margin-bottom: 14px;
}
#dps-overlay .dps-panel h3 {
  font-family: var(--dps-font-head);
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dps-ink-faint); margin-bottom: 10px; font-weight: 700;
}
#dps-overlay .ais-RefinementList-list, #dps-overlay .ais-HierarchicalMenu-list { list-style: none; }
#dps-overlay .ais-RefinementList-item, #dps-overlay .ais-HierarchicalMenu-item { margin: 2px 0; }
#dps-overlay .ais-RefinementList-label {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 400; padding: 5px 4px; border-radius: 6px; cursor: pointer; margin: 0;
}
#dps-overlay .ais-RefinementList-label:hover { background: #f2f4f6; }
#dps-overlay .ais-RefinementList-checkbox {
  width: 17px; height: 17px; accent-color: var(--dps-accent); flex-shrink: 0; margin: 0;
}
#dps-overlay .ais-RefinementList-labelText { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dps-overlay .ais-RefinementList-count, #dps-overlay .ais-HierarchicalMenu-count {
  font-size: 12px; color: var(--dps-ink-faint);
  background: #f0f2f4; border-radius: 999px; padding: 1px 8px;
}
#dps-overlay .ais-RefinementList-item--selected .ais-RefinementList-labelText { font-weight: 600; }
#dps-overlay .ais-HierarchicalMenu-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; padding: 6px 6px; border-radius: 6px;
}
#dps-overlay .ais-HierarchicalMenu-link:hover { background: #f2f4f6; text-decoration: none; }
#dps-overlay .ais-HierarchicalMenu-item--selected > div > .ais-HierarchicalMenu-link,
#dps-overlay .ais-HierarchicalMenu-link--selected { color: var(--dps-accent-dark); font-weight: 700; }
#dps-overlay .ais-HierarchicalMenu-list--child { margin-left: 14px; border-left: 1.5px solid var(--dps-line); padding-left: 6px; }
#dps-overlay .ais-RefinementList-showMore, #dps-overlay .ais-HierarchicalMenu-showMore {
  background: none; border: none; color: var(--dps-accent-dark); font-size: 13px; font-weight: 600;
  padding: 6px 4px 0;
}
#dps-overlay .ais-RefinementList-showMore--disabled { display: none; }
#dps-overlay .ais-RefinementList-searchBox input {
  width: 100%; padding: 8px 12px; font-size: 14px; font-family: var(--dps-font);
  border: 1.5px solid var(--dps-line); border-radius: var(--dps-radius-btn); outline: none; margin-bottom: 8px;
  background: var(--dps-card); color: var(--dps-ink); box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
#dps-overlay .ais-RefinementList-searchBox input:focus { border-color: var(--dps-accent); }
#dps-overlay .ais-RefinementList-searchBox button { display: none; }
#dps-overlay .ais-RefinementList-noResults { font-size: 13px; color: var(--dps-ink-faint); padding: 4px; }

/* Preis-Slider */
#dps-overlay #dps-price { padding: 22px 8px 6px; }
#dps-overlay #dps-price .rheostat { position: relative; height: 4px; margin: 8px 4px 26px; }
#dps-overlay #dps-price .rheostat-background { position: absolute; inset: 0; background: var(--dps-line); border-radius: 999px; }
#dps-overlay #dps-price .rheostat-progress { position: absolute; top: 0; bottom: 0; background: var(--dps-accent); border-radius: 999px; }
#dps-overlay #dps-price .rheostat-handle {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--dps-accent);
  box-shadow: 0 1px 4px rgba(30,30,30,.18); cursor: grab; z-index: 2;
}
#dps-overlay #dps-price .rheostat-handle:active { cursor: grabbing; }
#dps-overlay #dps-price .rheostat-tooltip {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; color: var(--dps-ink-soft); white-space: nowrap;
}
#dps-overlay #dps-price .rheostat-marker, #dps-overlay #dps-price .rheostat-value { display: none; }

/* ---------- Passende Varianten (eingeklappte Leiste) ---------- */
#dps-overlay .dps-variants { margin-bottom: 14px; }
#dps-overlay .dps-variants-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  background: var(--dps-card); border: 1px solid var(--dps-line);
  border-radius: var(--dps-radius-btn);
  padding: 10px 14px;
  font-family: var(--dps-font); font-size: 13px; font-weight: 600; color: var(--dps-ink);
  text-align: left;
  transition: border-color .12s ease;
}
#dps-overlay .dps-variants-toggle:hover { border-color: var(--dps-accent); }
#dps-overlay .dps-variants-count { color: var(--dps-ink-faint); font-weight: 600; }
#dps-overlay .dps-chevron { flex-shrink: 0; color: var(--dps-ink-faint); transition: transform .15s ease; }
#dps-overlay .dps-expanded .dps-chevron { transform: rotate(180deg); }
#dps-overlay #dps-variants { margin-top: 8px; }
#dps-overlay #dps-variants[hidden] { display: none; }
#dps-overlay #dps-variants .ais-Hits-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
#dps-overlay .dps-vcard {
  display: flex; align-items: center; gap: 10px;
  background: var(--dps-card); border: 1px solid var(--dps-line);
  border-radius: var(--dps-radius-btn); padding: 8px 10px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
#dps-overlay .dps-vcard:hover {
  border-color: var(--dps-accent);
  box-shadow: 0 2px 8px rgba(30,30,30,.08);
  text-decoration: none;
}
#dps-overlay .dps-vcard img {
  width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; background: #fff;
}
#dps-overlay .dps-vcard-text { display: flex; flex-direction: column; min-width: 0; }
#dps-overlay .dps-vcard-title {
  font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--dps-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#dps-overlay .dps-vcard-title mark { background: var(--dps-accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
#dps-overlay .dps-vcard-attr {
  font-size: 12px; color: var(--dps-ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Treffer ---------- */
#dps-overlay .ais-InfiniteHits-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
#dps-overlay .dps-card {
  background: var(--dps-card); border: 1px solid var(--dps-line);
  border-radius: var(--dps-radius); overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
#dps-overlay .dps-card:hover {
  transform: translateY(-2px);
  border-color: #d8dcdf;
  box-shadow: 0 1px 2px rgba(30,30,30,.05), 0 4px 16px rgba(30,30,30,.07);
  text-decoration: none;
}
#dps-overlay .dps-card-img {
  aspect-ratio: 1; background: #fff; padding: 14px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--dps-line);
}
#dps-overlay .dps-card-img img { width: 100%; height: 100%; object-fit: contain; }
#dps-overlay .dps-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
#dps-overlay .dps-card-brand {
  font-family: var(--dps-font-head);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--dps-accent-dark);
}
#dps-overlay .dps-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--dps-ink); }
#dps-overlay .dps-card-title mark { background: var(--dps-accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
#dps-overlay .dps-card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#dps-overlay .dps-card-price { font-size: 16px; font-weight: 700; white-space: nowrap; }
#dps-overlay .dps-card-price .dps-from { font-size: 11px; font-weight: 600; color: var(--dps-ink-faint); margin-right: 2px; }
#dps-overlay .dps-card-sku { font-size: 11px; color: var(--dps-ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
#dps-overlay .dps-badge {
  align-self: flex-start;
  font-size: 11px; font-weight: 600; color: var(--dps-ink-soft);
  background: #f0f2f4; border-radius: 999px; padding: 2px 8px;
}

#dps-overlay .ais-InfiniteHits-loadMore {
  display: block; margin: 24px auto 8px;
  background: var(--dps-accent); color: #fff; border: none;
  padding: 12px 28px; border-radius: var(--dps-radius-btn);
  font-family: var(--dps-font); font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .02em;
}
#dps-overlay .ais-InfiniteHits-loadMore:hover { background: #e07714; }
#dps-overlay .ais-InfiniteHits-loadMore--disabled { display: none; }

#dps-overlay .dps-empty { text-align: center; padding: 60px 20px; color: var(--dps-ink-soft); }
#dps-overlay .dps-empty strong { color: var(--dps-ink); }

/* ---------- Mobile ---------- */
#dps-overlay .dps-fab { display: none; }
#dps-overlay .dps-sheet-close, #dps-overlay .dps-sheet-apply { display: none; }

@media (max-width: 860px) {
  /* Mobil: Vollbild statt Modal */
  #dps-overlay { padding: 0; }
  #dps-overlay .dps-modal { border-radius: 0; box-shadow: none; }
  #dps-overlay .dps-top { border-radius: 0; }
  #dps-overlay .dps-top-inner { gap: 10px; padding: 10px 14px; }
  #dps-overlay .dps-close { position: static; transform: none; width: 34px; height: 34px; }
  #dps-overlay .dps-searchbox-wrap { max-width: none; }
  #dps-overlay .dps-shell { display: block; padding: 14px; }

  #dps-overlay #dps-filters {
    position: fixed; inset: 0; z-index: 60;
    background: var(--dps-bg);
    transform: translateY(100%);
    transition: transform .25s ease;
    overflow-y: auto;
    padding: 0 14px calc(84px + env(safe-area-inset-bottom));
    visibility: hidden;
  }
  #dps-overlay #dps-filters.dps-sheet-open { transform: translateY(0); visibility: visible; }
  #dps-overlay .dps-filters-head {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--dps-bg); z-index: 2;
    padding: 16px 2px 12px;
  }
  #dps-overlay .dps-filters-head h2 { font-family: var(--dps-font-head); font-size: 17px; text-transform: uppercase; }
  #dps-overlay .dps-sheet-close {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--dps-radius-btn);
    border: 1px solid var(--dps-line); background: var(--dps-card); font-size: 15px;
  }
  #dps-overlay .dps-sheet-apply {
    display: block;
    position: fixed; left: 14px; right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    background: var(--dps-accent); color: #fff; border: none;
    padding: 15px; border-radius: var(--dps-radius-btn);
    font-family: var(--dps-font); font-weight: 700; font-size: 15px;
    text-transform: uppercase; letter-spacing: .02em;
    box-shadow: 0 8px 24px rgba(246,134,34,.4);
  }
  #dps-overlay .dps-fab {
    display: flex; align-items: center; gap: 8px;
    position: fixed; z-index: 50;
    bottom: calc(18px + env(safe-area-inset-bottom)); right: 16px;
    background: var(--dps-ink); color: #fff; border: none;
    padding: 13px 20px; border-radius: var(--dps-radius);
    font-weight: 700; font-size: 14px;
    box-shadow: 0 8px 24px rgba(30,30,30,.3);
  }
  #dps-overlay .dps-fcount {
    background: var(--dps-accent); border-radius: 999px;
    font-size: 12px; min-width: 20px; height: 20px;
    display: none; align-items: center; justify-content: center; padding: 0 5px;
  }
  #dps-overlay .dps-fcount.dps-show { display: inline-flex; }

  #dps-overlay #dps-variants .ais-Hits-list { grid-template-columns: 1fr; }

  /* Listenansicht: eine Zeile pro Produkt, Bild links */
  #dps-overlay .ais-InfiniteHits-list { grid-template-columns: 1fr; gap: 10px; }
  #dps-overlay .dps-card { flex-direction: row; align-items: stretch; }
  #dps-overlay .dps-card:hover { transform: none; }
  #dps-overlay .dps-card-img {
    width: 104px; min-width: 104px; aspect-ratio: auto;
    padding: 10px;
    border-bottom: none; border-right: 1px solid var(--dps-line);
  }
  #dps-overlay .dps-card-body { padding: 10px 12px; gap: 3px; min-width: 0; }
  #dps-overlay .dps-card-title { font-size: 13.5px; }
  #dps-overlay .dps-card-foot { padding-top: 6px; }
  #dps-overlay .dps-card-price { font-size: 15px; }
}
