.#{$ns}Wizard {
  @include clearfix();
  position: relative;

  &,
  &-tabs {
    padding: 0;

    .#{$ns}Badge {
      display: inline-block;
      width: var(--Wizard-badge-size);
      height: var(--Wizard-badge-size);
      font-size: var(--Wizard-badge-fontSize);
      line-height: var(--Wizard-badge-size);
      color: var(--Wizard-badge-color);
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      background: var(--Wizard-badge-bg);
      border-radius: var(--Wizard-badge-borderRadius); // font-weight: 700;
      text-shadow: 0 px2rem(1px) 0 rgba(0, 0, 0, 0.2);
      margin-right: var(--Wizard-badge-marginRight);
      border: var(--Wizard-badge-border);
      box-sizing: content-box;

      // &--primary {
      //     background: var(--primary);
      // }

      // &--secondary {
      //     background: var(--secondary);
      // }

      // &--success {
      //     background: var(--success);
      // }

      // &--info {
      //     background: var(--info);
      // }

      // &--warning {
      //     background: var(--warning);
      // }

      // &--danger {
      //     background: var(--danger);
      // }

      // &--light {
      //     background: var(--light);
      // }

      // &--dark {
      //     background: var(--dark);
      // }
      &.is-active {
        color: var(--white);
        background: var(--Wizard-badge-onActive-backgroundColor);
      }

      &.is-complete {
        color: var(--white);
        background: var(--Wizard-badge-onComplete-backgroundColor);
      }
    }

    ul li.active {
      color: var(--info);
    }

    .#{$ns}Panel-footer>.#{$ns}Form-group,
    .#{$ns}Panel-footer>.btn {
      margin-left: var(--gap-xs);
    }

    >ul.nav {
      padding: 0;
      margin: 0;
      border: var(--borderWidth) solid var(--borderColor);

      li {
        position: relative;
        float: left;
        padding: 0 var(--gap-md) 0 px2rem(25px);
        margin: 0;
        color: #999999;
        cursor: pointer;
        height: var(--Wizard-steps-height);
        line-height: var(--Wizard-steps-height);

        a {
          border: 0 none !important;
          background: transparent !important;
          color: inherit;
          display: inline;
          padding: 0;

          div {
            display: inline;
          }
        }

        &:first-child {
          padding-left: var(--gap-md);
          border-radius: px2rem(4px) 0 0 0;
        }

        &:before,
        &:after {
          content: '';
          position: absolute;
          right: px2rem(-10px);
          border: var(--gap-md) solid transparent;
          border-right: 0;
          border-left: px2rem(10px) solid var(--borderColor);
          border-left-color: rgba(0, 0, 0, 0.05);
          z-index: 1;
          bottom: 0;
        }

        &:after {
          right: px2rem(-9px);
          border-left-color: var(--Wizard-steps-bg);
          z-index: 2;
        }

        &.is-active {
          color: var(--Wizard-steps-li-onActive-color);
          background: #fff;
        }

        &.is-active:after {
          border-left-color: #fff;
        }
      }

      // .Badge {
      //     margin-right: px2rem(4px);
      // }
    }
  }

  &-steps {
    font-size: var(--fontSizeBase);
    padding: var(--Wizard-steps-padding);
    background: var(--Wizard-steps-bg);
    border-bottom: var(--Wizard-steps-borderWidth) solid var(--borderColor);
    text-align: var(--Wizard-steps-textAlign);
    @include clearfix();

    ul {
      display: var(--Wizard-steps-ulDisplay);
      padding: 0;
      margin: 0;
      list-style: none outside none;

      li {
        position: relative;
        float: left;
        padding: 0 var(--gap-md) 0 px2rem(25px);
        margin: 0;
        color: #999999;
        cursor: default;
        height: var(--Wizard-steps-height);
        line-height: var(--Wizard-steps-height);

        &:first-child {
          padding-left: var(--gap-md);
          border-radius: px2rem(4px) 0 0 0;
        }

        &:before,
        &:after {
          font-family: var(--Wizard-steps-liVender);
          content: var(--Wizard-steps-liAfterContent);
          position: absolute;
          bottom: 0;
          right: px2rem(-10px);
          border: $Wizard-steps-liAfterBorder;
          border-right: 0;
          border-left: px2rem(10px) solid var(--borderColor);
          border-left-color: rgba(0, 0, 0, 0.05);
          z-index: 2;
        }

        &:after {
          right: px2rem(-9px);
          border-left-color: var(--Wizard-steps-bg);
          z-index: 2;
        }

        &.is-active {
          color: var(--Wizard-steps-li-onActive-color);
          background: var(--Wizard-steps-li-onActive-bg);
        }

        &.is-active:after {
          border-left-color: var(--Wizard-steps-li-onActive-arrow-bg);
        }

        &.is-complete,
        &.is-complete:hover {
          color: var(--Wizard-steps-li-onActive-color);
          cursor: pointer;
        }
      }

      // .Badge {
      //     margin-right: px2rem(4px);
      // }
    }
  }

  &-stepContent {
    padding: var(--Wizard-stepsContent-padding);

    & .Step-pane {
      display: none;

      &.is-active {
        display: inherit;
      }
    }
  }

  &--horizontal {
    height: calc(100% - 50px) !important;

    >.#{$ns}Wizard-step {
      height: 100%;
      display: flex;
      flex-direction: column;

      >.#{$ns}Wizard-stepContent {
        flex: 1;
        overflow: auto;
      }
    }
  }

  &--vertical {
    height: calc(100% - 50px);

    >.#{$ns}Wizard-step {
      height: 100%;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      border-bottom: none;

      >.#{$ns}Wizard-steps {
        height: 100%;
        min-width: 40px;
        margin-right: 30px;
        // margin-bottom: px2rem(30px); // padding: 0;
        background: none;
        border-bottom: none;

        li {
          background: var(--Wizard-steps-bg);
        }

        ul li {
          height: px2rem(40px);
          line-height: px2rem(40px);
          position: relative;
          float: none;
          border-bottom: var(--borderWidth) solid var(--borderColor);
          padding-left: var(--gap-md);

          &.is-active {
            background: #fff;
          }
        }
      }

      >.#{$ns}Wizard-stepContent {
        flex-grow: 1;
        width: 0;
        height: 100%;
        overflow: auto;
      }
    }
  }
}

