$namespace: "pay";

@mixin pay-box($width: auto, $height: auto) {
  background-color: #f7f7f7;
  width: $width;
  height: $height;
  border-radius: $--radius;
}

@include b(line) {
  height: 0.2rem;
  background-color: #f5f5f5;
  margin-left: -0.24rem;
  margin-right: -0.24rem;
}

@include b(type) {
  margin-bottom: .3rem;
  .title {
    height: 1rem;
    line-height: 1rem;
    font-size: 0.28rem;
  }
  @include e(list) {
    display: flex;
    justify-content: space-between;
  }
  @include e(item) {
    &:first-child {
      margin-right: 0.3rem;
    }
    &.cur{
      border: 1px solid #EF5952;
    }
    padding: 0 0.3rem;
    border-radius: 0.12rem;
    border: 1px solid #E5E5E5;
    height: 1rem;
    display: flex;
    align-items: center;
    flex: 1;
    font-size: .28rem;
    .name{
      flex-grow:1;
    }
    .icon {
      width: 0.6rem;
      height: 0.6rem;
      margin-right: .14rem;
    }
    .check-img{
      width: .32rem;
      height: .32rem;
    }
  }
}

@include b(coupon) {
  display: flex;
  margin-top: 0.2rem;
  height: 1rem;
  line-height: 1rem;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f5f5f5;
  @include e(img) {
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 0.26rem;

    img {
      width: 0.408rem;
      height: 0.312rem;
      display: inline-block;
      margin-right: 0.16rem;
    }
  }

  @include e(right) {
    display: flex;
    align-items: center;
    color: #999;

    img {
      width: 0.12rem;
      margin-left: 0.14rem;
    }
  }
}

@include b(fee) {
  font-size: $--font-size-big;
  color: $--font-color-dark;
  margin-bottom: 0.2em;
  // padding: 0 0.15rem;
  position: relative;

  span {
    font-weight: bold;
  }

  // &::before {
  //   content: "";
  //   position: absolute;
  //   left: 0rem;
  //   top: 50%;
  //   width: 0.1rem;
  //   height: 0.1rem;
  //   transform: translateY(-50%);
  //   background: #ff393a;
  //   border-radius: 50%;
  // }
}

@include b(account) {
  font-size: $--font-size-large;
  color: $--font-color-dark;
  // padding: 0 0.15rem;
  position: relative;
  // margin-bottom: 0.05rem;

  // &::before {
  //   content: "";
  //   position: absolute;
  //   left: 0rem;
  //   top: 50%;
  //   width: 0.1rem;
  //   height: 0.1rem;
  //   transform: translateY(-50%);
  //   background: #ff393a;
  //   border-radius: 50%;
  // }
}

@include b(explain) {
  font-size: $--font-size-medium;
  color: #4c4c4c;
  margin: 0.3rem 0 0.2rem;
}

