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

.van-card {
  position: relative;
  box-sizing: border-box;
  padding: @card-padding;
  color: @card-text-color;
  font-size: @card-font-size;
  background-color: @card-background-color;

  &:not(:first-child) {
    margin-top: @padding-xs;
  }

  &__header {
    display: flex;
  }

  &__thumb {
    position: relative;
    flex: none;
    width: @card-thumb-size;
    height: @card-thumb-size;
    margin-right: @padding-xs;
  }

  &__content {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0; /* hack for flex box ellipsis */
    min-height: @card-thumb-size;

    &--centered {
      justify-content: center;
    }
  }

  &__title,
  &__desc {
    word-break: break-all;
  }

  &__title {
    max-height: 32px;
    font-weight: 500;
    line-height: @card-title-line-height;

    .multi-ellipsis(2);
  }

  &__desc {
    max-height: @card-desc-line-height;
    color: @card-desc-color;
    line-height: @card-desc-line-height;
  }

  &__bottom {
    line-height: 20px;
  }

  &__price {
    display: inline-block;
    color: @card-price-color;
    font-weight: 500;
  }

  &__origin-price {
    display: inline-block;
    margin-left: 5px;
    color: @card-origin-price-color;
    font-size: @card-origin-price-font-size;
    text-decoration: line-through;
  }

  &__num {
    float: right;
  }

  &__tag {
    position: absolute;
    top: 2px;
    left: 0;
  }

  &__footer {
    flex: none;
    text-align: right;

    .van-button {
      margin-left: 5px;
    }
  }
}
