/*
 * Поиск по сайту (CHUNK-126): кнопка-лупа, оверлей и страница /?s=.
 * Подключается через wp_enqueue_style, то есть РАНЬШЕ main.css: при равной специфичности побеждает main.css,
 * поэтому у потомков селекторы из двух классов (.nest-search .nest-search__x). Все имена с префиксом nest-search.
 * Размеры на десктопе — в единицах сайта: при ширине до 1600 px у html zoom .75, до 750 px — zoom 1 (отдельный блок внизу).
 * Цвета: #599e31 — только заливка и рамки (на белом 3,3:1), текст — #303439 / #666e7b / тёмно-зелёный #3f7a1f (5,2:1).
 * Фокус: кольцо с клавиатуры даёт общее правило темы :focus-visible (main.css, CHUNK-089); у поля ввода его заменяет рамка
 * контейнера (:focus-within), на тёмной плашке кольцо кнопки белое.
 */

/* ---------- кнопка-лупа в шапке и мобильном меню ---------- */
.nest-search-open {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 57px;
  height: 57px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: #ecf2e9;
  color: #303439;
  cursor: pointer;
  transition: background-color .2s ease;
}
.nest-search-open:hover { background: #dce8d6; }
.nest-search-open svg { width: 26px; height: 26px; display: block; }

/* ---------- общая основа ---------- */
.nest-search {
  --ns-ink: #303439;
  --ns-muted: #666e7b;
  --ns-line: #e3e7e0;
  --ns-bg: #f6f7f4;
  --ns-card: #fefefe;
  --ns-green: #599e31;
  --ns-green-d: #3f7a1f;
  --ns-leaf: #ecf2e9;
  --ns-sun: #f5d814;
  --ns-sun-l: #fbf295;
  --ns-sph: #2f5d8a;
  --ns-sph-l: #e8eff6;
  font-family: "Manrope", sans-serif;
  color: var(--ns-ink);
  font-size: 18px;
  line-height: 1.5;
}
.nest-search[hidden] { display: none; }
.nest-search button { font-family: inherit; color: inherit; cursor: pointer; }
.nest-search mark { background: var(--ns-sun-l); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- оверлей: слой поверх меню (100000) и ниже окна согласия (100100) ---------- */
.nest-search.nest-search--overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 100050;
  background: var(--ns-bg);
}
.nest-search--overlay .nest-search__panel { display: flex; flex-direction: column; height: 100%; }
.nest-search--overlay .nest-search__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px max(40px, calc((100% - 1180px) / 2));
  background: var(--ns-card);
  border-bottom: 1px solid var(--ns-line);
}
.nest-search--overlay .nest-search__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 57px; height: 57px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: var(--ns-leaf);
}
.nest-search--overlay .nest-search__close:hover { background: #dce8d6; }
.nest-search--overlay .nest-search__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.nest-search .nest-search__inner { max-width: 1260px; margin: 0 auto; padding: 24px 40px 80px; }

/* ---------- строка ввода ---------- */
.nest-search .nest-search__box,
.nest-search-form .nest-search-form__box {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 20px;
  border: 2px solid var(--ns-green, #599e31);
  border-radius: 18px;
  background: #fff;
}
.nest-search .nest-search__box:focus-within,
.nest-search-form .nest-search-form__box:focus-within { border-color: #3f7a1f; box-shadow: 0 0 0 4px rgba(63, 122, 31, .3); }
.nest-search .nest-search__input:focus-visible,
.nest-search-form .nest-search-form__input:focus-visible { outline: 0 !important; }
.nest-search .nest-search__icon,
.nest-search-form .nest-search__icon { flex: none; color: #3f7a1f; }
.nest-search .nest-search__input,
.nest-search-form .nest-search-form__input {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 10px 0;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font: 600 26px/1.3 "Manrope", sans-serif;
  color: #303439;
  -webkit-appearance: none;
  appearance: none;
}
.nest-search .nest-search__input::placeholder,
.nest-search-form .nest-search-form__input::placeholder { color: #6f7680; font-weight: 500; opacity: 1; }
.nest-search .nest-search__input::-webkit-search-cancel-button,
.nest-search-form .nest-search-form__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.nest-search .nest-search__kbd,
.nest-search kbd {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--ns-line);
  border-bottom-width: 2px;
  border-radius: 8px;
  background: var(--ns-bg);
  color: var(--ns-muted);
  font: 600 15px/1.2 "Manrope", sans-serif;
}
.nest-search .nest-search__mic,
.nest-search-form .nest-search__mic {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #ecf2e9;
  color: #3f7a1f;
  cursor: pointer;
}
.nest-search .nest-search__mic[hidden] { display: none; }
.nest-search .nest-search__mic.is-rec,
.nest-search-form .nest-search__mic.is-rec { background: #fde2e2; color: #b42318; animation: nest-search-pulse 1s infinite; }
@keyframes nest-search-pulse { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .nest-search .nest-search__mic.is-rec { animation: none; } }

/* ---------- подсказка при ошибке голосового ввода (текст ставит search.js; role=status стоит в разметке всегда) ----------
   Пустой контейнер ничего не занимает, но остаётся в дереве доступности: display: none не даёт читать вставленный текст. */
.nest-search .nest-search__voice:not(:empty) {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ns-sun-l);
  color: #3d3a14;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
/* в оверлее — полоса под строкой ввода на всю ширину: она вне прокручиваемой области и не уезжает с выдачей */
.nest-search--overlay .nest-search__voice:not(:empty) {
  flex: none;
  padding: 10px max(40px, calc((100% - 1180px) / 2));
  border-radius: 0;
  border-bottom: 1px solid #ecdf6f;
}
/* на странице — под формой, ближе к ней, чем обычный отступ выдачи */
.nest-search--page .nest-search__voice:not(:empty) { margin: -16px 0 20px; font-size: 17px; }

/* ---------- страница /?s= ---------- */
.nest-search-form { display: flex; align-items: stretch; gap: 16px; margin: 0 0 32px; }
.nest-search-form .nest-search-form__submit {
  flex: none;
  padding: 0 40px;
  border: 0;
  border-radius: 18px;
  background: #3f7a1f;
  color: #fff;
  font: 700 22px/1 "Manrope", sans-serif;
  cursor: pointer;
}
.nest-search-form .nest-search-form__submit:hover { background: #356a19; }
.nest-search--page .nest-search__noscript { margin: 0; padding: 20px; border-radius: 16px; background: #ecf2e9; font-size: 20px; }
.nest-search--page .nest-search__noscript a { text-decoration: underline; }
.nest-search.nest-search--page { font-size: 20px; }

/* ---------- раздел «для кого» ---------- */
.nest-search .nest-search__segbar { margin: 0 0 20px; }
.nest-search .nest-search__seg { display: inline-flex; padding: 4px; border: 1px solid var(--ns-line); border-radius: 999px; background: #fff; }
.nest-search .nest-search__seg button {
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  white-space: nowrap;
  color: var(--ns-muted);
  font-size: 16px;
  font-weight: 700;
}
.nest-search .nest-search__seg button[aria-pressed="true"] { background: var(--ns-green-d); color: #fff; }
.nest-search .nest-search__seg button[data-seg="sph"][aria-pressed="true"] { background: var(--ns-sph); }

/* ---------- пустое состояние: примеры ---------- */
.nest-search .nest-search__hint { margin: 16px 0 10px; color: var(--ns-muted); font-size: 16px; }
.nest-search .nest-search__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.nest-search .nest-search__chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--ns-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ns-ink);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
.nest-search .nest-search__chip:hover { border-color: var(--ns-green); }
.nest-search .nest-search__chip small { margin-left: 4px; color: var(--ns-muted); font-size: 14px; font-weight: 500; }
.nest-search .nest-search__chip.is-on { border-color: var(--ns-green-d); background: var(--ns-green-d); color: #fff; }
.nest-search .nest-search__chip.is-on small { color: #e9f5e1; }
.nest-search .nest-search__chip--btn { display: inline-block; }
.nest-search .nest-search__chip--btn span { margin-left: 6px; color: var(--ns-muted); font-weight: 500; }

/* ---------- статус и сообщения ---------- */
.nest-search .nest-search__status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 14px; color: var(--ns-muted); font-size: 16px; }
.nest-search .nest-search__status:empty { display: none; }
.nest-search .nest-search__fix { padding: 3px 12px; border-radius: 8px; background: var(--ns-sun-l); color: #5c5313; font-weight: 600; }
.nest-search .nest-search__loading { font-weight: 600; }
.nest-search .nest-search__alert,
.nest-search .nest-search__note-box {
  width: 100%;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--ns-sun-l);
  color: #3d3a14;
  font-size: 18px;
}
.nest-search .nest-search__alert p { margin: 6px 0 0; }
.nest-search .nest-search__alert a,
.nest-search .nest-search__none a { text-decoration: underline; }
.nest-search .nest-search__none { padding: 28px; border: 1px dashed #c9d1c4; border-radius: 16px; background: #fff; text-align: center; }
.nest-search .nest-search__none p { margin: 8px 0 0; color: var(--ns-muted); }

/* ---------- карточка-ответ ---------- */
.nest-search .nest-search__answer:empty { display: none; }
.nest-search .nest-search__ans {
  position: relative;
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid #d6e6cc;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ns-leaf), #f7fbf4);
}
.nest-search .nest-search__ans--sph { border-color: #cddcea; background: linear-gradient(135deg, var(--ns-sph-l), #f6f9fc); }
.nest-search .nest-search__kicker { color: var(--ns-green-d); font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nest-search .nest-search__ans--sph .nest-search__kicker { color: var(--ns-sph); }
.nest-search .nest-search__ans-title { margin: 4px 0 6px; font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.nest-search .nest-search__tag { margin: 0 0 14px; color: var(--ns-muted); font-size: 18px; }
.nest-search .nest-search__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.nest-search .nest-search__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 14px; }
.nest-search .nest-search__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.nest-search .nest-search__btn--pri { background: var(--ns-green-d); color: #fff; }
.nest-search .nest-search__btn--pri:hover { background: #356a19; color: #fff; }
.nest-search .nest-search__ans--sph .nest-search__btn--pri { background: var(--ns-sph); }
.nest-search .nest-search__ans--sph .nest-search__btn--pri:hover { background: #264c72; }
.nest-search .nest-search__btn--sec { border-color: var(--ns-line); background: #fff; color: var(--ns-ink); }
.nest-search .nest-search__btn--sec:hover { border-color: var(--ns-green); color: var(--ns-ink); }
.nest-search .nest-search__quote {
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid var(--ns-line);
  border-radius: 14px;
  background: #fff;
  font-size: 18px;
  white-space: pre-line;
}
.nest-search .nest-search__num { padding: 0 3px; border-radius: 4px; background: var(--ns-sun-l); }
.nest-search .nest-search__note { margin: 12px 0 0; color: var(--ns-muted); font-size: 15px; }

/* ---------- выдача и фильтры ---------- */
.nest-search .nest-search__layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 36px; align-items: start; }
.nest-search .nest-search__layout[hidden] { display: none; }
.nest-search .nest-search__layout--solo { grid-template-columns: minmax(0, 1fr); }
.nest-search .nest-search__facet-h { margin: 0 0 8px; color: var(--ns-muted); font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nest-search .nest-search__facets > div { margin-bottom: 22px; }
.nest-search .nest-search__facets .nest-search__chip { display: flex; justify-content: space-between; width: 100%; margin-bottom: 7px; border-radius: 12px; }
.nest-search .nest-search__res { padding: 20px 0; border-top: 1px solid var(--ns-line); }
.nest-search .nest-search__res:first-child { padding-top: 0; border-top: 0; }
.nest-search .nest-search__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ns-muted); font-size: 15px; }
.nest-search .nest-search__badge { padding: 2px 10px; border-radius: 7px; background: var(--ns-bg); color: var(--ns-ink); font-size: 14px; font-weight: 700; }
.nest-search .nest-search__badge--product,
.nest-search .nest-search__badge--instruction { background: var(--ns-leaf); color: var(--ns-green-d); }
.nest-search .nest-search__badge--question { background: var(--ns-sun-l); color: #5c5313; }
.nest-search .nest-search__sg { font-weight: 700; }
.nest-search .nest-search__sg--lph { color: var(--ns-green-d); }
.nest-search .nest-search__sg--sph { color: var(--ns-sph); }
.nest-search .nest-search__partial { color: #7a5200; font-size: 14px; }
.nest-search .nest-search__rt { display: block; margin: 6px 0 2px; color: var(--ns-ink); font-size: 24px; font-weight: 700; line-height: 1.3; word-wrap: break-word; }
.nest-search .nest-search__rt:hover { color: var(--ns-green-d); text-decoration: underline; }
.nest-search .nest-search__ru { color: #646b75; font-size: 15px; word-break: break-all; }
.nest-search .nest-search__sn { margin: 8px 0 0; color: #454a50; font-size: 18px; }
.nest-search .nest-search__more { margin-top: 10px; }
.nest-search .nest-search__more summary { color: var(--ns-green-d); font-size: 16px; font-weight: 700; cursor: pointer; }
.nest-search .nest-search__more ul { margin: 10px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--ns-leaf); }
.nest-search .nest-search__more li { margin: 0 0 12px; list-style: none; }
.nest-search .nest-search__more li a { font-weight: 700; }
.nest-search .nest-search__more li a:hover { text-decoration: underline; }
.nest-search .nest-search__more li p { margin: 2px 0 0; color: #545a61; font-size: 16px; }
.nest-search .nest-search__alt { margin-top: 8px; font-size: 16px; }
.nest-search .nest-search__alt a { color: var(--ns-sph); font-weight: 700; text-decoration: underline; }
.nest-search .nest-search__showmore { display: flex; justify-content: center; width: 100%; margin-top: 16px; }
.nest-search .nest-search__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--ns-ink);
  color: #fff;
}
.nest-search .nest-search__cta b { font-size: 20px; }
.nest-search .nest-search__btn--cta { border: 0; background: var(--ns-sun); color: var(--ns-ink); }
.nest-search .nest-search__btn--cta:hover { background: #ffe94d; }
.nest-search .nest-search__cta .nest-search__btn:focus-visible { outline-color: #fff !important; }

/* ---------- якоря заголовков (search.js выдаёт им id s-… и этот класс) ---------- */
.nest-search-anchor { scroll-margin-top: 24px; }

/* ---------- телефон: html zoom 1, размеры настоящие ---------- */
@media (max-width: 750px) {
  .nest-search-open { width: 44px; height: 44px; margin-left: auto; margin-right: 8px; border-radius: 12px; }
  .nest-search-open svg { width: 22px; height: 22px; }
  /* Шапка телефона тесная: .container 305 px, логотип до 260 px, а лупа и бургер по 44 px. Логотип чуть уже, чтобы лупа осталась в строке. */
  .header .header-logo { max-width: 200px; }
  /* В меню текст логотипа и телефон занимают всю ширину строки: лупа встаёт под кнопкой закрытия, текст остаётся в две строки */
  .modal-menu .nest-search-open { position: absolute; top: 46px; right: 0; margin: 0; }
  .nest-search { font-size: 16px; }
  .nest-search.nest-search--page { font-size: 16px; }
  .nest-search--overlay .nest-search__bar { gap: 8px; padding: 12px; }
  .nest-search--overlay .nest-search__close { width: 44px; height: 44px; border-radius: 12px; }
  .nest-search--overlay .nest-search__voice:not(:empty) { padding: 10px 12px; font-size: 15px; }
  .nest-search--page .nest-search__voice:not(:empty) { margin-top: -10px; font-size: 15px; }
  .nest-search .nest-search__inner { padding: 16px 14px 60px; }
  .nest-search .nest-search__box,
  .nest-search-form .nest-search-form__box { gap: 8px; padding: 2px 6px 2px 12px; border-radius: 14px; }
  .nest-search .nest-search__input,
  .nest-search-form .nest-search-form__input { font-size: 17px; padding: 8px 0; }
  .nest-search .nest-search__kbd, .nest-search kbd { display: none; }
  .nest-search .nest-search__mic, .nest-search-form .nest-search__mic { width: 40px; height: 40px; }
  .nest-search-form { flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
  .nest-search-form .nest-search-form__box { flex: 1 1 100%; }
  .nest-search-form .nest-search-form__submit { flex: 1 1 100%; padding: 14px 20px; border-radius: 14px; font-size: 17px; }
  .nest-search .nest-search__seg { display: flex; }
  .nest-search .nest-search__seg button { flex: 1 1 auto; padding: 7px 10px; font-size: 14px; white-space: nowrap; }
  .nest-search .nest-search__ans { padding: 16px; }
  .nest-search .nest-search__ans-title { font-size: 22px; }
  .nest-search .nest-search__tag { font-size: 16px; }
  .nest-search .nest-search__quote { font-size: 16px; }
  .nest-search .nest-search__layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* фильтры на телефоне — горизонтальная лента */
  .nest-search .nest-search__facets { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px; padding: 0 14px 6px; -webkit-overflow-scrolling: touch; }
  .nest-search .nest-search__facets > div { display: flex; flex: none; align-items: center; gap: 6px; margin: 0; }
  .nest-search .nest-search__facet-h { display: none; }
  .nest-search .nest-search__facets .nest-search__chip { display: inline-flex; width: auto; margin: 0; white-space: nowrap; border-radius: 999px; }
  .nest-search .nest-search__chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .nest-search .nest-search__chips .nest-search__chip { flex: none; white-space: nowrap; }
  .nest-search .nest-search__rt { font-size: 19px; }
  .nest-search .nest-search__sn { font-size: 16px; }
  .nest-search .nest-search__cta { padding: 16px; }
}

/* CHUNK-127: «Карта сайта» — третья ссылка в подвале footer-home. На телефоне ссылки этого подвала стоят
   абсолютно (main.css, CHUNK-121: -261px и -301px), без этого правила третья легла бы на вторую.
   Правило здесь, а не в main.css: search.css подключён на всех страницах. */
@media (max-width: 750px) {
  .footer-home .footer__policy + .footer__policy + .footer__policy { bottom: -321px; }
}
