.d-select-dropdown-portal {
  max-height: 200px;
  overflow: auto;
  z-index: 2000;
}

.d-select {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.d-select-value-container {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  flex: 1;

  > * {
    display: inline-block;
  }
}

.d-select-placeholder {
  color: var(--d-color-neutral-30);
}

.d-select-value {
  @extend .d-text-body-m;
}

.d-select-arrow {
  display: flex;
  color: var(--d-color-neutral-80);
  margin-left: 10px;
}

.d-select-arrow-left {
  flex-direction: row-reverse;
  justify-content: flex-end;

  .d-select-arrow {
    margin-left: 0;
    margin-right: 10px;
  }
}

.d-select-option {
  display: flex;
  font-family: var(--d-font-stacks);
  align-items: center;
  padding: 4px 16px;
  @extend .d-text-body-m;
  &:not(.d-select-option-disabled):hover {
    cursor: pointer;
    background-color: var(--d-color-neutral-05);
  }
}

.d-select-option-selected {
  background-color: var(--d-color-neutral-05);
  font-weight: 500;
}

.d-select-option-disabled {
  color: var(--d-color-neutral-30);
  cursor: not-allowed;
}

.d-select-searchable-input {
  position: absolute;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  top: 50%;
  left: 16px;
  right: 40px;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--d-color-neutral-80);
  text-overflow: ellipsis;
  display: none;

  &.opened {
    display: inline-flex;
  }
}

.d-select-multiple {
  .d-select-placeholder {
    padding-left: 9px;
  }

  .d-select-label-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin: -2px;
  }

  .d-select-value {
    display: flex;
    align-items: center;
    border-radius: 4px;
    background-color: var(--d-color-neutral-10);
    margin: 2px;
    overflow: hidden;

    > :first-child {
      color: var(--d-color-neutral-80);
      display: flex;
      padding: 4px;
      &:hover {
        background-color: var(--d-color-neutral-20);
      }
    }

    > :nth-child(2) {
      width: 1px;
      align-self: stretch;
      background-color: var(--d-color-neutral-05);
    }

    > :last-child {
      color: var(--d-color-neutral-80);
      padding: 0 4px;
      margin-top: 2px;
    }
  }

  .d-select-searchable-input.relative {
    position: relative;
    top: unset;
    left: unset;
    right: unset;
    transform: unset;
    flex: 1;
    min-width: 100px;
    padding: 0 4px;
  }
}

.d-select-truncated-label {
  .d-select-value,
  .d-select-placeholder {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
}

.d-select-clearable {
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;

  &:hover {
    background-color: var(--d-color-neutral-20);
  }
}

.d-field-input-wrapper:hover .d-select,
.d-select:hover {
  .d-select-clearable {
    visibility: visible;
  }
}
