.complete-card-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 18px;
  overflow: visible;

  &__toggle {
    @include font-size(14);
    @include line-height(24);

    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
    padding: 7px 12px;
    overflow: hidden;
    border: 1px solid $gray;
    border-radius: 4px;
    background-color: $white;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
  }

  &__value {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__icon {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    pointer-events: none;
    color: $blue;
    transition: transform 0.2s;
  }

  &__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: $dropdown-z-index;
    display: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 220px;
    padding-top: 4px;
    overflow-y: auto;
    border-radius: 3px;
    background-color: $white;
    box-shadow: 0 0 15px $black-transparent20;
  }

  &__option {
    @include font-size(14);
    @include line-height(20);

    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    background-color: $white;
    color: $blue-dark;
    text-align: left;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    cursor: pointer;
    outline: none;

    &:first-of-type {
      pointer-events: none;
    }

    &:hover,
    &:focus {
      background-color: $ma-white;
      outline: none;
    }

    &--selected {
      border-color: $black;
    }
  }

  &__error {
    @include font-size(12);
    @include line-height(16);

    display: none;
    margin-top: 4px;
    color: $red;
    font-weight: 400;
  }

  &--open {
    .complete-card-dropdown {
      &__toggle {
        border-color: $blue;
      }

      &__icon {
        transform: rotate(180deg);
      }

      &__menu {
        display: block;
      }
    }
  }

  &--error {
    .complete-card-dropdown {
      &__toggle {
        border-color: $red;
      }

      &__error {
        display: block;
      }
    }
  }
}

@include media-breakpoint-up(md) {
  .complete-card-dropdown {
    &__error {
      position: absolute;
      top: 44px;
    }
  }
}

@include media-breakpoint-down(sm) {
  .complete-card-dropdown {
    &__toggle {
      @include font-size(14);
    }
  }
}

@media screen and (max-width: 375px) {
  .complete-card-dropdown {
    margin-bottom: 5px;

    &__toggle {
      @include font-size(12);

      column-gap: 8px;
      padding: 7px 12px;
    }
  }
}
