@import '../style/var';
@import '../style/mixins/clearfix';

.van-sku {
  &-container {
    font-size: 14px;
    background: @white;
    overflow-y: visible;
    max-height: max-content; /* avoid androiod keyboard cover fields */
  }

  &-body {
    max-height: 350px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;

    &::-webkit-scrollbar {
      display: none;
    }
  }

  /* sku header */
  &-header {
    margin-left: 15px;

    &__img-wrap {
      position: relative;
      float: left;
      margin-top: -10px;
      width: 80px;
      height: 80px;
      background: @background-color;
      border-radius: 2px;

      img {
        position: absolute;
        margin: auto;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        max-height: 100%;
      }
    }

    &__goods-info {
      padding: 10px 60px 10px 10px;
      min-height: 82px;
      overflow: hidden;
      box-sizing: border-box;
    }
  }

  &__goods-name {
    font-size: 12px;
  }

  &__price-symbol {
    vertical-align: middle;
  }

  &__price-num {
    font-size: 16px;
    vertical-align: middle;
  }

  &__goods-price {
    color: @red;
    margin-top: 10px;
    vertical-align: middle;
  }

  &__close-icon {
    top: 10px;
    right: 15px;
    font-size: 20px;
    color: @gray-dark;
    position: absolute;
    text-align: center;
  }

  &-group-container {
    margin-left: 15px;
    padding: 12px 0 2px;

    &--hide-soldout {
      .van-sku-row__item--disabled {
        display: none;
      }
    }
  }

  /* sku row */
  &-row {
    margin: 0 15px 10px 0;

    &:last-child {
      margin-bottom: 0;
    }

    &__title {
      padding-bottom: 10px;
    }

    &__item {
      display: inline-block;
      padding: 5px 9px;
      margin: 0 10px 10px 0;
      height: 28px;
      min-width: 52px;
      line-height: 16px;
      font-size: 12px;
      color: @text-color;
      text-align: center;
      border: 1px solid @gray-dark;
      border-radius: 3px;
      box-sizing: border-box;

      &--active {
        color: @white;
        border-color: @red;
        background: @red;
      }

      &--disabled {
        background: @active-color;
        border-color: @border-color;
        color: @gray;
      }
    }
  }

  /* sku stepper */
  &-stepper {
    &-stock {
      padding: 12px 0;
      margin-left: 15px;
    }

    &-container {
      height: 30px;
      margin-right: 20px;
    }
  }

  &__stepper {
    float: right;

    &-title {
      float: left;
      line-height: 30px;
    }
  }

  &__stock {
    display: inline-block;
    margin-right: 10px;
    color: @gray-dark;
    font-size: 12px;
  }

  &__quota {
    display: inline-block;
    color: @red;
    font-size: 12px;
  }

  &-messages {
    padding-bottom: 10px;
    background: @background-color;

    &__image-cell {
      .van-cell__title {
        max-width: 90px;
      }

      .van-cell__value {
        text-align: left;
      }
    }
  }

  &-img-uploader {
    display: inline-block;

    &__header {
      color: @text-color;
      padding: 0 10px;
      font-size: 12px;
      line-height: 24px;
      border-radius: 3px;
      border: 1px solid @border-color;

      .van-icon {
        top: 3px;
        margin-right: 5px;
        font-size: 14px;
      }
    }

    &__img {
      height: 60px;
      width: 60px;
      float: left;
      margin: 10px 10px 0 0;
      position: relative;
      border: 1px solid @border-color;

      img {
        max-width: 100%;
        max-height: 100%;
        top: 50%;
        position: relative;
        transform: translateY(-50%);
      }
    }

    &__delete {
      position: absolute;
      color: @red;
      top: -12px;
      right: -14px;
      z-index: 1;
      padding: 6px;

      &::before {
        border-radius: 14px;
        background-color: @white;
      }
    }

    &__uploading {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
      width: 20px;
      height: 20px;
    }
  }

  /* sku actions */
  &-actions {
    display: flex;
  }
}
