/**
 * COMPONENT: Select (.c-select)
 * Custom dropdown — enhances native <select class="js-select">
 */
.c-select {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.c-select--inline {
  width: auto;
  min-width: 168px;
}
.c-select__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-500);
}
.c-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  color: var(--neutral-800);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.c-select__trigger:hover {
  border-color: var(--neutral-300);
  background: var(--neutral-50);
}
.c-select.is-open .c-select__trigger,
.c-select__trigger:focus-visible {
  border-color: var(--secondary-600);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12);
  outline: none;
}
.c-select__value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-select__chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--neutral-500);
  transition: transform 0.18s ease, color var(--transition);
}
.c-select.is-open .c-select__chevron {
  transform: rotate(180deg);
  color: var(--secondary-600);
}
.c-select__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}

.c-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: var(--z-dropdown);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.c-select.is-open .c-select__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.c-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--neutral-700);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.c-select__option:hover,
.c-select__option.is-active {
  background: var(--secondary-50);
  color: var(--secondary-700);
}
.c-select__option.is-selected {
  background: var(--primary-50);
  color: var(--primary-900);
  font-weight: 600;
}
.c-select__option.is-selected::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-500);
  flex-shrink: 0;
}
.c-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Toolbar variant next to search */
.c-toolbar-select {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.c-toolbar-select .c-select--inline {
  min-width: 180px;
}

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