/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';
@import '../checkbox/vars.less';
@import '../checkbox-button/vars.less';
@import './vars.less';

@checkbox-group-prefix-cls: ~'@{css-prefix}checkbox-group';
@checkbox-button-prefix-cls: ~'@{css-prefix}checkbox-button';
@checkbox-prefix-cls: ~'@{css-prefix}checkbox';

.@{checkbox-group-prefix-cls} {
  .component-css-vars-checkbox();
  .component-css-vars-checkbox-button();
  .component-css-vars-checkbox-group();

  display: flex;
  flex-wrap: var(--ti-checkbox-group-flex-wrap);
  width: 100%;
  margin-top: var(--ti-checkbox-group-margin-top);

  &.is-vertical {
    display: inline-block;

    .@{checkbox-prefix-cls} {
      display: flex;
      margin-right: 0;

      &:not(:last-child) {
        margin-bottom: var(--ti-checkbox-group-margin-bottom);
      }
    }

    .@{checkbox-button-prefix-cls} {
      display: block;
      width: min-content;

      &:first-child .@{checkbox-button-prefix-cls}__inner {
        border-radius: var(--ti-checkbox-group-1st-child-border-radius);
      }

      &:last-child .@{checkbox-button-prefix-cls}__inner {
        border-radius: var(--ti-checkbox-group-last-child-border-radius);
      }

      &.is-checked .@{checkbox-button-prefix-cls}__inner {
        box-shadow: 0 -1px 0 0 var(--ti-checkbox-shadow-color);
        border-color: var(--ti-checkbox-button-checked-border-color);
      }

      &.is-checked.is-disabled .@{checkbox-button-prefix-cls}__inner {
        box-shadow: 0 -1px 0 0 var(--ti-checkbox-border-color);
        border-color: var(--ti-checkbox-border-color);
        background: var(--ti-checkbox-disabled-bg-color);
      }
    }
  }
}
