
.ub-image-list {
  .item {
    margin-bottom: 0.75rem;
    display: block;

    .cover {
      position: relative;
      overflow: hidden;

      img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
      }
    }
  }
}

.ub-image {
  .cover {
    position: relative;
    overflow: hidden;

    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
    }
  }
}

.ub-image-selector {
  position: relative;
  width: 3rem;
  height: 3rem;
  box-shadow: 0 0 1px #CCC;
  border-radius: 0.1rem;
  display: inline-block;
  vertical-align: middle;

  &:hover {
    .tools {
      display: block;
    }
  }

  &.has-value {
    .tools {
      .preview {
        display: inline-block;
      }

      .add {
        display: none;
      }
    }
  }


}

.ub-image-selector, .ub-images-selector {
  .cover {
    width: 100%;
  }

  .tools {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #FFF;
    border-radius: 0.1rem;
    text-align: center;
    padding: 1rem 0 0 0;
    display: none;

    .action {
      color: #FFF;
      display: none;
      line-height: 1rem;
      width: 1rem;
      height: 1rem;
      vertical-align: top;
    }

    .add {
      display: inline-block;
    }

    .close {
      position: absolute;
      top: 0.1rem;
      right: 0.1rem;
      width: 0.6rem;
      height: 0.6rem;
      line-height: 0.6rem;
      text-align: center;
      display: block;
    }
  }
}

.ub-images-selector {
  overflow: hidden;

  .item {
    position: relative;
    width: 3rem;
    height: 3rem;
    box-shadow: 0 0 1px #CCC;
    border-radius: 0.1rem;
    display: inline-block;
    vertical-align: middle;
    margin: 0.05rem .1rem 0.1rem 0.05rem;

    &.add {
      line-height: 3rem;
      text-align: center;

      .action {
        color: #999;
        font-size: 1rem;
      }
    }

    &:hover {
      .tools {
        display: block;

        .action {
          display: inline-block;
        }
      }
    }
  }
}
