@import "../text-field/text-field.mixin";

.autocomplete__wrapper {
  position: relative;
}

.autocomplete__hint,
.autocomplete__input {
  @include text-field;

  .autocomplete__wrapper.has-error & {
    @include text-field--error;
  }
}

.autocomplete__input {
  position: relative;
  background-color: transparent;
}

.autocomplete__hint {
  // color: #BFC1C3; // TODO: is there a special color needed?
  position: absolute;
}

.autocomplete__input--focused,
.autocomplete__wrapper.has-error .autocomplete__input--focused { // for the sake of specifity
  @include text-field--focused;
}

.autocomplete__input--show-all-values {
  padding-right: 62px;
  cursor: pointer;
}

.autocomplete__dropdown-arrow-down {
  position: absolute;
  top: 14px; // 50% - height/2
  right: 20px;
  z-index: -1;
  display: inline-block;
  width: 12px;
  height: 12px;
  color: $color-dusty-gray;
  fill: currentColor;

  @include media-breakpoint-up(tablet) {
    top: 19px; // 50% - height/2
  }

  .autocomplete__input--focused + & {
    color: $color-axa-blue;
  }
}

.autocomplete__menu {
  width: 100%;
  max-height: 342px;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  color: $color-dusty-gray;
  background-color: #fff;
  border: 1px solid $color-silver;
  border-top: 0;
  border-bottom-width: 3px;
}

.autocomplete__menu--visible {
  display: block;
}

.autocomplete__menu--hidden {
  display: none;
}

.autocomplete__menu--overlay {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  // box-shadow: rgba(0, 0, 0, 0.256863) 0 2px 6px;
}

.autocomplete__menu--inline {
  position: relative;
}

.autocomplete__option {
  position: relative;
  display: block;
  // display: flex;
  // align-items: center; won't work in IE :(
  min-height: 35px;
  padding: 7px 20px;
  cursor: pointer;

  @include media-breakpoint-up(tablet) {
    min-height: 40px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

.autocomplete__option > * {
  pointer-events: none;
}

.autocomplete__option--focused,
.autocomplete__option:hover {
  color: $color-axa-blue;
  background-color: $color-wild-sand;
  outline: none;
}

.autocomplete__option--no-results {
  //color: $color-axa-blue;
  // stylelint-disable-next-line
  cursor: not-allowed;
  //background-color: $color-wild-sand;
  outline: none;
}

.autocomplete__hint,
.autocomplete__input,
.autocomplete__option {
  @include typo-18;
}
