/* DS Market – stránka výsledků vyhledávání (chytré vyhledávání)
   Soubor: /user/documents/search-results.css – patří k search-results.js */

/* než se načtou naše výsledky, výsledky Shoptetu schováme (max. 4 s, pak se ukážou) */
.dsm-sr-pending #products-found,
.dsm-sr-pending #search-group-categories { visibility: hidden; }

.dsm-sr { --dsm-green: #138a2c; --dsm-green-dark: #0e6b22; --dsm-green-soft: #eef7ef; --dsm-line: #dfe7e0; --dsm-muted: #5f6660; }

/* hlavička: Produkty (počet) + řazení */
.dsm-sr__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 10px 0 12px; }
.dsm-sr__head .search-products-heading { margin: 0; }
.dsm-sr__count {
  display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px;
  background: var(--dsm-green-soft); color: var(--dsm-green-dark); font-size: .8em; vertical-align: middle;
}
.dsm-sr__sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--dsm-muted); }
.dsm-sr__sort select { font: inherit; color: #2b2b2b; padding: 6px 30px 6px 10px; border: 1px solid var(--dsm-line); border-radius: 6px; background-color: #fff; min-width: 0; width: auto; height: auto; }

/* štítky – filtrování */
.dsm-sr__filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px; margin: 0 0 16px; background: #f7faf7; border: 1px solid var(--dsm-line); border-radius: 10px;
}
.dsm-sr__filters[hidden] { display: none; }
.dsm-sr__lbl { font-size: 13px; color: var(--dsm-muted); margin-right: 2px; }
.dsm-sr__lbl:not(:first-child) { margin-left: 8px; }
.dsm-sr__on {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px;
  background: var(--dsm-green); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.3;
}
.dsm-sr .dsm-sr__f, .dsm-sr .dsm-sr__reset {
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: auto; min-height: 0; margin: 0;
  padding: 5px 12px; border: 1px solid var(--dsm-line); border-radius: 999px; background: #fff;
  color: #2b2b2b; font: inherit; font-size: 14px; font-weight: 400; line-height: 1.3; text-transform: none;
  cursor: pointer; box-shadow: none; transition: background-color .15s, border-color .15s;
}
.dsm-sr .dsm-sr__f small { font-size: 12px; color: var(--dsm-muted); }
.dsm-sr .dsm-sr__f:hover { border-color: var(--dsm-green); background: var(--dsm-green-soft); }
.dsm-sr .dsm-sr__f.is-on { background: var(--dsm-green); border-color: var(--dsm-green); color: #fff; font-weight: 700; }
.dsm-sr .dsm-sr__reset { border: 0; background: none; color: var(--dsm-green-dark); text-decoration: underline; padding: 5px 4px; }

.dsm-sr__note { margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: #fff7df; color: #7a5b00; font-size: 14px; }

/* karta produktu – doplňky ke stylům šablony */
.dsm-sr .dsm-pflags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 4px 0 2px; }
.dsm-sr .dsm-pflags i {
  font-style: normal; font-size: 11px; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 4px;
  background: var(--dsm-green-soft); color: var(--dsm-green-dark);
}
.dsm-sr .dsm-pflags .dsm-pf-pku, .dsm-sr .dsm-pflags .dsm-pf-vpku { background: #e9f0fb; color: #2b5a9c; }
.dsm-sr .dsm-pflags .dsm-pf-bio { background: #f2f5e1; color: #56650f; }
.dsm-old-price { font-size: 13px; color: #8a918b; }
.dsm-old-price span { color: #d93621; font-weight: 700; margin-left: 4px; }
.dsm-sr .p-tools .btn-primary { white-space: nowrap; }

/* načíst další */
.dsm-sr__more { text-align: center; margin: 20px 0 10px; }
.dsm-sr__more[hidden] { display: none; }

/* kategorie z indexu – nadřazená kategorie drobně */
#search-group-categories li small { color: #8a918b; font-size: 12px; }

/* nic nenalezeno */
.dsm-sr__empty { padding: 22px 24px; border: 1px solid var(--dsm-line); border-radius: 12px; background: #fff; }
.dsm-sr__empty h4 { margin: 0 0 8px; }
.dsm-sr__empty p { margin: 10px 0; color: var(--dsm-muted); }
.dsm-sr__empty a strong { color: var(--dsm-green); }
.dsm-sr__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dsm-sr__chip {
  display: inline-block; padding: 6px 13px; border: 1px solid var(--dsm-line); border-radius: 999px;
  background: #f6f8f6; color: #2b2b2b; font-size: 14px; text-decoration: none;
}
.dsm-sr__chip:hover { border-color: var(--dsm-green); background: var(--dsm-green-soft); color: var(--dsm-green-dark); }

@media (max-width: 767px) {
  .dsm-sr__filters { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 10px; }
  .dsm-sr__filters > * { flex: 0 0 auto; }
}

/* ---------- Kategorie / Značky / Články nad produkty ---------- */
.type-search .search-results-groups {
  --g-green: #138a2c; --g-green-dark: #0e6b22; --g-green-soft: #eef7ef; --g-line: #dfe7e0; --g-muted: #5f6660;
  margin: 14px 0 26px; padding: 0; background: #fff;
  border: 1px solid var(--g-line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 60, 20, .04);
}
.type-search .search-results-group {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: start; gap: 8px 18px;
  margin: 0; padding: 14px 18px; float: none; width: auto;
}
.type-search .search-results-group + .search-results-group { border-top: 1px solid var(--g-line); }
.type-search .search-results-group h4 {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 0; padding: 0;
  font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--g-muted);
}
.type-search .search-results-group h4::before {
  content: ''; flex: 0 0 28px; height: 28px; border-radius: 8px;
  background: var(--g-green-soft) var(--g-ico) center / 16px no-repeat;
}
#search-group-categories { --g-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23138a2c' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
#search-group-manufacturers { --g-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23138a2c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5'/%3E%3C/svg%3E"); }
#search-group-articles { --g-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23138a2c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E"); }

/* šablona dělí seznam do 3 sloupců – zrušíme */
.type-search .search-results-group-list,
.type-search .search-results-group-list ul { columns: auto !important; column-count: auto !important; width: auto !important; }
.type-search .search-results-group-list { margin: 0; padding: 0; }
.type-search .search-results-group-list ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.type-search .search-results-group-list li { display: block; width: auto !important; max-width: 100%; flex: 0 0 auto; float: none; margin: 0; padding: 0; list-style: none; background: none; }
.type-search .search-results-group-list li::before, .type-search .search-results-group-list li::marker { content: none; display: none; }
.type-search .search-results-group-list li.no-display { display: none; }

/* pilulky */
.type-search .search-results-group-list a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border: 1px solid var(--g-line); border-radius: 999px; background: #fff;
  color: #2b2b2b; font-size: 14px; line-height: 1.3; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.type-search .search-results-group-list a:hover { border-color: var(--g-green); background: var(--g-green-soft); color: var(--g-green-dark); text-decoration: none; }
.type-search .search-results-group-list a small { color: var(--g-muted); font-size: 12px; }
/* kategorie – zelené */
#search-group-categories .search-results-group-list a { background: var(--g-green-soft); border-color: transparent; color: var(--g-green-dark); font-weight: 600; }
#search-group-categories .search-results-group-list a::after { content: '›'; font-weight: 700; opacity: .7; }
#search-group-categories .search-results-group-list a:hover { background: var(--g-green); color: #fff; }
#search-group-categories .search-results-group-list a:hover small { color: rgba(255, 255, 255, .85); }
/* značky – tučně */
#search-group-manufacturers .search-results-group-list a { font-weight: 700; }
/* články – odkazy s ikonou, bez pilulky */
#search-group-articles .search-results-group-list ul { gap: 6px 22px; }
#search-group-articles .search-results-group-list a {
  white-space: normal; padding: 4px 0 4px 24px; border: 0; border-radius: 0; background: transparent var(--g-ico) left center / 16px no-repeat;
  color: var(--g-green-dark); font-weight: 600;
}
#search-group-articles .search-results-group-list a:hover { background-color: transparent; text-decoration: underline; }

/* Zobrazit vše (n) */
.type-search .search-results-group a.display-results-group {
  grid-column: 2; justify-self: start; display: inline-block; margin: 2px 0 0; padding: 0;
  border: 0; background: none; color: var(--g-green-dark); font-size: 13px; font-weight: 700; text-decoration: none;
}
.type-search .search-results-group a.display-results-group::after { content: ' ▾'; }
.type-search .search-results-group a.display-results-group:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .type-search .search-results-group { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; gap: 8px; }
  .type-search .search-results-group a.display-results-group { grid-column: 1; }
  .type-search .search-results-group-list ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .type-search .search-results-group-list li { flex: 0 0 auto; }
  /* na mobilu ukážeme všechny položky v posuvném řádku – „Zobrazit vše“ není potřeba */
  .type-search .search-results-group-list li.no-display { display: block !important; }
  .type-search .search-results-group a.display-results-group { display: none !important; }
  #search-group-articles .search-results-group-list ul { flex-wrap: wrap; overflow: visible; }
}
