// Display flex
@mixin flex() {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

// Flex wrap
@mixin wrap() {
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

// Justify content
@mixin justify($args) {
    -webkit-justify-content: $args;
    justify-content: $args;
}

// Flex Direction
@mixin flex-direction($args) {
    -webkit-flex-direction: $args;
    flex-direction: $args;
}

/*------------------------------------------------------------------
Tabs
-------------------------------------------------------------------*/
.etww-tabs {
    .etww-tabs-wrap {
        @include flex();
        @include wrap();

        &.etww-tabs-normal {
            &.etww-tabs-center {
                @include justify(center);
            }

            &.etww-tabs-right {
                @include justify(flex-end);
            }

            &.etww-tabs-justify .etww-tab-title {
                flex: 1;
                flex-basis: 1px;
                text-align: center;
            }
        }
    }

    &.etww-tabs-left,
    &.etww-tabs-right {
        @include flex();
        @include wrap();

        .etww-tabs-wrap {
            @include flex-direction(column);
        }

        .etww-tabs-content-wrap {
            flex: 1;
            flex-basis: 1px;
        }
    }

    &.etww-tabs-right .etww-tabs-wrap {
        order: 2;
    }

    .etww-tab-title {
        position: relative;
        padding: 20px 25px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;

        &.etww-active {
            background-color: #13aff0;
            color: #fff;
        }

        .etww-icon-align-left {
            margin-right: 3px;
        }

        .etww-icon-align-right {
            margin-left: 3px;
        }
    }

    .etww-tab-mobile-title {
        display: block;
        width: 100%;
        padding: 15px;
        border: 1px solid rgba(0,0,0,0.1);
        border-top-width: 0 !important;

        &:first-child {
            border-top-width: 0 !important;
        }
    }

    .etww-tabs-content-wrap {
        border-top: 1px solid rgba(0,0,0,0.1);

        .etww-tab-content {
            display: none;
            padding: 20px;
            border: 1px solid rgba(0,0,0,0.1);

            &.etww-active {
                display: block;
            }
        }

        p:last-child {
            margin-bottom: 0;
        }
    }
}

/* RTL */
body.rtl {
    .etww-tabs .etww-tab-title {
        .etww-icon-align-left {
            margin-left: 3px;
            margin-right: 0;
        }

        .etww-icon-align-right {
            margin-right: 3px;
            margin-left: 0;
        }
    }
}

/*------------------------------------------------------------------
Responsive
-------------------------------------------------------------------*/
@media (min-width: 767px) {
    .etww-tabs .etww-tab-mobile-title {
        display: none;
    }
}

@media (max-width: 767px) {
    .etww-tabs {
        .etww-tabs-wrap {
            display: none;
        }

        .etww-tab-content {
            border-top: 0 !important;
        }
    }
}