@if $css-variable-enabled {
  $primary-transition: var(--primary-transition);
  $tab-border-bottom-width: var(--tab-border-bottom-width);
  $tab-top-border-radius: var(--tab-top-border-radius);
}

.#{$prefix}tabs {
  overflow-x: auto;
  margin-bottom: 10px;

  &.#{$prefix}center-aligned > ul {
    justify-content: center;
  }

  &.#{$prefix}right-aligned > ul {
    justify-content: flex-end;
  }

  &.#{$prefix}fullwidth > ul, &.#{$prefix}full-width > ul {
    > li {
      width: 100%;
    }
  }

  > ul {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom-style: solid;
    padding: 0;
    margin: 0;
    border-color: var(--tab-selected-item-color);
    user-select: none;
    border-width: $tab-border-bottom-width;

    > li {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      height: 40px;
      padding: 0 20px;
      position: relative;
      transform-style: preserve-3d;
      white-space: nowrap;
      cursor: pointer;
      border-bottom-style: solid;
      border-width: $tab-border-bottom-width;
      transition: $primary-transition;
      border-color: var(--tab-selected-item-color);

      @if $css-variable-enabled {
        margin-bottom: calc(0px - var(--tab-border-bottom-width));
      } @else {
        margin-bottom: 0 - $tab-border-bottom-width;
      }

      > .#{$prefix}icon {
        $offset: 10px;
        --icon-size: 24px;

        &:not(:only-child) {
          &:first-child {
            margin-right: $offset;
          }

          &:last-child {
            margin-left: $offset;
          }
        }
      }

      &:after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        background-color: var(--tab-selected-item-color);
        width: 100%;
        height: 100%;
        transform: translateZ(-1px) scaleY(0);
        transform-origin: bottom;
        transition: $primary-transition;
      }

      &.#{$prefix}selected, &[selected] {
        color: var(--tab-selected-item-text-color);

        &:after {
          transform: translateZ(-1px) scaleY(1);
          border-radius: $tab-top-border-radius $tab-top-border-radius 0 0;
        }
      }
    }
  }

  &.#{$prefix}lined {
    > ul {
      border-color: var(--tab-border-color);

      > li {
        cursor: pointer;
        border-bottom-style: solid;
        border-width: 2px;
        border-color: $transparent;

        &:after {
          height: 0 !important;
          width: 0 !important;
        }

        &.#{$prefix}selected, &[selected] {
          color: var(--tab-selected-item-color);
          border-color: var(--tab-selected-item-color);
        }
      }
    }
  }
}
