$select-alto: #D9D9D9;
$select-main: #3B3B3B;
$select-white: #FFF;
$select-grey: #E9E9E9;


//
// Select
//


// <div class="zpa-select__wrap--block zpa-select--white zpa-select--sm">
//   <select class="zpa-select">
//     <option>------</option>
//     <option>Test 1</option>
//     <option>Test 2</option>
//   </select>
// </div>


.zpa-select {
  display: inline-block;
  width: 100%;
  margin: 0;
  padding: 4px 30px 4px 10px;
  line-height: 1.5;
  border-radius: 0;
  cursor: pointer;
  z-index: 3;
  appearance: none;

  //  Hide the arrow in IE10 and up

  &::-ms-expand {
    display: none;
  }

  &:focus {
    outline-color: #3AAA35;
    box-shadow: none;
  }
}

.zpa-select--white {
  background-color: $select-white;

  .zpa-select {
    color: $select-main;
    background-color: transparent;
    border: 1px solid $select-alto;
  }

  &:after {
    background: url("data:image/png;base64, PHN2ZyB2aWV3Qm94PSIwIDAgOCA1IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjUiPgogICAgPHBhdGggZmlsbD0iIzk5OSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNCA1bDQtNUgweiIvPgo8L3N2Zz4K") no-repeat right center;
    z-index: 10;
    pointer-events: none;
  }

  .zpa-select[disabled] {
    cursor: not-allowed;
    opacity: 1;
    background-color: #FAFAFA !important;
    border-color: $select-alto !important;
    color: #999 !important;
  }
}

.zpa-select--grey {
  background-color: $select-grey;

  .zpa-select {
    color: $select-main;
    background-color: transparent;
    border: 2px solid $select-grey;
  }

  &:after {
    background: url("data:image/png;base64, PHN2ZyB2aWV3Qm94PSIwIDAgOCA1IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjUiPgogICAgPHBhdGggZmlsbD0iIzk5OSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNCA1bDQtNUgweiIvPgo8L3N2Zz4K") no-repeat right center;
    z-index: 10;
    pointer-events: none;
  }

  .zpa-select[disabled] {
    cursor: not-allowed;
    opacity: 1;
    background-color: $select-grey !important;
    border-color: $select-grey !important;
    color: rgba($main-sec-font-color, .33) !important;
  }
}

.zpa-select--grey {
  background-color: $select-grey;

  .zpa-select {
    color: $select-main;
    background-color: transparent;
    border: 2px solid $select-grey;
  }

  &:after {
    background: url("data:image/png;base64, PHN2ZyB2aWV3Qm94PSIwIDAgOCA1IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjUiPgogICAgPHBhdGggZmlsbD0iIzk5OSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNCA1bDQtNUgweiIvPgo8L3N2Zz4K") no-repeat right center;
    z-index: 10;
    pointer-events: none;
  }

  .zpa-select[disabled] {
    cursor: not-allowed;
    opacity: 1;
    background-color: $select-grey !important;
    border-color: $select-grey !important;
    color: rgba($main-sec-font-color, .33) !important;
  }
}

// height 40px

.zpa-select--sm {

  &:after {
    content: "";
    position: absolute;
    right: 15px;
    top: 16px;
    width: 8px;
    height: 6px;
  }

  .zpa-select {
    line-height: 18px;
    height: 40px;
    font-size: 16px;
  }
}

// height 35px

.zpa-select--xs {

  &:after {
    content: "";
    position: absolute;
    right: 15px;
    top: 15px;
    width: 8px;
    height: 6px;
  }

  .zpa-select {
    line-height: 18px;
    height: 35px;
    font-size: 14px;
  }
}

.zpa-select:focus { // Undo the Firefox inner focus ring

  &:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #3B3B3B;
  }
}

// Media query to target Firefox only

@-moz-document url-prefix() { /* stylelint-disable-line */

  //  Firefox hack to hide the arrow

  .zpa-select__wrap--block:after,
  .zpa-select__wrap--inline:after {
    top: 17px;
  }

  .zpa-select {
    text-indent: -2px;

    option { //  <option> elements inherit styles from <select>, so reset them.
      background-color: $select-white;
    }
  }
}

.zpa-select__wrap--block {
  display: block;
  position: relative;

  &:empty {
    display: none;
  }
}

.zpa-select__wrap--inline {
  display: inline-flex;
  position: relative;

  &:empty {
    display: none;
  }
}

.zpa-select__wrap--full-width {
  width: 100%;
}
