/* ==========================================================================
   Combobox — a text field with suggestions. Point any input at a <datalist>
   and it gets a Moey suggestion list instead of the browser's:

   <input class="form-control" list="cities" placeholder="City">
   <datalist id="cities">
     <option value="Lisbon" data-moey-detail="Portugal">
     <option value="Porto" data-moey-detail="Portugal">
   </datalist>

   data-moey-source="/api/customers?q={q}"   suggestions from your server (JSON)
   data-moey-strict                          only values from the list are allowed
   data-moey-create                          offer "Add “…”" for something new
   data-moey-id-field="#customer-id"         also fill a hidden input with the item's id
   data-moey-min-chars="2" · data-moey-limit="50" · data-moey-native (keep the browser's)
   The list itself is the Moey dropdown's (.menu.select-menu).
   ========================================================================== */

.combobox-menu .menu-item-label mark,
.combobox-menu .menu-item-detail mark {
  padding: 0;
  font-weight: var(--mo-font-weight-semibold, 600);
  color: inherit;
  background: none;
}
.combobox-menu .menu-item[aria-selected="true"] { font-weight: var(--mo-font-weight-normal); }
.combobox-menu .menu-item[aria-selected="true"] .menu-item-label { font-weight: var(--mo-font-weight-medium); }

/* "Add “…”" */
.combobox-menu .combobox-create { color: var(--mo-theme-fg); }
.combobox-menu .combobox-create::after { display: none; }
.combobox-menu .combobox-create .menu-item-label > .mi { color: inherit; }
.combobox-menu .menu-divider + .combobox-create,
.combobox-menu .combobox-create:first-child { margin-top: 0; }

/* Searching… · nothing found · couldn't load */
.combobox-status {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  padding: .75rem;
  font-size: .8125rem;
  color: var(--mo-fg-3);
  text-align: center;
}
.combobox-status > .spinner { --mo-spinner-size: 1rem; }
.combobox-status.is-error { color: var(--mo-red-fg); }
