.btn-finalizar-compra{
    background: #111827;
    color: #fff;
    border: none;
    padding: 14px 22px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

/* =========================
   MODAL PAGO - UI MEJORADA
========================= */
.payment-modal-overlay{
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 999999 !important;
}

.payment-modal-overlay.active{
    display: flex;
}

.payment-modal-box{
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(0,0,0,.22);
    overflow: hidden;
    z-index: 1000000 !important;
    animation: modalFadeIn .22s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn{
    from{
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
    to{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.payment-modal-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #eef0f3;
    background: #fff;
    flex-shrink: 0;
}

.payment-modal-header h3{
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -.2px;
}

.payment-close-btn{
    width: 38px;
    height: 38px;
    background: #f3f4f6;
    border: none;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    display: grid;
    place-items: center;
    transition: .2s ease;
}

.payment-close-btn:hover{
    background: #e5e7eb;
    color: #111827;
}

.payment-modal-body{
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
}

.payment-modal-body::-webkit-scrollbar{
    width: 8px;
}

.payment-modal-body::-webkit-scrollbar-thumb{
    background: #d1d5db;
    border-radius: 20px;
}

.payment-summary{
    text-align: center;
    margin-bottom: 18px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #edf1f5;
}

.payment-summary-label{
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.payment-summary h2{
    margin: 6px 0 2px;
    font-size: 30px;
    line-height: 1.1;
    color: #111827;
    font-weight: 800;
    letter-spacing: -.4px;
}

.payment-summary-items{
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.payment-methods{
    display: grid;
    gap: 10px;
}

.payment-option{
    display: block;
    cursor: pointer;
    margin: 0;
}

.payment-option input{
    display: none;
}

.payment-card{
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 13px 14px;
    transition: .22s ease;
    background: #fff;
    min-height: 72px;
}

.payment-option:hover .payment-card{
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.payment-option input:checked + .payment-card{
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.payment-icon{
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    font-size: 22px;
    flex-shrink: 0;
    transition: .22s ease;
}

.payment-option input:checked + .payment-card .payment-icon{
    background: #dbeafe;
}

.payment-info{
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.payment-info strong{
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.payment-info span{
    color: #6b7280;
    font-size: 13px;
    margin-top: 3px;
    line-height: 1.35;
}

.payment-extra-box{
    margin-top: 14px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f9fafb;
}

.payment-extra-box h4{
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.payment-extra-box p{
    margin: 0 0 8px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.45;
}

.payment-extra-box p:last-child{
    margin-bottom: 0;
}

.payment-yape-qr{
    text-align: center;
    margin: 14px 0;
    padding: 10px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #eceff3;
}

#yapeQrImg{
    max-width: 180px;
    width: 100%;
    border-radius: 14px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

#yapeNumeroBox{
    display: inline-block;
    font-size: 18px;
    color: #111827;
    letter-spacing: .3px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #eef2ff;
}

.payment-file-wrap{
    margin-top: 12px !important;
    margin-bottom: 0;
}

.payment-file-wrap p{
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.payment-extra-box input[type="file"]{
    width: 100%;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: #374151;
}

.payment-extra-box input[type="file"]:focus{
    outline: none;
    border-color: #2563eb;
}

.payment-modal-footer{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #eef0f3;
    background: #ffffff;
    flex-shrink: 0;
}

.payment-btn-cancel,
.payment-btn-continue{
    min-width: 130px;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: .2s ease;
}

.payment-btn-cancel{
    background: #e5e7eb;
    color: #111827;
}

.payment-btn-cancel:hover{
    background: #d1d5db;
}

.payment-btn-continue{
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 20px rgba(37,99,235,.18);
}

.payment-btn-continue:hover:not(:disabled){
    background: #1d4ed8;
}

.payment-btn-continue:disabled{
    background: #93c5fd;
    cursor: not-allowed;
    box-shadow: none;
}

/* prioridad máxima del modal */
#paymentModalOverlay{
    z-index: 999999 !important;
}

#paymentModalOverlay .payment-modal-box{
    z-index: 1000000 !important;
}

/* cuando el modal está abierto */
body.payment-open{
    overflow: hidden !important;
}

/* oculta y baja elementos conflictivos */
body.payment-open .instagram,
body.payment-open .footer,
body.payment-open .search-model{
    position: relative;
    z-index: 1 !important;
}

/* whatsapp por debajo o invisible */
body.payment-open .whatsapp-float,
body.payment-open .float-whatsapp,
body.payment-open .whatsapp,
body.payment-open #whatsapp,
body.payment-open a[href*="whatsapp"]{
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* cualquier bloque del checkout debajo del modal */
.checkout,
.billing-modern,
.instagram,
.footer{
    position: relative;
    z-index: 1;
}

@media (max-width: 575px){
    .payment-modal-overlay{
        padding: 10px;
    }

    .payment-modal-box{
        max-width: 100%;
        max-height: 92vh;
        border-radius: 18px;
    }

    .payment-modal-header,
    .payment-modal-body,
    .payment-modal-footer{
        padding-left: 15px;
        padding-right: 15px;
    }

    .payment-summary h2{
        font-size: 26px;
    }

    .payment-card{
        padding: 12px;
        gap: 10px;
        min-height: 68px;
    }

    .payment-icon{
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .payment-info strong{
        font-size: 14px;
    }

    .payment-info span{
        font-size: 12px;
    }

    .payment-modal-footer{
        flex-direction: column;
    }

    .payment-btn-cancel,
    .payment-btn-continue{
        width: 100%;
    }

    #yapeQrImg{
        max-width: 150px;
    }
}