@import "../common/variables";
@import "../common/mixins";

.@{css-prefix} {
  &-tab {
    &-box {
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      background-color: #fff;
    }

    &-nav-nomal {
      .ac-tab-nav {
        display: flex;
        .ac-tab-nav-item {
          width: 1%;
          flex: 1;
          display: block;
        }
      }
    }

    &-nav-scoll {
      .ac-tab-nav {
        .ac-tab-nav-item {
          padding: 0 40rpx;
          display: inline-block;
        }
      }
    }

    &-nav {
      position: relative;
      z-index: 0;
      &:after {
        .bottom-line(@tab-bottom-border-color, 3);
      }

      &-item {
        position: relative;
        text-align: center;
        color: @tab-color;
        font-size: @tab-fontsize;
        line-height: @tab-height;
        .tap-color(@tab-bg, .97);
        > a {
          display: inherit;
          color: inherit;
        }

        &:not(:last-child):after {
          position: absolute;
          top: 35%;
          right: 0;
          content: '';
          width: 1px;
          height: 30%;
          transform: scaleX(.5);
          border-right: 1px solid @tab-break-color;
        }
      }

      .@{css-prefix}-tab-active {
        color: currentColor;
        .tap-color(@tab-bg, 1);
        &:before {
          content: '';
          width: 70%;
          height: 2px;
          position: absolute;
          left: 50%;
          bottom: 0;
          margin-left: -35%;
          z-index: 4;
          background-color: currentColor;
        }
      }
    }

    &-panel {
      position: relative;
      overflow: hidden;
      background-color: #FFF;

      &-item {
        width: 100%;
        position: absolute;
        top: 0;
        transform: translateX(-100%);

        &.@{css-prefix}-tab-active {
          position: relative;
          transition: transform .15s;
          transform: translateX(0);

          & ~ .@{css-prefix}-tab-panel-item {
            transform: translateX(100%);
          }
        }
      }
    }
  }
}
