.c-select {
  position: relative;
  width: 100%;
}

.c-select__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem 0.65rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: inherit;
  font-size: 16px;
  line-height: var(--lh-tight);
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color var(--ease);
}

.c-select__btn:hover,
.c-select.is-open .c-select__btn {
  border-color: var(--c-secondary);
}

.c-select__btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.c-select__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-select__chevron {
  flex-shrink: 0;
  color: var(--c-secondary);
  transition: transform var(--ease);
}

.c-select.is-open .c-select__chevron {
  transform: rotate(180deg);
}

.c-select__list {
  z-index: 2;
  margin: var(--space-1) 0 0;
  padding: var(--space-1);
  max-height: min(16rem, 50dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.c-select__list[hidden] {
  display: none;
}

.c-select__opt {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 16px;
  line-height: var(--lh-tight);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.c-select__opt:hover,
.c-select__opt:focus-visible {
  background: var(--c-bg-alt);
}

.c-select__opt.is-selected {
  background: color-mix(in srgb, var(--c-primary) 8%, var(--c-surface));
  color: var(--c-primary);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .c-select__btn,
  .c-select__chevron {
    transition: none;
  }
}