@include b(product) {
  @include flex();
  flex-wrap: wrap;

  @include e(item) {
    @include pay-box(3.4rem, 1.8rem);
    @include flex($direction: column, $space: center);
    position: relative;
    margin-bottom: 0.2rem;
    text-align: center;
    flex-wrap: wrap;
    line-height: 1.6;
    border: 1px solid #f7f7f7;
    // padding-bottom: 0.56rem;

    @include when(first) {
      position: relative;
      border-color: #f7f7f7;

      &::after {
        content: "";
        position: absolute;
        // top: -.5rem;
        // right: .1rem;
        // height: .69rem;
        // width: .58rem;
        top: -0.08rem;
        right: -0.01rem;
        height: 0.5rem;
        width: 1.2rem;
        background: url(~@/assets/shoc.png) no-repeat center / 100%;
      }

      .pay-product__name,
      .pay-product__intro {
        // color: #c09d00;
      }
    }

    @include when(active) {
      // background-color: $--color-theme-girl;
      background-color: #fff5f6;
      border-color: #ff393a;

      // box-shadow:  0 0 .16rem  rgba($--color-theme-girl, .5);
      .pay-product__name,
      .pay-product__intro {
        // color: #fff;
        color: #ff393a;
      }

      .pay-product__name {
        font-weight: bold;
      }

      .red {
        // color: #fff000;
        font-weight: bold;
      }

      .cheaper-box {
        border-color: #ff393a;

        span {
          color: #ff393a;
        }

        .text {
          background: #ff393a;
          color: #fff;
        }
      }

      .pay-product__gift {
        border: none;
        border-top: 1px solid #ff9e7c;
        background: #ff393a;
        color: #fff;
      }
    }

    @include when(recommend) {
      position: relative;

      &::after {
        content: "";
        position: absolute;
        // top: -.5rem;
        // right: .1rem;
        // height: .69rem;
        // width: .58rem;
        top: -0.08rem;
        right: -0.01rem;
        height: 0.5rem;
        width: 1.2rem;
        background: url(~@/assets/jinri.png) no-repeat center / 100%;
      }
    }

    .pay-product__gift {
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translate(-50%, 0);
      font-size: $--font-size-tiny;
      width: 100%;
      height: 0.56rem;
      line-height: 0.56rem;
      color: #ff9e7c;
      border: 1px solid #ff9e7c;
      background: #fff;
      border-radius: 0 0 $--radius $--radius;
      overflow: hidden;
    }

    .item-tag {
      position: absolute;
      top: 0;
      right: 0;
      background: $--color-theme-girl;
      color: #fff;
      font-size: 0.24rem;
      border-radius: 0.06rem;
      padding: 0.01rem 0.1rem;
    }
  }

  @include e(name) {
    font-size: $--font-size-large;
    color: $--font-color-dark;
  }

  @include e(intro) {
    font-size: $--font-size-big;
    color: #999;

    &.cheaper-box {
      @include flex($space: flex-start);
      font-size: $--font-size-small;
      border: 1px solid #ff9470;
      border-radius: 20px;
      overflow: hidden;

      span {
        padding: 0 0.1rem;
        color: #ff9470;
      }

      .text {
        color: #fff;
        background: #ff9470;
      }

      .is_year {
        background: url(~@/assets/year_pay.png) no-repeat center / contain;
        width: 0.32rem;
        height: 0.32rem;
        display: inline-block;
        vertical-align: text-top;
      }
    }
  }
}

@include b(btn) {
  display: block;
  width: 5.8rem;
  height: 1rem;
  margin: 0.1rem auto 0;
  border-radius: 0.5rem;
  line-height: 1rem;
  font-size: $--font-size-large;
  box-shadow: 0 0 0.16rem rgba($--color-theme-girl, 0.5);
  text-align: center;
  background: linear-gradient(
    to right,
    darken($--color-theme-girl, 3%),
    lighten($--color-theme-girl, 3%)
  );
  color: #fff;
}

@include b(agreement) {
  margin-top: 0.3rem;
  text-align: center;
  color: #b2b2b2;
  font-size: $--font-size-small;
}

@include b(tip) {
  @include pay-box($height: 1.6rem);
  font-size: $--font-size-medium;
  padding: 1em;
  box-sizing: border-box;
  line-height: 1.8;
  margin-top: 0.5rem;
}

@include b(shubi-tip) {
  text-align: center;
  color: #999;
  margin-top: 1em;
}

@include b(shubis-tip) {
  text-align: left;
  color: #999;
  margin: 1em auto 0;

  @include b(shubi-tip__item) {
    display: block;
    margin-top: 5px;
  }
}

.pay-btn-box {
  @include flex();
  width: 95%;
  margin: 0.2rem auto 0;
}

.help-pay__btn {
  display: block;
  width: 5.8rem;
  height: 1rem;
  margin: 0.1rem auto 0;
  border-radius: 0.5rem;
  line-height: 1rem;
  font-size: 0.36rem;
  text-align: center;
  color: $--color-theme-girl;
  border: 1px solid $--color-theme-girl;
  border-radius: 0.5rem;
  margin-top: 0.2rem;
}

