$icon-size: 1.6rem;
$input-horizontal-padding: spacing(tighter) * 1.5;

// Without a small amount of vertical adjustment, the text
// in the Select does not appear vertically centered.
// $input-vertical-adjust: rem(1px);

.select {
  position: relative;
  margin-top: 0px;

  // IE 11 fix to remove default dropdown arrow
  select::-ms-expand {
    display: none;
  }
}

.disabled {
  .backdrop {
    @include control-backdrop(disabled);
  }

  .icon {
    opacity: 0.4;
  }
}

.hasValue {
  
  .input{
    color: theme-color(m-grey, 900);
    padding-top: calc((#{control-vertical-padding()} * 2) - 0.3rem); // total padding - padding-bottom
    padding-bottom: 0.3rem;
  }

  &.labelHidden {
  
    > .input {
      padding-top: control-vertical-padding();
      padding-bottom: control-vertical-padding();
    }

  }
}

.error {
  .backdrop {
    // @include control-backdrop(error);
    background-color: #fff;
    border-color: #E53935;
  }

  // Need to override the higher specificity of the sibling selector
  // so that errors still have red borders.
  // stylelint-disable-next-line selector-max-specificity
  .input:focus ~ .backdrop {
    // @include control-backdrop(focused-error);
    border-color: #E53935;
    box-shadow: 0 0 0 1px #E53935;
  }
}

.backdrop {
  @include control-backdrop;
}

.icon {
  @include recolor-icon(theme-color(m-grey, 800));
 }

.input {
  @include text-style-input;
  color: color(ink, lighter);
  min-height: control-height();
  padding: control-vertical-padding() ($input-horizontal-padding + $icon-size) control-vertical-padding() $input-horizontal-padding;
  transition: 0.3s all ease;
  background:rgba(255,255,255,0);

  &:focus {
    outline: none;

    ~ .backdrop {
      @include control-backdrop(focused);
    }
  }

  &:disabled {
    color: theme-color(m-grey, 700);
  }
}

.readOnly {

  &:not(.disabled) > .input:disabled {
    color: theme-color(m-grey, 900);
  }
}

.labelHidden {
  
  > .input {
    transition: none;
  }

}

.placeholder {
  
  .input {
    color: theme-color(m-grey, 500);
    padding-top: calc((#{control-vertical-padding()} * 2) - 0.3rem); // total padding - padding-bottom
    padding-bottom: 0.3rem;
  }

  &.labelHidden {
  
    .input {
      padding-top: control-vertical-padding();
      padding-bottom: control-vertical-padding();
    }

  }

}


// Lable Styling

.labelStyle {
  @include text-style-body-large;
  color: color(ink, lighter);
  transition: 0.3s all ease;
  background:rgba(255,255,255,0);
}

.labelHasValue {
  @include text-style-body-small;
  color: theme-color(m-grey, 700);
}

.labelDisabled {
  color: theme-color(m-grey, 700);
}
