#custom_car_search {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ----------- SELECT BASE ----------- */
.custom-select {
  position: relative;
  flex: 1 1 auto;
  font-size: 15px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ----------- TRIGGER ----------- */
.custom-select-trigger {
  display: block;
  position: relative;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 14px;
  padding-right: 44px; /* место под стрелку */
  transition: background 0.2s ease, border-color 0.2s ease;
  line-height: 1.3;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* при открытии */
.custom-select.open .custom-select-trigger {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* внутренний контент */
.custom-select-trigger span,
.custom-select-trigger img,
.custom-select-trigger {
  display: inline-block;
  max-width: calc(100% - 28px);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* стрелка */
.custom-select-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 6px;
  height: 6px;
  border-right: 1px solid #333;
  border-bottom: 1px solid #333;
  border-radius: 1px;
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.custom-select.open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(-135deg);
}

/* выпадающий список */
.custom-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.custom-select.open .custom-options {
  display: block;
  animation: fadeIn 0.15s ease-in;
}

.custom-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.custom-option:hover {
  background: #f2f2f2;
}

.custom-option.selected {
  background: #393e46;
  color: #fff;
}

/* иконки */
.custom-option img.brand-icon,
.custom-select-trigger img.brand-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
  margin-right: 4px;
  vertical-align: middle;
}

/* ----------- DISABLED ----------- */
.custom-select.disabled .custom-select-trigger {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f7f7f7;
}

/* ----------- ANIMATION ----------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------- BUTTON ----------- */
#custom_car_search button {
  flex: 0 0 120px;
  padding: 10px 16px;
  background-color: #000;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
  appearance: none;
  box-sizing: border-box;
  transition: background-color 0.3s ease, transform 0.15s ease;
}

#custom_car_search button:hover {
  background-color: #393e46;
  transform: translateY(-1px);
}

/* ----------- MOBILE ----------- */
@media (max-width: 768px) {
  #custom_car_search {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 0 0px; /* ✅ отступы по 20px */
  }

  .custom-select {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  .custom-select-trigger {
    width: 100%;
    max-width: 100%;
  }

  #custom_car_search button {
    width: 100%;
    flex: none;
    padding: 12px 16px;
    font-size: 16px;
  }
}