@use 'sass:math';
@use 'sass:map';

@use 'mixins/mixins' as *;
@use 'common/var' as *;

@include b(numeric-input) {
  position: relative;
  width: 160px;

  .#{$namespace}-input {
    &__inner {
      -webkit-appearance: none;
      -moz-appearance: textfield;
      &::-webkit-inner-spin-button,
      &::-webkit-outer-spin-button {
        margin: 0;
        -webkit-appearance: none;
      }
      text-align: center;

      padding-left: 0 !important;
      padding-right: 0 !important;
    }

    &__suffix,
    &__prefix {
      &.is-button .#{$namespace}-button {
        min-width: 36px;
        width: 36px;
      }
    }

    &__suffix.is-button {
      @include e('controls-right') {
        .#{$namespace}-button {
          height: 50%;
          min-height: 50%;
        }
      }
    }
  }

  @include e('controls-right') {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  @include m(large) {
    .#{$namespace}-input {
      &__suffix,
      &__prefix {
        &.is-button .#{$namespace}-button {
          min-width: 40px;
          width: 40px;
        }
      }
    }
  }

  @include m(small) {
    .#{$namespace}-input {
      &__suffix,
      &__prefix {
        &.is-button .#{$namespace}-button {
          min-width: 32px;
          width: 32px;
        }
      }
    }
  }
}
