@import '../style/var';

.hl-stepper {
  font-size: 0;
  user-select: none;

  &__minus,
  &__plus {
    position: relative;
    box-sizing: border-box;
    width: $stepper-input-height;
    height: $stepper-input-height;
    margin: 0;
    padding: 0;
    color: $stepper-button-icon-color;
    vertical-align: middle;
    background-color: $stepper-background-color;
    border: 0;
    cursor: pointer;

    &::before {
      width: 50%;
      height: 1px;
    }

    &::after {
      width: 1px;
      height: 50%;
    }

    &::before,
    &::after {
      position: absolute;
      top: 50%;
      left: 50%;
      background-color: $blue;
      transform: translate(-50%, -50%);
      content: '';
    }

    &:active {
      background-color: $stepper-active-color;
    }

    &--disabled {
      color: $stepper-button-disabled-icon-color;
      background-color: $stepper-button-disabled-color;
      cursor: not-allowed;

      &:active {
        background-color: $stepper-button-disabled-color;
      }
    }
  }

  &__minus {
    border-radius: $stepper-border-radius 0 0 $stepper-border-radius;

    &::after {
      display: none;
    }
  }

  &__plus {
    border-radius: 0 $stepper-border-radius $stepper-border-radius 0;
  }

  &__value {
    display: inline-block;
    width: 32px;
    text-align: center;
  }

  &--round {
    display: flex;
    align-items: center;

    .hl-stepper__plus,
    .hl-stepper__minus {
      border-radius: 100%;

      &:active {
        opacity: $active-opacity;
      }

      &--disabled {
        &,
        &:active {
          opacity: 0.3;
        }
      }
    }

    .hl-stepper__plus {
      color: $stepper-button-round-theme-color;
      background-color: $white;
      border: 1px solid $stepper-button-round-theme-color;
    }

    .hl-stepper__minus {
      color: $stepper-button-round-theme-color;
      background-color: $white;
      border: 1px solid $stepper-button-round-theme-color;
    }
  }
}
