.filter {
  .accordion__content {
    padding: 20px 0 0;
  }

  &__facet-cta {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: $blue;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 22px;

    &:focus {
      outline: none;
    }

    &:focus-visible {
      outline: auto;
    }
  }

  &__item {
    margin-bottom: 20px;

    &:last-child {
      margin-bottom: 0;
    }
  }

  &.category-filter {
    .accordion__content {
      padding-top: 5px;
    }
  }

  &-quantity {
    color: $warm-grey;
  }
}

.filter-results {
  .accordions {
    overflow: auto;
    max-height: calc(100vh - 137px);
    // prevents Top Facets from being bold
    will-change: transform;
    transform: translate3d(0, 0, 0);
  }

  &_mobile {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  &_desktop {
    position: sticky;
  }

  &__heading {
    padding: 12px 0;
    position: sticky;
    background-color: $white;
    z-index: $filters;

    &:before {
      content: '';
      bottom: 100%;
      left: 0;
      position: absolute;
      width: 100%;
      height: 40px;
      background: $white;
    }

    .link-secondary {
      text-decoration: none;
      float: right;
    }

    .flex {
      margin-bottom: 8px;
    }
  }

  &__actions {
    padding-top: 40px;
  }

  &__clear {
    @include link-primary;
    float: right;
    margin-top: 2px;
    background-color: transparent;
    border: 0;
    text-decoration: underline;
    padding: 0;

    &:hover {
      cursor: pointer;
    }
  }

  .custom-scroll {
    &[data-simplebar] {
      max-height: 234px;
    }
  }
}

.hidden-state {
  display: none;
}

@include media-breakpoint-down(sm) {
  .is-filters-visible {
    position: fixed;
  }

  .filter-results {
    &_desktop {
      display: none;
    }

    &__heading {
      padding-bottom: 20px;
    }
  }
}

.page-responsiveThematicProductListPage {
  .sort-products-list {
    @include make-row;
    justify-content: space-between;
  }

  .filter-results_mobile {
    display: none;
    padding: 20px 15px;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: $zindex-modal;
    background-color: $white;
    overflow-y: auto;

    &.show {
      display: block;
    }

    &__close-holder {
      display: block;
    }

    .filter-results {
      &__heading:before {
        display: none;
      }

      &__close-holder {
        margin-bottom: 10px;
        text-align: right;
      }

      &__btn-close {
        color: $warm-grey;
        font-size: 1rem;
      }
    }
  }
}

@include media-breakpoint-up(md) {
  .filter-results {
    &__heading {
      padding-top: 0;
    }

    &_mobile,
    &__actions,
    &__close-holder {
      display: none;
    }
  }

  .page-responsiveThematicProductListPage {
    .filter-results {
      &_desktop {
        display: block;
        position: static;
      }

      &__heading {
        position: static;
      }
    }
  }
}
