@import './theme/default.pcss';
$c-gray-darker: $theme-stroke-3 !default;

.zent-sku {
  background-color: $theme-stroke-10;
  padding: 10px;
  border: 1px solid $theme-stroke-7;

  &-pop {
    z-index: 1;
  }

  &-group {
    position: relative;

    &:hover .group-remove {
      display: block;
    }

    .group-title {
      position: relative;
      padding: 7px 10px;
      margin: 0;
      color: $theme-stroke-3;
      background-color: $theme-stroke-9;
      font-size: 12px;
      line-height: 16px;
      font-weight: normal;
    }

    .group-remove {
      display: none;
      position: absolute;
      top: 12px;
      right: 10px;
      color: $theme-stroke-10;
      text-align: center;
      cursor: pointer;
      width: 18px;
      height: 18px;
      font-size: 14px;
      line-height: 16px;
      background: $theme-mask-3;
      border-radius: 10px;
      text-indent: 0;
    }

    .sku-group-cont {
      padding: 0 10px;
      margin-bottom: 10px;

      .help-block {
        line-height: 14px;
        font-size: 12px;
        margin-top: 6px;
        margin-bottom: 0;

        ul li {
          font-size: 12px;
          line-height: 12px;
        }

        &:empty {
          margin-top: 0 !important;
        }
      }
    }

    h4 {
      font-size: 12px;
      font-weight: bold;
      margin: 0;
    }

    .addImg-radio {
      display: inline-block;
      margin: 3px 0 0 30px;

      input {
        vertical-align: 0;
        margin-right: 6px;
      }
    }

    .group-container {
      color: $c-gray-darker;
      padding: 10px;
      margin-bottom: 10px;

      .zent-sku-pop {
        margin: 0;
      }
    }

    .sku-list {
      ul {
        & > li {
          float: left;
          width: 20%;
          text-align: left;
        }
      }
    }

    .sku-add {
      display: inline-block;
      padding: 0 5px;
      margin: 9px 5px 0;
      vertical-align: top;
      font-size: 12px;
      color: $theme-primary-2;
      text-decoration: none;
      cursor: pointer;
    }

    .zent-sku-pop {
      cursor: pointer;
      font-size: 12px;
      display: inline-block;
      padding: 0 5px;
      margin: 9px 5px 0;
      vertical-align: top;
    }
  }

  .zent-sku-item {
    background-color: $theme-stroke-9;
    padding: 5px;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
    margin-top: 5px;
    width: 80px;
    vertical-align: middle;
    text-align: center;
    position: relative;
    border-radius: 2px;
    cursor: pointer;

    span {
      display: block;
      width: 74px;
      margin: 0 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .item-remove {
      position: absolute;
      z-index: 2;
      top: -9px;
      right: -9px;
      width: 20px;
      height: 20px;
      font-size: 16px;
      line-height: 18px;
      color: $theme-stroke-10;
      text-align: center;
      cursor: pointer;
      background: $theme-mask-3;
      border-radius: 10px;

      &:hover {
        color: $theme-stroke-10;
        background: $theme-stroke-1;
      }

      &.small {
        top: -8px;
        right: -8px;
        width: 18px;
        height: 18px;
        font-size: 14px;
        line-height: 16px;
        border-radius: 9px;
      }
    }

    .item-remove {
      display: none;
    }

    &:hover {
      .item-remove {
        display: block;
      }
    }

    &.active {
      margin-bottom: 100px;
    }

    .upload-img-wrap {
      position: absolute;
      top: 36px;
      left: 0;
      padding: 2px;
      width: 84px;
      background: $theme-stroke-10;
      border-radius: 4px;
      border: 1px solid $theme-stroke-7;

      img {
        width: 100%;
        height: 100%;
        cursor: pointer;
      }

      .add-image,
      .zent-upload-trigger {
        width: 84px;
        height: 84px;
        line-height: 84px;
        text-align: center;
        background: $theme-stroke-10;
        font-size: 30px;
        color: $theme-stroke-7;
        cursor: pointer;
        border: 0;
      }

      .upload-img {
        position: relative;
        width: 84px;
        height: 84px;

        &:hover {
          .item-remove {
            display: inline;
          }

          .img-edit {
            display: block;
          }
        }
      }

      .arrow {
        position: absolute;
        width: 0;
        height: 0;
        top: -5px;
        left: 44%;
        border-style: solid;
        border-color: transparent;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: 5px solid $theme-stroke-1;

        &::after {
          position: absolute;
          display: block;
          width: 0;
          height: 0;
          border-color: transparent;
          border-style: solid;
          top: 0;
          margin-left: -10px;
          border-bottom-color: $theme-stroke-10;
          border-width: 10px;
          border-top-width: 0;
          content: "";
        }
      }

      .img-edit {
        cursor: pointer;
        display: none;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        color: $theme-stroke-10;
        opacity: 0.5;
        background: $theme-stroke-1;
      }
    }
  }
}
