$dsbf_fontColor        : #999;
$dsbf_headingColor     : #2F2F2F;
$dsbf_borderColor      : #E7E7E7;
$dsbf_backgroundColor  : #EEE;
$dsbf_accentColor      : #2EA3F2;
$dsbf_accentColorLight : #EAF5FD;
$dsbf_red              : #CF202A;
$dsbf_lineHeight       : 1.7em;
$dsbf_fontSize         : 14px;
$dsbf_checkboxSize     : 18px;
$dsbf_boxShadow        : 0 8px 30px 0 rgba(61, 59, 56, 0.07);
$dsbf_transition       : all 0.2s ease-in-out;

// Icons:
// e800 search
// e801 arrow down
// e802 arrow up
// e803 check
// e804 close

@mixin inputField() {
  outline          : none;
  width            : 100%;
  border-width     : 0;
  border-style     : solid;
  border-radius    : 0;
  background-color : $dsbf_backgroundColor;
  border-color     : $dsbf_backgroundColor;
  color            : $dsbf_fontColor;
  font-size        : $dsbf_fontSize;
  line-height      : $dsbf_lineHeight;
  transition       : $dsbf_transition;
  }

@mixin DSBfont($icon) {
  content                 : $icon;
  font-family             : "Divi Shop Builder";
  font-style              : normal;
  font-variant            : normal;
  -webkit-font-smoothing  : antialiased;
  -moz-osx-font-smoothing : grayscale;
  font-weight             : 400;
  line-height             : 1;
  }

/*----------- Filter ----------------*/

.ags-wc-filters-section {

  /* Filter Inner */
  .ags-wc-filters-section-inner {
    ul {
      list-style : none !important;
      padding    : 0;
      }
    }

  /* Toggled section */
  &.ags-wc-filters-section-toggle-closed {
    .ags-wc-filters-section-inner {
      display : none;
      }
    }
  }


/*----------- Filter Title ----------------*/

.ags_woo_products_filters .ags-wc-filters-section-title {
  h4 {
    font-size      : 16px;
    line-height    : 1.2em;
    font-weight    : 600;
    padding-bottom : 0;
    }
  }

.ags-wc-filters-section-title {
  &::after {
    display : none;
    }

  /* Title Toggled */
  &.ags-wc-filters-section-toggle {
    position        : relative;
    cursor          : pointer;
    display         : flex;
    flex-wrap       : nowrap;
    justify-content : space-between;
    align-items     : center;

    h4 {
      flex : 1;
      }

    &::after {
      @include DSBfont("\e801");
      display   : block;
      color     : inherit;
      font-size : 20px;
      }
    }
  }

.ags-wc-filters-section-toggle-closed .ags-wc-filters-section-title.ags-wc-filters-section-toggle:after {
  content : "\e802";
  }


/*----------- Buttons ----------------*/

.ags-wc-filters-buttons {
  display     : flex;
  flex-wrap   : wrap;
  align-items : flex-start;
  }

.ags-wc-filters-buttons, .ags-wc-filters-selected-main {
  .ags-wc-filters-button {
    cursor : pointer;

    &.ags-wc-filters-button-clear {
      border-color     : $dsbf_red;
      background-color : $dsbf_red;
      color            : #FFF;
      }
    }
  }

/*----------- Checkboxes & Radio buttons  ----------------*/

.ags-wc-filters-checkbox-list, .ags-wc-filters-radio-button-list {
  list-style : none !important;
  padding    : 0;

  li {
    display  : inline-block;
    width    : 100%;
    position : relative;

    label {
      transition : $dsbf_transition;
      cursor     : pointer;
      position   : relative;
      }
    }
  }

.ags-wc-filters-list-child {
  padding-left : 24px !important;
  }

/*----------- Product Count ----------------*/

.ags-wc-filters-product-count {
  flex-shrink : 0;
  }


/*----------- Search Field ----------------*/

