/* public/styles/search.css — поиск по сайту (docs/krepezh-ux.md, пункт 2; мокап docs/reference/poisk-mockup.html).
   Подключён в views/layout.pug на всех страницах. Без Bootstrap: .hs-* — поле и подсказки (шапка, окно каталога на телефоне),
   .ps-* — страница результатов /poisk (views/poisk.pug). Разметку строк рисует сервер — services/search/view.js. */

/* ---------- поле в шапке (компьютер) ---------- */
.search-form-wrapper .hs-input { color: #333e48; font-size: 14px; }
.search-form-wrapper .hs-input::placeholder { color: #8a949c; opacity: 1; }
.search-form-wrapper .hs-go {
  position: absolute; right: 0; top: 0; width: 100px; height: 47px; border: 0; padding: 0; cursor: pointer;
  color: #333e48; background: #febf00; font-size: 18px; line-height: 47px; border-radius: 0 25px 25px 0;
  transition: background .2s ease-out, color .2s ease-out;
}
.search-form-wrapper .hs-go:hover, .search-form-wrapper .hs-go:focus-visible { color: #fff; background: #92938e; }
.search-form-wrapper .hs-go:focus-visible, .hs-pop a:focus-visible, .hs-zapros:focus-visible, .ps a:focus-visible, .ps button:focus-visible { outline: 2px solid #2d719d; outline-offset: 2px; }
@media (min-width: 768px) and (max-width: 991px) {
  .search-form-wrapper .hs-go { width: 56px; }
  .ssw-nocat .search-form-wrapper .hs-input { padding-right: 64px; }
}

/* ---------- список подсказок ---------- */
.search_section_wrapper .hs-pop {
  position: absolute; top: 53px; left: 0; width: 600px; max-width: calc(100vw - 16px); z-index: 1200;
  max-height: calc(100vh - 150px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 10px; box-shadow: 0 12px 34px rgba(31, 42, 51, .24);
}
/* ссылки списка — без правил темы для ссылок шапки */
.hs-pop a { position: static; width: auto; height: auto; line-height: inherit; background: none; border-radius: 0; font-size: inherit; text-align: left; }
.hs-pop { color: #333e48; font: 14px/1.4 'Rubik', Arial, sans-serif; text-align: left; -webkit-font-smoothing: antialiased; }
.hs-pop[hidden] { display: none !important; }
.hs-q { padding: 9px 16px; font-size: 13px; color: #5b6670; background: #f7f9fa; border-bottom: 1px solid #e3e8ec; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hs-q b { color: #333e48; font-weight: 500; }
.hs-q__m { color: #8a949c; }
.hs-chip { background: #eef2f6; color: #333e48; border-radius: 12px; padding: 1px 9px; font-size: 12px; }
.hs-chip.is-off { text-decoration: line-through; color: #8a949c; }
.hs-relax { padding: 8px 16px; font-size: 13px; color: #6d5200; background: #fff8e1; border-bottom: 1px solid #f3e2b0; }
.hs-grp { padding: 9px 16px 3px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #5b6670; }
.hs-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 16px; color: #333e48 !important; text-decoration: none !important; }
.hs-row:hover, .hs-row.is-sel { background: #fff8de; }
.hs-th { width: 42px; height: 42px; border-radius: 6px; background: #f1f4f6; overflow: hidden; display: block; }
.hs-th img { width: 42px; height: 42px; object-fit: cover; display: block; }
.hs-tt { min-width: 0; display: block; }
.hs-t1 { display: block; font-size: 14px; line-height: 1.3; }
.hs-t1 b, .ps-t1 b { font-weight: 600; background: #fff3c4; border-radius: 3px; padding: 0 2px; }
.hs-t2 { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: #5b6670; }
.s-ok { color: #2e7d32; }
.s-wait { color: #9a6b00; }
.hs-pr { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hs-pr b { display: block; font-size: 15px; font-weight: 600; }
.hs-pr b.s-req { font-size: 12px; font-weight: 500; color: #5b6670; }
.hs-pr small { display: block; font-size: 11px; color: #5b6670; }
.hs-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; margin-top: 4px; border-top: 1px solid #e3e8ec; font-size: 13px; }
.hs-all { font-weight: 500; color: #2d719d !important; text-decoration: none !important; padding: 2px 0; }
.hs-all.is-sel, .hs-all:hover { text-decoration: underline !important; }
.hs-keys { color: #8a949c; font-size: 12px; }
.hs-keys kbd { font: 11px/1 'Rubik', Arial, sans-serif; color: #5b6670; background: #fff; border: 1px solid #d9dfe5; border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; box-shadow: none; }
.hs-empty { padding: 14px 16px 16px; display: grid; gap: 8px; justify-items: start; }
.hs-empty b { font-size: 15px; font-weight: 600; }
.hs-empty p { margin: 0; font-size: 13px; color: #5b6670; }
.hs-zapros, .ps-zapros { border: 0; border-radius: 22px; background: #febf00; color: #333e48; font: 500 14px/20px 'Rubik', Arial, sans-serif; padding: 9px 20px; cursor: pointer; }
.hs-zapros:hover, .ps-zapros:hover { background: #f0b400; }

/* ---------- телефон: подсказки вместо каталога (окно .mnav-catalog) ---------- */
@media (max-width: 767px) {
  .mnav-results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 90px; background: #fff; }
  .mnav-results .hs-grp { padding: 12px 14px 4px; }
  .mnav-results .hs-q { padding: 8px 14px; }
  .mnav-results .hs-relax { padding: 8px 14px; }
  .mnav-results .hs-row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding: 8px 14px; min-height: 60px; border-bottom: 1px solid #f0f3f5; }
  .mnav-results .hs-th, .mnav-results .hs-th img { width: 46px; height: 46px; }
  .mnav-results .hs-row:hover { background: none; }
  .mnav-results .hs-foot { position: sticky; bottom: 0; background: #fff; padding: 10px 14px 14px; border-top: 1px solid #e3e8ec; }
  .mnav-results .hs-all { display: block; flex: 1; text-align: center; background: #febf00; color: #333e48 !important; border-radius: 22px; padding: 11px 16px; }
  .mnav-results .hs-empty { padding: 16px 14px; }
}

/* ---------- страница /poisk ---------- */
.ps { display: grid; gap: 16px; padding: 6px 0 40px; color: #333e48; font-family: 'Rubik', Arial, sans-serif; }
.ps-h1 { font-family: 'Unbounded', 'Rubik', Arial, sans-serif; font-weight: 600; font-size: 28px; line-height: 1.2; margin: 0 !important; }
.ps-form { display: flex; max-width: 720px; height: 48px; border: 2px solid #333e48; border-radius: 24px; overflow: hidden; background: #fff; }
.ps-input { flex: 1; min-width: 0; border: 0; outline: none; padding: 0 18px; font: 16px 'Rubik', Arial, sans-serif; color: #333e48; background: transparent; }
.ps-input::placeholder { color: #8a949c; }
.ps-go { border: 0; padding: 0 26px; background: #febf00; color: #333e48; font: 500 15px 'Rubik', Arial, sans-serif; cursor: pointer; }
.ps-go:hover { background: #f0b400; }
.ps-note, .ps-fix, .ps-sum { margin: 0; font-size: 14px; color: #5b6670; max-width: 900px; }
.ps-fix b, .ps-sum b { color: #333e48; font-weight: 500; }
.ps-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: #5b6670; }
.ps-chip { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid #d9dfe5; color: #333e48 !important; text-decoration: none !important; border-radius: 14px; padding: 3px 6px 3px 11px; font-size: 13px; }
.ps-chip:hover { border-color: #333e48; }
.ps-chip__x { width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; background: #eef2f6; color: #5b6670; font-size: 10px; }
.ps-chip.is-off { text-decoration: line-through !important; color: #8a949c !important; padding-right: 11px; }
.ps-sec { background: #fff; border: 1px solid #e3e8ec; border-radius: 10px; overflow: hidden; }
.ps-sec__h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 11px 16px; border-bottom: 1px solid #e3e8ec; }
.ps-sec__n { margin: 0 !important; font: 600 16px/1.3 'Rubik', Arial, sans-serif; color: #333e48; }
.ps-sec__a { font-size: 13px; color: #2d719d; }
.ps-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 160px 120px 92px; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid #f0f3f5; color: #333e48 !important; text-decoration: none !important; }
.ps-list > .ps-row:first-child, .ps-list > .ps-more-row:first-child .ps-row { border-top: 0; }
a.ps-row:hover { background: #fffaf0; }
.ps-th { width: 56px; height: 56px; border-radius: 6px; background: #f1f4f6; overflow: hidden; display: block; }
.ps-th img { width: 56px; height: 56px; object-fit: cover; display: block; }
.ps-tt { min-width: 0; display: block; }
.ps-t1 { display: block; font-size: 15px; line-height: 1.35; }
.ps-t2 { display: block; margin-top: 2px; font-size: 12px; color: #5b6670; }
.ps-st { font-size: 13px; line-height: 1.3; }
.ps-pr { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-pr b { display: block; font-size: 16px; font-weight: 600; }
.ps-pr b.s-req { font-size: 13px; font-weight: 500; color: #5b6670; }
.ps-pr small { display: block; font-size: 12px; color: #5b6670; }
.ps-open { justify-self: end; border: 1px solid #d9dfe5; border-radius: 18px; padding: 5px 13px; font-size: 13px; white-space: nowrap; }
a.ps-row:hover .ps-open { border-color: #333e48; }
.ps-row--nolen { grid-template-columns: 56px minmax(0, 1fr); align-items: start; }
.ps-row--nolen .ps-t1 b { background: none; padding: 0; }
.ps-near { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 6px; }
.ps-near__a { display: grid; gap: 1px; border: 1px solid #d9dfe5; border-radius: 8px; padding: 7px 12px; color: #333e48 !important; text-decoration: none !important; font-size: 13px; }
.ps-near__a:hover { border-color: #333e48; }
.ps-near__a b { font-weight: 600; }
.ps-near__a small { color: #5b6670; font-size: 12px; }
.ps-alllen { font-size: 13px; color: #2d719d; }
.ps-more { display: block; width: 100%; border: 0; border-top: 1px solid #f0f3f5; background: #f7f9fa; color: #2d719d; font: 500 14px 'Rubik', Arial, sans-serif; padding: 10px; cursor: pointer; }
.ps-more:hover { background: #eef2f6; }
.ps-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; background: #fffaf0; border: 1px solid #f3e2b0; border-radius: 10px; padding: 14px 16px; }
.ps-ask p { margin: 0; font-size: 14px; }
.ps-ask b { font-weight: 600; }
.ps-empty { background: #fff; border: 1px solid #e3e8ec; border-radius: 10px; padding: 20px; display: grid; gap: 12px; justify-items: start; }
.ps-empty p { margin: 0; font-size: 14px; max-width: 760px; }
.ps-empty__h { margin: 0 !important; font: 600 18px/1.3 'Rubik', Arial, sans-serif; color: #333e48; }
.ps-empty__row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ps-muted { color: #5b6670; font-size: 13px; }
.ps-tries { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-tries a { background: #eef2f6; border-radius: 14px; padding: 4px 11px; color: #333e48; font-size: 13px; text-decoration: none; }
.ps-tries a:hover { background: #e2e7ec; }
.ps-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ps-tile { background: #fff; border: 1px solid #e3e8ec; border-radius: 8px; padding: 11px 13px; display: grid; gap: 2px; color: #333e48 !important; text-decoration: none !important; font-size: 13px; }
.ps-tile:hover { border-color: #333e48; }
.ps-tile b { font-size: 14px; font-weight: 600; }
.ps-tile span { color: #5b6670; }

@media (max-width: 991px) {
  .ps-row { grid-template-columns: 56px minmax(0, 1fr) 130px 110px; }
  .ps-open { display: none; }
  .ps-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ps-h1 { font-size: 22px; }
  .ps-form { height: 44px; }
  .ps-input { font-size: 16px; padding: 0 14px; }
  .ps-go { padding: 0 16px; }
  .ps-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "i t p" "i s s"; row-gap: 3px; column-gap: 10px; padding: 10px 12px; }
  .ps-row .ps-th { grid-area: i; width: 52px; height: 52px; }
  .ps-row .ps-th img { width: 52px; height: 52px; }
  .ps-row .ps-tt { grid-area: t; }
  .ps-row .ps-st { grid-area: s; font-size: 12px; }
  .ps-row .ps-pr { grid-area: p; }
  .ps-row .ps-t1 { font-size: 14px; }
  .ps-row--nolen { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: none; }
  .ps-row--nolen .ps-th, .ps-row--nolen .ps-tt { grid-area: auto; }
  .ps-sec__h { padding: 10px 12px; }
  .ps-ask { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .search-form-wrapper .hs-go { transition: none; } }
