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

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

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

  &-input {
    width: calc(100% - 24px);
    height: 32px;
    margin-left: 12px;
    margin-top: 10px;
    & + div {
      margin-top: 10px;
    }
    .el-input__icon, .el-input__inner {
      height: 32px;
      line-height: 32px;
    }

    &+.el-cascader-panel {
      .el-cascader-menu__list {
        padding-top: 0;
      }
    }
  }

  &-content {
    display: flex;

    .el-cascader-menu {
      &__wrap {
        height: 204px;
      }
    }
  }
}

@include b(cascader-menu) {
  width: 100%;
  min-width: 180px;
  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(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 12px;
  height: 40px;
  line-height: 40px;
  outline: none;

  i {
    color: $--color-text-secondary;
  }

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

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

    i {
      color: $--cascader-menu-selected-font-color
    }
  }

  &:not(.is-disabled) {
    cursor: pointer;
    &:hover, &:focus {
      background: $--cascader-node-background-hover;
    }
  }

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

    i {
      color: #DCDFE6;
    }
  }

  @include e(prefix) {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }

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

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

  @include e(div) {
    .el-radio, .el-checkbox {
      padding-right: 8px;
    }
    > .el-radio {
      margin-right: 0;
  
      .el-radio__label {
        padding-left: 0;
      }
    }
  }

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

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