// Steps
// @import "./variables.scss";

.#{$namespace}step {
    display: $step-display;
    flex-wrap: $step-flex-wrap;
    width: $step-width;
    margin: $step-margin;
    padding: $step-padding;
    list-style: $step-list-style;
  
    // 尺寸
    &.#{$namespace}step-xs{
      .#{$namespace}step-item {
        .#{$namespace}step-head {
          font-size: $step-head-xs-font-size;
          margin-top: $step-head-xs-margin-top;
          .#{$namespace}step-circle {
            width: $step-circle-xs-diameter;
            min-width: $step-circle-xs-diameter;
            height: $step-circle-xs-diameter;
            line-height: $step-circle-xs-diameter;
          }
        }
        .#{$namespace}step-item-box {
          .#{$namespace}step-title {
            font-size: $step-title-xs-font-size;
          }
          .#{$namespace}step-description {
            font-size: $step-description-xs-font-size;
          }
        }
      }
    }
    &.#{$namespace}step-sm {
      .#{$namespace}step-item {
        .#{$namespace}step-head {
          font-size: $step-head-sm-font-size;
          margin-top: $step-head-sm-margin-top;
          .#{$namespace}step-circle {
            width: $step-circle-sm-diameter;
            min-width: $step-circle-sm-diameter;
            height: $step-circle-sm-diameter;
            line-height: $step-circle-sm-diameter;
          }
        }
        .#{$namespace}step-item-box {
          .#{$namespace}step-title {
            font-size: $step-title-sm-font-size;
          }
          .#{$namespace}step-description {
            font-size: $step-description-sm-font-size;
          }
        }
      }
    }
    &.#{$namespace}step-md {
      .#{$namespace}step-item {
        .#{$namespace}step-head {
          font-size: $step-head-md-font-size;
          .#{$namespace}step-circle {
            width: $step-circle-md-diameter;
            min-width: $step-circle-md-diameter;
            height: $step-circle-md-diameter;
            line-height: $step-circle-md-diameter;
          }
        }
        .#{$namespace}step-item-box {
          .#{$namespace}step-title {
            font-size: $step-title-md-font-size;
          }
          .#{$namespace}step-description {
            font-size: $step-description-md-font-size;
          }
        }
      }
    }
    &.#{$namespace}step-lg {
      .#{$namespace}step-item {
        .#{$namespace}step-head {
          font-size: $step-head-lg-font-size;
          .#{$namespace}step-circle {
            width: $step-circle-lg-diameter;
            min-width: $step-circle-lg-diameter;
            height: $step-circle-lg-diameter;
            line-height: $step-circle-lg-diameter;
          }
        }
        .#{$namespace}step-item-box {
          .#{$namespace}step-title {
            font-size: $step-title-lg-font-size;
          }
          .#{$namespace}step-description {
            font-size: $step-description-lg-font-size;
          }
        }
      }
    }
  
    // 文字是否居中
    &.#{$namespace}step-align-center:not(.#{$namespace}step-simple) {
      .#{$namespace}step-item {
        text-align: center;
        &:not(:last-child) {
          .#{$namespace}step-head::before {
            content: "";
            position: absolute;
            left: 50%;
            top: 50%;
            height: 1px;
            width: calc(100% - 48px);
            margin: 0 24px;
            background: $text-color-secondary-lighter;
          }
        }
  
        .#{$namespace}step-head {
          justify-content: center;
          .#{$namespace}step-circle {
            position: relative;
            z-index: 1;
          }
          .#{$namespace}step-lines {
            display: none;
          }
        }
  
        .#{$namespace}step-item-box {
          .#{$namespace}step-title {
            text-align: center;
            word-break: break-all;
          }
        }
      }
    }
    
    &.#{$namespace}step-align-left,
    &.#{$namespace}step-simple {
      .#{$namespace}step-item {
        text-align: left;
        &:last-child {
          flex-basis: auto;
          flex-shrink: 0;
          flex-grow: 0;
        }
      }
    }
  
    // step方向
    &.#{$namespace}step-vertical {
      flex-direction: column;
      height: 100%;
    
      .#{$namespace}step-item {
        display: flex;
        &:last-child {
          max-width: none;
        }
        &:not(:last-child) .#{$namespace}step-lines,
        &:not(:last-child) .#{$namespace}step-finish-lines {
          margin: 10px 0px;
          min-height: 20px;
        }
        .#{$namespace}step-item-box {
          padding: 0 0 0 10px;
          .#{$namespace}step-title {
            word-break: break-all;
          }
        }
      }
      
      .#{$namespace}step-head {
        flex-direction: column;
      }
    }
  
    // 文字位置，(direction!=vertical&labelPlacement=horizontal)
    &.#{$namespace}step-label-horizontal {
      .#{$namespace}step-item {
        display: flex;
        overflow: hidden;
        &:not(:first-child) {
          margin-left: 10px;
        }
        &:not(:last-child) {
          .#{$namespace}step-item-box {
            .#{$namespace}step-title:after {
              content: '';
              position: absolute;
              top: .92em;
              width: 100%;
              height: 1px;
              margin-left: 10px;
              background: $step-lines-background;
            }
          }
        }
        // 分隔线颜色
        &.#{$namespace}step-item-finish .#{$namespace}step-item-box .#{$namespace}step-title:after {
          background: $step-lines-finish-background;
        }
      }
      .#{$namespace}step-head {
        align-self: flex-start;
      }
      .#{$namespace}step-lines {
        display: none;
      }
      .#{$namespace}step-item-box {
        position: relative;
        padding: 0px 10px !important;
        .#{$namespace}step-title {
          display: inline-block;
        }
      }
    }
  
    .#{$namespace}step-item {
      position: relative;
      flex: 1;
      min-height: 1rem;
      margin-top: 0;
      cursor: pointer;
      user-select: none;
      color: $text-color-secondary-lighter;
  
      &:not(:last-child) .#{$namespace}step-lines,
      &:not(:last-child) .#{$namespace}step-finish-lines {
        flex: 1;
        width: 1px;
        height: 1px;
        margin: 0 10px;
      }
  
      &:not(:last-child) .#{$namespace}step-lines {
        background: $step-lines-background;
      }
      &.#{$namespace}step-item-finish:not(:last-child) {
        .#{$namespace}step-lines,
        .#{$namespace}step-head::before {
          background: $step-lines-finish-background !important;
        }
      }
      .#{$namespace}step-head {
        position: relative;
        display: flex;
        align-items: center;
        .#{$namespace}step-circle {
          display: flex;
          justify-content: center;
          text-align: center;
          border:$step-circle-border;
          border-radius: 50%;
          background: $step-circle-background;
          span { 
            display: flex;
            justify-content: center;
            align-self: center;
          }
        }
      }
      .#{$namespace}step-item-box {
        display: inline-block;
        width: 100%;
        padding: 10px 0 0 0;
        color: $step-description-color;
        
        text-decoration: none;
        .#{$namespace}step-title {
          font-size: $step-title-font-zise;
          word-break:$step-title-word-break;
          vertical-align: $step-title-word-vertical-align;
        }
        .#{$namespace}step-description {
          font-size: $step-description-font-zise;
          word-break: $step-description-word-break;
          color:$step-description-color;
          line-height: $step-description-line-height;
        }
      }
  
      &.#{$namespace}step-active {
        .#{$namespace}step-item-box {
          .#{$namespace}step-head:before {
            background: $step-circle-active-background;
          }
        }
  
        & ~ .#{$namespace}step-item {
          &::before {
            background: $step-item-background-color;
            

          }
  
          .#{$namespace}step-item-box {
            &::before {
              background: $step-item-box-background-color;
            }
          }
        }
      }
  
      // 默认icon样式
      &.#{$namespace}step-primary-process {
        .#{$namespace}step-head {
          color: $step-primary-process-head-color;
          .#{$namespace}step-circle {
            border: $step-primary-process-circle-border;
            background: $step-primary-process-circle-background;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-primary-process-title-color;
          .#{$namespace}step-title {
            color: $step-primary-process-title-color;
          }
        }
      }
      &.#{$namespace}step-process {
        .#{$namespace}step-head {
          color: $step-process-head-color;
          .#{$namespace}step-circle {
            border: $step-process-circle-border;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-process-title-color;
          .#{$namespace}step-title {
            color: $step-process-title-color;
          }
        }
      }
      &.#{$namespace}step-primary-finish,
      &.#{$namespace}step-primary-finish-correct {
        .#{$namespace}step-head {
          color: $step-primary-finish-head-color;
          .#{$namespace}step-circle {
            border: $step-primary-finish-circle-border;
            background: $step-primary-finish-circle-background;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-active-color;
          .#{$namespace}step-title {
            color: $step-primary-finish-title-color;
          }
        }
      }
      &.#{$namespace}step-finish,
      &.#{$namespace}step-finish-correct {
        .#{$namespace}step-head {
          color: $step-finish-head-color;
          .#{$namespace}step-circle {
            border: $step-finish-circle-border;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-active-color;
          .#{$namespace}step-title {
            color: $step-finish-title-color;
          }
        }
      }
      &.#{$namespace}step-primary-success {
        .#{$namespace}step-head {
          color: $step-primary-success-head-color;
          .#{$namespace}step-circle {
            border: $step-primary-success-circle-border;
            background: $step-primary-success-circle-background;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-primary-success-title-color;
          .#{$namespace}step-title {
            color: $step-primary-success-title-color;
          }
        }
      }
      &.#{$namespace}step-success {
        .#{$namespace}step-head {
          color: $step-success-head-color;
          .#{$namespace}step-circle {
            border: $step-success-circle-border;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-success-title-color;
          .#{$namespace}step-title {
            color: $step-success-title-color;
          }
        }
      }
      &.#{$namespace}step-primary-error {
        .#{$namespace}step-head {
          color: $step-primary-error-head-color;
          .#{$namespace}step-circle {
            border: $step-primary-error-circle-border;
            background: $step-primary-error-circle-background;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-primary-error-title-color;
          .#{$namespace}step-title {
            color: $step-primary-error-title-color;
          }
        }
      }
      &.#{$namespace}step-error {
        .#{$namespace}step-head {
          color: $step-error-head-color; 
          .#{$namespace}step-circle {
            border: $step-error-circle-border;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-error-title-color;
          .#{$namespace}step-title {
            color: $step-error-title-color;
          }
        }
      }
      &.#{$namespace}step-primary-wait {
        .#{$namespace}step-head {
          color: $step-primary-wait-head-color;
          &::before {
            background: $text-color-secondary-lighter;
          }
          .#{$namespace}step-circle {
            border: $step-primary-wait-circle-border;
            background: $step-primary-wait-circle-background;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-primary-wait-title-color;
          .#{$namespace}step-title {
            color: $step-primary-wait-title-color;
          }
        }
      }
      &.#{$namespace}step-wait {
        .#{$namespace}step-head {
          color: $step-wait-head-color;
          &::before {
            background: $text-color-secondary-lighter;
          }
          .#{$namespace}step-circle {
            border: $step-wait-circle-border;
            color: $step-wait-circle-color;
          }
        }
        .#{$namespace}step-item-box {
          color: $step-wait-title-color;
          .#{$namespace}step-title {
            color: $step-wait-title-color;
          }
        }
      }
    }
  }
  
  .#{$namespace}step-simple {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    margin: $unit-1 0;
    padding: 13px 8%;
    list-style: none;
    .#{$namespace}step-item {
      flex: 1 1 0;
      align-items: center;
      min-height: 1rem;
      margin-top: 0;
      text-align: left;
      color: $text-color-secondary-lighter;
      .#{$namespace}step-head {
        align-self: center;
      }
      &.#{$namespace}step-item-finish,
      &.#{$namespace}step-primary-finish {
        .#{$namespace}step-arrow {
          color: $step-arrow-finish-color !important;
        }
      }
      .#{$namespace}step-item-box {
        width: auto;
        .#{$namespace}step-title:after {
          display: none;
        }
      }
      .#{$namespace}step-arrow {
        display: none;
      }
      &:not(:last-child) {
        .#{$namespace}step-arrow {
          color: $step-arrow-color;
          width: 100%;
          display: inline-block;
          transform: translateX(50%);
        }
      }
    }
  }
  