@import "./abstracts/variable";
@import "./abstracts/mixin";
@import "./icon.scss";

@include b(cell) {
  display: block;
  position: relative;
  padding-left: $-cell-padding;
  background-color: $-color-white;
  text-decoration: none;
  color: $-cell-title-color;
  line-height: $-cell-ling-height;
  -webkit-tap-highlight-color: transparent;

  @include e(wrapper) {
    position: relative;
    display: flex;
    padding: $-cell-wrapper-padding $-cell-padding $-cell-wrapper-padding 0;
    justify-content: space-between;
    align-items: flex-start;

    @include when(vertical) {
      display: block;

      .wd-cell__right {
        margin-top: $-cell-vertical-top;
      }
      .wd-cell__value {
        text-align: left;
      }
    }
    @include when(label) {
      padding: $-cell-wrapper-padding-with-label $-cell-padding $-cell-wrapper-padding-with-label 0;
    }
  }
  @include e(left) {
    position: relative;
    flex: 1;
    display: flex;
    margin-right: $-cell-padding;
    font-size: $-cell-title-fs;
    box-sizing: border-box;

    @include when(required) {
      padding-left: 12px;

      &::after {
        position: absolute;
        content: '*';
        top: 0;
        left: 0;
        font-size: $-cell-required-size;
        color: $-cell-required-color;
      }
    }
  }
  @include e(right) {
    position: relative;
    display: flex;
    flex: 1;
  }
  @include e(title) {
    flex: 1;
    width: 100%;
    font-size: $-cell-title-fs;
    margin-right: $-cell-padding;
  }
  @include e(label) {
    margin-top: 2px;
    font-size: $-cell-label-fs;
    color: $-cell-label-color;
    @include lineEllipsis;
  }
  @include e(icon) {
    display: block;
    position: relative;
    width: $-cell-icon-size;
    height: $-cell-icon-size;
    line-height: 1.25;
    margin-right: $-cell-icon-right;
    font-size: $-cell-icon-size;
  }
  @include e(value) {
    position: relative;
    flex: 1;
    font-size: $-cell-value-fs;
    color: $-cell-value-color;
    text-align: right;
    line-height: $-cell-value-line-height;
  }
  @include e(arrow-right) {
    display: inline-block;
    margin-left: 8px;
    width: $-cell-arrow-size;
    height: $-cell-arrow-size;
    line-height: 1.25;
    font-size: $-cell-arrow-size;
    color: $-cell-arrow-color;
    vertical-align: middle;
  }
  @include when(link) {
    transition: background 0.2s;
    -webkit-tap-highlight-color: $-cell-tap-bg;

    &:active {
      background: $-cell-tap-bg;
    }
  }
  @include when(large) {
    .wd-cell__title {
      font-size: $-cell-title-fs-large;
    }
    .wd-cell__label {
      font-size: $-cell-label-fs-large;
    }
    .wd-cell__icon {
      font-size: $-cell-icon-size-large;
      width: $-cell-icon-size-large;
      height: $-cell-icon-size-large;
    }
  }
  @include when(align-center) {
    .wd-cell__wrapper {
      align-items: center;
    }
  }
}
