@import "var";
@import "../icon/index.less";
:host{
	width: 100%;
}
.@{prefixName}-stepper {
	display: flex;
	align-items: flex-start;
	text-align: center;
	width: 100%;
	counter-reset: step;
	font-size: @stepper-font-size;

	&.is-vertical {
		flex-direction: column;
		.@{prefixName}-stepper {
			&__list{
				&.is-danger{
					.@{prefixName}-stepper{
						&__counter{
							background-color: @stepper-counter-danger-bg-color;
						}
						&__title{
							color: @stepper-danger-text-color;
						}
					}
				}
				& + .@{prefixName}-stepper__content{
					.@{prefixName}-stepper__content-desc{
						font-size: 14px;
						color: @stepper-desc-text-color;
					}
				}
				&.is-current{
					& + .@{prefixName}-stepper__content{
						.@{prefixName}-stepper__content-desc{
							color: @stepper-default-text-color;
						}
					}

					&~.@{prefixName}-stepper__list{
						&+.@{prefixName}-stepper__content{
							.@{prefixName}-stepper__content-desc{
								color: @stepper-disabled-text-color;
							}
						}
					}
				}
				&.is-danger + .@{prefixName}-stepper__content{
					.@{prefixName}-stepper__content-desc{
						color: @stepper-danger-text-color;
					}
				}
			}
			&__title{
				display: inline-block;
				vertical-align: middle;
				padding-left: @stepper-arrow-and-counter-gap;
				margin-top: 0;
				box-sizing: border-box;
				font-size: @stepper-font-size;
				line-height: 20px;
			}
			&__arrow{
				margin-top: 0;
				display: none;
			}
			&__content{
				position: relative;
				padding-bottom: 10px;
				padding-left: @stepper-counter-size+@stepper-arrow-and-counter-gap;
				box-sizing: border-box;
				&::before{
					content: '';
					position: absolute;
					top: 0;
					bottom: 0;
					width: 1px;
					border-left: 1px solid @stepper-arrow-color;
					left: @stepper-counter-size / 2;
				}
				&:last-child::before{
					display: none;
				}
				&-desc{
					padding-top: 5px;
					text-align: left;
					margin-left: -10px;
					padding-bottom: 5px;
				}
			}
			&__children-title {
				position: relative;
				color: @stepper-completed-text-color;

				&::before {
					content: '';
					width: @stepper-children-counter-size;
					height: @stepper-children-counter-size;
					border-radius: 50%;
					position: absolute;
					top: 50%;
					margin-top: -1 * @stepper-children-counter-size / 2;
					left: -1 * (@stepper-counter-size / 2 + @stepper-children-counter-size / 2 + @stepper-arrow-and-counter-gap);
					background-color: @stepper-counter-completed-bg-color;
				}
				&.is-current{
					color: @stepper-default-text-color;
					&::before {
						background-color: @stepper-counter-default-bg-color;
					}
					&~.@{prefixName}-stepper__children-title {
						color: @stepper-disabled-text-color;
						&::before{
							background-color: @stepper-counter-disabled-bg-color;
						}
					}
				}
			}
		}
	}

	&.is-discount {
		.@{prefixName}-stepper {
			&__list{
				&.is-current{
					color: @stepper-default-text-color;
					.@{prefixName}-stepper {
						&__list{
							&__counter{
								background-color: @stepper-counter-default-bg-color;
							}
						}
					}
				}
			}
			&__counter {
				display: none;
				width: @stepper-counter-size;
				height: @stepper-counter-size;
				background-color: @stepper-counter-completed-bg-color;
				&::before {
					display: none;
				}
			}
			&__title{
				margin-top: 0;
				color: @stepper-completed-text-color;
			}

			&__arrow{
				margin-top: 0;
			}

			&__content{
				&::before{
					left: floor(@stepper-children-counter-size / 2);
				}
			}

			&__children-title{
				&::before{
					left: -30px;
				}
			}
		}
	}

	&.is-vertical.is-discount{
		.@{prefixName}-stepper{
			&__counter{
				display: inline-block;
				width: @stepper-children-counter-size;
				height: @stepper-children-counter-size;
			}
		}
	}

	&__list {
		flex: 1;
		font-size: 0;

		&.is-current {

			.@{prefixName}-stepper {
				&__counter {
					font-family: inherit;
					color: #fff;
					font-size: @stepper-font-size;
					background-color: @stepper-counter-default-bg-color;
					&::before {
						content: counter(step);
						font-size: @stepper-font-size;
						margin-top: -2px;
					}
				}

				&__title {
					color: @stepper-default-text-color;
				}
			}

			&~.@{prefixName}-stepper__list {
				.@{prefixName}-stepper {
					&__counter {
						font-family: inherit;
						background-color: @stepper-counter-disabled-bg-color;
						color: #fff;
						font-size: @stepper-font-size;
						&::before{
							content: counter(step);
							font-size: @stepper-font-size;
							margin-top: -2px;
						}
					}

					&__title {
						color: @stepper-disabled-text-color;
					}
				}
			}
		}
	}

	&__arrow {
		flex-basis: 7px;
		height: 24px;
		font-size: 0;
		margin-top: 11px;
		flex-shrink: 0;
		position: relative;
		display: inline-block;
		font-family: 'tea-icon' !important;
		speak: none;
		font-style: normal;
		font-weight: normal;
		font-variant: normal;
		text-transform: none;
		text-rendering: auto;
		line-height: 1;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		&::before {
			content: "\e90d";
			font-size: 24px;
			color: @stepper-arrow-color;
			display: block;
		}
	}

	&__counter {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: relative;
		vertical-align: middle;
		// background-color: @stepper-counter-completed-bg-color;
		border-radius: 50%;
		height: @stepper-counter-size;
		width: @stepper-counter-size;
		color: @stepper-completed;
		line-height: 1;
		font-size: 0;
		font-family: 'tea-icon' !important;
		speak: none;
		font-style: normal;
		font-weight: normal;
		font-variant: normal;
		text-transform: none;
		text-rendering: auto;
		line-height: 1;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		&::before {
			// position: absolute;
			// top: 50%;
			// left: 50%;
			// transform: translate(-50%, -50%);
			counter-increment: step;
			font-size: 24px;
			content: '\e915';
			margin-top: 0;
		}
	}

	&__title {
		display: block;
		line-height: 1.6em;
		margin-top: 6px;
		font-size: @stepper-font-size;
		color: @stepper-completed-text-color;
	}

	&__children-content{
		padding-top: 5px;
		padding-bottom: 5px;
	}

}
