/* Filter */
.filter {
  text-align: center;
  margin-bottom: 60px;
  margin-top: 60px;
  @include media-breakpoint-down(md){
    margin-bottom: 15px;
    margin-top: 0;
  }
}


/* FILTER OPTIONS */
.filter-options {
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility 0.2s;
  position: absolute;
  left: 0;
  right: 0;
  top: 115%;
  z-index: 99;
  text-transform: none;
  font-weight: $font-weight-bold;
  font-size: $font-size-18;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 0 10px rgb(0 0 0 / 50%);

  > div {
    padding: 15px 25px;
    position: relative;
    &.disabled span {
      opacity: 0.4;
    }

    &:hover {
      filter: brightness(1.2);
    }
  }

}

.filter-red .filter-options {
  background: $secondary-color;
}

.filter-darkblue .filter-options {
  background: $tertiary-color;

}

.filter-lightblue .filter-options {
  background: $quaternary-color;

}


.filter.border-rounded .filter-options {
  border-radius: 26px;
}

.filter-elements .btn-filter {
  text-transform: none;
  font-weight: $font-weight-bold;
  font-size: $font-size-16;
  margin: 5px 15px;
  padding: 15px 10px;
  border-radius: 360px;
  color: $white;
  border: none;

  @include media-breakpoint-down(md){
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .btn-filter-content {

    .icon{
      background: none;
    }
  }

  .icon-select img {
    width: 23px;
    height: 13px;
    margin-left: 10px;
  }

  &:active{
    .btn-filter-content {
      .icon{
        background: none;
      }
    }
  }
}

.filter.border-rounded .btn-filter {
  border-radius: 26px;
}

.filter-elements {
  text-align: center;
  text-transform: uppercase;

  .row > div:not(.d-grid) {
    display: block;
  }

  .row > div.disabled {
    display: none;
  }

  .btn-filter{
    &:hover, &:active, &:focus, &:active:focus{
      color: $white;
      box-shadow: 0 0 15px rgba(0,0,0,0.3);
    }
  }

  .filter-options div{
    overflow: hidden;

    &:hover:before{
      background: rgba(0,0,0,0.1);
      content: "";
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
    }
  }

  .box, .btn-filter {

    &:focus {
      .filter-options {
        opacity: 1;
        visibility: visible;
      }
    }

    &.filter-red {
      background: $tertiary-color;

      .figure {

        &:before {
          background: transparent linear-gradient(180deg, $secondary-color 0%, $tertiary-color 100%) 0% 0%;
        }
      }
    }

    &.filter-darkblue {
      background: $tertiary-color;

      .figure {

        &:before {
          background: transparent linear-gradient(180deg, $tertiary-color 0%, $tertiary-color 100%) 0% 0%;
        }
      }
    }

    &.filter-lightblue {
      background: $quaternary-color;

      .figure {

        &:before {
          background: transparent linear-gradient(180deg, $quaternary-color 0%, $quaternary-color 100%) 0% 0%;
        }
      }
    }
  }
}

/* SELECTED FILTER OPTIONS */

.filter-active-options{
  margin-top: $spacer;
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  > div {
    padding: 0 8px;
    margin: 4px;
    font-size: $font-size-sm;
    font-weight: $font-weight-light;
    border: solid 1px $secondary-color;
    color: $secondary-color;
    display: flex;
    flex-direction: row;
    align-items: center;

    .icon {
      cursor: pointer;
      margin-left: 6px;
      display: inline-block;
      height: 12px;
      width: 12px;
      background-color: $secondary-color
    }
  }
}
.filter.border-rounded .filter-active-options > div {
  border-radius: 500px;
}

/* Filter - Bar (Wo wird das eingesetzt?)*/
.filter-bar {
  width: 100%;
  float: none;
  display: inline-block;
  vertical-align: top;
  text-align: center;
  position: relative;
  z-index: 5;
  margin-bottom: 40px;

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

  .filter-title-sm {
    width: 100%;
    height: 50px;
    float: left;
    display: none;
    font-weight: $font-weight-bold;
    font-size: $font-size-18;
    color: $primary-color;
    line-height: $line-height-50;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    background: $orange;
    border-radius: $border-radius;
    position: relative;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding: 0 20px;

    .count {
      width: 20px;
      height: 20px;
      float: none;
      display: inline-table;
      vertical-align: middle;
      font-weight: $font-weight-bold;
      font-size: $font-size-12;
      color: $orange;
      line-height: $line-height-20;
      text-align: center;
      background: $primary-color;
      border-radius: $border-radius;
      position: relative;
      top: -2px;
      margin-left: 10px;
    }
  }

  .filter-item-out {
    width: 102.74%;
    float: none;
    display: inline-block;
    vertical-align: top;
    margin: 0 -1.37% -30px -1.37%;
  }

  .filter-item {
    width: 30.59%;
    max-width: 345px;
    display: inline-block;
    vertical-align: top;
    position: relative;
    margin: 0 1% 30px 1%;

    .filter-title {
      width: 100%;
      height: 50px;
      float: left;
      font-weight: $font-weight-bold;
      font-size: $font-size-18;
      color: $tertiary-color;
      line-height: $line-height-46;
      text-align: left;
      text-decoration: $link-hover-decoration-none;
      border: 2px solid $gray-a2;
      border-radius: $border-radius;
      cursor: pointer;
      background: $primary-color;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      position: relative;
      padding: 0 70px 0 56px;
      margin: 0;

      &:before {
        content: "";
        width: 16px;
        height: 46px;
        float: left;
        background: url(../img/icon-3.svg) no-repeat center right;
        background-size: auto 16px;
        position: absolute;
        top: 0;
        left: 30px;
      }

      &:after {
        content: "\f078";
        width: 70px;
        height: 50px;
        float: right;
        font-family: "Font Awesome 5 Pro";
        font-weight: $font-weight-bold;
        font-size: $font-size-20;
        line-height: $line-height-50;
        text-align: center;
        position: absolute;
        top: 0;
        right: 0;
      }

      &.active {
        &:after {
          content: "\f077";
        }
      }
    }

    ul {
      width: 100%;
      float: left;
      display: none;
      text-align: left;
      background: $primary-color;
      border: 2px solid $gray-a2;
      border-radius: 25px 25px;
      position: absolute;
      top: 48px;
      left: 0;
      z-index: 6;
      padding: 20px 0;
      margin: 0;

      li {
        width: 100%;
        float: left;
        font-weight: $font-weight-bold;
        font-size: $font-size-18;
        color: $tertiary-color;
        line-height: $line-height-22;
        padding: 0;
        margin: 0;

        &:before {
          display: none;
        }

        a {
          width: 100%;
          float: left;
          color: $tertiary-color;
          text-decoration: $link-hover-decoration-none;
          padding: 8px 30px;

          &:hover,
          &:focus,
          &.active {
            color: $quaternary-color;
          }
        }
      }
    }

    &:nth-child(2) {
      .filter-title {
        &:before {
          background-image: url(../img/icon-4.svg);
        }
      }
    }

    &:nth-child(3) {
      .filter-title {
        &:before {
          background-image: url(../img/icon-5.svg);
        }
      }
    }
  }

  @include media-breakpoint-up(md) {
    .filter-item-out {
      display: block !important;
    }
  }

  @include media-breakpoint-down(md) {
    max-width: 460px;
    margin-bottom: 30px;

    .filter-title-sm {
      display: inline-block;
    }

    .filter-item-out {
      width: 100%;
      display: none;
      margin: 0;
    }

    .filter-item {
      width: 100%;
      max-width: 100%;
      margin: 30px 0 0 0;
    }
  }
}