@import "../common/mixin.scss";
@import "../common/utils.scss";

@mixin inputNumberSize() {
}

@include b(input-number) {
	position: relative;
	display: inline-block;
	width: 100%;
	line-height: calc(#{$--input-height} - 2px);

	.tu-input {
		display: block;

		&__inner {
			-webkit-appearance: none;
			padding-left: calc(#{$--input-height} + 10px);
			padding-right: calc(#{$--input-height} + 10px);
			text-align: center;
		}
	}

	@include e((increase, decrease)) {
		position: absolute;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		z-index: 1;
		top: 1px;
		width: $--input-height;
		height: 100%;
		background: transparent;
		color: $--color-text-placeholder;
		cursor: pointer;
		font-size: 13px;
		transition: all 0.3s ease;

		&:hover {
			color: $--color-primary;
			font-weight: $--font-weight-bold;
		}

		@include when(disabled) {
			color: $--color-text-disabled;
			cursor: not-allowed;
		}
	}

	@include e(increase) {
		right: 1px;
	}

	@include e(decrease) {
		left: 1px;
	}

	@include when(disabled) {
		@include e((increase, decrease)) {
			color: $--color-text-disabled;

			&:hover {
				color: $--color-text-disabled;
				cursor: not-allowed;
			}
		}
	}

	@include m(mini) {
		line-height: calc(#{$--input-mini-height} - 2px);

		@include e((increase, decrease)) {
			width: $--input-mini-height;
			font-size: $--input-mini-font-size;

			[class*="tu-icon"] {
				transform: scale(0.8);
			}
		}
	}

	@include m(small) {
		line-height: calc(#{$--input-small-height} - 2px);

		@include e((increase, decrease)) {
			width: $--input-small-height;
			font-size: $--input-small-font-size;

			[class*="tu-icon"] {
				transform: scale(0.9);
			}
		}
	}

	@include m(large) {
		line-height: calc(#{$--input-large-height} - 2px);

		@include e((increase, decrease)) {
			width: $--input-large-height;
			font-size: $--input-large-font-size;
		}
	}

	@include when(without-controls) {
		.tu-input__inner {
			padding-left: 15px;
			padding-right: 15px;
		}
	}

	@include when(controls-right) {
		.tu-input__inner {
			padding-left: 15px;
			padding-right: calc(#{$--input-height} + 10px);
		}

		@include e((increase, decrease)) {
			line-height: calc((#{$--input-height} - 2px) / 2);
			height: calc((#{$--input-height} - 2px) / 2);

			[class*="tu-icon"] {
				transform: scale(0.8);
			}
		}

		@include e(decrease) {
			right: 1px;
			bottom: 1px;
			top: auto;
			left: auto;
		}
	}
}