.ags-wc-filters-search-container {

  .ags-wc-filters-search-input-wrapper {
    background-color : $dsbf_backgroundColor;
    transition       : $dsbf_transition;
    border-style     : solid;
    }

  input[type="search"] {
    outline      : none;
    width        : 100%;
    border-width : 0 !important;
    color        : $dsbf_fontColor;
    font-size    : $dsbf_fontSize;
    line-height  : $dsbf_lineHeight;
    transition   : $dsbf_transition;
    background   : transparent !important;
    }

  &.ags-wc-filters-search-with-icon {

    .ags-wc-filters-search-input-wrapper {
      display     : flex;
      align-items : center;
      position    : relative;

      input[type="search"] {
        flex : 1;
        }

      &:after {
        @include DSBfont("\e800");
        padding : 0 10px;
        }
      }
    }

  &.ags-wc-filters-search-with-suggestions {
    display  : inline-block;
    position : relative;
    width    : 100%;
    }
  }

/*----------- Dropdown ----------------*/

.ags-wc-filters-search-container.ags-wc-filters-search-with-suggestions .ags-wc-filters-search-suggestions-container,
.ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options,
.ags-wc-filters-dropdown-multi .ags-wc-filters-dropdown-multi-options {
  display          : none;
  position         : absolute;
  right            : 0;
  top              : 100%;
  width            : 100%;
  z-index          : 9999;
  background-color : #FFF;

  li {
    a {
      display         : block;
      text-decoration : none;
      color           : inherit;

      &:hover {
        transition : $dsbf_transition;
        cursor     : pointer;
        }
      }
    }
  }


/*----------- Select Fields ----------------*/

.ags-wc-filters-dropdown-single,
.ags-wc-filters-dropdown-multi {
  display  : inline-block;
  position : relative;
  width    : 100%;
  }

.ags-wc-filters-dropdown-single .ags-wc-filters-active > a,
.ags-wc-filters-dropdown-multi .ags-wc-filters-active > span {
  position      : relative;
  display       : block;
  cursor        : pointer;
  z-index       : 2;
  @include inputField;
  padding-right : 30px !important;

  &::before {
    @include DSBfont("\e801");
    display          : inline-block;
    position         : absolute;
    right            : 0;
    top              : 50%;
    transform        : translateY(-50%);
    font-size        : 20px;
    background-color : inherit;
    padding          : 0 5px;
    }
  }

// Dropdown
.ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options,
.ags-wc-filters-dropdown-multi .ags-wc-filters-dropdown-multi-options {
  .ags-wc-filters-list-child {
    padding-left : 25px;
    }
  }

// Dropdown list item text
.ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options li a > span,
.ags-wc-filters-dropdown-multi .ags-wc-filters-dropdown-multi-options label {
  display     : flex;
  width       : 100%;
  align-items : center;
  color       : inherit;
  cursor      : pointer;
  }

// List item active
.ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options li a.ags-wc-filters-active > span:after,
.ags-wc-filters-dropdown-multi .ags-wc-filters-dropdown-multi-options input:checked + label:after {
  @include DSBfont("\e803");
  font-size   : 20px;
  margin-left : auto;
  }

.ags-wc-filters-dropdown-single .ags-wc-filters-active span.value,
.ags-wc-filters-dropdown-single .ags-wc-filters-dropdown-single-options span.value {
  display : none;
  }

/*----------- Single Select Fields ----------------*/

.ags-wc-filters-dropdown-single {
  .option {
    position : relative;
    }
  }

/*----------- Multiple Select Fields ----------------*/

.ags-wc-filters-dropdown-multi {
  .ags-wc-filters-dropdown-multi-options {
    input[type="checkbox"] {
      padding       : 0;
      height        : 0;
      width         : 0;
      margin-bottom : 0;
      display       : none;
      cursor        : pointer;
      }
    }

  .ags-wc-filters-active > span {
    white-space : nowrap;
    overflow    : hidden;
    }
  }


/*----------- Star Rating ----------------*/

.ags-wc-filters-stars-control {
  display     : flex;
  flex-wrap   : wrap;
  align-items : center;

  .ags-wc-filters-stars {
    margin-right : 5px;
    }
  }

.ags-wc-filters-stars {
  font-family : ETmodules;
  cursor      : pointer;
  line-height : 1;
  }


/*----------- Selected Section ----------------*/

.ags-wc-filters-selected-outer {
  display : none;
  }

