//
// Cell
//
$cell-height: rem(44px);

.container_cell, .xm-cell-container {
  background: #F8F8F8;
}

.xm-cell {
  overflow: hidden;
  margin: 0 -1rem;
  position: relative;
  line-height: rem(44px);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  @include set-line(top, $left: 1rem);
  &:first-child {
    @include set-line(none);
    &:before {
      display: none;
    }
  }
  > .xm-title {
    flex: 1;
    color: $c-font-dark;
    min-width: 6.5rem;
  }
  > .xm-desc {
    text-align: right;
    color: $c-font-lightest;
  }
  > .xm-img:first-child {
    margin-left: rem(-2px);
    margin-right: rem(10px);
  }

  //input
  > .xm-input {
    width: 100%;
    border: 0;
    outline: 0;
    -webkit-appearance: none;
    background-color: transparent;
    font-size: inherit;
    color: inherit;
    height: rem(24px);
    line-height: rem(24px);
    // hides the spin-button
    &::-webkit-outer-spin-button, &::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  }
  > .icon-info-circle {
    font-size: rem(18px);
    color: $c-theme;
  }
  input::placeholder, textarea::placeholder {
    color: $c-font-lightest;
  }
  &.status-wrong {
    > .xm-title, .icon-warn {
      color: $c-red;
    }
    > .icon-warn {
      font-size: rem(18px);
    }
  }
  //check
  @mixin cell-iconfont {
    outline: none !important;
    border: none !important;
    background: none !important;
    -webkit-appearance: none;
    width: rem(24px);
    height: rem(44px);
    &:after {
      font-family: 'iconfont-base';
      display: block;
      text-align: center;
      width: rem(24px);
      content: '';
    }
  }
  > input[type='radio'] {
    @include cell-iconfont;
    &:checked:after {
      height: rem(44px);
      content: '\EA08';
      color: $c-theme;
      font-size: 16px;
    }
  }
  > input[type='checkbox']:not(.xm-switch) {
    @include cell-iconfont;
    margin-right: rem(10px);
    &:after {
      border-radius: 50%;
      border: 1px solid $c-line-dark;
      height: rem(24px);
      line-height: rem(24px);
      font-size: 12px;
      color: #FFF;
      margin-top: rem(10px);
    }
    &:checked:after {
      content: '\EA08';
      background: $c-theme;
      border-color: $c-theme;
    }
    &.small-fix{
      transform: scale(0.6);
      margin-right: 0;
    }
  }

  //textarea
  > textarea {
    display: block;
    background: transparent;
    border: 0;
    resize: none;
    flex: 0 0 100%;
    color: inherit;
    font-size: 1rem;
    line-height: 1.2;
    margin-top: 1rem;
    margin-bottom: 2.2rem;
    outline: 0;
  }

  > .textarea-counter {
    color: $c-font-lightest;
    position: absolute;
    bottom: 0;
    right: 1rem;
  }

  //select
  > .xm-select {
    display: flex;
    min-width: 6.5rem;
    width: 100%;
    position: relative;
    z-index: 1;
    @include set-arrow(right);
    > select {
      @include xm-col;
      -webkit-appearance: none;
      border: 0;
      outline: 0;
      background-color: transparent;
      color: $c-font-dark;
      font-size: inherit;
      height: $cell-height;
      line-height: $cell-height;
    }
    &.xm-title {
      @include set-line(right);
      &:before {
        right: 1rem;
      }
      &:after {
        right: 2rem;
      }
    }
  }
}

label, a {
  &.xm-cell {
    @include cell-press-effect();
  }
}

a.xm-cell:not([role='button']) {
  @include set-arrow(right);
}

a.xm-cell[role='button'] {
  display: block;
  text-align: center;
  color: $c-font-dark;
  &:before {
    left: 0;
  }
}

//

.xm-cell-tips {
  padding: rem(12px) 1rem;
  font-size: rem(13px);
  color: $c-font-light;
}

@import "switch";
@import "uploader";