.#{$ns}Combination.#{$ns}Wizard {
  background-color: #f7f9fc;
  border-color: transparent;

  .#{$ns}Wizard-step {
    .#{$ns}Wizard-steps {
      background-color: #fff;

      .step-ul {


        &::-webkit-scrollbar {
          width: 0px;
          height: 0px;
        }

        li {
          .#{$ns}Badge {
            width: 20px;
            height: 20px;
            line-height: 20px;
            border-radius: 50%
          }
        }
      }
    }

    .#{$ns}Wizard-stepContent {
      background-color: #fff;
    }
  }
}

.#{$ns}Combination.#{$ns}Wizard--horizontal {
  .#{$ns}Wizard-step {
    .#{$ns}Wizard-steps {
      margin-bottom: 5px;
      padding: 5px 10px;
      overflow-y: hidden;
      overflow-x: auto;

      .step-ul {
        white-space: nowrap;
        height: 40px;

        li {
          background-color: #f7f9fc;
          overflow: hidden;
          margin-right: 5px;
          padding: 0 1.56rem 0 1rem;
          display: inline-block;
          float: none;
          border-radius: 0.25rem 0 0 0.25rem;

          &::before,
          &::after {
            border-left: 1.125rem solid#f7f9fc;
            border: none;
            width: 28px;
            height: 28px;
            background: #fff;
            transform: rotate(45deg);
            right: -15px;
            top: 26px;
          }

          &::after {
            top: -14px !important;
          }
        }

        .is-active {
          color: #fff;
          background-color: var(--saas-Primary-Color);

          .#{$ns}Badge {
            border: transparent;
            background-color: #fff;
            color: var(--saas-Primary-Color);
          }
        }
      }
    }
  }
}

.#{$ns}Combination.#{$ns}Wizard--vertical {
  .#{$ns}Wizard-step {
    .#{$ns}Wizard-steps {
      margin-right: 8px;

      .step-ul {
        overflow: auto;
        height: 100%;

        li {
          background: #fff;
          border: none;
          height: 3rem;
          line-height: 3rem;

          .#{$ns}Badge {
            width: 24px;
            height: 24px;
            line-height: 24px;
            border: 1px solid transparent;
            background: #e2f6ff;
            color: var(--saas-Primary-Color);

            &::before {
              content: "";
              position: absolute;
              top: 26px;
              width: 2px;
              height: 20px;
              border-right: 2px solid #e9f6f1;
              z-index: 1;
              left: 9px;
            }
          }

          &::before,
          &::after {
            content: none;
          }
        }

        .is-complete {
          .#{$ns}Badge {
            background: #fff;
            border: 1px solid var(--saas-Primary-Color);
            color: var(--saas-Primary-Color);

            &::before {
              border-right-style: solid;
              border-right-color: var(--saas-Primary-Color);
            }
          }
        }

        .is-active {
          font-weight: 600;

          .#{$ns}Badge {
            background: var(--saas-Primary-Color);
            border: 1px solid var(--saas-Primary-Color);
            color: #fff;
          }
        }

        li:nth-last-child(1) {
          .#{$ns}Badge {
            &::before {
              content: none;
            }
          }
        }
      }
    }
  }
}

.#{$ns}Wizard-footer {
  height: 50px;
  margin-left: -16px;
  margin-right: -16px;
  margin-top: 5px;
}

@include media-breakpoint-down(sm) {
  .#{$ns}Wizard {
    height: 100%;

    &-step {
      height: 100%;
      display: flex;
      flex-direction: column;

      .#{$ns}Wizard-stepContent {
        flex: 1;
        overflow-y: auto;
      }
    }
  }

  .#{$ns}Wizard--horizontal {
    .#{$ns}Wizard-step {
      .#{$ns}Wizard-steps {
        overflow: hidden;

        >ul {
          display: flex;
          justify-content: flex-start;
          flex-wrap: nowrap;
          overflow-x: auto;

          >li {
            display: flex;
            justify-content: flex-start;
            align-items: center;
          }
        }

        >ul::-webkit-scrollbar {
          width: 0px;
          height: 0px;
          background-color: transparent;
        }
      }
    }
  }

  .#{$ns}Wizard-footer {
    height: 50px;
    margin: 0;
  }

  .#{$ns}Combination.#{$ns}Wizard--horizontal {
    margin: 0;
    background-color: #fff;
    border-color: #eceff8;

    .#{$ns}Wizard-step {
      .#{$ns}Wizard-steps {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
        margin-bottom: 0;

        &::-webkit-scrollbar {
          width: 0px;
          height: 0px;
        }

        .step-ul {
          display: block;
          overflow-y: hidden;
        }
      }
    }
  }
}
