@use "scss/colors";
@use "scss/variables";

.listboxButton {
  padding: 0 variables.$spacing-md;
  width: 100%;
  cursor: pointer;
  background-color: initial;
  color: colors.$dark-blue;
  border: variables.$border-thin solid colors.$grey-200;
  border-radius: variables.$border-radius-sm;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: variables.$spacing-md;
  font-size: variables.$font-size-lg;
  line-height: 1.4;
  height: variables.$form-input-height;

  &:disabled {
    border-color: colors.$grey-100;
    cursor: not-allowed;
  }

  &:hover:not(:disabled) {
    border-color: colors.$grey-300;
  }

  &[data-focus] {
    border-color: colors.$blue;
    outline: none;
  }

  &:focus:not([data-focus]) {
    outline: none;
  }

  &:hover:not(:disabled)[aria-expanded="true"] {
    border-color: colors.$grey-200;
  }

  &--error {
    border-color: colors.$red-200;

    &:hover:not(:disabled) {
      border-color: colors.$red;
    }
  }

  .disabledText {
    color: colors.$grey-300;
  }

  &__content {
    width: 100%;
  }

  &__children {
    min-width: 0;
    display: flex;
    gap: variables.$spacing-md;
  }

  &__caret {
    flex-shrink: 0;
  }
}
