@import "../common/var.scss";
@import "../mixins/mixins.scss";
@import "../common/transition.scss";

@include b(collapse) {
  border-top: 1px solid $--collapse-border-color;
  border-bottom: 1px solid $--collapse-border-color;
}
@include b(collapse-item) {
  @include when(disabled) {
    .ss-collapse-item__header {
      color: $--font-color-disabled-base;
      cursor: not-allowed;
    }
  }
  @include e(header) {
    font-family: "PingFang SC";
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: $--collapse-header-height;
    line-height: $--collapse-header-height;
    background-color: $--collapse-header-background-color;
    color: $--collapse-header-font-color;
    cursor: pointer;
    border-bottom: 1px solid $--collapse-border-color;
    font-size: $--collapse-header-font-size;
    font-weight: 600;
    transition: border-bottom-color .3s;
    outline: none;
    &.with-switch{
      cursor: default;
      img{
        cursor: pointer;
      }
      .title-left{
        flex: 1;
        display: flex;
      }
    }
    .title-switch{
      display: inline-flex;
      flex: 1;
      justify-content: space-between;
      align-items: center;
      margin-left: 16px;
      font-weight: 400;  
    }
    // @include e(arrow) {
    //   margin: 0 8px 0 auto;
    //   transition: transform .3s;
    //   font-weight: 300;
    //   @include when(active) {
    //     transform: rotate(90deg);
    //   }
    // }
    img{
      width: 24px;
      height: 24px;
      margin-left: 8px;
    }
    &.focusing:focus:not(:hover){
      color: $--color-primary;
    }
    @include when(active) {
      border-bottom-color: transparent;
    }
  }

  @include e(wrap) {
    will-change: height;
    background-color: $--collapse-content-background-color;
    box-sizing: border-box;
    border-bottom: 1px solid $--collapse-border-color;
  }

  @include e(content) {
    font-size: $--collapse-content-font-size;
    color: $--collapse-content-font-color;
    line-height: 1.769230769230769;
  }

  &:last-child {
    margin-bottom: -1px;
  }
}
