@use "sass:map";
@use "helpers";

.pagamentos-titulo{ 
    display: block;
    margin: 0px;
    margin-bottom: 10px;
    color: #868686;
    font-size: 11px;
    font-weight: normal;
    text-align: center;
    text-transform: uppercase;
}

#pagamento-integrado{
    display: block;
    font-family: helpers.$fontRegular;
    height: auto;
    margin: 0 auto;
    margin: 20px auto;
    max-width: 540px;
    padding: 0px;
    width: 100%;

    > .card:last-of-type {
        border-bottom: 1px solid rgba(0,0,0,.125);
    }

    > .payment{
        > .card-header{
            cursor: pointer;
            padding: 4px;
        }

        .card-body{
            max-height: 0;
            padding: 0;
            transition: all 0.3s ease-out;
            overflow: hidden;
            overflow-y: auto;
        }

        &.active{
            > .card-body{
                max-height: 400px;
            }
        }

        &[data-tipo="3"], 
        &[data-tipo="99"] {
            .item-info{
                background: helpers.$backgroundModal;
                height: 100%;
                left: 0;
                opacity: 0;
                pointer-events: none;
                position: fixed;
                top: 0;
                transition: all 0.2s 0.05s linear;
                width: 100%;
                z-index: 2002;
    
                .modal{
                    opacity: 0;
                    overflow-y: auto;
                    position: fixed;
                    z-index: 2;
                    display: flex;
                    width: 100%;
                    height: 100%;
                    max-height: 400px;
                    max-width: 400px;
                    left: 50%;
                    top: 50%;
                    border-radius: 4px;
                    background-color: map.get(helpers.$palletCheckout, light);
                    flex-direction: column;
                    transform: translate(-50%, -60%);
                    transition: all 0.2s;
                    
                    .header{
                        display: flex;
                        align-items: center; 
                        border-bottom: solid 1px map.get(helpers.$palletCheckout, borders);

                        .title{
                            flex-grow: 1;
                            width: calc(100% - 110px);
                            padding: 10px 15px;
                            color: map.get(helpers.$palletCheckout, textMedium);
                            font: normal 15px helpers.$fontRegular;
                        }

                        .btn-close{
                            display: flex;
                            cursor: pointer;
                            outline: 0px;
                            width: 110px;
                            padding: 10px;
                            color: map.get(helpers.$palletCheckout, textDark);
                            font: normal 15px helpers.$fontBold;
                            text-align: center;
                            border-left: solid 1px map.get(helpers.$palletCheckout, borders);
                            align-self: stretch;
                            align-items: center;
                            justify-content: center;
                        }
                    }
            
                    .content{
                        display: flex;
                        flex-direction: column;
                        flex-grow: 1;
                        margin-bottom: 0 !important;
                        overflow: auto;
                        padding: 6px;
                        
                        .description{
                            flex-grow: 1;
                            overflow: auto;
                            padding: 20px 15px;
                            color: map.get(helpers.$palletCheckout, textDark);
                            font: normal 15px helpers.$fontMedium;
                        }
                        .footer {
                            border-top: solid 1px map.get(helpers.$palletCheckout, borders);
                            padding-top: 10px;

                            .btn {
                                width: 100%;
                            }
                        }
                    }
                }
            
                &.visible{
                    opacity: 1;
                    pointer-events: all;
                    transition-delay: 0s;
                    
                    .modal {
                        opacity: 1;
                        transition-delay: 0.2s;
                        transform: translate(-50%, -50%);
                    }
                }
            }
        }
    
        &[data-tipo="2"],
        &[data-tipo="12"]{
            .pagamento-integrado-form {
                padding: 20px 15px;

                .description-container{
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    width: 100%;
                    margin-bottom: 15px;

                    .descricao {
                        display: block;
                        margin: 0px;
                        color: map.get(helpers.$palletCheckout, textDark);;
                        font: normal 15px helpers.$fontMedium;
                    }

                    .info{
                        .vl-final{
                            display: flex;
                            align-items: center;
                            justify-content: flex-end;
                            gap: 5px;
                            white-space: nowrap;
                            flex-wrap: wrap;
                            font-family: helpers.$fontSemibold;
    
                            .desconto, .juros, .sem-juros{
                                font-size: 10px;
                                font-family: helpers.$fontRegular;
                            }
                        }
                    }
                }

                
                .checkout-aviso{
                    display: block;
                    margin: 0px;
                    margin-bottom: 15px;
                    color: map.get(helpers.$palletCheckout, textMedium);
                    font: normal 15px helpers.$fontRegular;
                }
                button{
                    width: 100%;
                }
            }
        }
    }

    .content-type-button {
        max-height: 300px;
        overflow-y: auto;
    }

    .content-type-list {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
        gap: 5px;
        padding: 15px;

        .item{
            display: flex;
            width: 100%;
            padding: 7px 15px;
            border-radius: 3px;
            border: solid 1px map.get(helpers.$palletCheckout, borders);
            align-items: center;
            @include helpers.transicao(0.4s ease-in-out);

            &:hover,&:focus{
                background-color: map.get(helpers.$palletCheckout, medium);
            }

            .icon{
                width: 71px;
                height: 50px;
                padding: 5px;
                border: double 3px map.get(helpers.$palletCheckout, borders);
                border-radius: map.get(helpers.$palletCheckout, borderRadius);
                transition: all 0.1s;
                background-origin: content-box ;
                background-position: center;
                background-repeat: no-repeat;
                background-size: contain;
            }

            .item-content{
                display: flex;
                flex-direction: column;
                width: calc(100% - 71px);
                padding-left: 16px;
                gap: 5px;
            }

            .title{
                display: block;
                margin: 0px;
                color: map.get(helpers.$palletCheckout, textDark);
                font: normal 12px helpers.$fontBold;
            }

            // .title,
            // .content{
            //     border-top: solid 1px #ccc;
            //     display: flex;
            //     font-size: 11px;
            //     padding: 2px;
            // }
            
            .content{
                display: flex;
                flex-direction: column;
                align-items: flex-start;

                p{
                    margin: 0px;
                }

                .valores {
                    display: flex;
                    margin: 0px;
                    color: map.get(helpers.$palletCheckout, textDark);
                    font: normal 14px helpers.$fontRegular;

                    .vl-total {
                        color: map.get(helpers.$palletCheckout, textMedium);
                        text-decoration: line-through;
                        margin-right: 0.5em;
                        display: none;
                        font-size: 12px;
                    }

                    .vl-final{
                        font-family: helpers.$fontMedium;
                    }
                }

                .vl-desconto,
                .vl-juros {
                    display: none;
                }
            }

            &.vl-desconto {
                .content {
                    .vl-desconto{
                        display: inline;
                    }
                    .vl-total {
                        display: inline;
                    }
                }
            }
            
            &.vl-juros {
                .content {
                    .vl-juros{
                        display: inline;
                    }
                    .vl-total {
                        display: inline;
                    }
                }
            }
        }
    }

    .content-type-form {
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
        padding: 1.25rem;

        .frmInput{
            display: inline-block;
            height: auto;
            margin-bottom: 10px;
            position: relative;
            vertical-align: bottom;
            width: 100%;

            .card-brand{
                display: inline;
                float: right;
                height: 2.5em;
                margin: -0.4em 0;
                vertical-align: middle;
        
                &[src=""]{
                    display: none;
                }
            }
            
            label{
                display: block;
                margin: 0px;
                color: map.get(helpers.$palletCheckout, textDark);
                font: normal 15px helpers.$fontRegular;
            }
            
            input, select, textarea{
                display: block;
                outline: 0px;
                width: 100%;
                height: auto;
                padding: 10px;
                color: map.get(helpers.$palletCheckout, textMedium);
                font: normal 15px helpers.$fontRegular;
                border-radius: map.get(helpers.$palletCheckout, borderRadius);
                border: solid 1px map.get(helpers.$palletCheckout, inputBorderColor);
                background-color: map.get(helpers.$palletCheckout, light);
                box-shadow: none;
            }
            
            .mes{
                padding-right: 6px;
                
                &:after{
                    content: '/';
                    left: 100%;
                    position: absolute;
                    top: 50%;
                    transform: translateX(-50%) translateY(-50%);
                }
                
                input{
                    text-align: center;
                }
            }
            .ano{
                padding-left: 6px;

                input{
                    text-align: center;
                }
            }
            
            &.cvc{
                input{
                    text-align: center;
                }
            }
            
            
            &.parcelas{
                select{
                    padding: 10px;
                }
                
                @media(min-width:767px){
                    width: 32%;
                }
            }
            
            &.bandeira{
                @media(min-width:500px){
                    width: 49.7%;
                }
            }
            
            &.cvc{
                .cvc-info{
                    @include helpers.sprite();
                    z-index: 20;
                    position: absolute;
                    display: block;
                    width: 15px;
                    height: 16px;
                    right: 10px;
                    bottom: 10px;
                    background-position: -246px -273px;
                    outline: 0;
                }
                
                .cvc-texto{
                    position: absolute;
                    z-index: 100;
                    display: block;
                    width: 100%;
                    height: auto;
                    bottom: 50px;
                    right: 0px;
                    max-width: 210px;
                    min-width: 250px;
                    padding: 10px;
                    background-color: #FFFFFF;
                    border: solid 1px rgba(0,131,230,0.6);
                    -webkit-border-radius: 10px;
                    -webkit-border-bottom-right-radius: 3;
                    -moz-border-radius: 10px;
                    -moz-border-radius-bottomright: 3;
                    border-radius: 10px;
                    border-bottom-right-radius: 3;
                    -webkit-transform:scale(0);
                    -moz-transform:scale(0);
                    -o-transform:scale(0); 
                    transform:scale(0);
                    @include helpers.transicao(0.3s ease-in-out);
                    
                    &:before{
                        @include helpers.sprite();
                        position: absolute;
                        content: "";
                        width: 12px;
                        height: 22px;
                        top: auto;
                        bottom: -17px;
                        right: 10px;
                        background-position: -267px -271px;
                        -webkit-transform: rotate(-90deg);
                        -moz-transform: rotate(-90deg);
                        -o-transform: rotate(-90deg);
                        transform: rotate(-90deg);
                    }
                    
                    p{
                        color: #858585;
                        font-size: 12px;
                        font-weight: normal;
                    }
                    
                    .icon-card{
                        @include helpers.sprite();
                        display: block;
                        width: 74px;
                        height: 46px;
                        margin: 0 auto;
                        background-position: -247px -129px;
                    }
                    
                    &.ativo{
                        -webkit-transform:scale(1);
                        -moz-transform:scale(1);
                        -o-transform:scale(1);
                        transform:scale(1);
                    }
                }
            }
        }

        .parcelas-resumo{
            display: flex;

            .row {
                flex-grow: 1;
            }
        
            .info{
                align-items: center;
                display: flex;
                flex-grow: 1;
                flex-wrap: wrap;
                height: 100%;
                white-space: nowrap;

                .vl-total{
                    line-height: 1em;
                    margin-right: 4px;
                }

                .descricao{
                    font-size: 11px;
                    // font-style: italic;
                }
            }

            .btn-show-installments{
                border: 1px solid map.get(helpers.$palletCheckout, borders)
            }
        }

        .parcelas{
            background: #fff;
            bottom: 0;
            left: 0;
            overflow-y: auto;
            position: absolute;
            right: 0;
            top: 0;
            transform: translateX(100%);
            transition: all 0.3s ease-out;
            width: auto;
            z-index: 2;
        
            &.visible{
                transform: translateX(0);
            }
        
            td:nth-child(2),
            th:nth-child(2){
                text-align: right;
            }
        
            th{
                background: #fff;
                position: sticky;
                top: 0;
            }
        }

        .table-parcelamento{
            [data-replace="nr-parcela-single"]{
                display: none;
            }
            
            [data-nr-parcela="1"]{
                [data-replace="nr-parcela-plural"]{
                    display: none;
                }
                [data-replace="nr-parcela-single"]{
                    display: inline;
                }
            }

            td{
                vertical-align: middle;
            }

            .vl-final {
                display: flex;
                flex-direction: column;

                .desconto, .juros, .sem-juros{
                    font-size: 11px;
                    // font-style: italic;
                }
            }
        }

        .btn-confirmar-pagamento{
            margin-top: 10px;
            width: 100%;
        }
    }

    .g-recaptcha{
        display: flex;
        margin: 15px 0px;
        justify-content: center;
    }

    .pagamento-conclusao{
        position: static;
    }
}

