@import 'Variables';
@import 'FacetValues';
@import 'FacetVariables';

.coveo-facet-search-results {
  position: absolute;
  left: $facet-value-padding;
  right: $facet-value-padding;
  @include defaultRoundedLowContrastBorder();
  background-color: white;
  list-style: none;
  margin: 0 0 3px;
  padding: 0 0 10px;
  z-index: 999;
  input[type='checkbox'] {
    display: none;
  }
  max-height: 200px;
  overflow-x: hidden;
  overflow-y: scroll;
  -ms-overflow-style: scrollbar;
  font-size: $font-size-smallest;
  .coveo-with-computed-field {
    .coveo-facet-value-count,
    .coveo-facet-value-computed-field {
      top: 0;
    }
  }
  &.coveo-no-results {
    display: none;
    visibility: hidden;
  }
  .coveo-facet-value {
    @include facetValuesCheckboxes('smaller');
    .coveo-facet-value-checkbox {
      position: relative;
      top: 5px;
    }
  }
  .coveo-facet-value-exclude {
    right: 10px;
  }
  .coveo-facet-value-label {
    padding-right: 15px;
  }
  .CoveoFacet & {
    margin-top: -1px;
  }
  .CoveoCategoryFacet & {
    line-height: normal;
  }
}

.coveo-facet-search-selectable {
  margin: 0;
  padding: 0 10px;
}

.coveo-facet-search-current-result {
  background-color: $color-blueish-white-grey;
}

.coveo-facet-search-select-all {
  margin: 0;
  padding: 10px;
  font-weight: bold;
  @include clickable();
}

.coveo-facet-search-clear {
  float: right;
  margin-right: 3px;
  cursor: pointer;
  opacity: 0.5;
  clear: none;
  @include clearButton('&', 'small');
  &:hover {
    opacity: 1;
  }
}

.coveo-facet-search-input {
  border: 0;
  padding: 1px 0 0;
  margin: 0;
  font-size: 13px;
  width: 100%;
  background-color: inherit;
  line-height: 15px;
  &[value=''] {
    color: $color-light-grey;
  }
}

@keyframes grow {
  0% {
    margin-right: 200px;
  }
  100% {
    margin-right: $facet-value-padding;
  }
}

.coveo-facet-search {
  @include defaultRoundedLowContrastBorder();
  position: relative;
  background: white;
  display: none;
  margin: 2px $facet-value-padding 1px;
  padding: 4px;

  &:not(.without-animation) {
    @include animation(grow 0.3s linear);
  }
}

.coveo-facet-searching {
  .coveo-facet-search {
    display: block;
  }
}

.coveo-facet-search-no-results {
  + .coveo-facet-search-results {
    padding: 0;
    overflow-y: hidden;

    @at-root .coveo-facet-value-not-found {
      margin: 1px;
      padding: 4px 9px;
      font-size: 13px;
    }
  }
}

.coveo-facet-search-magnifier {
  float: left;
}

.coveo-facet-search-magnifier-svg {
  margin: 5px 6px 5px 10px;
  width: 10px;
  height: 10px;
  color: $color-blueish-gray;
}

.coveo-facet-search-wait-animation {
  float: left;
}

.coveo-facet-search-wait-animation-svg {
  width: 13px;
  height: 13px;
  color: $color-greyish-teal-blue;
  margin: 3px 3px 5px 10px;
  @include animation-name(coveo-spin);
  @include animation-timing-function(linear);
  @include animation-duration(1s);
  @include animation-iteration-count(infinite);
}

.coveo-facet-search-middle {
  overflow: hidden;
  line-height: 19px;
}

.coveo-facet-value.coveo-facet-search-button {
  color: $coveo-blue;
  .coveo-facet-value-checkbox {
    border-style: dashed;
  }
  &:hover .coveo-facet-value-checkbox,
  .coveo-facet-value-checkbox:focus {
    border-style: solid;
  }
}

.coveo-facet-searching {
  .coveo-facet-value.coveo-facet-search-button {
    display: none;
  }
}

.coveo-facet-value.coveo-facet-search-button {
  .coveo-facet-value-checkbox {
    bottom: 1px;
    svg {
      bottom: 3px;
      .coveo-more-svg {
        fill: grey;
      }
    }
  }
  .coveo-facet-value-checkbox > .coveo-facet-value-checkbox-svg,
  &:hover .coveo-facet-value-checkbox > .coveo-facet-value-checkbox-svg {
    color: grey;
    width: 16px;
    height: 11px;
  }
}
