@import 'scss/styles.scss';
$tab-colors: '26A690', 'EF5350', '3074D3';

.tab-switch-holder {
    position: relative;
    width: 100%;
    height: 32px;
    border-radius: 3px;
    background-color: $white;
    padding: 4px;
    box-sizing: border-box;
    user-select: none;
    line-height: 32px;
    gap: 4px;

    &.dashboard-height {
        height: 38px;
    }

    &.disabled {
        background: $ta-light-grey-5 !important;

        cursor: default;
        .tab-switch-items-holder {
            pointer-events: none !important;

            .tab-switch-text {
                color: $ta-light-grey-6 !important;
            }
        }
    }

    .tab-switch-items-holder {
        .tab-switch-text {
            pointer-events: none;
            position: relative;
        }
    }

    &.dark {
        .tab-switch-items-holder {
            .tab-switch-text {
                .tab-switch-name {
                    text-transform: uppercase !important;
                    font-weight: 700;
                    font-size: 11px;
                    line-height: 13px;
                }
            }
        }
    }

    .switch-tab-indicator {
        position: absolute;
        background-color: $ta-black !important;
        color: $white;
        border-radius: 2px;
        width: 100%;
        height: calc(100% - 8px);
        pointer-events: none;
        transition:
            250ms transform cubic-bezier(0.4, 0, 0.2, 1),
            250ms width cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: left;

        &.dark {
            background-color: $ta-black;
        }
    }

    .tab-switch-items-holder {
        position: relative;
        height: 32px;
        padding: 3px 8px;
        box-sizing: border-box;
        border-radius: 2px;
        background-color: $bw-10;
        font-size: 14px;
        font-weight: 800;
        color: $grey-3;
        cursor: pointer;
        flex: 1;

        &.active {
            cursor: default;
            color: $ta-black;
            .tab-switch-text {
                .tab-counter {
                    background-color: $white !important;

                    .counter-number {
                        color: $ta-black !important;
                    }
                }
            }
        }

        &:hover:not(.active) {
            color: $muted;

            .tab-switch-text {
                .tab-counter {
                    background-color: $muted !important;
                }
            }
        }

        &.disabled {
            cursor: auto !important;
            pointer-events: none !important;

            .tab-switch-text {
                color: $ta-light-grey-6 !important;
            }
        }
    }

    &.type1-modal-popup {
        height: 34px;
        background-color: $bw2;
        line-height: 34px;
        padding: 4px;

        .tab-switch-items-holder {
            height: 30px;
            font-weight: 700;
            transition: color 0.25s ease-out;

            &.active {
                color: $ta-blue-18 !important;
            }

            &:hover:not(.active) {
                color: $ta-black;
            }
        }

        .switch-tab-indicator {
            background-color: $white !important;
            box-shadow: 0 0 2px $ta-black-5;
            height: calc(100% - 4px);
        }
    }

    &.type2-modal-popup {
        height: 26px;
        background-color: $bw2;
        line-height: 26px;
        padding: 4px;
        border-radius: 2px;

        .tab-switch-text {
            .tab-switch-name {
                font-size: 11px;
                font-weight: 700;
                text-transform: uppercase;

                &-big {
                    line-height: 18px;
                    text-transform: none;
                    font-size: 14px;
                }
            }
        }

        .tab-switch-items-holder {
            height: 26px;
            font-size: 12px;
            font-weight: 700;
            border-radius: 1px;
            transition: color 0.25s ease-out;

            &.active {
                color: $ta-black !important;
            }

            &:hover:not(.active) {
                color: $ta-black !important;
            }
        }

        .switch-tab-indicator {
            background-color: $white !important;
            box-shadow: 0px 0px 2px 0px $ta-border-grey;
            height: calc(100% - 8px);
        }

        &-header {
            margin-top: 12px;
        }

        &.pickup {
            .tab-switch-items-holder {
                &.active {
                    color: $ta-green !important;
                }
            }
        }

        &.delivery {
            .tab-switch-items-holder {
                &.active {
                    color: $ta-orange-4 !important;
                }
            }
        }
    }

    &.type4-modal-popup {
        height: 26px;
        background-color: $bw2;
        line-height: 26px;
        padding: 4px;
        border-radius: 2px;

        .tab-switch-text {
            .tab-switch-name {
                font-size: 11px;
                font-weight: 700;
                text-transform: uppercase;

                &-big {
                    line-height: 18px;
                    text-transform: none;
                    font-size: 14px;
                }
            }
        }

        .tab-switch-items-holder {
            height: 26px;
            font-size: 12px;
            font-weight: 700;
            border-radius: 1px;
            transition: color 0.25s ease-out;

            &.active {
                color: $blue-11 !important;
            }

            &:hover:not(.active) {
                color: $grey-2;
            }
        }

        .switch-tab-indicator {
            background-color: $white !important;
            box-shadow: 0px 0px 2px 0px $ta-border-grey;
            height: calc(100% - 8px);
        }

        &-header {
            margin-top: 12px;
        }
    }

    &.type3-modal-popup {
        height: 26px;
        background-color: $bw2;
        line-height: 26px;
        padding: 4px;

        .tab-switch-text {
            .tab-switch-name {
                font-size: 11px;
                font-weight: 700;
                text-transform: uppercase;

                &-big {
                    line-height: 18px;
                    text-transform: none;
                    font-size: 14px;
                }
            }
        }

        .tab-switch-items-holder {
            height: 26px;
            font-size: 12px;
            font-weight: 700;
            transition: color 0.25s ease-out;

            &.active {
                color: $ta-black !important;
            }

            &:hover:not(.active) {
                color: $ta-black !important;
            }
        }

        .switch-tab-indicator {
            background-color: $white !important;
            box-shadow: 0px 0px 2px 0px $ta-border-grey;
            height: calc(100% - 8px);
        }

        &-header {
            margin-top: 12px;
        }
    }

    &.area-filter {
        background-color: $ta-black-3;
        border-radius: 2px;
        height: 26px;

        .tab-switch-items-holder {
            height: 26px;
            font-size: 11px;
            font-weight: 700;
            padding: 4px;

            color: $ta-light-grey-2;

            &.active {
                color: $white;
            }
        }
    }

    &.dark {
        background-color: $ta-black-3;
        border-radius: 2px;

        .tab-switch-items-holder {
            color: $ta-light-grey-2;

            &.active {
                color: $white;
            }
        }
    }
}

.custom-popover-holder {
    width: 300px;
    margin-top: -4px;
}

.rating-review {
    width: 252px;
    height: 26px;
    background: $ta-black-3;
    border-radius: 1px;

    .tab-switch-items-holder {
        width: 33.33%;

        .tab-switch-name {
            font-size: 11px;
            font-weight: 700;
            color: $muted;
        }
    }

    .switch-tab-indicator {
        background: $ta-black;
        border-radius: 1px;
    }

    .tab-switch-items-holder.active {
        .tab-switch-name {
            color: $white;
        }
    }
}

@each $col in $tab-colors {
    .tab-switch-#{$col}.active {
        .tab-switch-text {
            .tab-switch-name {
                color: unquote('#' + $col) !important;
            }

            .tab-counter {
                background-color: unquote('#' + $col) !important;
            }
        }
    }
}
