.select-field {
  display: inline-block;
  position: relative;
}

.select-field-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--color-line);
  border-radius: var(--form-input-border-radius);
  background-color: white;
  font-size: var(--text-size-regular);
  color: var(--text-color-ultra-dark);
  cursor: pointer;
  outline: none;
  overflow: hidden;
  text-align: left;
  outline-offset: -2px;

  [slot="value"],
  .react-aria-SelectValue {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-holder {
    flex-shrink: 0;
  }

  &[data-invalid] {
    border-color: var(--color-error);
  }

  &[data-disabled] {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

.select-field-popover {
  background-color: white;
  border: 1px solid var(--color-line);
  border-radius: var(--form-input-border-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1100;
  min-width: var(--trigger-width);
  width: max-content;
}

.select-field-listbox {
  outline: none;
  padding: 4px 0;
}

.select-field-option {
  padding: 8px 12px;
  font-size: var(--text-size-regular);
  color: var(--text-color-ultra-dark);
  cursor: pointer;
  outline: none;
  white-space: nowrap;

  &[data-hovered],
  &[data-focused],
  &[data-selected] {
    background-color: var(--color-fill);
  }
}
