@use 'sass:math';
@use 'sass:map';

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

@include b(badge) {
  // @include set-component-css-var('badge', $badge);

  position: relative;
  vertical-align: middle;
  display: inline-block;

  @include e(content) {
    background-color: getCssVar('color', 'red');
    border-radius: getCssVar('border-radius', 'max');
    color: getCssVar('color', 'white');

    display: inline-flex;
    justify-content: center;
    align-items: center;

    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    padding: 1px 6px;
    white-space: nowrap;
    border: 1px solid getCssVar('color-white');

    @include when(fixed) {
      position: absolute;

      transform: translateY(-50%) translateX(50%);

      &:not([class*='top-']) {
        top: 0;
      }

      &:not([class*='right-']) {
        right: 0;
      }

      @include when(dot) {
        &:not([class*='right-']) {
          right: 5px;
        }
      }
    }

    @include when(dot) {
      height: 10px;
      width: 10px;
      padding: 0;

      &:not([class*='right-']) {
        right: 0;
      }
    }

    @each $type in (primary, success, warning, info, danger) {
      $color: map.get($colorStatusMap, $type);

      @include m($type) {
        background-color: getCssVar('color', $color);
      }
    }
  }
}
