@charset "UTF-8";
@import "./input.css";
@import "./common/var.css";

@component-namespace el {
  @b autocomplete {
    position: relative;
    display: inline-block;

    @e suggestions {
      position: absolute;
      left: 0;
      top: 110%;
      margin: 5px 0 0;
      background-color: var(--color-white);
      border: 1px solid var(--color-base-gray);
      width: 100%;
      padding: 6px 0;
      z-index: 10;
      border-radius: 2px;
      max-height: 280px;
      box-sizing: border-box;
      overflow: auto;
      box-shadow: 0 0 6px 0 rgba(0,0,0,0.04), 0 2px 4px 0 rgba(0,0,0,0.12);

      & li {
        list-style: none;
        line-height: 36px;
        padding: 0 10px;
        margin: 0;
        cursor: pointer;
        color: var(--color-extra-light-black);
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        &:hover {
          background-color: var(--select-option-hover-background);
        }
        &.highlighted {
          background-color: var(--color-primary);
          color: var(--color-white);
        }
        &:active {
          background-color: darken(var(--color-primary), 0.2);
        }
        &.divider {
          margin-top: 6px;
          border-top: 1px solid var(--color-base-gray);
        }
        &.divider:last-child {
          margin-bottom: -6px;
        }
      }

      @when loading {
        li {
          text-align: center;
          height: 100px;
          line-height: 100px;
          font-size: 20px;
          color: #999;
          @utils-vertical-center;

          &:hover {
            background-color: var(--color-white);
          }
        }

        & .el-icon-loading {
          vertical-align: middle;
        }
      }
    }
  }
}
