﻿/* segmented control toggle */
.segmented-control {
    background: #e8e8e8;
    border-radius: 9px;
    margin: 0;
    padding: 3px;
    border: none;
    outline: none;
    display: flex;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

    .segmented-control .option {
        position: relative;
        cursor: pointer;
        flex-basis: 0;
        flex-grow: 1;
    }

        .segmented-control .option:hover input:not(:checked) + label span,
        .segmented-control .option:active input:not(:checked) + label span,
        .segmented-control .option:focus input:not(:checked) + label span {
            opacity: .90;
        }

        .segmented-control .option:active input:not(:checked) + label span {
            transform: scale(.92);
        }

        .segmented-control .option label {
            position: relative;
            display: block;
            text-align: center;
            padding: 5px 0px 1px 3px;
            background: #e8e8e8;
            font-weight: 500;
            color: black;
            font-size: 16px;
            font-weight: bold;
        }

            .segmented-control .option label::before,
            .segmented-control .option label::after {
                content: '';
                width: 1px;
                background: #c9c9c9;
                position: absolute;
                top: 20%;
                bottom: 0%;
                border-radius: 10px;
                will-change: background;
                -webkit-transition: background .2s ease;
                transition: background .2s ease;
            }

            .segmented-control .option label::before {
                left: 0;
                transform: translateX(-.5px);
            }

            .segmented-control .option label::after {
                right: 0;
                transform: translateX(.5px);
            }

        .segmented-control .option:first-of-type label::before {
            opacity: 0;
        }

        .segmented-control .option:last-of-type label::after {
            opacity: 0;
        }

        .segmented-control .option input {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            outline: none;
            border: none;
            opacity: 0;
        }

        .segmented-control .option label .text {
            display: block;
            position: relative;
            z-index: 2;
            -webkit-transition: all .2s ease;
            transition: all .2s ease;
            will-change: transform;
        }

        .segmented-control .option input:checked + label::before,
        .segmented-control .option input:checked + label::after {
            background: #e8e8e8;
            z-index: 1;
        }

        .segmented-control .option input:checked {
           
            box-shadow: 0 3px 8px 0 rgba(0,0,0,0.12), 0 3px 1px 0 rgba(0,0,0,0.04);
            border-radius: 7px;
        }

            .segmented-control .option input:checked + label {
                cursor: default;
                color: white;
                font-weight: bold;
                
                box-shadow: 0 3px 8px 0 rgba(0,0,0,0.12), 0 3px 1px 0 rgba(0,0,0,0.04);
                border-radius: 7px;
            }

@supports (display:grid) {
    .segmented-control {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
    }

        .segmented-control .selection {

            box-shadow: 0 3px 8px 0 rgba(0,0,0,0.12), 0 3px 1px 0 rgba(0,0,0,0.04);
            border-radius: 7px;
            grid-column: 1;
            grid-row: 1;
            z-index: 2;
            will-change: transform;
            -webkit-transition: transform .2s ease;
            transition: transform .2s ease;
        }

        .segmented-control .option:first-of-type {
            grid-column: 1;
            grid-row: 1;
            box-shadow: none;
        }

        .segmented-control .option input:checked + label {
            background: none;
            box-shadow: none;
            border-radius: 0;
        }
}