/**
 * Widget select con autocomplete - sdm_views
 *
 * Colori e misure allineati al design system del tema sdm:
 *   primary: #ec0e00  |  black: #000  |  lightgray: #f3f3f3
 *   font: 16px/24px light  |  opzioni: 18px/20px weight 300
 */

/* ── Contenitore wrapper ────────────────────────────────── */
.sdm-aselect {
  position: relative;
  width: 100%;
  display: inline-block;
}

/* ── Pulsante trigger ───────────────────────────────────── */
.sdm-aselect__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #000;
  border-radius: 0;
  padding: 6px 0;
  font-size: 16px;
  line-height: 24px;
  font-family: inherit;
  color: #000;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  outline: none;
  transition: border-color 0.15s ease;
}

.sdm-aselect__trigger:focus {
  outline: none;
}

/* Stato: filtro attivo (valore selezionato) */
.sdm-aselect__trigger--active {
  color: #ec0e00;
}

/* Stato: dropdown aperto */
.sdm-aselect--open .sdm-aselect__trigger {
  border-bottom: 2px solid #ec0e00;
}

/* ── Freccia chevron CSS ────────────────────────────────── */
.sdm-aselect__arrow {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-bottom: 4px;
  margin-left: 10px;
  transition: transform 0.2s ease, margin-bottom 0.2s ease;
}

.sdm-aselect--open .sdm-aselect__arrow {
  transform: rotate(-135deg);
  margin-bottom: -2px;
}

/* ── Pannello dropdown ──────────────────────────────────── */
.sdm-aselect__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  min-width: 200px;
}

/* ── Input di ricerca ───────────────────────────────────── */
.sdm-aselect__search {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #f3f3f3;
  font-size: 14px;
  font-family: inherit;
  color: #000;
  background: #fff;
  box-sizing: border-box;
  outline: none;
}

.sdm-aselect__search:focus {
  border-bottom-color: #ec0e00;
  outline: none;
}

/* ── Lista opzioni ──────────────────────────────────────── */
.sdm-aselect__list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  max-height: 240px;
  overflow-y: auto;
}

/* ── Singola opzione ────────────────────────────────────── */
.sdm-aselect__option {
  padding: 8px 12px 8px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  line-height: 20px;
  color: #000;
  white-space: normal;
  letter-spacing: 0;
}

.sdm-aselect__option:hover,
.sdm-aselect__option--selected {
  color: #ec0e00;
}
