/*
  edukursy — строка поиска под меню и подсказки при вводе.
  Если на сайте подключён полный style.css из основного пакета — замените в нём блок
  «СТРОКА ПОИСКА ПОД МЕНЮ» на этот файл (без :root) или подключите этот файл после style.css.
  Нужен класс .visually-hidden (есть в style.css).
*/
:root {
  --c-text: #1a1d23;
  --c-muted: #5b6270;
  --c-bg: #ffffff;
  --c-bg-light: #f4f6f9;
  --c-border: #dde1e8;
  --c-primary: #1f5eff;
  --c-primary-dark: #1546c4;
  --gutter: 16px;
}

/* ============================================================
   СТРОКА ПОИСКА ПОД МЕНЮ + ПОДСКАЗКИ (search.js)
   ============================================================ */
.site-search {
  position: relative;
  z-index: 95;
  padding: 12px var(--gutter);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.site-search__form {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}
.site-search__field {
  display: flex;
  align-items: center;
  height: 52px;
  padding-left: 16px;
  border: 1.5px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-bg-light);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.site-search__field:hover {
  border-color: #c3cad6;
}
.site-search__field:focus-within,
.site-search.is-open .site-search__field {
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}
.site-search svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-search__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--c-muted);
}
.site-search.is-loading .site-search__icon {
  color: var(--c-primary);
  animation: suggest-pulse 0.9s ease-in-out infinite;
}
@keyframes suggest-pulse {
  50% { opacity: 0.35; }
}
.site-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: var(--c-text);
}
.site-search__input::placeholder {
  color: #8a919e;
}
.site-search__input::-webkit-search-cancel-button {
  display: none;
}
.site-search__clear {
  display: none;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin-right: 6px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--c-muted);
  cursor: pointer;
}
.site-search__clear:hover {
  background: var(--c-bg-light);
  color: var(--c-text);
}
.site-search__clear svg {
  width: 18px;
  height: 18px;
}
.site-search.has-value .site-search__clear {
  display: grid;
}
.site-search__kbd {
  display: none;
  flex: none;
  margin-right: 10px;
  padding: 2px 8px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--c-muted);
}
@media (hover: hover) and (min-width: 768px) {
  .site-search:not(.has-value):not(.is-open) .site-search__kbd {
    display: block;
  }
}
.site-search__btn {
  flex: none;
  align-self: stretch;
  margin: 5px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  background: var(--c-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.site-search__btn:hover {
  background: var(--c-primary-dark);
}

/* ----- Выпадающий список ----- */
.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 110;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 23, 28, 0.16);
  overscroll-behavior: contain;
}
.suggest[hidden] {
  display: none;
}
.suggest__group + .suggest__group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--c-border);
}
.suggest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
}
.suggest__total {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--c-bg-light);
  font-size: 12px;
  letter-spacing: 0;
}
.suggest__link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--c-muted);
  text-decoration: underline;
  cursor: pointer;
}
.suggest__link:hover {
  color: var(--c-text);
}
.suggest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--c-text);
  text-decoration: none;
}
.suggest__item.is-active,
.suggest__all.is-active,
.suggest__chip.is-active {
  background: #eef3ff;
}
.suggest__thumb {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--c-bg-light);
}
.suggest__thumb--round {
  border-radius: 50%;
}
.suggest__thumb--empty {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--c-muted);
}
.suggest__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.suggest__name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.suggest__name mark {
  padding: 0;
  background: none;
  color: var(--c-primary);
  font-weight: 800;
}
.suggest__meta {
  overflow: hidden;
  font-size: 13px;
  color: var(--c-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.suggest__tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e2f5ec;
  color: #1f8a5b;
  font-size: 12px;
  font-weight: 700;
}
.suggest__price {
  flex: none;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.suggest__price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-muted);
}
.suggest__all {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 10px;
  border-top: 1px solid var(--c-border);
  border-radius: 0 0 8px 8px;
  color: var(--c-primary);
  font-weight: 700;
  text-decoration: none;
}
.suggest__all span {
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef3ff;
  font-size: 13px;
}
.suggest__all svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
}
.suggest__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 8px 8px;
}
.suggest__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  font-size: 14px;
  text-decoration: none;
}
.suggest__chip:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.suggest__chip svg {
  width: 14px;
  height: 14px;
  color: var(--c-muted);
}
.suggest__state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  color: var(--c-muted);
}
.suggest__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: suggest-spin 0.7s linear infinite;
}
@keyframes suggest-spin {
  to { transform: rotate(360deg); }
}
.suggest__fix {
  padding: 8px 10px 0;
  font-size: 14px;
  color: var(--c-muted);
}
.suggest__empty {
  padding: 16px 10px 8px;
}
.suggest__empty p {
  color: var(--c-muted);
}
.suggest__empty .suggest__empty-title {
  margin-bottom: 4px;
  font-weight: 700;
  color: var(--c-text);
}
.suggest__empty .suggest__chips {
  padding: 12px 0 0;
}

@media (max-width: 767.98px) {
  .site-search {
    padding: 8px var(--gutter);
  }
  .site-search__field {
    height: 46px;
    padding-left: 12px;
  }
  .site-search__input {
    font-size: 16px;
    padding: 0 8px;
  }
  .site-search__btn {
    padding: 0 14px;
  }
  .suggest {
    top: calc(100% + 8px);
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    max-height: calc(100vh - 140px);
    border-radius: 0 0 14px 14px;
    border-left: 0;
    border-right: 0;
  }
  .suggest__tag {
    display: none;
  }
  .suggest__price {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .suggest__spinner,
  .site-search.is-loading .site-search__icon {
    animation: none;
  }
}

/* ----- Страница результатов /search/ ----- */
.search-profs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.search-prof {
  border: 1px solid var(--c-border);
  background: #fff;
}
.search-prof:hover {
  border-color: var(--c-primary);
}
.search-popular {
  padding: 12px 0 20px;
}
.search-empty .search-popular {
  justify-content: center;
}
