/* Умный поиск в шапке (2026-11-28) — см. js/smart-search.js */
.header-search .search_five_res.ss-box {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  width: auto;
  display: none;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(0, 54, 99, .08);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 30, 60, .18), 0 4px 12px rgba(0, 30, 60, .06);
  z-index: 100000;
  overflow: hidden;
  text-align: left;
  animation: ssIn .18s ease-out;
}
.header-search .search_five_res.ss-box.ss-box--open { display: block; }
@keyframes ssIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ss-panel { max-height: min(72vh, 620px); overflow-y: auto; padding: 18px 20px 16px; color: #1f2937; font-size: 14px; line-height: 1.4; }
.ss-panel--results { padding: 10px 10px 12px; }
.ss-sec + .ss-sec { margin-top: 18px; }
.ss-sec__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ss-sec__title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a94a6; }
.ss-link { padding: 0; border: 0; background: none; color: #3d6fd6; font-size: 13px; cursor: pointer; text-decoration: none; }
.ss-link:hover { color: #003663; text-decoration: underline; }

.ss-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid #e5eaf2; border-radius: 999px;
  background: #f7f9fc; color: #1f2937; font-size: 13px; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s, color .15s;
}
.ss-chip svg { flex: 0 0 auto; color: #8a94a6; }
.ss-chip:hover, .ss-chip.is-active { border-color: #3d6fd6; background: #eef3ff; color: #003663; }
.ss-chip:hover svg { color: #3d6fd6; }
.ss-chip--hist { padding: 0; gap: 0; overflow: hidden; }
.ss-chip__q { display: inline-flex; align-items: center; gap: 6px; padding: 7px 4px 7px 12px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.ss-chip__x { padding: 7px 10px 7px 6px; border: 0; background: none; color: #a0a8b6; font-size: 16px; line-height: 1; cursor: pointer; }
.ss-chip__x:hover { color: #e5484d; }
.ss-chip--cat em { margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: #fff; color: #8a94a6; font-size: 11px; font-style: normal; }
.ss-chips--cats { padding: 6px 8px 10px; border-bottom: 1px solid #eef1f6; margin-bottom: 6px; }

.ss-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ss-cat {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 10px; border: 1px solid #eef1f6; border-radius: 12px;
  color: #1f2937; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ss-cat:hover { border-color: #cfdcf7; box-shadow: 0 6px 16px rgba(0, 54, 99, .08); transform: translateY(-1px); color: #003663; }
.ss-cat__img { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 9px; background: #f3f6fa; overflow: hidden; }
.ss-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.ss-cat__name { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.ss-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 18px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, #f2f6ff 0%, #fff6ec 100%); color: #4b5563; font-size: 13px;
}
.ss-tip__text b { color: #003663; }
.ss-tip__call {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; background: #ff8a1f; color: #fff !important;
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s;
}
.ss-tip__call:hover { background: #f27400; }

.ss-fixed { margin: 2px 8px 8px; padding: 9px 12px; border-radius: 10px; background: #fff7ec; color: #7a4a10; font-size: 13px; }
.ss-fixed b { color: #c25e00; }
.ss-fixed span { display: block; margin-top: 2px; color: #a5835b; font-size: 12px; }

.ss-list { display: flex; flex-direction: column; }
.ss-prod {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px; color: #1f2937; text-decoration: none; transition: background .12s;
}
.ss-prod:hover, .ss-prod.is-active { background: #f3f7ff; }
.ss-prod__img { flex: 0 0 52px; width: 52px; height: 52px; border: 1px solid #eef1f6; border-radius: 10px; background: #fff; overflow: hidden; }
.ss-prod__img img { width: 100%; height: 100%; object-fit: contain; }
.ss-prod__body { flex: 1 1 auto; min-width: 0; }
.ss-prod__name { display: block; overflow: hidden; color: #111827; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ss-prod__meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; color: #8a94a6; font-size: 12px; }
.ss-prod__price { flex: 0 0 auto; color: #003663; font-size: 15px; font-weight: 700; text-align: right; white-space: nowrap; }
.ss-prod__price small { display: block; color: #8a94a6; font-size: 11px; font-weight: 400; }
.ss-box mark { padding: 0 1px; border-radius: 3px; background: #ffe7c7; color: inherit; font-weight: 700; }

.ss-stock { display: inline-flex; align-items: center; gap: 5px; }
.ss-stock::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ss-stock--in { color: #16a34a; }
.ss-stock--few { color: #d97706; }
.ss-stock--order { color: #dc2626; }

.ss-all {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 8px 8px 0; padding: 11px; border-radius: 12px;
  background: #003663; color: #fff !important; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s;
}
.ss-all:hover, .ss-all.is-active { background: #0b4a85; }

.ss-empty { padding: 14px 12px 6px; }
.ss-empty__title { margin-bottom: 6px; color: #111827; font-size: 15px; font-weight: 700; }
.ss-empty__text { margin-bottom: 12px; color: #6b7280; font-size: 13px; }

.ss-loading { display: flex; justify-content: center; gap: 6px; padding: 22px 0; }
.ss-loading i { width: 8px; height: 8px; border-radius: 50%; background: #3d6fd6; animation: ssDot .9s infinite ease-in-out; }
.ss-loading i:nth-child(2) { animation-delay: .15s; }
.ss-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes ssDot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }

/* мобильный полноэкранный поиск: панель встаёт под строкой, на всю ширину */
.mobile_search_block .search_five_res.ss-box {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.mobile_search_block .ss-panel { max-height: none; height: 100%; padding: 16px; }
@media (max-width: 760px) {
  .ss-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ss-tip { flex-direction: column; align-items: stretch; text-align: left; }
  .ss-tip__call { justify-content: center; }
  .ss-prod__img { flex-basis: 46px; width: 46px; height: 46px; }
  .ss-prod__name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (prefers-reduced-motion: reduce) {
  .header-search .search_five_res.ss-box, .ss-loading i { animation: none; }
}

.ss-page-fixed { display: inline-block; margin: 4px 0 14px; padding: 9px 14px; border-radius: 10px; background: #fff7ec; color: #7a4a10; font-size: 14px; }
.ss-page-fixed b { color: #c25e00; }

/* десктоп: панель шире строки поиска, по центру под ней */
@media (min-width: 1051px) {
  .header-search:not(.mobile_search_block) .search_five_res.ss-box { left: 50%; right: auto; width: 700px; margin-left: -350px; }
}
.ss-cat__name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }

/* страница результатов поиска: сетка карточек */
.ss-results-grid { width: 100%; margin-top: 8px; }
.ss-results-grid .ss-hl { padding: 0 1px; border-radius: 3px; background: #ffe7c7; color: inherit; font-weight: 700; }
