/*
 * PivotLab: the pivot selector (views/pages/pivot_selector.php).
 *
 * The old app's views/pivot_selector.php <style>, scoped under [data-pl-view="pivot_selector"]
 * because every view's sheet loads on every page. The old rules on `main` and `#mainFooter` are
 * outside the scope below, limited to the page that carries the selector.
 */

.site-main:has([data-pl-view="pivot_selector"]) {
    position: relative;
}

body:has([data-pl-view="pivot_selector"]) #mainFooter {
    background-color: #fff;
    z-index: 999;
}

[data-pl-view="pivot_selector"] {

    @media (min-width: 576px) {
        .modal-sm {
            max-width: 350px !important;
        }
    }

    .input-radio-color {
        label {
            width: 100%;
        }
    }

    .table-sm {
        font-size: 13px;
    }

    .gif-swap {
        height: 100%;
        width: 100%;
        position: relative;
    }

    .gif-preview {
        position: absolute;
        z-index: 2;
        /* transition: opacity 0.3s ease; */
    }

    .gif-animated {
        position: relative;
        z-index: 1;
    }

    /* Hovering over the still image fades it out */
    .gif-preview:hover {
        opacity: 0;
    }

    #pivot_point_container.disabled {
        background-color: #e2e2e2 !important;
        border-color: #e2e2e2 !important;
        input {
            background-color: #e2e2e2 !important;
        }
    }

    #prodcutDetailsModal {
        @media (min-width: 992px) {
            .modal-dialog {
                width: 507px !important;
                position: fixed !important;
                right: 30px;
                top: 134px;
                margin-top: 0;
                height: calc(100% - 172px);
                display: block;
                min-height: 400px;
                max-height: 100%;
                margin-bottom: 0;
            }

            .modal-content {
                height: 100%;
            }
        }

        .modal-footer {
            justify-content: space-between;
        }
    }
    

    #preview-container {

        .preview-mobile, .preview-desktop {
            height: 100%;
            width: 100%;
            object-fit: cover;
        }

        @media (max-width: 991px) {
            .preview-desktop {
                display: none;
            }
        }
        @media (min-width: 992px) {
            .preview-mobile {
                display: none;
            }
        }
    }

    .col-min {
    width: 1%;          /* forces minimal width */
    white-space: nowrap;
    }

    .col-fill {
    width: auto;
    }

    #report-section {
        background-color: #fff;
        position: fixed;
        left: 0;
        right: 0;
        top: 94px;
        bottom: 0;
        z-index: 999;
        transform: translateY(300vw);
        transition: ease-in-out .5s all;
        overflow-y: auto;

        @media (min-width: 1921px) {
            top: 110px;
        }

        &.show {
            transform: translateY(0);
        }
    }

    .pivot-selector-navigation.desktop {
        display: flex;
        justify-content: space-between;
        padding-top: 16px;
        @media (max-width: 991px) {
            display: none;
        }
    }

    .pivot-selector-navigation.mobile {
        position: fixed;
        bottom: 50px;
        background: #212529b7;
        left: 0;
        right: 0;
        padding: 8px;
        display: flex;
        justify-content: space-between;
        backdrop-filter: blur(4px);
        transform: translateY(54px);
        transition: ease-in-out .25s all;
        z-index: 1;

        @media (min-width: 992px) {
            display: none;
        }
    }

    .pivot-selector-navigation.show {
        transform: translateY(0);
    }

    #pivot-selector-view {
        background-color: #EFEFF0;
        overflow: hidden;
        height: 100%;
        position: relative;
        color: #fff;

        /* the old <main> was a box of the viewport's height under the 94px top bar (110px from
           1921px); here the window scrolls, so the wizard takes that height itself */
        @media (min-width: 992px) {
            height: calc(100vh - 94px);
        }
        @media (min-width: 1921px) {
            height: calc(100vh - 110px);
        }
        
        @media (max-width: 991px) {
            background-color: #09090b;
            border-radius: 30px 30px 0 0;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            height: auto;
            min-height: 100%;

            .tab-content {
                padding-bottom: 60px;
            }

        }       

        #preview-container {
            background-color: #777;
            max-height: 400px;
            aspect-ratio: 16 / 9;
            flex-shrink: 0;
            /* background-image: url('../../img/app/pivot-selector-mobile-none.png');
            background-size: cover;
            background-size: cover;
            background-position: center; */
            

            @media (min-width: 992px) {
                max-height: 100%;
                /* background-image: url('../../img/app/pivot-selector-desktop-none.png'); */
                height: 100%;
                width: 100%;
            }
        }

        .pivot-content-wrapper {
            overflow-y: hidden;

            @media (min-width: 992px) {
                position: absolute;
                top: 16px;
                left: 16px;
                bottom:16px;
                right: 16px;
                display: flex;
                justify-content: flex-end;
                align-items: flex-start;
            }
        }

        .pivot-content {
            display: flex;
            flex-direction: column;
            
            @media (max-width: 991px) {
                overflow-y: auto;
                height: 100%;
                padding: 24px 16px;
            }

            @media (min-width: 992px) {
                padding: 32px;
                background-color: #ffffff38;
                width: 530px;
                border-radius: 30px;
                height: 100%;
                backdrop-filter: blur(3px);
                border: 1px solid #ccc;

                .tab-content {
                    height: 100%;
                    overflow-y: auto;
                    padding: 16px 0 32px;

                    .tab-pane {
                        height: 100%;
                    }
                }
            }

            .section-title {
                font-size: 20px;
                text-align: center;
                @media (max-width: 991px) {
                }
            }
        }

        .pivot-selector-dots {
            margin-bottom: 16px;
            display: flex;
            justify-content: center;

            @media (max-width: 991px) {
                position: absolute;
                top: 16px;
                left: 16px;
                right: 16px;
            }
        }

        .cm-steps {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 80%;
            max-width: 30em;

            /* LINE BEHIND STEPS */
            hr {
                position: absolute;
                /* top: 0; */
                left: calc(1em / 2);
                right: calc(1em / 2);
                border: none;
                height: 2px;
                background-color: #C9C9C9; /* inactive color */
                z-index: 0;
                margin: 0;
                opacity: 1;
            }

            /* ACTIVE FILL LINE */
            hr::after {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                background-color: #ff7648;
                width: var(--progress, 0%);
                transition: width 0.4s ease;
            }

            /* STEP DOTS */
            .step {
                width: 1em;
                height: 1em;
                border-radius: 50%;
                background-color: #C9C9C9;
                transition: background-color 0.4s;
                border: 1px solid #fff;
                z-index: 10;
            }

            /* ACTIVE / COMPLETED DOTS */
            .step.active {
                background-color: var(--bs-primary);
                /* border: 1px solid var(--bs-primary); */
            }
        }

        .pivot-content-body {
            flex: 1 1 100%;
            /* overflow-y: auto; */
            overflow-x: clip;
        }

        .img-w-txt-bottom {
            height: 100%;

            .input-radio-img-label {
                height: 100%;
                display:flex;
                flex-direction:column;
                align-items:center;
                justify-content: space-between;
                border: 1px solid #fff;
                border-radius: 8px;
                padding: 16px;
                cursor: pointer;
                transition: ease-in-out .2s all;

                @media (max-width: 991px) {
                    font-size: 14px;
                }

                img {
                    padding-bottom: 16px;
                }
            }

            .input-radio-img-input:checked + label.input-radio-img-label {
                border: 1px solid #fff;
                background-color: #fff;
                color: var(--bs-body-color);
            }

            &.color {
                .input-radio-img-label {
                    padding: 4px;
                    border: 2px solid #fff;
                    background-color: #fff;
                    color:#09090b;
                    overflow: hidden;
                }

                .input-radio-img-input:checked + label.input-radio-img-label {
                    border: 2px solid #ff7648;
                }

                img.original {
                    padding-bottom: 0 !important;
                }

                .text {
                    padding: 8px;
                }
            }
            
            
            &.toggle-img {
                img.original {
                    display: none !important;
                }
                .input-radio-img-input:checked + label.input-radio-img-label { 
                    img.original {
                        display: inline !important;
                    }
                    img.alt {
                        display: none !important;
                    }
                }
            }
        }            

        .img-w-txt-overlay {
            .input-radio-img-label {
                position: relative;
                border-radius: 8px;
                overflow: hidden;
                display: block;
                cursor: pointer;

                img {
                    aspect-ratio: 4 / 3;
                    object-fit: contain;
                    object-position: center 80%;
                }

                .text {
                    position: absolute;
                    top: 0;
                    left: 0;
                    bottom: 0;
                    right: 0;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    background: #000a;
                    color: #fff;
                    transition: ease-in-out .2s all;
                }
            }

            .input-radio-img-input:checked + label.input-radio-img-label {

                img {
                    filter: contrast(120%);
                }

                .text {
                    background: #0003;
                }
            }
        }

        .input-group-flex-img-txt-field {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border: 1px solid #ccc;
            border-radius: 10px;
            padding: 15px;

            @media (max-width: 991px) {
                border: 1px solid #ccc2;
            }
        }

        .input-affix {
            background-color: #fff;
            border-radius: 5px;
            border: 1px solid #fff;
            display: inline-flex;
            align-items: center;
            padding: 4px 6px;
            max-width: 110px;

            input {
                border: none;
                width: 100%;
            }

            input:focus {
                outline: none !important;
                border: none !important;
            }

            .txt {
                font-size: 13px;
                color: var(--bs-body-color);
            }
        }

        .suggested-product-card {
            border-radius: 10px;
            background-color: #fff;
            color: var(--bs-body-color);
            overflow: hidden;
            width: 100%;
            border: none;
            padding: 0;
            height: 100%;
            border: 2px solid #fff;
            position: relative;
            cursor: pointer;

            &.selected {
                border: 2px solid #ff7648;

                &::after {
                    content: "";
                    display: inline-block; /* or block */
                    width: 16px;  /* adjust as needed */
                    height: 16px; /* adjust as needed */
                    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m 3 0 c -1.644531 0 -3 1.355469 -3 3 v 10 c 0 1.644531 1.355469 3 3 3 h 10 c 1.644531 0 3 -1.355469 3 -3 v -10 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 10 c 0.421875 0 0.765625 0.234375 0.917969 0.585938 l -0.667969 0.757812 l -6.296875 7.195312 l -2.246094 -2.246093 c -0.390625 -0.390625 -1.023437 -0.390625 -1.414062 0 s -0.390625 1.027343 0 1.417969 l 3 3 c 0.410156 0.40625 1.078125 0.386718 1.460937 -0.050782 l 6.246094 -7.136718 v 7.476562 c 0 0.570312 -0.429688 1 -1 1 h -10 c -0.570312 0 -1 -0.429688 -1 -1 v -10 c 0 -0.570312 0.429688 -1 1 -1 z' fill='%232e3436'/%3E%3C/svg%3E");
                    background-size: contain;
                    background-repeat: no-repeat;
                    top: 8px;
                    right: 8px;
                    position: absolute;
                }
            }


            .suggested-product-card__img {
                height: 150px;
                width: 100%;
                object-fit: contain;
                object-position: center;
                /* background-color: #E4E4E433; */

                @media (min-width: 1921px) {
                    height: 200px;
                }
            }

            .suggested-product-card__content {
                padding: 8px;
                text-align: left;
            }

            .title {
                font-size: 13px;
                font-weight: 300;
                margin-bottom: 0;
            }

            .subtitle {
                font-size: 13px;
                margin-bottom: 0;
                font-weight: 600;
            }
        }

        .swiper-slide .suggested-product-card .title,
        .swiper-slide .suggested-product-card .subtitle {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .swiper-slide {
            width: 175px;
        }

        #product-offcanvas-title {
            font-size: 15px;
            margin-bottom: 0;
        }

        #product-offcanvas-subtitle {
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 0;
        }

        #product-offcanvas-img {
            /* max-width: 100px; */
            display: block;
            width: auto;
            height: auto;
            max-height: 200px;
        }

        .no-results {
            margin-top: 42px;
            margin-bottom: 32px;

            font-size: 13px;

            b {
                font-size: 14px;
                margin-bottom: 8px;
                display: block;
            }
        }

        #product-modal-details-features {
            .name {
                font-size: 12px;
            }
        }
    }

    .jnf-pivot-badge {
        background-color: #FFD5C7;
        color: #FF7648;
        border-radius: 7px;
        padding: 0px 6px;
        margin-left: 4px;
    }
    
}
