@use 'mixins/mixins' as *;
@use 'mixins/var' as *;
@use 'common/var' as *;

@include b(card) {
  @include set-component-css-var('card', $card);
}

@include b(card) {
  background-color: getCssVar('card', 'bg-color');
  overflow: hidden;
  color: getCssVar('text-color', 'primary');
  transition: getCssVar('transition-duration');

  @include when(always-shadow) {
    box-shadow: getCssVar('box-shadow', 'light');
  }

  @include when(none-shadow) {
    box-shadow: none;
  }

  @include when(hover-shadow) {
    &:hover,
    &:focus {
      box-shadow: getCssVar('box-shadow', 'light');
    }
  }

  @include when(border) {
    border: 1px solid getCssVar('card', 'border-color');
    border-radius: getCssVar('card', 'border-radius');
  }

  @include e(header) {
    padding: calc(#{getCssVar('card', 'padding')} - 2px)
      getCssVar('card', 'padding');
    border-bottom: 1px solid getCssVar('card', 'border-color');
    box-sizing: border-box;
    display: flex;
    align-items: center;
    align-content: center;
    font-weight: 600;

    &::before {
      content: '';
      display: inline-block;
      height: 12px;
      width: 3px;
      background-color: var(--el-color-primary);
      vertical-align: middle;
      margin-right: 4px;
    }
  }

  @include e(body) {
    padding: getCssVar('card', 'padding');
  }
}
