/* Дропдаун подсказок поиска в шапке */
.dropdown--search {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  margin-top: 4px;
  max-height: 70vh;
  overflow-y: auto;
}

.vd-suggest-list {
  padding: 4px 0;
}

.vd-suggest-item {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f4f4f4;
  text-decoration: none;
  color: #222;
}
.vd-suggest-item:last-child { border-bottom: none; }
.vd-suggest-item:hover { background: #f7faff; text-decoration: none; }

.vd-suggest-pic {
  flex: 0 0 50px;
  width: 50px; height: 50px;
  background: #fafafa;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vd-suggest-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }

.vd-suggest-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.vd-suggest-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vd-suggest-name {
  font-size: 13px;
  line-height: 1.3;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.vd-suggest-discount {
  flex: 0 0 auto;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.2;
}
.vd-suggest-price {
  margin-top: 4px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.vd-suggest-price b { font-weight: 700; color: #222; }
.vd-suggest-price s { color: #999; font-weight: 400; }

.vd-suggest-all {
  display: block;
  padding: 10px 12px;
  background: #f7f7f7;
  color: #1e8fbf;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  border-top: 1px solid #eee;
}
.vd-suggest-all:hover { background: #eef6fb; color: #1e8fbf; text-decoration: none; }

.vd-suggest-empty {
  padding: 18px 14px;
  color: #888;
  font-size: 13px;
  text-align: center;
}

.search { position: relative; }

/* Мобильная шапка: при раскрытии поиска (.searchCollapseTrigger) Bitrix-JS
   делает slideDown. Обёртка .header__search сидит во flex-col шириной 229
   из 375 — без позиционных правок поле выезжает за viewport на 37px.
   Решение: position:absolute поверх .row (для ширины 100%), а контент
   под шапкой получает динамический margin-bottom = высоте развёрнутого
   поиска (через --mobile-search-h, выставляется JS). */
@media (max-width: 1010px) {
  #header__content .row { position: relative; }
  #header__content .row > [class*="col-"] { position: static !important; }
  #header__content .header__search {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 100%;
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    background: #fff;
    z-index: 1000;
  }
  #header__content { margin-bottom: var(--mobile-search-h, 0px); transition: margin-bottom .2s; }
  #header__content .header__search #search {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 !important;
  }
  #header__content .header__search .api-search-fields,
  #header__content .header__search form.form-inline { width: 100%; }
  #header__content .header__search .api-query { display: flex; align-items: center; gap: 4px; width: 100%; }
  #header__content .header__search input.api-search-input { flex: 1 1 auto; min-width: 0; width: auto !important; }
  #header__content .header__search button[type="submit"] { flex: 0 0 auto; }
}

/* Спиннер и кнопка очистки — позиционируются JS'ом по input.getBoundingClientRect() */
.vd-suggest-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #e5e5e5;
  border-top-color: #27aae1;
  border-radius: 50%;
  animation: vd-suggest-spin 0.7s linear infinite;
  pointer-events: none;
  z-index: 5;
}
@keyframes vd-suggest-spin {
  to { transform: rotate(360deg); }
}

.vd-suggest-clear {
  position: absolute;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%;
  background: #e5e5e5; color: #666;
  font-size: 11px; line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: background .15s, color .15s;
}
.vd-suggest-clear:hover { background: #c9c9c9; color: #222; }
.vd-suggest-clear:focus { outline: none; }
