/* Окно умного поиска (assets/js/search.js) по макету Figma «Поиск»: десктоп — сцены 145:*, 146:*; телефон — 147:*. */

.ptvs { --bg: #204547; --ink: #1e1e1e; --muted: #6e655b; --line: #e7e3dc; --soft: #f6f5f2; --sel: #e9f1ef; --link: #2e7d5f;
  position: fixed; inset: 0; z-index: 2000; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 1.4; color: var(--ink); }
.ptvs[hidden] { display: none; }
.ptvs *, .ptvs *::before, .ptvs *::after { box-sizing: border-box; }
.ptvs a { color: inherit; text-decoration: none; }
.ptvs p { margin: 0; }
.ptvs-dim { position: fixed; left: 0; right: 0; bottom: 0; top: var(--ptvs-dim-top, 0); background: rgba(8, 20, 19, .55); }
html.ptvs-open .js-search-wrap .t1261__search-input { border-color: #2e7d5f !important; box-shadow: 0 0 0 3px rgba(37, 211, 102, .35); }

.ptvs-panel {
  position: fixed; display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28); max-height: calc(100vh - 140px);
}
.ptvs-bar { display: none; }
.ptvs-top { display: flex; flex-direction: column; border-bottom: 1px solid #eeebe5; }
.ptvs-top[hidden] { display: none; }
.ptvs-row { display: flex; align-items: center; gap: 8px; padding: 10px 16px; flex-wrap: wrap; }
.ptvs-row + .ptvs-row { border-top: 1px solid #eeebe5; }
.ptvs-row--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ptvs-row--scroll::-webkit-scrollbar { display: none; }
.ptvs-note { padding: 11px 16px; background: #f3f7f6; font-size: 14px; color: #3a3631; }
.ptvs-note b { color: var(--bg); }
.ptvs-note--cross { background: #f2eed6; color: #462e21; font-weight: 600; }
.ptvs-muted { color: var(--muted); font-size: 13px; white-space: nowrap; }

.ptvs-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border: 1px solid #d9d4cb; border-radius: 999px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; }
.ptvs-chip small { font-weight: 400; color: #8a8178; }
.ptvs-chip:hover { border-color: var(--bg); }
.ptvs-chip--on { background: var(--bg); border-color: var(--bg); color: #fff; cursor: default; }

.ptvs-body { display: flex; min-height: 0; flex: 1 1 auto; }
.ptvs-list { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 10px 8px 12px; overscroll-behavior: contain; }
.ptvs-side { flex: 0 0 340px; overflow-y: auto; background: #fbfaf7; border-left: 1px solid #eeebe5; padding: 16px; overscroll-behavior: contain; }
.ptvs.is-loading .ptvs-list { opacity: .65; transition: opacity .15s .1s; }

.ptvs-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #8a8178; }
.ptvs-opt { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.ptvs-opt.is-sel { background: var(--sel); }
.ptvs-txt { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.ptvs-t { font-size: 15px; line-height: 1.35; }
.ptvs-t b, .ptvs-s b, .ptvs-pv__dl b { font-weight: 700; color: #0f3a3c; }
.ptvs-s { font-size: 12.5px; color: var(--muted); }
.ptvs-n { font-size: 13px; color: #8a8178; }
.ptvs-enter { visibility: hidden; }
.ptvs-opt.is-sel .ptvs-enter { visibility: visible; }
.ptvs kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid #d9d4cb; border-radius: 4px; background: #fff; font: 600 11px/1.4 'Open Sans', Arial, sans-serif; color: var(--muted); text-align: center; }
.ptvs-th { flex: 0 0 var(--s); width: var(--s); height: var(--s); border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ptvs-th img { width: 100%; height: 100%; object-fit: cover; }
.ptvs-th--icon { background: #f2f0eb; }
.ptvs-th--icon img { width: 70%; height: 70%; object-fit: contain; mix-blend-mode: multiply; opacity: .75; }

/* пустое поле */
.ptvs-recent { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.ptvs-recent > span:first-child { color: #8a8178; }
.ptvs-recent > span:nth-child(2) { flex: 1 1 auto; }
.ptvs-recent button { border: 0; background: none; color: #b0a89e; cursor: pointer; font-size: 12px; padding: 4px; }
.ptvs-recent:hover, .ptvs-recent.is-sel { background: var(--sel); }
.ptvs-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 10px; }
.ptvs-tip { margin: 6px 10px 0; padding: 12px 14px; border-radius: 8px; background: #f2eed6; color: #5a4a3c; font-size: 13px; line-height: 1.45; }
.ptvs-tip b { display: block; color: #462e21; margin-bottom: 2px; }
.ptvs-secgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-top: 4px; }
.ptvs-sec { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; background: #fff; border: 1px solid #eeebe5; }
.ptvs-sec:hover { border-color: #b9c6c2; }
.ptvs-sec b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.ptvs-sec small { font-size: 11.5px; color: #8a8178; }
.ptvs.is-empty .ptvs-side { flex-basis: 420px; }

/* предпросмотр */
.ptvs-pv { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.ptvs-pv__img { display: flex; align-items: center; justify-content: center; height: 180px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.ptvs-pv__img img { width: 100%; height: 100%; object-fit: contain; }
.ptvs-pv__img img.is-icon { width: 96px; height: 96px; opacity: .55; mix-blend-mode: multiply; }
.ptvs-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ptvs-tag { background: #e6eeed; color: var(--bg); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.ptvs-tag--brand { background: #d6cf8b; color: #462e21; }
.ptvs-pv__t { font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 20px; line-height: 1.25; }
.ptvs-pv__dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ptvs-pv__dl div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.ptvs-pv__dl dt { color: var(--muted); }
.ptvs-pv__dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ptvs-btns { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.ptvs-btn { display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1.5px solid var(--bg); color: var(--bg); background: #fff; }
.ptvs-btn--dark { background: var(--bg); color: #fff !important; }
.ptvs-btn--wa { background: #25d366; border-color: #25d366; color: #0b2416 !important; }

/* ничего не нашлось */
.ptvs-none { padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.ptvs-none__t { font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 22px; }
.ptvs-none p:not(.ptvs-none__t) { color: #4a443e; font-size: 15px; line-height: 1.45; }
.ptvs-bubble { background: #dcf8c6; border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.4; }
.ptvs-bubble small { display: block; font-size: 11px; color: #5a7a52; margin-bottom: 2px; }
.ptvs-none .ptvs-btns { flex-direction: row; margin: 0; }
.ptvs.is-none .ptvs-foot .ptvs-all { display: none; }

.ptvs-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--soft); border-top: 1px solid #eeebe5; }
.ptvs-all { font-weight: 600; color: var(--link) !important; }
.ptvs-all:hover { text-decoration: underline; }
.ptvs-keys { margin-left: auto; font-size: 12px; color: #8a8178; display: flex; align-items: center; gap: 6px; }
.ptvs-keys kbd + kbd { margin-left: 0; }

/* ---------- телефон: на весь экран ---------- */
@media (max-width: 767px) {
  .ptvs-dim { display: none; }
  .ptvs-panel { inset: 0; border-radius: 0; max-height: none; box-shadow: none; }
  .ptvs-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #eeebe5; }
  .ptvs-field { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 2px solid #2e7d5f; border-radius: 999px; box-shadow: 0 0 0 3px rgba(37, 211, 102, .3); color: var(--muted); }
  .ptvs-input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); -webkit-appearance: none; appearance: none; }
  .ptvs-input::-webkit-search-cancel-button { -webkit-appearance: none; }
  .ptvs-cancel { border: 0; background: none; font: inherit; font-weight: 600; font-size: 15px; color: var(--bg); padding: 6px 2px; }
  .ptvs-body { flex-direction: column; overflow-y: auto; }
  .ptvs-list { overflow: visible; padding: 4px 4px 8px; flex: 0 0 auto; }
  .ptvs-side { flex: 0 0 auto; overflow: visible; border-left: 0; border-top: 1px solid #eeebe5; padding: 12px 14px 16px; }
  .ptvs.is-empty .ptvs-side { flex-basis: auto; }
  .ptvs-body:not(:has(.ptvs-secgrid)):not(:has(.ptvs-opt)) .ptvs-side, .ptvs:not(.is-empty):not(.is-none) .ptvs-side { display: none; }
  .ptvs-keys, .ptvs .ptvs-enter { display: none; }
  .ptvs-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); justify-content: center; }
  .ptvs-all { display: flex; align-items: center; justify-content: center; width: 100%; height: 42px; border: 1.5px solid var(--bg); border-radius: 999px; color: var(--bg) !important; }
  .ptvs-all:empty { display: none; }
  .ptvs-foot:not(:has(.ptvs-all[href])) { display: none; }
  .ptvs-none .ptvs-btns .ptvs-btn { flex: 1 1 auto; height: 46px; }
}
