.vb-comboBox {
  display: inline;
  position: relative;

  &__listBox {
    display: none;

    &--open {
      display: block;
    }

    &--widthXSmall {
      width: 4rem + 2 * $vbBasicSize;
    }

    &--widthSmall {
      width: 7rem + 2 * $vbBasicSize;
    }

    &--widthMedium {
      width: 11rem + 2 * $vbBasicSize;
    }

    &--widthLarge {
      width: 24rem + 2 * $vbBasicSize;
    }
  }

  &__listOptions {
    overflow-y: auto;
  }

  $class: &;

  &__listOption {
    padding: $vbSmallSize $vbBasicSize;
    font-size: $vbNormalFontSize;
    word-break: keep-all;
    overflow: hidden;
    transition-duration: 0.2s;
    transition-property: background-color;
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    &--disabled {
      background: inherit;
      opacity: 0.5;
      cursor: default;
      pointer-events: none;
    }

    &--selected:not(&--disabled) {
      background: $vbColorsP05;
      color: #fff;
    }

    &:hover:not(&--selected):not(&--disabled) {
      background: $vbColumnColor;
      color: $vbBlackColor;
      cursor: pointer;
    }
  }

  &__listOptionLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 fit-content;
  }

  &__listOptionSubLabel {
    font: $vbCaptionFont;
    color: $vbBurntColor;
    margin-left: $vbSmallSize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 fit-content;
    text-align: right;

    // キーボードで選択中のときは色反転する
    @at-root #{$class}__listOption--selected & {
      color: #fff;
    }
  }

  &__emptyMessage {
    padding: $vbSmallSize $vbSmallSize;
    text-align: center;
  }

  &__spinner {
    padding: $vbBasicSize;
    text-align: center;
  }

  &__fixedItem {
    display: flex;
    color: $vbLinkColor;
    font-weight: bold;
    vertical-align: middle;
    margin: -0.5rem -1rem;
    padding: 0.5rem 1rem;

    &--add {
      border-top: 1px solid $vbBaseColor2;
    }

    &--selected {
      background: $vbColorsP05;
      color: #fff;
    }
  }

  &__fixedItemIcon {
    width: 1.5em;
    height: 1.5em;
    margin: -$vbMinimum 0.25rem 0 0;
  }
}

.vb-multiComboBox {
  display: inline-block;

  &--widthXSmall {
    width: 4rem;
  }

  &--widthSmall {
    width: 7rem;
  }

  &--widthMedium {
    width: 11rem;
  }

  &--widthLarge {
    width: 24rem;
  }

  &--widthFull {
    width: 100%;
  }

  &__border {
    line-height: 1;
    vertical-align: middle;
    margin: -1px;
    display: inline-block;
    overflow: hidden;
    border: 1px solid $vbColorsGY02;
    border-radius: $vbFontBorderRadius;
    background-color: #fff;
    transition-duration: 0.2s;
    transition-property: border-color, background-color, color;

    &--disabled {
      background-color: $vbBaseColor1;
      cursor: not-allowed;
    }

    &--error {
      border-color: $vbAlertColor;
    }

    &--widthXSmall {
      width: 4rem;
    }

    &--widthSmall {
      width: 7rem;
    }

    &--widthMedium {
      width: 11rem;
    }

    &--widthLarge {
      width: 24rem;
    }

    &--widthFull {
      width: 100%;
    }
  }

  &__flex {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    min-height: $vbFormControlHeight;
  }

  &__field {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 1rem;

    &--maxSelectionCountReached {
      width: $vbMinimum;
      height: $vbMinimum;
      clip: rect(1px 1px 1px 1px);
      position: absolute;
      left: 0;
      top: 0;
      overflow: hidden;
    }
  }

  &__list {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: fit-content;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  &__listItem {
    margin: $vbXSmallSize;
    max-width: calc(100% - #{$vbXSmallSize * 2});
  }
}
