@import "mixins/mixins";
@import "common/var";
@import "./checkbox";
@import "./radio";
@import "./scrollbar";

@include b(cascader-panel) {
  display: flex;
  // border-radius: $--cascader-menu-radius;
  border-radius: $--border-radius-medium;
  font-size: $--font-size-body-3;

  @include when(bordered) {
    border: $--cascader-menu-border;
    // border-radius: $--cascader-menu-radius;
    border-radius: $--border-radius-medium;
  }
}

@include b(cascader-menu) {
  min-width: 100px;
  box-sizing: border-box;
  color: $--cascader-menu-font-color;
  border-right: $--cascader-menu-border;

  @include e(wrap) {
    height: 188px!important;
    overflow-x: auto !important;
    margin-bottom: -3px!important;
  }

  @include e(list) {
    max-width: 167px;
    position: relative;
    min-height: 100%;
    margin: 0;
    padding: 4px 0;
    padding-bottom: 8px;
    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;
    width: 100%;
  }
}

@include b(cascader-panel-multiple) {
  @include b(cascader-node) {
    &.is-selectable.in-active-path {
      color: $--cascader-menu-font-color;
      font-weight: $--font-weight-500;
    }
    &.in-active-path,
    &.is-selectable.in-checked-path {
      // &.is-active {
      //color: $--cascader-menu-selected-font-color;
      background: $--cascader-node-background-hover;
      font-weight: $--font-weight-500;
    }

    &.in-active-path,
    &.is-selectable.in-checked-path,
    &.is-active {
      //color: $--cascader-menu-selected-font-color;
      font-weight: $--font-weight-500;
    }
  }
}
@include b(cascader-panel-single) {
  @include b(cascader-node) {
    &.is-selectable.in-active-path {
      color: $--cascader-menu-font-color;
      font-weight: $--font-weight-500;
    }
    &.in-active-path,
    &.is-selectable.in-checked-path {
      // &.is-active {
      //color: $--cascader-menu-selected-font-color;
      background: $--cascader-node-background-hover;
      font-weight: $--font-weight-500;
    }

    &.in-active-path,
    &.is-selectable.in-checked-path,
    &.is-active {
      //color: $--cascader-menu-selected-font-color;
      background: $--cascader-node-background-hover;
      font-weight: $--font-weight-500;
    }
  }
}
@include b(cascader-node) {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px 0 7px;
  height: 36px;
  line-height: 36px;
  outline: none;

  &.is-click{
  background: $--color-fill-3;
  }

  &:not(.is-disabled) {
    cursor: pointer;
    &:hover, &:focus {
      background: $--cascader-node-background-hover;
      font-weight: $--font-weight-500;
    }
    .el-checkbox__input:not(.is-checked):not(.is-indeterminate){
      &:hover {
        background: $--color-text-active;
        // border-radius: 50%;
        border-radius: $--border-radius-circle;
        .el-checkbox__inner {
          border-color: $--cascader-node-color-disabled;
          background: $--color-white;
        }
      }
    }
  }

  .el-checkbox__input {
    display: flex;
    align-items: center;
    .el-checkbox__inner {
      transition: all 0s;
    }
  }

  label.el-checkbox{
    // margin-left: -5px;
    margin-right: 4px;
  }

  @include when(disabled) {
    color: $--color-text-4;
    cursor: not-allowed;
    background-color: $--color-white;
    .el-checkbox__input {
      background-color: transparent;
      border-radius: initial;
    }
  }

  @include e(postfix) {
    font-size: $--font-size-title-1;
  }

  @include e(label) {
    flex: 1;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  > .el-radio {
    margin-right: 0;

    .el-radio__label {
      padding-left: 0;
    }

    .el-radio__input{
      top: -1px;
    }
  }
}
