$control-height: em(70px);
$icon: em(40px);
$container-width: em(400px);
$result-width: $container-width;
$result-max-height: em(300px);
$result-left: em(10px);
$result-top: $control-height + .2;

&.#{map-get($input-text, container)} {
  position: absolute;
  width: $container-width;
  height: $control-height;
  top: .5em;
  left: calc(50% - #{$container-width / 2});
  box-sizing: border-box;

  *,
  *::before,
  *::after {
    box-sizing: inherit;
  }
}
.#{map-get($input-text, control)} {
  position: relative;
  width: 100%;
  height: $control-height;
  border: 1px solid #ccc;
  background-color: #fff;
  overflow: hidden;
}
.#{map-get($input-text, label)} {
  display: inline-block;
  width: 100%;
  text-align: center;
}
.#{map-get($input-text, input)} {
  position: absolute;
  z-index: $z-index;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 5px 30px 5px 40px;
  border: none;
  text-indent: 6px;
  background-color: transparent;
  font-family: inherit;
  font-size: $font-medium;

  &:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px #4d90fe, inset 0 0 6px #4d90fe;
  }
}
.#{map-get($input-text, search)} {
  position: absolute;
  z-index: $z-index + 1;
  top: 0;
  right: 0;
  width: $icon;
  height: 100%;
  line-height: 100%;
  border: none;
  background-color: transparent;
  display: inline-block;
  vertical-align: middle;
  outline: 0;
  cursor: pointer;

  &::after {
    content: "\2386";
    display: inline-block;
    color: #333;
    font-size: $font-big * 2;
    cursor: pointer;
  }
}
.#{map-get($input-text, icon)} {
  position: absolute;
  top: 26px;
  left: 9px;
  z-index: $z-index + 1;
  display: inline-block;
  width: $icon;
  height: 100%;
}
.#{map-get($input-text, icon)}:after {
  content: "\1F50D";
}

ul.#{map-get($input-text, result)} {
  position: absolute;
  top: $result-top;
  left: 0;
  width: $result-width;
  max-height: $result-max-height;
  white-space: normal;
  list-style: none;
  padding: 0;
  margin: 0;

  background-color: white;
  border-radius: 4px;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.8);

  transition: max-height 300ms ease-in;

  > li {
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    padding: 0;
    @include line-height(14);

    > a {
      display: block;
      text-decoration: none;
      padding: 3px 5px;

      &:hover {
        background-color: rgb(212, 212, 212);
      }
    }
  }

  > li:nth-child(odd) {
    background-color: rgb(224, 255, 224);
  }
}

ul.#{map-get($input-text, result)}:empty {
    display: none;
}
