// Tabs
.tab {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  height: 100%;

  .tab-item {
    @include flex-centered();
    display: inline-flex;
    cursor: pointer;
    margin-top: 0;

    height: inherit;
    border-bottom: 1px solid transparent;
    color: inherit;
    text-decoration: none;
    opacity: .5;
    padding: 0 $control-padding;

    &:focus,
    &:hover {
      opacity: 1;
      color: $link-color;
    }

    &.active {
      opacity: 1;
      border-bottom-color: $primary-color;
      color: $link-color;
    }

    &[disabled],
    &:disabled,
    &.disabled {
      @include disabled();
    }

    &.tab-action {
      flex: 1 0 auto;
      text-align: right;
    }

    .btn-clear {
      margin-top: -$unit-1;
    }
  }

  &.tab-block {
    .tab-item {
      flex: 1 0 0;
      text-align: center;
      height: inherit;

      a {
        margin: 0;
      }

      .badge {
        &[data-badge]::after {
          position: absolute;
          right: $unit-h;
          top: $unit-h;
          transform: translate(0, 0);
        }
      }
    }
  }

  &:not(.tab-block) {
    .badge {
      padding-right: 0;
    }
  }
}

// Mobile tabs

.tab-mobile {

  .tab-item {
    padding: 2px 10px;
    display: initial;
    font-size: $font-size-sm;

    &.active {
      border-radius: 20px;
      //  color: $font-color-light;
      background: $primary-color;
    }
  }
}

@media (max-width: $size-sm) {
  .tab {
    .tab-item {
      padding: 0 $control-padding / 2;
    }
  }
}
