//
@mixin tabs() {
    $def-height: 48px;

    .tabstrip {
        .nav {
            //display: inline-flex;
            min-height: $def-height;

            .nav-link {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                vertical-align: middle;
                text-transform: uppercase;
                font-weight: 500;
                user-select: none;
                color: inherit;
                cursor: pointer;
                border-bottom: 2px solid transparent;
                text-align: center;
                min-width: 72px;
                max-width: 360px;
                padding: calc(2px + 0.5rem) 1rem;
                overflow: hidden;
                white-space: nowrap;
                flex: 0 0 auto;
                opacity: 0.75;
                transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
                outline: none;

                &.disabled {
                    opacity: 0.4;
                }

                &.active {
                    border-color: currentColor;
                    opacity: 1;
                }
            }
        }

        //--
        &.tabstrip-indicator-none .nav-link {
            border: 0 !important;
        }

        &.tabstrip-indicator-reverse .nav-link {
            border: 0;
            border-top: 2px solid transparent;
        }

        //--
        &.scroll-pane-vertical {
            .nav-link {
                max-width: 100%;
                border: 0;
                @include borderEnd(2px solid transparent);
            }

            &.tabstrip-indicator-reverse .nav-link {
                border: 0;
                @include borderStart(2px solid transparent);
            }
        }

        &.tabstrip-indicator-all .nav-link {
            border: 1px solid transparent;
            border-radius: 2px;
        }
    }

    //--

    //--
    .tabstrip-fixed {
        display: inline-flex !important;
        width: auto;
    }

    //--
    .tabstrip-full-width {
        .nav {
            .nav-link {
                max-width: none !important;
                flex: 1;
            }
        }
    }

    .tabstrip-centered .nav {
        justify-content: center;
    }

    @media (max-width: 599.95px) {
        .tabstrip-sm-hide-scroll-button {
            display: none;
        }
    }

    .toolstrip-item-wrapped {
        white-space: normal !important;
        font-size: 0.75rem;
        line-height: 1.5;
        padding: 4px 1rem !important;
    }

    .tabstrip-scroll-button {
        height: auto;

        .scroll-pane-vertical & {
            height: 2rem;
            flex: 0 0 auto;

            svg {
                transform: rotate(90deg);
            }
        }
    }
}

@mixin tabsTheme($palette) {
    $text-primary: map-get($palette, text, primary);
    $bg: map-get($palette, bg);

    $primary-palette: map-get($palette, primary);
    $primary: map-get($primary-palette, main);

    $secondary-palette: map-get($palette, secondary);
    $secondary: map-get($secondary-palette, main);

    //
    .tabstrip-shade .active {
        background-color: rgba($text-primary, 5%);
    }

    .tabstrip-shade-primary .active {
        background-color: rgba($primary, 7%);
    }

    .tabstrip-shade-secondary .active {
        background-color: rgba($secondary, 7%);
    }

    //
    .tabstrip-text-primary .active {
        color: $primary;
    }

    .tabstrip-text-secondary .active {
        color: $secondary;
    }

    .tabstrip-indicator-default .active {
        border-color: $text-primary;
    }

    .tabstrip-indicator-primary .active {
        border-color: $primary;
    }

    .tabstrip-indicator-secondary .active {
        border-color: $secondary;
    }
}

@include tabs();

.theme-bd.theme-light {
    $palette: map-get($theme, light);
    @include tabsTheme($palette);
}

.theme-bd.theme-dark {
    $palette: map-get($theme, dark);
    @include tabsTheme($palette);
}
