/* LOST — выпадающий поиск в шапке */

.lost-header-search {
  position: relative;
}

.lost-header-search__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(400px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 20px;
  border-radius: 16px;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  z-index: calc(var(--lost-z-header) + 15);
  box-sizing: border-box;
  overflow-x: hidden;
}

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

.lost-header-search__form {
  min-width: 0;
  overflow-x: hidden;
}

.lost-header-search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.lost-header-search__field:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.lost-header-search__field-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.4);
}

.lost-header-search__field:focus-within .lost-header-search__field-icon {
  color: rgba(255, 255, 255, 0.7);
}

.lost-header-search__input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lost-header-search__input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.lost-header-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 43%, #fff 43%, #fff 57%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, #fff 43%, #fff 57%, transparent 57%);
  border-radius: 50%;
  opacity: 0.75;
}

.lost-header-search__hint {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lost-header-search__results {
  margin-top: 18px;
  min-width: 0;
  overflow-x: hidden;
}

.lost-header-search__label {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
}

.lost-header-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.lost-header-search__list::-webkit-scrollbar {
  width: 5px;
}

.lost-header-search__list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.lost-header-search__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0;
  max-width: 100%;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s ease;
  overflow: hidden;
}

.lost-header-search__item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lost-header-search__item-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.lost-header-search__item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lost-header-search__item-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
  font-weight: 600;
}

.lost-header-search__item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lost-header-search__item-cat {
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  line-height: 1.2;
}

.lost-header-search__item-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lost-header-search__item-sub {
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lost-header-search__empty,
.lost-header-search__loading {
  padding: 12px 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .lost-header-search__panel {
    position: fixed;
    top: auto;
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - var(--lost-header-h) - 24px);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .lost-header-search__list {
    max-height: none;
  }
}
