/* mainpage/static/mainpage/css/search_suggest.css */

/* чтобы абсолют работал корректно */
.header__search,
.m-header__search{
  position: relative;
}

/* Дропдаун */
.m-header__search .search-dd,
.header__search .search-dd{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 3000;

  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.14);
  overflow: hidden;

  /* важно для мобилки: не растягивать на весь экран */
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== СБРОС ВЛИЯНИЯ СТИЛЕЙ ШАПКИ НА КНОПКИ ВНУТРИ ДРОПДАУНА ===== */
.search-dd button,
.search-dd a{
  appearance: none;
  -webkit-appearance: none;

  font: inherit;
  color: inherit;

  background: transparent;
  border: 0;
  outline: 0;

  text-decoration: none;
}

/* Шапка дропдауна */
.search-dd__head{
  position: sticky;
  top: 0;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #f1f1f1;
}

.search-dd__title{
  font-weight: 800;
  font-size: 13px;
  color: #111;
}

/* Кнопка "Очистить" — в твоей стилистике */
.search-dd .search-dd__clear{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 7px 10px;
  border-radius: 999px;

  border: 1px solid #e6e6e6;
  background: #fff;

  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.search-dd .search-dd__clear:hover{
  border-color: #111;
}

/* Контент */
.search-dd__list{
  display: grid;
}

/* Пусто */
.search-dd__empty{
  padding: 14px 12px;
  color: #777;
  font-weight: 700;
  font-size: 13px;
}

/* "Показать все" */
.search-dd .search-dd__all{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  width: 100%;
  padding: 12px;

  background: #fafafa;
  cursor: pointer;

  font-weight: 800;
  font-size: 13px;

  border-bottom: 1px solid #f1f1f1;
}

.search-dd .search-dd__all:hover{
  background: #f3f3f3;
}

.search-dd__all .arrow{
  opacity: .6;
  font-weight: 900;
}

/* ===== История ===== */
.search-dd .search-dd__hitem{
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  padding: 12px;
  cursor: pointer;

  background: #fff;
  border-bottom: 1px solid #f3f3f3;

  font-weight: 800;
  font-size: 13px;
  text-align: left;
}

.search-dd .search-dd__hitem:hover{
  background: #fafafa;
}

.search-dd__hicon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f5f6fa;
  border: 1px solid #ececec;

  display: grid;
  place-items: center;

  flex: 0 0 34px;
}

.search-dd__hicon svg{
  width: 16px;
  height: 16px;
  opacity: .7;
}

.search-dd__htext{
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Подсказки товаров ===== */
.search-dd__item{
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;

  padding: 10px 12px;
  border-bottom: 1px solid #f3f3f3;
}

.search-dd__item:hover{
  background: #fafafa;
}

.search-dd__img{
  width: 44px;
  height: 44px;
  border-radius: 12px;

  background: #f5f6fa;
  border: 1px solid #ececec;

  display: grid;
  place-items: center;
  overflow: hidden;
}

.search-dd__img img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.search-dd__ph{
  font-size: 10px;
  color: #999;
  font-weight: 900;
}

.search-dd__meta{
  min-width: 0;
}

.search-dd__name{
  font-weight: 900;
  font-size: 13px;
  line-height: 1.15;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dd__price{
  margin-top: 4px;
  font-weight: 900;
  font-size: 12px;
  color: #444;
}

/* Мобилка: чуть компактнее */
@media (max-width: 860px){
  .m-header__search .search-dd{
    border-radius: 18px;
    max-height: calc(100vh - 210px);
  }
}
