/* custom-select.js — visuele laag bovenop native <select>. */

select.mm-select {
  /* Native onzichtbaar maar blijft form-source-of-truth */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mm-select-display {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 12rem;
  padding: .5rem .75rem;
  background: var(--input-bg, #fff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 4px);
  color: var(--text, #0f172a);
  font: inherit;
  cursor: pointer;
  user-select: none;
}

.mm-select-display:focus-visible {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: 2px;
}

.mm-select-display[aria-expanded="true"] {
  border-color: var(--primary, #3b82f6);
}

.mm-select-display[data-empty="1"] .mm-select-label {
  color: var(--text-muted, #64748b);
}

.mm-select-arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .6;
  transition: transform 120ms;
}

.mm-select-display[aria-expanded="true"] .mm-select-arrow {
  transform: scaleY(-1);
}

/* Dropdown */
.mm-select-dropdown {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
  z-index: 1000;
  min-width: 12rem;
  max-height: 24rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mm-select-search {
  padding: .35rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.mm-select-search input {
  width: 100%;
  padding: .35rem .55rem;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  color: inherit;
  font: inherit;
  outline: none;
}

.mm-select-search input:focus {
  border-color: var(--primary, #3b82f6);
}

.mm-select-options {
  overflow-y: auto;
  scrollbar-width: thin;
}

.mm-select-group {
  padding: .35rem .75rem;
  font-size: .8em;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.mm-select-option {
  padding: .4rem .75rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background-color 80ms, color 80ms;
}

.mm-select-option--in-group {
  padding-left: 1.25rem;
}

.mm-select-option:hover,
.mm-select-option[data-highlighted="1"] {
  background: var(--primary, #3b82f6);
  color: var(--primary-contrast, #fff);
}

.mm-select-option[data-selected="1"] {
  font-weight: 600;
}

.mm-select-option[data-disabled="1"] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