.ags-wc-filters-selected-main {

  .ags-wc-filters-selected {
    display   : flex;
    flex-wrap : wrap;

    .ags-wc-filters-selected-inner {
      display      : inline-flex;
      align-items  : center;
      cursor       : default;
      border-width : 1px;
      border-style : solid;
      border-color : #DADADA;

      .ags-wc-filters-remove {
        cursor      : pointer;
        font-size   : 0;
        line-height : 0;

        &:before {
          @include DSBfont("\e804");
          }
        }
      }
    }
  }

// Show Selected Filters in Visual Builder
.et-fb .ags-wc-filters-selected-outer {
  display : block;
  }


/*----------- Tagcloud ----------------*/

.ags-wc-filters-tagcloud {
  display   : flex;
  flex-wrap : wrap;

  li {
    display : inline-block;

    label {
      display            : inline-flex;
      align-items        : center;
      justify-content    : center;
      border-radius      : 3px;
      -webkit-transition : $dsbf_transition;
      transition         : $dsbf_transition;
      cursor             : pointer;
      }

    input[type="radio"] {
      -webkit-appearance : none;
      -moz-appearance    : none;
      appearance         : none;
      display            : none;
      opacity            : 0;
      }

    input[type="radio"]:checked + label, input[type="radio"]:checked:hover + label {
      cursor : default;
      }
    }
  }


/*----------- Miscellanous ----------------*/

.d-none {
  display : none !important;
  }

.ags-wc-filters-hidden {
  display : none !important;
  }

/*----------- Price range ----------------*/

/* @license
This file includes code from range-slider, with or without modifications
https://github.com/slawomir-zaziablo/range-slider
range-slider is licensed under the following license.

MIT License

Copyright (c) 2017 Slawomir Zaziablo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

.ags-wc-filters-number-range-container {

  &.ags-wc-filters-number-range-slider_inputs {
    .rs-container {
      margin-bottom : 10px;
      }
    }

  &.ags-wc-filters-number-range-slider {
    .rs-container {
      margin-top : 40px;
      }
    }

  input.ags-wc-filters-slider {
    opacity : 0;
    }

  input[type="number"] {
    @include inputField;
    width : auto;
    }

  .rs-container {
    height   : 45px;
    position : relative;

    * {
      box-sizing            : border-box;
      -webkit-touch-callout : none;
      -webkit-user-select   : none;
      -khtml-user-select    : none;
      -moz-user-select      : none;
      -ms-user-select       : none;
      user-select           : none;
      }

    .rs-bg, .rs-selected {
      height   : 8px;
      left     : 0;
      position : absolute;
      top      : 0;
      width    : 100%;
      }

    .rs-selected {
      transition : $dsbf_transition;
      width      : 0;
      }

    .rs-pointer {
      cursor     : pointer;
      height     : 16px;
      width      : 16px;
      left       : 0;
      position   : absolute;
      top        : 0;
      transform  : translate(-25%, -25%);
      transition : $dsbf_transition;
      }

    .rs-scale {
      left        : 0;
      position    : absolute;
      top         : 0;
      white-space : nowrap;

      span {
        float    : left;
        position : relative;

        &:last-child {
          margin-left : -1px;
          width       : 0;
          }

        ins {
          color           : inherit;
          display         : inline-block;
          font-size       : 14px;
          margin-top      : 20px;
          text-decoration : none;
          }
        }
      }

    .rs-tooltip {
      color       : inherit;
      width       : auto;
      min-width   : 60px;
      height      : 30px;
      line-height : 30px;
      position    : absolute;
      transform   : translate(-50%, -35px);
      left        : 14px;
      text-align  : center;
      font-size   : 14px;
      padding     : 0 10px;
      cursor      : default;
      }

    &.rs-noscale {
      span {
        &::before {
          display : none;
          }

        &:first-child::before, &:last-child::before {
          display : block;
          }
        }
      }

    &.sliding {
      .rs-pointer, .rs-selected {
        transition : none;
        }
      }

    &.disabled {
      .rs-selected {
        background-color : #CCC;
        }

      .rs-pointer {
        background-color : #CCC;
        cursor           : default;
        }

      .rs-scale span ins {
        color : #999;
        }

      .rs-tooltip {
        background-color : #CCC;
        color            : #999;
        }
      }
    }
  }