/* effectSearch — публичная страница результатов поиска /s/<site_id>.
   Оформление наследует фирменный цвет сайта из /api/widget/config (--s-accent). */

:root {
  --s-accent: #B9001D;
  --s-accent-dark: #8f0016;
  --s-bg: #f6f7f9;
  --s-surface: #ffffff;
  --s-line: #e6e8ec;
  --s-text: #111827;
  --s-muted: #6b7280;
  --s-green: #16a34a;
  --s-radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--s-bg);
  color: var(--s-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.s-ico { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; }
.s-ico svg { width: 100%; height: 100%; display: block; }

/* ---------- Шапка ---------- */
.s-head { background: var(--s-surface); border-bottom: 1px solid var(--s-line); }
.s-head-in {
  max-width: 1440px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.s-logo { font-size: 19px; font-weight: 800; letter-spacing: -.2px; text-decoration: none; color: var(--s-text); }
.s-bar {
  flex: 1; min-width: 260px; max-width: 720px;
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 6px 0 14px;
  background: var(--s-surface); border: 2px solid var(--s-line); border-radius: 12px;
}
.s-bar:focus-within { border-color: var(--s-accent); }
.s-bar .s-ico { color: var(--s-muted); }
.s-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
/* у type="search" браузер рисует собственную × — без подавления в поле два крестика */
.s-bar input::-webkit-search-cancel-button,
.s-bar input::-webkit-search-decoration,
.s-bar input::-webkit-search-results-button { -webkit-appearance: none; appearance: none; }
.s-clear { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--s-muted); cursor: pointer; padding: 0 6px; }
.s-clear:hover { color: var(--s-text); }
.s-go {
  height: 34px; padding: 0 18px; border: 0; border-radius: 9px;
  background: var(--s-accent); color: #fff; font-weight: 700; cursor: pointer;
}
.s-go:hover { background: var(--s-accent-dark); }
.s-back { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--s-accent); text-decoration: none; }
.s-back:hover { text-decoration: underline; }

/* ---------- Каркас ---------- */
.s-main { max-width: 1440px; margin: 0 auto; padding: 18px 24px 40px; }
.s-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--s-muted); margin-bottom: 18px; }
.s-crumbs a { color: var(--s-muted); text-decoration: none; }
.s-crumbs a:hover { color: var(--s-accent); }
.s-crumbs b { color: var(--s-text); font-weight: 600; }

.s-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
/* wide: фильтры и подсказки — крайние колонки, товары между ними; обёртка не участвует в раскладке */
.s-col { display: contents; }
.s-rail { grid-column: 1; grid-row: 1; }
.s-content { grid-column: 2; grid-row: 1; min-width: 0; }
.s-side { grid-column: 3; grid-row: 1; }

