/* DS Market – vylepšený našeptávač vyhledávání
   Soubor: /user/documents/search-whisperer.css – načíst v patičce vedle cart-empty.css
   Patří k search-whisperer.js */

.dsm-whisperer,
.dsm-search-pop {
  --dsm-green: #138a2c;
  --dsm-green-dark: #0e6b22;
  --dsm-green-soft: #eef7ef;
  --dsm-line: #dfe7e0;
  --dsm-text: #2b2b2b;
  --dsm-muted: #5f6660;
  --dsm-side: #f7faf7;
}

/* ---------- rám panelu ---------- */
#formSearchForm .search-whisperer.dsm-whisperer,
#formSearchForm .dsm-search-pop {
  background: #fff;
  border: 1px solid var(--dsm-line);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .14);
  padding: 0;
  text-align: left;
  color: var(--dsm-text);
  z-index: 1000;
}
#formSearchForm .search-whisperer.dsm-whisperer {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dsm-sw {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-areas:
    "chips chips"
    "main  side"
    "foot  foot";
}
.dsm-sw--noside {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "chips" "main" "foot";
}

/* nadpisy sekcí */
.dsm-whisperer .dsm-sw__h,
.dsm-search-pop .dsm-sw__h {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--dsm-muted);
}

/* ---------- štítky oblíbených dotazů ---------- */
.dsm-sw__chips {
  grid-area: chips;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--dsm-line);
}
.dsm-sw__label {
  font-size: 13px;
  color: var(--dsm-muted);
  margin-right: 2px;
}
/* !important kvůli stylům šablony pro tlačítka ve vyhledávacím formuláři */
#formSearchForm .dsm-chip {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0;
  padding: 5px 13px !important;
  border: 1px solid var(--dsm-line) !important;
  border-radius: 999px !important;
  background: #f6f8f6 !important;
  box-shadow: none !important;
  color: var(--dsm-text) !important;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
#formSearchForm .dsm-chip:hover,
#formSearchForm .dsm-chip:focus-visible {
  background: var(--dsm-green-soft) !important;
  border-color: var(--dsm-green) !important;
  color: var(--dsm-green-dark) !important;
  outline: none;
}

/* ---------- produkty ---------- */
.dsm-sw__main {
  grid-area: main;
  min-width: 0;
  padding: 14px 18px 12px;
}
#formSearchForm .dsm-sw .search-whisperer-products {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
}
#formSearchForm .dsm-sw .search-whisperer-products li {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  width: auto;
  float: none;
}
#formSearchForm .dsm-sw .search-whisperer-products li::before { content: none; }
#formSearchForm .dsm-sw .search-whisperer-products li > a {
  display: grid !important;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: auto;
  padding: 8px;
  border-radius: 8px;
  color: var(--dsm-text);
  text-decoration: none;
  transition: background-color .15s;
}
#formSearchForm .dsm-sw .search-whisperer-products li > a:hover,
#formSearchForm .dsm-sw .search-whisperer-products li > a:focus-visible,
#formSearchForm .dsm-sw .search-whisperer-products li.active > a {
  background: var(--dsm-green-soft);
  outline: none;
}
#formSearchForm .dsm-sw .search-whisperer-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0;
  float: none;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}
#formSearchForm .dsm-sw .search-whisperer-image img {
  width: auto;
  height: auto;
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}
#formSearchForm .dsm-sw .p-info {
  display: block;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  margin: 0;
  padding: 0;
}
#formSearchForm .dsm-sw .p-name {
  display: -webkit-box !important;
  width: auto !important;
  max-width: none !important;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
}
#formSearchForm .dsm-sw .p-availability {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
}
#formSearchForm .dsm-sw .price {
  position: static;
  float: none !important;
  width: auto !important;
  margin: 0;
  padding: 0 !important;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--dsm-text);
}

/* zvýraznění hledaného výrazu */
#formSearchForm mark.dsm-hl {
  background: #fff1a8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* ---------- boční sloupec: kategorie, značky, články ---------- */
.dsm-sw__side {
  grid-area: side;
  min-width: 0;
  padding: 14px 14px 12px;
  background: var(--dsm-side);
  border-left: 1px solid var(--dsm-line);
}
.dsm-sw__group + .dsm-sw__group { margin-top: 14px; }
#formSearchForm .dsm-sw__side a.search-whisperer-document {
  display: block;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--dsm-text);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  white-space: normal;
}
#formSearchForm .dsm-sw__side a.search-whisperer-document:hover,
#formSearchForm .dsm-sw__side a.search-whisperer-document.active {
  background: var(--dsm-green-soft);
  color: var(--dsm-green-dark);
}
#formSearchForm .dsm-sw__side a.search-whisperer-document em { display: none; }

/* ---------- tlačítko Zobrazit všechny výsledky ---------- */
.dsm-sw__foot {
  grid-area: foot;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--dsm-line);
  text-align: center;
}
#formSearchForm .dsm-sw__foot a.dsm-sw__all {
  display: inline-block;
  margin: 0;
  padding: 11px 30px;
  border: 0;
  border-radius: 6px;
  background: var(--dsm-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .15s;
}
#formSearchForm .dsm-sw__foot a.dsm-sw__all:hover { background: var(--dsm-green-dark); color: #fff; }

/* ---------- panel při prázdném poli ---------- */
#formSearchForm .dsm-search-pop {
  display: none;
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  padding: 16px 18px;
}
#formSearchForm .dsm-search-pop.is-open { display: block; }
.dsm-search-pop__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
#formSearchForm .dsm-search-pop__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
#formSearchForm .dsm-search-pop__links li { margin: 0; padding: 0; }
#formSearchForm .dsm-search-pop__links li::before { content: none; }
#formSearchForm .dsm-search-pop__links a {
  display: block;
  padding: 10px 12px;
  border: 1.5px solid var(--dsm-green);
  border-radius: 6px;
  background: var(--dsm-green-soft);
  color: var(--dsm-green-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
#formSearchForm .dsm-search-pop__links a:hover { background: var(--dsm-green); color: #fff; }

/* ---------- tablet ---------- */
@media (max-width: 991px) {
  .dsm-sw { grid-template-columns: minmax(0, 1fr) 220px; }
  #formSearchForm .dsm-sw .search-whisperer-products { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- mobil ---------- */
@media (max-width: 767px) {
  .dsm-sw,
  .dsm-sw--noside {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "chips" "main" "side" "foot";
  }
  .dsm-sw__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 12px 14px;
    -webkit-overflow-scrolling: touch;
  }
  #formSearchForm .dsm-chip { flex: 0 0 auto; }
  .dsm-sw__label { flex: 0 0 auto; }
  .dsm-sw__main { padding: 12px 10px 8px; }
  .dsm-sw__side { border-left: 0; border-top: 1px solid var(--dsm-line); }
  #formSearchForm .dsm-sw .search-whisperer-products li > a { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  #formSearchForm .dsm-sw .search-whisperer-image { width: 48px; height: 48px; }
  #formSearchForm .dsm-sw .search-whisperer-image img { max-width: 48px; max-height: 48px; }
  #formSearchForm .dsm-sw__foot a.dsm-sw__all { display: block; }
  #formSearchForm .search-whisperer.dsm-whisperer { max-height: calc(100vh - 120px); }
}
