/* ASI autocomplete/select. Keep JS structure intact, style only. */
.asi {
  margin: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  height: 48px;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  overflow: visible;
}

.asi_name {
  display: block;
  line-height: 46px;
  position: relative;
  height: 48px;
  width: 100%;
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px;
  border: 1px solid #d5e1ee;
  padding: 0 44px 0 14px;
  color: #2c3d51;
  font-size: 14px;
  font-weight: 500;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.asi:hover .asi_name,
.asi.asi_open .asi_name {
  border-color: #1c7ed6;
  box-shadow: 0 0 0 3px rgba(28,126,214,.12);
}

.asi_name_selected .asi_name {
  font-weight: 800;
}

.asi_name_selected .asi_name:before {
  content: "";
  width: 46px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff 50%);
  position: absolute;
  right: 0;
  top: 0;
  pointer-events: none;
}

.asi_name:after {
  content: "";
  width: 0;
  height: 0;
  transition: transform .18s ease;
  border: 5px transparent solid;
  border-top: 6px #233141 solid;
  position: absolute;
  right: 16px;
  top: 20px;
  z-index: 2;
}

.asi.asi_open .asi_name:after {
  transform: rotate(180deg);
  top: 15px;
}

.asi .asi_stuff {
  display: block;
  max-height: 0;
  opacity: 0;
  transition: opacity .16s ease;
  overflow: hidden;
  pointer-events: none;
}

.asi.asi_open {
  z-index: 50000;
}

.asi.asi_open .asi_stuff {
  display: block;
  opacity: 1;
  max-height: none;
  background: #fff;
  position: absolute;
  left: 0;
  top: 54px;
  width: 100%;
  min-width: 100%;
  border: 1px solid #d5e1ee;
  border-radius: 10px;
  padding: 8px;
  overflow: visible;
  pointer-events: auto;
  box-shadow: 0 18px 38px rgba(35,49,65,.22);
  z-index: 50001;
}

.asi .asi_stuff input {
  display: block;
  width: 100%;
  height: 42px;
  margin: 0 0 8px 0;
  outline: none;
  background: #fff;
  border: 1px solid #1c7ed6;
  border-radius: 8px;
  padding: 0 12px;
  color: #233141;
  font-size: 14px;
  box-shadow: 0 0 0 3px rgba(28,126,214,.10);
}

.asi .asi_stuff ul {
  display: flex;
  flex-direction: column;
  max-height: 230px;
  overflow: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
}

.asi .asi_stuff ul li {
  padding: 9px 10px;
  min-height: 34px;
  border-top: 1px solid #edf3f8;
  cursor: pointer;
  color: #2c3d51;
  background: #fff;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.2;
}

.asi .asi_stuff ul li:hover,
.asi .asi_stuff ul li.current {
  color: #fff;
  background: #1c7ed6;
}

.asi .asi_stuff ul li.sort1 { order: 1; }
.asi .asi_stuff ul li.sort2 { order: 2; }

.asi_cleaner {
  width: 20px;
  height: 20px;
  line-height: 20px;
  border-radius: 50%;
  text-align: center;
  position: absolute;
  right: 28px;
  top: 14px;
  z-index: 10;
  display: none;
}

.asi_name_selected .asi_cleaner {
  display: block;
  transition: .2s;
  opacity: .65;
}

.asi_name_selected .asi_cleaner:hover {
  opacity: 1;
  color: #1c7ed6;
}

.asi_open.asi_name_selected .asi_cleaner { display: none; }

.asi .eventsBar {
  padding: 6px;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: #f3f8fd;
  text-align: center;
  font-weight: 800;
  border-radius: 8px;
}

.asi .eventsBar > div { margin: 0; }
.asi .eventsBar-go { padding: 5px 8px; color: #fff; border-radius: 6px; background: #1c7ed6; }
.asi .eventsBar-cleaner { padding: 5px 8px; color: #fff; border-radius: 6px; background: #2c3d51; }

@media (max-width: 639px) {
  .asi.asi_open {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 48px;
    background: transparent;
    box-shadow: none;
  }

  .asi .asi_stuff ul { max-height: 210px; }
}

/* v15: одинаковый внешний вид ASI-полей */
.asi_name {
  border: 1px solid #c9d8e8 !important;
  border-radius: 8px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(35,49,65,.03) !important;
}
.asi:hover .asi_name,
.asi.asi_open .asi_name {
  border-color: #1c7ed6 !important;
  box-shadow: 0 0 0 3px rgba(28,126,214,.11) !important;
}
.asi.asi_open .asi_stuff {
  background: #fff !important;
  border: 1px solid #c9d8e8 !important;
  box-shadow: 0 18px 38px rgba(35,49,65,.22) !important;
}


/* v16: strong visible ASI input borders. Keep JS structure untouched. */
html body .filterForm.filterForm-d4 .asi {
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  position: relative !important;
  overflow: visible !important;
  background: #fff !important;
  border: 1px solid #b8cadc !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(35,49,65,.04), inset 0 0 0 1px rgba(255,255,255,.75) !important;
}
html body .filterForm.filterForm-d4 .asi:hover,
html body .filterForm.filterForm-d4 .asi.asi_open,
html body .filterForm.filterForm-d4 .asi:focus-within {
  border-color: #1c7ed6 !important;
  box-shadow: 0 0 0 3px rgba(28,126,214,.12), inset 0 0 0 1px rgba(255,255,255,.75) !important;
}
html body .filterForm.filterForm-d4 .asi .asi_name {
  height: 46px !important;
  min-height: 46px !important;
  line-height: 46px !important;
  width: 100% !important;
  padding: 0 42px 0 14px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #2c3d51 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}
html body .filterForm.filterForm-d4 .asi .asi_name:after {
  right: 15px !important;
  top: 20px !important;
}
html body .filterForm.filterForm-d4 .asi.asi_open .asi_name:after {
  top: 15px !important;
}
html body .filterForm.filterForm-d4 .asi.asi_open .asi_stuff {
  left: -1px !important;
  top: 54px !important;
  width: calc(100% + 2px) !important;
  min-width: calc(100% + 2px) !important;
  max-width: calc(100% + 2px) !important;
  background: #fff !important;
  border: 1px solid #b8cadc !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 38px rgba(35,49,65,.22) !important;
  z-index: 90000 !important;
}


/* V19: финальное выравнивание ASI-полей под общий стиль фильтра. */
.filterForm-d4 .asi {
  height: 48px !important;
  min-height: 48px !important;
  overflow: visible !important;
}
.filterForm-d4 .asi_name {
  height: 48px !important;
  line-height: 46px !important;
  background: #fff !important;
  border: 1px solid #c7d8ea !important;
  border-radius: 8px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(35,49,65,.05) !important;
}
.filterForm-d4 .asi:hover .asi_name,
.filterForm-d4 .asi.asi_open .asi_name {
  border-color: #1c7ed6 !important;
  box-shadow: 0 0 0 3px rgba(28,126,214,.12) !important;
}
