/*
 * tp-selects.css - фирменный выпадающий список панели (.select) в модуле «Тарифы и промокоды».
 * Разметку строит /assets/js/tp-selects.js из <select data-tp-select>; базовые стили .select - style.css панели,
 * здесь только то, что нужно спискам модуля: шапка в строку, скрытый стандартный <select>, отключённое состояние, ошибка.
 */

.tp-select {
  position: relative;
  min-width: 0;
}

.tp-select .select__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  outline: none;
}

.tp-select .select__header:focus-visible {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(52, 66, 225, 0.18);
}

.tp-select .select__current {
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
}

.tp-select .select__current.select-placeholder {
  color: var(--color-text-secondary, #6c757d);
}

.tp-select .select__body {
  z-index: 30;
  min-width: max(100%, 220px);
  background: var(--color-white, #fff);
}

.tp-select .select__body-wrapp {
  max-height: 260px;
}

/* стандартный <select> остаётся в форме (name, required, обработчики), но не виден */
.tp-select .tp-select__native {
  position: absolute;
  left: 12px;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* отключённый список (например, курс пакета не отмечен) */
.tp-select--disabled {
  cursor: default;
}

.tp-select--disabled .select__header {
  opacity: 0.55;
  pointer-events: none;
}

.tp-select__label--off {
  pointer-events: none;
  opacity: 0.45;
}

/* не выбран обязательный вариант */
.tp-select--invalid .select__header {
  border-color: var(--color-red, #fb5858);
  background: var(--color-surface-danger, #fff6f6);
}

/* фильтры над таблицами: список не растягивается на всю строку */
form .tp-select:not(.pc-bitem__sel) {
  width: auto;
}

.input-box > .tp-select,
.ctf-inline > .tp-select {
  width: 100%;
}

/* режим «везде» (tp-selects.js с data-auto): список, который на странице был в строку, остаётся в строку */
.tp-select--inline {
  display: inline-block;
  width: auto;
  min-width: 160px;
  vertical-align: middle;
}

.tp-select--auto .select__current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* у обёртки класс .select - снять оформление, которое страницы дают своему <select class="select"> (рамка, стрелка, высота) */
.select.tp-select.tp-select--auto {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  appearance: none;
}

/* компактный список (в таблицах, фильтрах) - как был */
.tp-select--sm .select__header {
  height: 32px;
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
  border-radius: 8px;
}
