/*
 * Copyright (c) 2008-2016 Haulmont.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

@mixin halo-filterselect($primary-stylename: v-filterselect) {
  .#{$primary-stylename}.v-readonly {
    .#{$primary-stylename}-button {
      display: none;
    }
  }

  .#{$primary-stylename} {
    img.v-icon {
      height: round($v-unit-size/2);
      width: round($v-unit-size/2);
      margin-left: round($v-unit-size/4);
    }
  }

  .#{$primary-stylename}-suggestpopup {
    img.v-icon {
      height: round($v-unit-size/2);
      width: round($v-unit-size/2);
    }
  }

  .#{$primary-stylename}.v-readonly {
    input {
      cursor: default;
      padding-right: ceil($v-unit-size/6) + ceil($v-border-radius/3);
    }
  }

  .#{$primary-stylename}.v-readonly [class*="input"]:focus {
    border-color: $v-focus-color;
  }

  .#{$primary-stylename}.c-disabled-or-readonly.c-empty-value {
      input {
        color: transparent;
      }
    }

  .v-ios.v-touch &,
  .v-android.v-touch & {
    .#{$primary-stylename}-suggestpopup {
      div[class*="next"] span,
      div[class*="prev"] span {
          display: none;
      }

      div[class*="next"],
      div[class*="prev"] {
        @include box-shadow(valo-bevel-and-shadow($bevel: null, $shadow: $v-overlay-shadow));
        @include box-sizing(border-box);
        opacity: 1;
        display: block;
        height: $v-unit-size;
        line-height: $v-unit-size;
        width: 100%;
        margin: 0 auto 0 auto;
        overflow: hidden;
        position: relative;
        background-color: $v-overlay-background-color;
      }

      div[class*="next"]:before,
      div[class*="prev"]:before {
        font-size: 1.5em;
      }

      div[class*="prev"] {
        z-index: 1;
      }

      div[class*="suggestmenu"] {
        border-radius: 0;
        z-index: 2;
        @include box-shadow(valo-bevel-and-shadow($bevel: null, $shadow: $v-overlay-shadow));
      }

      div[class*="next"] {
        z-index: 3;
      }

      div[class*="next"]:hover,
      div[class*="prev"]:hover {
        background-color: $v-overlay-background-color;
      }

      div[class*="next"] {
        border-radius: 0 0 $v-border-radius $v-border-radius;
      }

      div[class*="prev"] {
        border-radius: $v-border-radius $v-border-radius 0 0;
      }

      div[class*="page-off"] {
        cursor: default;
      }

      div[class*="page-off"]:before {
        opacity: 0.2;
      }

      div[class*="page"] {
        @include transition(none);
        @include transform(none);
      }
    }
  }
}