.pay-product__adwrap {
  width: 3.4rem;
  height: 1.8rem;
  margin-bottom: 0.2rem;
  border-radius: 0.06rem;
  font-size: 0;

  img {
    width: 100%;
  }
}

.pay-for__year {
  font-size: 0;
  margin-bottom: 0.2rem;

  img {
    width: 100%;
  }
}

.pay-for__gift--txt {
  margin: 0.32rem auto;
  text-align: center;
  font-size: $--font-size-small;
  color: $--font-color-medium;

  i {
    color: #ff4242;
    font-style: normal;
    font-weight: bold;
  }
}

.has-banner {
  @include b(product) {
    width: 95%;
    margin: 0.22rem auto 0;

    .pay-product__item {
      // @include pay-box(3.15rem, 1.5rem);
      width: 3.15rem;
      height: 1.5rem;
      border-color: #e6e6e6;
      background: #fff;

      &.is-active {
        background-color: #fff5f6;
        border-color: #ff393a;
      }

      img {
        width: 100%;
      }

      &.pay-product__item--year {
        width: 100%;
        border: none;
        height: auto;
      }
    }
  }

  .pay-product__name {
    font-size: $--font-size-big;
    color: $--font-color-medium;
    font-weight: bold;
  }

  .pay-product__intro {
    font-size: $--font-size-base;

    &.cheaper-box {
      font-size: $--font-size-tiny;
    }
  }

  @include b(btn) {
    display: block;
    flex: 1;
    width: auto;
    height: 0.9rem;
    border-radius: 2px;
    line-height: 0.9rem;
    font-size: $--font-size-big;
    box-shadow: 0 0 0.16rem rgba(#ef5952, 0.53);
    text-align: center;
    background: linear-gradient(
      to right,
      darken(#ff591f, 3%),
      lighten(#ff1a1a, 3%)
    );
    color: #fff;
    font-weight: bold;
    margin: 0;
  }

  .help-pay__btn {
    display: block;
    width: 2.18rem;
    height: 0.9rem;
    line-height: 0.9rem;
    font-size: 0.28rem;
    text-align: center;
    color: #ff6060;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    margin-right: 0.24rem;
    color: #999;
    margin-top: 0;
  }

  @include b(fee) {
    font-size: $--font-size-small;
    color: #666;
    // margin-bottom: 0.2em;
    // padding: 0 0.15rem;
    position: relative;

    span {
      font-weight: bold;
    }
  }

  @include b(account) {
    font-size: $--font-size-big;
    color: $--font-color-dark;
    // padding: 0 0.15rem;
    position: relative;
    margin-bottom: 0.05rem;

    span {
      font-weight: bold;
    }

    .no-enough-money {
      background: url(~@/assets/no-enough.png) left top / contain no-repeat;
      width: 1.44rem;
      height: 0.4rem;
      display: inline-block;
      vertical-align: middle;
      margin-left: 0.1rem;
    }
  }

  @include b(explain) {
    font-size: $--font-size-small;
    color: #333;
    width: 95%;
    margin: 0 auto 0.2rem;
  }
}

.pay-product__month {
  font-size: 0;
  width: 100%;

  img {
    width: 100%;
  }
}

.xiyue-pay-template {
  &.section-edge-all {
    padding: 0;
    margin: 0;
  }

  .user-balance {
    padding: 0 0.24rem 0.2rem;
    margin: 0.24rem 0;
    border-bottom: 0.2rem solid #f7f7f7;
  }

  .xiyue-entry {
    font-size: 0;
    padding: 0 0.24rem;
    margin: 0.24rem 0;

    img {
      width: 100%;
    }
  }

  .pay-wrap {
    padding: 0 0.24rem 0.2rem;
    margin: 0.24rem 0;

    .pay-product,
    .pay-explain {
      width: 100%;
    }

    .pay-product__item {
      width: 3.4rem;
      height: 1.8rem;
    }
  }
}
