/* ==========================================================
   Умный поиск в шапке
   ========================================================== */
.header-search {
  position: relative;
  z-index: 30;
}
.header-search.live-search-loading button {
  background-image: none;
}
.header-search.live-search-loading button::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(17, 17, 17, 0.15);
  border-top-color: #111;
  border-radius: 50%;
  animation: live-search-spin 0.7s linear infinite;
}
@keyframes live-search-spin {
  to { transform: rotate(360deg); }
}

.live-search {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: min(600px, 75vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 25px 30px 30px;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 15px 60px 0 rgba(2, 14, 30, 0.12);
  text-align: left;
}
.live-search-open .live-search {
  display: block;
}
.live-search a:focus-visible {
  outline: 2px solid var(--c6e12c);
  outline-offset: 2px;
}

.live-search__group + .live-search__group {
  margin-top: 22px;
}
.live-search__label {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(17, 17, 17, 0.45);
}

/* Категории / бренды — чипсы */
.live-search__terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.live-search__term {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 30px;
  background: var(--f7f7f0);
  font-size: 14px;
  line-height: 1.3;
  color: var(--111111);
  text-decoration: none;
  transition: background 0.3s;
}
.live-search__term small {
  font-size: 12px;
  color: rgba(17, 17, 17, 0.45);
}
.live-search__term:hover,
.live-search__term:focus {
  background: var(--c6e12c);
}
.live-search__term--brand::before {
  content: "Бренд";
  font-size: 11px;
  font-weight: 700;
  color: rgba(17, 17, 17, 0.45);
}

/* Товары */
.live-search__products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
}
.live-search__product {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px;
  border-radius: 16px;
  color: var(--111111);
  text-decoration: none;
  transition: background 0.3s;
}
.live-search__product:hover,
.live-search__product:focus {
  background: var(--f7f7f0);
}
.live-search__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.live-search__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.live-search__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.live-search__name {
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.live-search__price {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.live-search__price del {
  margin-right: 6px;
  font-weight: 400;
  font-size: 13px;
  opacity: 0.5;
}
.live-search__price ins {
  text-decoration: none;
}

.live-search__all.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  margin-top: 22px;
  white-space: normal;
}

.live-search__empty {
  padding: 10px 0;
  font-size: 15px;
  color: rgba(17, 17, 17, 0.6);
}

@media (max-width: 992px) {
  .live-search__products {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .live-search {
    top: calc(100% + 8px);
    padding: 18px 15px 20px;
    border-radius: 20px;
    max-height: 70vh;
  }
  .live-search__thumb {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }
  .live-search__name {
    font-size: 13px;
  }
  .live-search__price {
    font-size: 14px;
  }
  .live-search__term {
    padding: 7px 12px;
    font-size: 13px;
  }
  .live-search__all.btn {
    height: 50px;
    font-size: 14px;
    margin-top: 16px;
  }
}
