@import '../../style/themes/default';
@import "../../style/mixins";

@listPrefixCls: fm-list;
@inputNumberPrefixCls: fm-input-number;

.@{inputNumberPrefixCls} {
  position: relative;
  margin: 0;
  display: inline-block;
  box-sizing: content-box;
  width: 63 * @hd;
  height: 35 * @hd;
  line-height: 35 * @hd;
  font-size: @font-size-base;
  vertical-align: middle;
  overflow: hidden;
  border: @border-width-md solid @border-color-base;
  border-radius: @radius-md;

  &-sm {
    min-height: @input-number-height-sm;
    height: @input-number-height-sm;
    font-size: @input-number-font-size-sm;
    line-height: @input-number-height-sm;

    .@{inputNumberPrefixCls} {
      font-size: @input-number-font-size-sm;
      &-handler {
        height: @input-number-height-sm;
        line-height: @input-number-height-sm;
        > i {
          font-size: @input-number-font-size-sm;
        }
      }
      &-input-wrap {
        height: @input-number-height-sm;
        line-height: @input-number-height-sm;
      }
    }
  }

  &-handler-wrap {
    position: absolute;
    width: 100%;
    font-size: 24 * @hd;
  }

  &-handler,
  &-handler-up-inner,
  &-handler-down-inner {
    width: 30 * @hd;
    height: 35 * @hd;
    line-height: 35 * @hd;
  }

  &-handler {
    text-align: center;
    overflow: hidden;
    color: @color-text-paragraph;
    position: absolute;
    display: inline-block;
    box-sizing: content-box;
    top: 0;
    bottom: 0;
    z-index: 2;
    > i {
      font-size: 20 * @hd;
    }

    &-active {
      background-color: @fill-tap;
    }
  }

  &-handler-up-inner,
  &-handler-down-inner {

    user-select: none;
    right: 2 * @hd;
    color: @color-text-base;
  }

  &-input-wrap {
    display: none;
    width: 100%;
    height: 35 * @hd;
    line-height: 35 * @hd;
    text-align: center;
    overflow: hidden;
  }

  &-input {
    display: none;
    width: 60 * @hd;
    font-size: 16 * @hd;
    color: @color-text-base;
    text-align: center;
    border: 0;
    padding: 0;
    background: none;
    vertical-align: middle;

    &[disabled] {
      opacity: 1;
      color: @color-text-base;
    }
  }

  &.showNumber {
    width: 138 * @hd;

    .@{inputNumberPrefixCls}-input-wrap {
      display: inline-block;
    }

    .@{inputNumberPrefixCls}-input {
      display: inline-block;
    }

    .@{inputNumberPrefixCls}-handler-down-disabled {
      right: -1PX;
    }
  }

  &-handler-up {
    cursor: pointer;
    right: 0;
    border-left: @border-width-md solid @border-color-base;

    &-inner {
      &:before {
        text-align: center;
        content: "+";
      }
    }
  }

  &-handler-down {
    cursor: pointer;
    left: 0;
    border-right: @border-width-md solid @border-color-base;

    &-inner {
      &:before {
        text-align: center;
        content: "-";
      }
    }
  }

  &-handler-down-disabled,
  &-handler-up-disabled {
    opacity: @opacity-disabled;
  }

  &-handler-up-disabled &-handler-active {
    background: none;
  }

  &-disabled {
    .@{inputNumberPrefixCls}-handler-down,
    .@{inputNumberPrefixCls}-handler-up {
      opacity: @opacity-disabled;
      background: none;
    }
  }

  &-disabled {
    .@{inputNumberPrefixCls}-handler {
      opacity: @opacity-disabled;
    }

    .@{inputNumberPrefixCls}-input-wrap {
      opacity: @opacity-disabled;
    }
  }
}
