#kvcoreidx-properties-search {
  margin-bottom:-50px;
  z-index:12;
  border-top:1px solid #e5e5e5;
  padding-top:10px;
}
.kv-quicksearch-bar {
  margin-bottom:0!important;
  border-top:0!important;
  padding-top:0!important;
  .kv-properties-search-form {
    .kv-properties-search-filters {
      margin-left:5px;
    }
    .kv-properties-search-areas {
      width:85%;
    }
    .kv-properties-search-areas.kv-filters-areas-has-filters {
      width:70%;
    }
    .kv-properties-search-filters,
    .kv-properties-search-submit {
      width:15%;
    }
    #kv-properties-alerts {
      display:none;
    }
    @media (max-width: map_get($grid-breakpoints, 'sm') - 1) {
      .kv-properties-search-areas,
      .kv-properties-search-submit,
      .kv-properties-search-areas.kv-filters-areas-has-filters {
        width:100%;
      }
      .kv-properties-search-filters {
        padding-right:10px;
        width:100%;
      }
    }
  }
  
}

@media (max-width: map_get($grid-breakpoints, 'lg') - 1) {
  #kvcoreidx-properties-search {
    margin-bottom:0;
  }
  
}

.kv-properties-search {
  
  .kv-filters {
    display: table;
    height: 100%;
    padding: 0;
    width: 100%;
  }
  @media (max-width: map_get($grid-breakpoints, 'md') - 1) {
    .kv-properties-search-form {
      width:100%;
    }
    
  }
  &-form {
    @extend %kv-col-12, %kv-col-md-12;
    @extend .kv-no-gutters;

    display:flex;
    vertical-align:top;
    padding:0;

    & > .kv-form-group {
      display: flex;
      flex-direction: row;
      align-items: center;
      padding: 0 5px 0 0;
    }

    & > .kv-properties-search-filters {
      margin-left:auto;
      margin-right:10px;
      z-index:10;
    }


    .kv-properties-search-areas {
      min-width:420px;
      max-width:600px;

      .kv-multiple-select {
        padding-left:10px;
      }
      .kv-multiple-select-token-container {
        white-space:normal;
        margin:4px 0;
      }

      .kv-multiple-select-container {
        padding:0!important;
        .kv-multiple-select-search-container {
          height:38px;
          overflow-y:scroll;
          align-items:unset;
        }
        .kv-form-label-button {
          text-transform: none;
        }
      }

      &.kv-filters-areas-no-filters {
        @extend %kv-col-12, %kv-col-md-10;
      }

      & > .view-content {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
      }
    }

    .kv-properties-search-price {
      @extend %kv-col-12, %kv-col-sm-6, %kv-col-md-6, %kv-col-lg-1;
    }

    .kv-properties-search-beds-baths {
      @extend %kv-col-12, %kv-col-sm-6, %kv-col-md-6, %kv-col-lg-2;

      & > div:first-of-type {
        margin-right: 5px !important;
      }
    }

    .kv-properties-search-submit {
      max-width: none;
      padding: 0;
      z-index: 9;

      @media (max-width: map_get($grid-breakpoints, 'md') - 1) {
        #kv-filters-submit {
          margin:5px !important;
        }
      }

      #kv-filters-submit {
        width: 100%;
        padding:10px;
        margin:0;
        border-radius:0;
        border:1px;
      }
    }

    @media (max-width: map_get($grid-breakpoints, 'lg') - 1) {
      #kv-properties-alerts { 
        margin-bottom:0.5em;
      }
    }

    #kv-properties-alerts {
      z-index:9;
      padding-left:5px;
      display:flex;
      flex-direction:row;
      align-items:center;

      .profile-alerts-link {
        position: relative;
        line-height: 18px;
        font-size: 0.75em;
        text-transform: uppercase;
        cursor: pointer;
        overflow: hidden;
        padding:10px;
        border-radius:0;
        border:1px;
        margin:0;
      }
  
      .profile-alerts-link:focus {
        outline: none;
      }
    }

    .kv-filters-control-container {
      position: relative;
      flex: 1;

      & > button {
        width: 100%;
      }

      .kv-filters-container {
        position: absolute;
        top: 100%;
        min-width: 75px;
        margin-top: 8px;
        background-color: #f2f2f2;
        z-index: 100;

        &.kv-collapsed {
          display: none;
        }

        .kv-border-container {
          display: flex;
          flex: 1;
	        float: left;
	        width: 50%;

          .kv-border-right {
            flex: 1 auto;
            width: 100%;
            margin-bottom: 0;
            padding: 5px;
          }
        }
      }

      .kv-radio-container {
        display: flex;
        flex-direction: column;
	      clear: both;
        width: 100%;
        max-height: 1415px;
        overflow: hidden;
      }

      .kv-radio-container-label {
        text-align: center;
        margin-bottom: 5px;
        border-bottom: 1px solid #aaaaaa;
      }

      #kv-filters-container-more {
        right: 0;
        max-width: 800px;
        width: calc(40vw - 14px)!important;
        padding: 0!important;
        height: calc(100vh - 64px);

        .filters-container-more-wrapper {
          overflow-x:scroll;
          height: calc(100% - 60px);
        }

        .kv-row {
          margin: 10px 15px;

          & > div, & > fieldset, & > .kv-properties-search-submit {
            @extend %kv-col-12;
          }

          &:last-of-type, label {
            margin-bottom: 0;
          }
          .kv-field-full-width {
            flex:none;
            max-width:100%;
          }
          &-bordertop {
            border-top:1px solid #d1d1d1;
            margin:0;
            h3 {
              margin:15px 30px 0 30px;
              font-size:17px;
            }
          }
          &-multiselect {
            margin:15px 30px;
          }
          &-proptypes {
            margin:15px 25px;
            .types-row {
              display: flex;
              flex-wrap: wrap;
              padding:0;
              margin:0;
            }
            .kv-imagecheck-group {
              flex: 0 0 33.333%;
              text-align: center;
              padding: 5px;
              label {
                display:block;
                margin-bottom:0;
              }
            }
            @media (max-width: map_get($grid-breakpoints, 'md') - 1) {
              .kv-imagecheck-group {
                flex: 100%;
              }
            }
            #kv-filters-property-types-options-list {
              display:none;
            }
            .kv-imagecheck-group .other {
              border: solid 1px #d0d0d0;
            }
            .kv-imagecheck-group .kv-imagecheck {
              position: absolute;
              visibility: hidden;
            }
            .kv-imagecheck-group div {
              display: flex;
              align-items: center;
              justify-content: center;
              padding:10px;
              background:#fff;
            }
            .kv-imagecheck-group input + div {
              border: solid 1px #d0d0d0;
            }
            .kv-imagecheck-group .kv-imagecheck-text {
              font-size: 14px;
            }          
            .kv-imagecheck-group div {
              color:#666;
            }
            .kv-imagecheck-icon {
              font-family: 'Material Icons';
              font-weight: normal;
              font-style: normal;
              font-size: 24px;
              line-height: 1;
              margin-right:10px;
              letter-spacing: normal;
              text-transform: none;
              display: inline-block;
              white-space: nowrap;
              word-wrap: normal;
              direction: ltr;
              -webkit-font-feature-settings: 'liga';
              -webkit-font-smoothing: antialiased;
            }
  
            .kv-imagecheck-icon.righthome {
              margin-left:-23px;
            }
            .kv-filters-options-panel {
              background-color:#fff;
              border: solid 1px #d0d0d0;
              padding:10px;
              width:100%;
              margin:5px;
              overflow:hidden;
              ul {
                display: flex;
                flex-wrap: wrap;
                padding:0;
                margin:0;
                font-size:12px;
                list-style: none;
                li {
                  flex: 0 0 33.333%;
                  padding: 5px;
                  display:flex;
                  align-items:center;
                }
                @media (max-width: map_get($grid-breakpoints, 'md') - 1) {
                  li {
                    flex: 50%;
                    input, label {
                      width:auto;
                    }
                  }
                }
              }
              ul.kv-options-list {
                display: block;
                width:33.33%;
                float:left;
              }
              @media (max-width: map_get($grid-breakpoints, 'md') - 1) {
                ul.kv-options-list {
                  width:50%;
                }
              }
            }
          }
        }
        
        .kv-row-align-right {
          flex-direction: row-reverse;
        }

        .kv-filters-section-title {
          display: block;
          margin-bottom: 0;
          font-size: 12px;
          font-weight: 400;
          text-transform: uppercase;
        }

        .prices-filter {
          display: flex !important;
          align-items: center !important;
        }

        .kv-filters-container-row {
          display:flex;
          flex-wrap:wrap;
          align-items:baseline;

          @media (max-width: map_get($grid-breakpoints, 'sm') - 1) {
            .kv-filters-field-container-col {
              flex-basis:100% !important;
            }
            .kv-filters-field-container-col-middle {
              flex-basis:3%;
            }
          }

          .kv-filters-field-radio-col {
            margin-bottom:10px;
            margin-right:20px;
            input[type="radio"]{
              vertical-align: baseline;
            }
            label {
              margin-top:-3px;
            }
          }

          .kv-filters-field-container-col {
            margin-bottom: 10px;
            flex-basis:48.5%;
            flex-wrap:wrap;
  
            &-middle {
              flex-basis:3%;
              text-align:center;
            }
            &-fullwidth {
              flex-basis:100%;
              min-width:100%;
            }
            select {
              height:38px;
              padding:0;
              color:#000;
            }
          }
        }
        

        select {
          width: 100%;
        }

        fieldset {
          clear: both;

          label {
            display: none;
          }

          .kv-hyphen {
            width: 10%;
            text-align: center;
          }

          input[type="number"]:first-of-type, .kv-hyphen {
            float: left;
          }

          input[type="number"]:last-of-type {
            float: right;
          }
        }

        .kv-properties-search-submit {
          display:flex;
          width:100%;
          background-color:#fff;
          padding:10px 30px;
          align-items:center;
          border-top:1px solid #d1d1d1;
          border-bottom:1px solid #d1d1d1;
          a#kv-filters-clear {
            box-shadow:none;
          }
          button {
            margin-left:auto;
            padding:10px;
          }
        }
      }

      @media (max-width: map_get($grid-breakpoints, 'sm') - 1) {
        #kv-filters-container-more {
          width:98% !important;
          left:0;
          .filters-container-more-wrapper .kv-filters-container-row .kv-filters-field-container-col select {
            border-color:#ccc;
          }
        }
      }
    }
    .kv-properties-search-submit button {
      position: relative;
      line-height: 18px;
      font-size: 0.75em;
      text-transform: uppercase;
      cursor: pointer;
      overflow: hidden;
      color:#fff;
      margin:0;
    }

    button.kv-filter-control {
      position: relative;
      height:auto!important;
      line-height: 18px;
      border: 1px solid #cccccc;
      background-color: #fff;
      color:#000;
      font-size: 0.75em;
      text-transform: uppercase;
      cursor: pointer;
      overflow: hidden;
      border-radius:0;
      padding:10px;

      &.kv-filter-has-value:after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 10px;
        background-color: white;
      }

      &:focus {
        outline: none;
      }

      &.kv-has-counter {
        .kv-counter {
          padding-left: 1px;
          display: inline-block;
          width: 18px;
          min-width: 18px;
          height: 18px;
          min-height: 18px;
          line-height: 18px;
          background-color: #454545;
          border-radius: 50%;
          font-size: 11px;
          color: white;
        }
      }
    }

    .kv-filters-radio-label {
      text-align: center;
      padding: 0 10px;
      margin: 1px;
      border: none;
      border-radius: $border-radius;
      font-weight: 400;
      cursor: pointer;
      user-select: none;

      &:hover {
        background-color: white;
      }
    }

    [type='radio']:checked + label.kv-filters-radio-label,
    .kv-filters-radio-label.checked {
      background: white;
      color: #666666;
    }

    &.kv-multi-line {
      .kv-properties-search-areas {
        @extend %kv-col-12;
      }

      .kv-properties-search-price {
        @extend %kv-col-12, %kv-col-sm-6;
      }

      .kv-properties-search-beds-baths {
        @extend %kv-col-12, %kv-col-sm-6;
      }

      .kv-properties-search-filters {
        @extend %kv-col-12, %kv-col-sm-6;
      }

      .kv-properties-search-submit {
        @extend %kv-col-12, %kv-col-sm-6;
      }

      & > .kv-form-group {
        margin-bottom: 5px;
        padding: 0 5px 0 0;
      }
    }
  }

  @media (max-width: map_get($grid-breakpoints, 'lg') - 1) {
    &-form {
      .kv-properties-search-filters {
        margin-left:5px;
        margin-right:0;
        z-index:auto;
      }
      .kv-form-group, &.kv-multi-line .kv-form-group {
        margin-bottom: 0.5em;

        &.kv-properties-search-areas, &.kv-properties-search-beds-baths {
          padding: 0;
          min-width:auto;
        }
      }

      .kv-filters-control-container {
        .kv-filters-container {
          &.kv-filters-container-mobile-relative {
            display: flex;
            justify-content: space-between;
            position: relative;
            height: 52px;
            margin: 0;
            padding: 0;
            border-color: transparent;
            background-color: transparent;

            &.kv-collapsed {
              display: flex;
            }

            .kv-border-container {
              &:first-of-type {
                margin-right: 5px;
              }
            }

            .kv-border-left, .kv-border-right {
              max-width: none;
              height: 52px;
              line-height: 52px;
              margin-bottom: 0;
              border: 1px solid #cccccc;
              text-transform: uppercase;
              font-size: 13px;
            }

            .kv-border-left {
              width: 35%;
              text-align: center;
              border-right: none;
              background-color: $color-buttonface;
            }

            .kv-border-right {
              width: 65%;
              line-height: 40px;
              border-left: none;
              font-size: 15px;

              &:focus {
                border-color: #b5b5b5;
              }
            }
          }
        }
      }

      &.kv-multi-line .kv-properties-search-submit {
        padding-right: 0;
      }
    }
  }

  @media (max-width: map_get($grid-breakpoints, 'md') - 1) {
    .kv-properties-search-form #kv-properties-alerts {
      padding:5px;
      .profile-alerts-link {
        width:100%;
      }
    }
    .kv-properties-search-form .kv-properties-search-areas .kv-multiple-select {
      padding:5px !important;
    }
    &-form {
      .kv-form-group {
        margin-bottom: 0;
      }

      .kv-properties-search-filters {
        .kv-filters-control-container {
          #kv-filters-container-more {
            .kv-row {
              margin-bottom: 0;

              .col-12 {
                margin-bottom: 0.75em;
              }
            }
          }
        }
      }

      .kv-properties-search-submit {
        .kv-search-text {
          display: none;
        }

        .kv-search-icon {
          display: inline-block;
          font-size: 18px;
        }
      }
    }
  }

  @media (max-width: map_get($grid-breakpoints, 'sm') - 1) {
    &-form {
      .kv-form-group, &.kv-multi-line .kv-form-group {
        padding: 0;
      }

      .kv-properties-search-submit {
        .kv-search-text {
          display: inline-block;
        }

        .kv-search-icon {
          display: none;
        }
      }
    }
  }
}