.recaptcha{
    margin-top: -15px;
    padding: 0px 20px;
}

#paypal-plus-container{
    background: #fff;
    border: solid 1px #999;
    box-shadow: 6px 6px 0 #eee;
    display: flex;
    flex-direction: column;
    left: 50%;
    max-height: calc(100% - 90px); /*altura do topo mais respiro*/
    min-height: min(100%, 300px);
    position: fixed;
    top: calc(50% + 32px); /* metade da altura do topo*/
    transform: translate(-50%,-50%);
    width: 80%;
    z-index: 1000;

    .header{
        border-bottom: solid 1px #ccc;
        display: flex;
        height: 40px;
        justify-content: space-between;
        position: relative;

        .title{
            align-items: center;
            display: flex;
            flex-grow: 1;
            font-family: helpers.$fontRegular;
            font-size: 14px;
            padding: 0 10px;
        }

        .btn-close{
            align-items: center;
            background-color: #1D252C;
            border: solid 1px #1D252C;
            color: #FFCD00;
            cursor: pointer;
            display: flex;
            font-family: helpers.$fontRegular;
            font-size: 14px;
            height: 100%;
            margin: 0 auto;
            padding: 0 10px;
            text-align: center;
            text-transform: uppercase;
            transition: all 0.2s ease-out;

            &:hover{
                background-color: #0EAF78;
                color: #fff;
            }
        }
    }
    .body{
        flex-grow: 1;
        overflow: auto;

        .loading{
            //transform: rotate(0deg) translate(-50%, -50%);
            animation: spin 2s linear 0s infinite;
            border-radius: 50%;
            border-top: solid 4px #ccc;
            height: 60px;
            left: 50%;
            margin-left: -30px;
            margin-top: -30px;
            position: absolute;
            top: 50%;
            transform-origin: center;
            width: 60px;
        }
    }
    .footer{
        border-top: solid 1px #ccc;
        height: 40px;

        #continueButton{
            background-color: #1D252C;
            border: solid 1px #1D252C;
            color: #FFCD00;
            display: block;
            font-family: helpers.$fontRegular;
            font-size: 14px;
            height: 100%;
            margin: 0 auto;
            max-width: 530px;
            padding: 0 10px;
            text-align: center;
            text-transform: uppercase;
            transition: all 0.2s ease-out;
            width: 80%;

            &:hover{
                background-color: #0EAF78;
                color: #fff;
            }
        }
    }
}

@keyframes spin {
    from {
        transform: rotateZ(0deg);
    }

    to {
        transform: rotateZ(360deg);
    }
}