/* stylelint-disable no-descending-specificity */
@import '../style/var.less';

.van-steps {
  overflow: hidden;
  .theme(background-color, '@steps-background-color');

  &--horizontal {
    padding: 20px;

    .van-step__wrapper {
      position: relative;
      display: flex;
      overflow: hidden;
    }
  }

  &--vertical {
    padding-left: 20px;

    .van-step__wrapper {
      padding: 0 0 0 40px;
    }
  }
}

.van-step {
  position: relative;
  flex: 1;
  .theme(font-size, '@step-font-size');
  .theme(color, '@step-text-color');

  &--finish {
    .theme(color, '@step-finish-text-color');
  }

  &__circle {
    border-radius: 50%;
    .theme(width, '@step-circle-size');
    .theme(height, '@step-circle-size');
    .theme(background-color, '@step-circle-color');
  }

  &--horizontal {
    padding-bottom: 28px;

    &:first-child {
      .van-step__title {
        transform: none;
      }

      .van-step__circle-container {
        padding: 0 16px 0 0;
        transform: translate3d(0, 50%, 0);
      }
    }

    &:last-child {
      position: absolute;
      right: 0;
      width: auto;

      .van-step__title {
        text-align: right;
        transform: none;
      }

      .van-step__circle-container {
        right: 0;
        padding: 0 0 0 16px;
        transform: translate3d(0, 50%, 0);
      }
    }

    .van-step__circle-container {
      position: absolute;
      bottom: 12px;
      z-index: 1;
      transform: translate3d(-50%, 50%, 0);
      .theme(background-color, '@white');
      .theme(padding, '0 @padding-xs');
    }

    .van-step__title {
      display: inline-block;
      transform: translate3d(-50%, 0, 0);
      .theme(font-size, '@step-horizontal-title-font-size');
    }

    .van-step__line {
      position: absolute;
      right: 0;
      bottom: 12px;
      left: 0;
      height: 2px;
      transform: translate3d(0, 50%, 0);
      .theme(background-color, '@step-line-color');
    }

    &.van-step--process {
      .theme(color, '@step-process-text-color');

      .van-step__icon {
        display: block;
        line-height: 1;
        .theme(font-size, '@step-icon-size');
      }
    }
  }

  &--vertical {
    padding: 20px 20px 20px 0;
    line-height: 36px;

    &::after {
      border-bottom-width: 2px;
    }

    &:last-child::after {
      border-bottom-width: none;
    }

    &:first-child {
      &::before {
        position: absolute;
        top: 0;
        left: -30px;
        z-index: 1;
        width: 2px;
        height: 40px;
        content: '';
        .theme(background-color, '@white');
      }
    }

    .van-step__icon,
    .van-step__circle,
    .van-step__line {
      position: absolute;
      top: 38px;
      left: -28px;
      z-index: 2;
      transform: translate3d(-50%, -50%, 0);
    }

    .van-step__icon {
      line-height: 1;
      .theme(font-size, '@step-icon-size');
    }

    .van-step__line {
      z-index: 1;
      width: 2px;
      height: 100%;
      transform: translate3d(-50%, 0, 0);
      .theme(background-color, '@step-line-color');
    }
  }
}
