/* todo rename to products-filter.scss */

/* move to mixin file */
@mixin placeholder-visibility($visibility: visible) {
   &::-moz-placeholder {
      visibility: $visibility;
   }

   &:-ms-input-placeholder {
      visibility: $visibility;
   }

   &::-webkit-input-placeholder {
      visibility: $visibility;
   }
}

.products-filter, .users-filter {
   margin-bottom: 20px;

   .form-control {
      @include placeholder-visibility(hidden);
   }

   .chosen-container .chosen-choices:has(.search-choice) {
      border-color: $primary !important;
   }
}

.products-filter-2, .users-filter-2 {
   .form-control {
      @include placeholder-visibility();
   }

   .wpj-form-group > label {
      display: none;
   }

   .wpj-form-group-flex {
      .btn,
      .radio,
      .checkbox,
      .radio-inline,
      .checkbox-inline {
         margin-top: 0;
      }
   }
}

.productfilter-nav, .userfilter-nav {
   .wpj-panel-heading,
   .wpj-form-group > label {
      display: none;
   }

   .wpj-panel-collapse.collapse.in {
      background: transparent;
   }

   .wpj-panel-body {
      padding: 8px 0 0;
   }

   .wpj-form-group-flex {
      flex-wrap: wrap;
   }

   .row {
      margin: 0;
   }

   .col-xs-6,
   .col-xs-4,
   .col-xs-2 {
      width: 100%;
      padding: 0;
   }

   .form-control {
      @include placeholder-visibility(visible);

      height: $input-height-xs;
   }

   .btn {
      @include button-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $btn-border-radius-base);

      .bi {
         font-size: $bootstrap-icon-size-small;
      }
   }

   /* v postranim menu není videt tlacitko, musi se scrollovat - hotfix pred redesignem */
   .autocomplete {
      &.opened:not(:empty) {
         min-width: unset;
         left: 0;
      }

      > div:first-of-type {
         flex-wrap: wrap;

         .btn {
            width: 100% !important;
            margin-left: 0;
         }
      }

      > div[data-autocomplete-item] {
         flex-wrap: wrap;
         position: relative;
         min-height: 50px;
         padding-left: 50px;
         overflow: hidden;

         img {
            position: absolute;
            max-width: 50px;
            max-height: 50px;
            width: auto;
            left: 5px;
         }
      }

      p {
         width: 100%;
      }

      .btn {
         margin-top: 5px;
         padding: 0 10px;
         font-size: 12px;
         margin-left: 15px;
      }
   }
}
