.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 100vw;

  .tab-menu {
    position: relative;
    display: flex;
    flex-direction: row;
    transition-duration: inherit;
    align-items: center;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
    margin: 0;
    padding: 0;

    .tab-link {
      position: relative;
      cursor: pointer;
      display: inline-block;
      text-align: center;

      a {
        display: block;
        text-overflow: ellipsis;
        padding: 1rem 1.25rem;
      }
    }

    &::before {
      content: '';
      position: absolute;
      bottom: 0;
      left: var(getCssVar(tab-bar-left-offset));
      right: var(getCssVar(tab-bar-right-offset));
      border-bottom: var(getCssVar(tab-bar-border));
      transition-property: left, right;
      transition-timing-function: ease;
      transition-duration: inherit;
    }
  }

  &.tab-full-width .tab-menu .tab-link {
    width: 100%;
  }

  // Arrow mode
  .tab-arrow {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    transition-duration: inherit;

    .tab-menu {
      overflow: hidden;
    }

    .tab-prev,
    .tab-next {
      justify-content: center;
      align-items: center;
      cursor: pointer;
      padding: 0.5rem;
      z-index: 10;
      display: none;
    }

    .tab-prev {
      left: 0;
    }

    .tab-next {
      right: 0;
    }

    &.tab-arrow-show {
      .tab-prev,
      .tab-next {
        display: flex;
      }
    }
  }
}
