@import "mixins/mixins";
@import "common/var";
@import "./checkbox";
@import "./radio";
@import "./scrollbar";

@include b(cascader-panel) {
  display: flex;
  border-radius:$--border-radius-base;
  font-size: $--cascader-menu-font-size;

  @include when(bordered) {
    border-radius:$--border-radius-base;
  }
}

@include b(cascader-menu) {
  min-width: 180px;
  max-width: 20em;
  box-sizing: border-box;
  color: $--cascader-menu-font-color;
  border-right: $--cascader-menu-border;

  &:last-child {
    border-right: none;
    .el-cascader-node {
      padding-right: 20px;
    }
  }     

  @include e(wrap) {
    height: 204px;
  }

  @include e(list) {
    position: relative;
    min-height: 100%;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    box-sizing: border-box;
  }

  @include e(hover-zone) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  @include e(empty-text) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: $--cascader-color-empty;
  }
}

@include b(cascader-node) {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 30px 0 24px;
  height: 34px;
  line-height: 34px;
  outline: none;

  &.is-selectable.in-active-path {
    color: $--cascader-menu-font-color;
  }

  &.in-active-path,
  &.is-selectable.in-checked-path,
  &.is-active {
    background: $--background-color-active;
    color: $--font-color-theme-base;
  }

  &:not(.is-disabled) {
    cursor: pointer;
    &:hover {
      background: $--background-color-hover;
      .el-checkbox__input .el-checkbox__inner {
        border: 1px solid $--color-primary;
      }
      .el-radio__input .el-radio__inner {
        border: 1px solid $--color-primary;
      }
    }
    &:focus {
      background: $--background-color-active;
      color: $--font-color-theme-base;
    }
  }

  @include when(disabled) {
    color: $--cascader-node-color-disabled;
    cursor: not-allowed;
  }

  @include e(prefix) {
    position: absolute;
    left: 14px;
  }

  @include e(postfix) {
    position: absolute;
    right: 10px;
  }

  @include e(label) {
    flex: 1;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  > .el-radio {
    margin-right: 0;

    .el-radio__label {
      padding-left: 0;
    }
  }
}