/* ---------- Фильтры ---------- */
.s-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 18px; }
.s-fblock { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--s-radius); padding: 14px 16px 16px; }
.s-fhead { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.s-fhead h4 { margin: 0; font-size: 15px; font-weight: 700; }
.s-fhead .s-ico { color: var(--s-muted); transform: rotate(90deg); transition: transform .18s ease; }
.s-fblock.closed .s-fhead .s-ico { transform: rotate(-90deg); }
.s-fblock.closed .s-flist, .s-fblock.closed .s-fbody { display: none; }
.s-flist, .s-fbody { margin-top: 12px; }
.s-facet { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: pointer; }
.s-facet input { width: 16px; height: 16px; margin: 0; accent-color: var(--s-accent); cursor: pointer; flex-shrink: 0; }
.s-facet .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-facet .c { color: var(--s-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.s-facet:hover .n { color: var(--s-accent); }
.s-facet.on .n { font-weight: 700; }
.s-fempty { color: var(--s-muted); font-size: 13px; padding: 4px 0; }
.s-fmore {
  width: 100%; text-align: left; margin-top: 6px; padding: 4px 0 0 25px;
  border: 0; background: none; color: var(--s-accent); font-size: 13px; font-weight: 600; cursor: pointer;
}
.s-fmore:hover { text-decoration: underline; }
.s-price-row { display: flex; gap: 8px; }
.s-price-row input {
  flex: 1; min-width: 0; width: 100%; padding: 8px 10px;
  border: 1px solid var(--s-line); border-radius: 9px; background: var(--s-surface); outline: none;
}
.s-price-row input:focus { border-color: var(--s-accent); }
.s-fblock input[type="range"] { width: 100%; margin-top: 12px; accent-color: var(--s-accent); }

/* ---------- Результаты ---------- */
.s-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.s-title-row h1 { margin: 0; font-size: 30px; letter-spacing: -.5px; }
.s-found { color: var(--s-muted); font-size: 14px; margin-top: 4px; }
.s-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.s-sort { display: flex; align-items: center; gap: 8px; color: var(--s-muted); font-size: 13px; }
.s-sort select {
  padding: 8px 10px; border: 1px solid var(--s-line); border-radius: 9px;
  background: var(--s-surface); outline: none; cursor: pointer;
}
.s-view { display: flex; gap: 4px; }
.s-view button {
  width: 38px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--s-line); background: var(--s-surface); border-radius: 9px; cursor: pointer; color: var(--s-muted);
}
.s-view button svg { width: 17px; height: 17px; }
.s-view button.on { background: var(--s-accent); border-color: var(--s-accent); color: #fff; }

.s-active { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.s-active:empty { display: none; }
.s-chip-x {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--s-line); border-radius: 999px;
  background: var(--s-surface); font-size: 13px; cursor: pointer;
}
.s-chip-x:hover { border-color: var(--s-accent); color: var(--s-accent); }
.s-chip-x b { font-size: 14px; line-height: 1; }

.s-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.s-grid.list { grid-template-columns: minmax(0, 1fr); }
.s-card-item {
  display: flex; flex-direction: column;
  background: var(--s-surface); border: 1px solid var(--s-line);
  border-radius: var(--s-radius); overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.s-card-item:hover { box-shadow: 0 10px 26px rgba(17, 24, 39, .09); transform: translateY(-2px); }
.s-grid.list .s-card-item { flex-direction: row; }
.s-img {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; color: #cbd5e1;
}
.s-img svg { width: 42px; height: 42px; }
.s-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.s-grid.list .s-img { width: 180px; aspect-ratio: auto; height: 130px; flex-shrink: 0; }
.s-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; min-width: 0; container-type: inline-size; }
.s-brand { font-size: 12px; color: var(--s-muted); }
.s-name { margin: 3px 0 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.s-cat { font-size: 12px; color: var(--s-muted); margin-top: 4px; }
.s-desc {
  font-size: 12.5px; color: var(--s-muted); line-height: 1.45; margin-top: 6px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* цена и кнопка не влезают в одну строку на узких карточках (3 колонки при 1440 = 248px):
   без переноса кнопка упиралась за правую границу карточки и обрезалась overflow:hidden */
.s-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }
.s-price { font-size: 17px; font-weight: 800; white-space: nowrap; }
.s-open {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  max-width: 100%;
  padding: 9px 14px; border-radius: 9px; background: var(--s-accent); color: #fff;
  font-size: 13px; font-weight: 700; text-decoration: none;
}
.s-open:hover { background: var(--s-accent-dark); }
.s-open .s-ico { width: 15px; height: 15px; }
@container (max-width: 280px) {
  /* в трёх колонках при 1440 ширина карточки 248: строка «цена + Перейти в товар»
     требует ~270, поэтому на узких карточках кнопка становится отдельной строкой */
  .s-bottom { flex-direction: column; align-items: stretch; }
  .s-open { justify-content: center; }
}
.s-stock { font-size: 12px; color: var(--s-muted); margin-top: 8px; }
.s-stock.out { color: #b45309; }

.s-load { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--s-muted); }
.s-empty { grid-column: 1 / -1; padding: 40px 16px; text-align: center; color: var(--s-muted); background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--s-radius); }
.s-empty.err { color: var(--s-accent); }
.s-more-wrap { display: flex; justify-content: center; margin-top: 22px; }
.s-more {
  padding: 11px 26px; border: 1px solid var(--s-line); border-radius: 10px;
  background: var(--s-surface); font-weight: 700; cursor: pointer;
}
.s-more:hover { border-color: var(--s-accent); color: var(--s-accent); }
.s-more:disabled { opacity: .55; cursor: default; }

/* ---------- Правая колонка ---------- */
.s-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 18px; }
.s-side .s-card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--s-radius); padding: 16px; }
.s-side h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16px; font-weight: 700; }
.s-side h3 .s-ico { color: var(--s-accent); }
.s-allcats {
  margin-left: auto; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--s-accent); font-size: 12.5px; font-weight: 600;
}
.s-allcats:hover { text-decoration: underline; }
.s-note { margin: 6px 0 12px; font-size: 12.5px; color: var(--s-muted); }
.s-hint {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; margin-bottom: 8px;
  border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-surface);
  font-size: 13px; text-align: left; cursor: pointer;
}
.s-hint span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-hint .s-ico { color: var(--s-muted); }
.s-hint:hover { border-color: var(--s-accent); color: var(--s-accent); }
.s-hint:hover .s-ico { color: var(--s-accent); }

