@use 'functions/color' as *;
@use 'functions/get-var' as *;
@use 'mixins/shadow' as *;
@use 'variables' as *;

// Autocomplete
.form-autocomplete {
  position: relative;

  .form-autocomplete-input {
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    height: auto;
    // min-height: $unit-8; // old spectre.css
    min-height: get-var('unit-8');
    // padding: $unit-h; // old spectre.css
    padding: get-var('unit-h');

    &.is-focused {
      @include control-shadow();
      // border-color: $primary-color; // old spectre.css
      border-color: color('primary-color');
    }

    .form-input {
      border-color: transparent;
      box-shadow: none;
      display: inline-block;
      flex: 1 0 auto;
      // height: $unit-6; // old spectre.css
      height: get-var('unit-6');
      // line-height: $unit-4; // old spectre.css
      line-height: get-var('unit-4');
      // margin: $unit-h; // old spectre.css
      margin: get-var('unit-h');
      width: auto;
    }
  }

  .menu {
    left: 0;
    position: absolute;
    top: 100%;
    width: 100%;
  }

  &.autocomplete-oneline {
    .form-autocomplete-input {
      flex-wrap: nowrap;
      overflow-x: auto;
    }

    .chip {
      flex: 1 0 auto;
    }
  }
}
