/* =========================================================
   Дела сердечные — Поиск-подсказчик в шапке
   Десктоп: выпадающее окно под строкой
   Мобайл: полноэкранный оверлей
   ========================================================= */

/* шапка-инпут в активном состоянии */
.search-wrap input:focus { box-shadow: 0 8px 28px rgba(48,30,110,0.10); }

/* корень */
.hs-root { position: fixed; inset: 0; z-index: 300; display: none; pointer-events: none; }
.hs-root.is-open { display: block; }

/* десктоп: без затемнения, окно не перекрывает страницу и не ловит клики */
.hs-scrim {
  position: absolute; inset: 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.hs-root.is-open .hs-scrim { opacity: 1; }

/* ── ДЕСКТОП: панель под строкой ── */
.hs-shell {
  position: absolute;
  pointer-events: auto;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 28px 64px rgba(48, 30, 110, 0.22);
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(.99);
  transform-origin: top center;
  transition: opacity .22s ease, transform .26s cubic-bezier(.22,1,.36,1);
}
.hs-root.is-open .hs-shell { opacity: 1; transform: none; }

.hs-bar { display: none; }            /* верхняя панель только в мобайле */
.hs-body {
  max-height: min(70vh, 620px);
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--violet-soft) transparent;
}
.hs-body::-webkit-scrollbar { width: 8px; }
.hs-body::-webkit-scrollbar-thumb { background: var(--violet-soft); border-radius: 4px; }

/* ── Заголовки групп ── */
.hs-glabel {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-light);
  padding: 14px 14px 6px;
}
.hs-glabel .hs-gall {
  font-size: 11px; font-weight: 700; color: var(--violet); cursor: pointer;
  text-transform: none; letter-spacing: 0; opacity: .85;
}
.hs-glabel .hs-gall:hover { opacity: 1; }

