/* ============================================
   Поиск в шапке — UI-kit «Searching button set» (7556:3426)
   Состояния кита: иконка → ховер → раскрытое поле (279×78) →
   подсказки (279×156) → выбор варианта → нажатие кнопки.
   ============================================ */

.site-search {
  position: relative;
}

.site-search__toggle {
  align-items: center;
  display: inline-flex;
  padding: 0;
  transition: opacity 0.2s ease;
}

.site-search__toggle:hover {
  opacity: 0.6;
}

/* Раскрытое поле: в макете 279 шириной, выпадает под иконкой вправо */
.site-search__panel {
  align-items: center;
  background: var(--c-cream);
  border: 1px solid rgba(26, 12, 4, 0.15);
  display: flex;
  gap: 8px;
  min-height: 78px; /* размер поля из кита: 279×78 */
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 279px;
  z-index: 40;
}

.site-search__panel[hidden] {
  display: none;
}

.site-search__icon {
  flex-shrink: 0;
  height: 20px;
  margin-left: 8px;
  width: 20px;
}

.site-search__field {
  flex: 1;
  min-width: 0;
}

.site-search__input {
  background: transparent;
  border: none;
  color: var(--c-black);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  outline: none;
  text-transform: uppercase;
  width: 100%;
}

.site-search__input::placeholder {
  color: var(--c-gray);
}

/* Кнопка из кита: терракотовый квадрат со стрелкой, во всю высоту поля.
   На нажатии светлеет — как состояние «Click button». */
.site-search__submit {
  align-items: center;
  align-self: stretch;
  background: var(--c-terracotta-dark);
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease;
  width: 60px; /* квадрат: высота поля 78 минус паддинги 8+8 */
}

.site-search__submit:hover,
.site-search__submit:active {
  background: var(--c-terracotta);
}

.site-search__submit img,
.site-search__submit svg {
  height: 18px;
  width: 18px;
}

/* Подсказки — состояние «suitable options»: панель растёт с 78 до 156 */
/* Список подсказок в ките на БЕЛОМ фоне, поле — на кремовом */
.site-search__results {
  background: var(--c-white);
  border: 1px solid rgba(26, 12, 4, 0.15);
  border-top: none;
  left: -1px;
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  right: -1px;
  top: 100%;
}

.site-search__results[hidden] {
  display: none;
}

.site-search__item {
  display: block;
  padding: 10px 16px;
  transition: background 0.15s ease;
}

/* Состояние «Take options» — наведение/выбор клавишами */
.site-search__item:hover,
.site-search__item.is-active {
  background: var(--c-light-gray);
}

.site-search__item-type {
  color: var(--c-gray);
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

/* В ките совпавшая часть запроса набрана жирным тёмным, хвост — серым */
.site-search__item-title {
  color: var(--c-gray);
  display: block;
  font-family: var(--font-serif-text);
  font-size: 15px;
  line-height: 1.3;
}

.site-search__item-title b {
  color: var(--c-black);
  font-weight: 700;
}

.site-search__empty {
  color: var(--c-gray);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 14px 16px;
  text-transform: uppercase;
}

.site-search__all {
  border-top: 1px solid rgba(26, 12, 4, 0.12);
  color: var(--c-terracotta-dark);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.site-search__all:hover {
  color: var(--c-terracotta);
}

@media (max-width: 560px) {
  /* На узком экране панель прижимается к краям шапки, а не тянет 279px */
  .site-search__panel {
    right: -8px;
    width: calc(100vw - 32px);
  }
}
