@import '../../src/scss/settings/colours';
@import '../../src/scss/settings/typography';
@import '../../src/scss/utility/responsive';

.icon {
  font-family: 'TELUS Core Icons';
  display: inline-block;
  font-weight: normal;
  font-style: normal;
  speak: none;
  text-decoration: inherit;
  text-transform: none;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  transition: color 0.1s linear;
}

.icon-core-caret-up::before {
  content: '\f106';
}

.icon-core-caret-down::before {
  content: '\f105';
}

.selector-counter {
  position: relative;
  display: inline-block;
  width: 100%;

  @include from-breakpoint(medium) {
    width: 11.125rem;
  }

  @include from-breakpoint(xl) {
    width: 9.875rem;
  }

  &__plain-button {
    margin: 0;
    padding: 0;
    border: 0;
    background-image: none;
    background-color: transparent;
    box-shadow: none;
    text-align: center;
  }

  &__button {
    position: absolute;
    right: 15px;
    top: 1px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    min-height: 0;
    min-width: auto;
    width: auto;
    background: transparent;

    &:last-child {
      top: 24px;
    }

    &:disabled {
      background: transparent;
    }
  }

  &__icon {
    color: $color-primary;
    font-size: 11px;
    line-height: normal;

    &:hover {
      color: $color-primary;
    }

    .selector-counter--error &,
    .selector-counter--error button:disabled & {
      color: $color-cardinal;
    }

    .selector-counter--successful &,
    .selector-counter--successful button:disabled & {
      color: $color-primary;
    }

    button:disabled & {
      color: $color-shuttle-grey;
    }
  }
}

// FIXME: remove redundant specificity once global css styles (forms.scss) are removed
input.selector-counter__value.selector-counter__value {
  font-weight: 300;
  font-size: 2.75rem;
  line-height: 2.75rem;
  padding: 0 35px 0 25px;
  height: 52px;
  max-width: 100%;
  -moz-appearance: textfield;

  // Hide the built-in up/down arrows
  &::-webkit-inner-spin-button,
  &::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .selector-counter--error & {
    border-color: $color-cardinal;
  }

  .selector-counter--successful & {
    border-color: $color-primary;
  }
}

.field .selector-counter__value {
  margin-bottom: 18px;
}

.selector-counter__value {
  border: 1px solid $color-shuttle-grey;
  border-radius: 4px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
  color: $color-shark;
  font-family: $font-telus;
  font-size: 1.25rem;
  letter-spacing: 0.4px;
  line-height: 1.4;
  outline: 0;
  padding: 11px;
  width: 100%;
  transition: background-color 0.1s linear;
}

.accessible-hide {
  display: block;
  position: absolute !important;
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
}