/* ── Строка-подсказка ── */
.hs-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--r-md);
  cursor: pointer; transition: background .14s ease;
  text-decoration: none; color: inherit;
}
.hs-item:hover, .hs-item.is-active { background: var(--violet-soft); }
.hs-ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--bg-soft); color: var(--violet); overflow: hidden;
}
.hs-ico.hs-photo { background: linear-gradient(180deg, #F4EFFA 0%, #ECE2F3 100%); align-items: flex-end; }
.hs-ico.hs-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hs-main { flex: 1 1 auto; min-width: 0; }
.hs-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hs-title b { color: var(--violet); }
.hs-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-right { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.hs-price { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.hs-slot {
  font-size: 11px; font-weight: 600; color: var(--green-text);
  background: var(--green-pill); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.hs-kind {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  background: var(--bg-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.hs-go { color: var(--text-light); transition: transform .2s ease, color .2s ease; }
.hs-item:hover .hs-go { color: var(--violet); transform: translate(2px,-2px); }

/* ── Чипы (популярные запросы) ── */
.hs-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 14px 12px; }
.hs-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 999px; background: var(--bg-soft); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}
.hs-chip svg { color: var(--text-light); transition: color .18s ease; }
.hs-chip:hover { background: #fff; border-color: var(--violet); color: var(--violet); transform: translateY(-1px); }
.hs-chip:hover svg { color: var(--violet); }

/* ── Быстрые ссылки (плитки) ── */
.hs-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 14px 14px; }
.hs-qlink {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 13px; border-radius: var(--r-md); background: var(--bg-soft);
  font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}
.hs-qlink svg { color: var(--violet); }
.hs-qlink:hover { background: var(--violet-soft); color: var(--violet); transform: translateY(-2px); }

/* разделитель */
.hs-divider { height: 1px; background: var(--border); margin: 6px 8px; }

/* ── Исправление опечатки ── */
.hs-correct {
  padding: 12px 14px; margin: 4px 6px 2px;
  font-size: 13.5px; color: var(--text-muted);
  background: var(--violet-soft); border-radius: var(--r-md);
}
.hs-correct b { color: var(--violet); cursor: pointer; font-weight: 700; }
.hs-correct b:hover { text-decoration: underline; }

/* ── Симптом-блок ── */
.hs-symptom {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 6px 6px 2px; padding: 12px 14px;
  background: #FFF6EC; border: 1px solid #FBD9A8; border-radius: var(--r-md);
}
.hs-symptom .hs-sym-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  background: #FBE3BF; color: #B9710F; display: grid; place-items: center; }
.hs-symptom .hs-sym-text { font-size: 12.5px; color: #8A5410; line-height: 1.45; }
.hs-symptom .hs-sym-text b { color: #7A480C; }

/* ── Состояние загрузки (скелетон) ── */
.hs-skel-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.hs-skel-ico { width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto; }
.hs-skel-line { height: 11px; border-radius: 6px; }
.hs-skel-1 { width: 55%; margin-bottom: 7px; }
.hs-skel-2 { width: 35%; }
.hs-shimmer { background: linear-gradient(90deg, #EFEFF3 25%, #F7F7F9 37%, #EFEFF3 63%);
  background-size: 400% 100%; animation: hsShimmer 1.2s ease infinite; }
@keyframes hsShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.hs-loading-note { padding: 6px 14px 12px; font-size: 12px; color: var(--text-light); }

/* ── Нет результатов / ошибка ── */
.hs-empty { padding: 26px 20px 22px; text-align: center; }
.hs-empty .hs-empty-ico {
  width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--violet-soft); color: var(--violet); display: grid; place-items: center;
}
.hs-empty h4 { font-size: 17px; font-weight: 600; color: var(--text); margin: 0 0 6px; letter-spacing: -.01em; }
.hs-empty h4 .hs-eq { color: var(--violet); }
.hs-empty p { font-size: 13.5px; color: var(--text-muted); margin: 0 0 16px; }
.hs-empty-tips { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 0 auto 18px; text-align: left; }
.hs-empty-tip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.hs-empty-tip .et-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }

/* ── Подвал: показать все ── */
.hs-footer {
  position: sticky; bottom: 0;
  background: #fff; border-top: 1px solid var(--border);
  padding: 6px;
}
.hs-showall {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border: 0; border-radius: var(--r-md);
  background: var(--violet); color: #fff; font-family: inherit;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .2s ease;
}
.hs-showall:hover { background: var(--violet-hover); }
.hs-showall b { font-weight: 700; }

/* ════════════════ МОБАЙЛ: полноэкранный оверлей ════════════════ */
@media (max-width: 1280px) {
  .hs-root.is-open { pointer-events: auto; }
  .hs-scrim { background: #fff; pointer-events: auto; }
  .hs-shell {
    position: absolute; inset: 0;
    width: 100% !important; left: 0 !important; top: 0 !important;
    border-radius: 0; border: 0; box-shadow: none;
    transform: translateY(0); opacity: 1;
    display: flex; flex-direction: column;
  }
  .hs-root.is-open .hs-shell { transform: none; }
  .hs-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .hs-bar .hs-bar-field {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px;
    height: 50px; padding: 0 16px; background: var(--bg-soft); border-radius: var(--r-md);
    border: 1.5px solid transparent;
  }
  .hs-bar .hs-bar-field:focus-within { background: #fff; border-color: var(--violet); }
  .hs-bar .hs-bar-field svg { color: var(--violet); flex: 0 0 auto; }
  .hs-bar input {
    flex: 1 1 auto; border: 0; background: transparent; outline: none;
    font-size: 16px; font-weight: 500; color: var(--text); min-width: 0;
  }
  .hs-bar input::placeholder { color: var(--text-light); }
  .hs-cancel {
    flex: 0 0 auto; border: 0; background: transparent; color: var(--violet);
    font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; padding: 6px 4px;
  }
  .hs-body { flex: 1 1 auto; max-height: none; padding: 4px 6px; }
  .hs-quick { grid-template-columns: repeat(2, 1fr); }
  .hs-footer { position: sticky; bottom: 0; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .hs-quick { grid-template-columns: 1fr 1fr; }
}