.s-cat-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 4px; border: 0; background: none; cursor: pointer; text-align: left;
}
.s-cat-row:hover .n { color: var(--s-accent); }
.s-thumb {
  width: 44px; height: 44px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: #f3f4f6; display: flex; align-items: center; justify-content: center; color: #cbd5e1;
}
.s-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-cat-text { flex: 1; min-width: 0; }
.s-cat-text .n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-cat-text .c { font-size: 12px; color: var(--s-muted); }
.s-cat-row > .s-ico { color: var(--s-muted); }

/* ---------- Подвал ---------- */
.s-foot {
  max-width: 1440px; margin: 0 auto; padding: 22px 24px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--s-muted);
}
.s-foot b { color: var(--s-accent); }
.s-foot a { color: var(--s-muted); text-decoration: none; }
.s-foot a:hover { color: var(--s-accent); }

@media (max-width: 1300px) {
  /* третья колонка не вмещается: обёртка становится обычной flex-колонкой, и фильтры
     с подсказками стоят столбцом слева, а товары — справа, а не блоком под выдачей */
  .s-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .s-col { display: flex; flex-direction: column; gap: 18px; grid-column: 1; grid-row: 1; }
  .s-rail, .s-side { grid-column: auto; grid-row: auto; position: static; }
  .s-content { grid-column: 2; grid-row: 1; }
  .s-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .s-main, .s-head-in { padding-left: 14px; padding-right: 14px; }
  .s-layout { grid-template-columns: minmax(0, 1fr); }
  /* на телефоне обёртку распадаем: фильтры, затем товары, подсказки в конце — иначе
     выдача уезжала за два блока вверх экрана */
  .s-col { display: contents; }
  .s-rail { grid-column: 1; grid-row: 1; }
  .s-content { grid-column: 1; grid-row: 2; }
  .s-side { grid-column: 1; grid-row: 3; position: static; flex-direction: column; }
  .s-grid { grid-template-columns: minmax(0, 1fr); }
  .s-title-row h1 { font-size: 24px; }
  .s-grid.list .s-card-item { flex-direction: column; }
  .s-grid.list .s-img { width: 100%; height: 200px; }
}

/* ---------- Обратная связь ---------- */
.s-fb {
  border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-muted);
  border-radius: 9px; padding: 8px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.s-fb:hover { color: var(--s-accent); border-color: var(--s-accent); }
.s-back[hidden] + .s-fb { margin-left: auto; }

.s-fb-sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(17, 24, 39, .5);
}
.s-fb-sheet[hidden] { display: none; }
.s-fb-card {
  width: 420px; max-width: 100%; max-height: 90vh; overflow: auto; background: var(--s-surface);
  border: 1px solid var(--s-line); border-radius: var(--s-radius); padding: 0 22px 22px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, .22);
}
.s-fb-head {
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0;
  background: var(--s-surface); padding: 18px 0 10px;
}
.s-fb-head b { font-size: 16px; }
.s-fb-x {
  margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--s-bg);
  color: var(--s-muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.s-fb-x:hover { color: var(--s-text); }
.s-fb-sub { margin: 0 0 14px; color: var(--s-muted); font-size: 13px; line-height: 1.5; }
.s-fb-card form { display: flex; flex-direction: column; gap: 9px; }
.s-fb-f {
  padding: 10px 12px; border: 1px solid var(--s-line); border-radius: 9px; background: var(--s-surface);
  color: var(--s-text); font: inherit; font-size: 14px; outline: none; width: 100%;
}
.s-fb-f:focus { border-color: var(--s-accent); }
.s-fb-ta { resize: vertical; min-height: 68px; line-height: 1.45; }
.s-fb-err:empty { display: none; }
.s-fb-err { color: #e11d48; font-size: 12.5px; font-weight: 600; }
.s-fb-go {
  padding: 11px; border: 0; border-radius: 9px; background: var(--s-accent); color: #fff;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.s-fb-go:hover { background: var(--s-accent-dark); }
.s-fb-go:disabled { opacity: .6; cursor: default; }
.s-fb-go.ok { background: var(--s-green); }
