/* ============================================================
   ZINAPTIK - PASARELA DE PAGOS SEGURA (CHECKOUT MODAL)
   Estándar Institucional y Bancario (Stripe, Mercado Pago, PayPal)
   Diseño Claro, Oficial y Limpio
   ============================================================ */

#zinaptik-checkout-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#zinaptik-checkout-overlay.active {
    opacity: 1;
}

.tf-checkout-box {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    max-height: 92vh;
    animation: tfModalFadeIn 0.25s ease-out;
}

@keyframes tfModalFadeIn {
    0% { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Header */
.tf-checkout-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tf-sec-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tf-lock-pulse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #059669;
    font-size: 18px;
}

.tf-sec-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.tf-sec-sub {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
    margin-top: 2px;
}

.tf-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 6px;
    padding: 6px;
}
.tf-close-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

/* Cuerpo Dividido */
.tf-checkout-body {
    display: grid;
    grid-template-columns: 340px 1fr;
    overflow-y: auto;
    flex-grow: 1;
}

/* Columna Izquierda: Resumen */
.tf-col-summary {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tf-col-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tf-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 190px;
    overflow-y: auto;
    padding-right: 4px;
}

.tf-item-row {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tf-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
}

.tf-item-info {
    flex-grow: 1;
}

.tf-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.tf-item-qty {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.tf-item-price {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.tf-totals-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-total-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
}

.tf-total-line.final {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.tf-trust-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.tf-trust-card h5 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tf-trust-logos {
    display: flex;
    gap: 12px;
    font-size: 20px;
    color: #64748b;
    margin-top: 10px;
    align-items: center;
}

/* Columna Derecha: Métodos de Pago con Selector Radio */
.tf-col-payment {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: #ffffff;
}

.tf-payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjeta de Opción de Pago (Acordeón con Radio) */
.tf-method-card {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tf-method-card.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.tf-method-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    background: #ffffff;
    user-select: none;
}

.tf-method-card.selected .tf-method-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tf-method-radio-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.tf-method-radio-wrap input[type="radio"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #2563eb;
}

.tf-method-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    color: #64748b;
}

.tf-method-content {
    display: none;
    padding: 16px;
    background: #ffffff;
}

.tf-method-card.selected .tf-method-content {
    display: block;
}

/* Formularios */
.tf-form-group {
    margin-bottom: 14px;
}

.tf-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.tf-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tf-input {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.tf-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tf-input-icon {
    position: absolute;
    right: 12px;
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

.tf-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Banner de Sandbox / Prueba */
.tf-sandbox-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.tf-btn-autofill {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.tf-btn-autofill:hover {
    background: #1d4ed8;
}

/* Opciones de Mercado Pago */
.tf-mp-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    background: #f8fafc;
}
.tf-mp-option:hover {
    background: #f1f5f9;
}
.tf-mp-option input[type="radio"] {
    margin-top: 3px;
    accent-color: #009ee3;
}
.tf-mp-title {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}
.tf-mp-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* PayPal Button */
.tf-paypal-box {
    text-align: center;
    padding: 10px 0;
}
.tf-paypal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffc439;
    color: #111111;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #e0a800;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.tf-paypal-btn:hover {
    background: #f4b400;
}

/* Botón Principal */
.tf-pay-btn {
    width: 100%;
    background: #0f172a;
    color: #ffffff;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    margin-top: 6px;
}
.tf-pay-btn:hover {
    background: #1e293b;
}
.tf-pay-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tf-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tfSpin 0.6s linear infinite;
}
@keyframes tfSpin {
    to { transform: rotate(360deg); }
}

/* Pantalla de Éxito */
.tf-success-screen {
    display: none;
    text-align: center;
    padding: 40px 24px;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #ffffff;
}

.tf-success-icon {
    width: 60px;
    height: 60px;
    background: #ecfdf5;
    border: 2px solid #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    font-size: 32px;
}

.tf-success-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.tf-success-desc {
    color: #64748b;
    font-size: 13px;
    max-width: 440px;
    margin: 0;
    line-height: 1.5;
}

.tf-success-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    text-align: left;
}

.tf-success-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
}

.tf-success-line.final {
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

@media (max-width: 768px) {
    .tf-checkout-body {
        grid-template-columns: 1fr;
    }
    .tf-col-summary {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* Reglas de Impresión */
@media print {
    #zinaptik-checkout-overlay {
        position: static !important;
        display: none !important;
    }
}


.tf-items-list::-webkit-scrollbar,
.tf-checkout-body::-webkit-scrollbar {
    width: 5px;
}
.tf-items-list::-webkit-scrollbar-track,
.tf-checkout-body::-webkit-scrollbar-track {
    background: transparent;
}
.tf-items-list::-webkit-scrollbar-thumb,
.tf-checkout-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
.tf-items-list::-webkit-scrollbar-button,
.tf-checkout-body::-webkit-scrollbar-button,
.tf-items-list::-webkit-scrollbar-corner,
.tf-checkout-body::-webkit-scrollbar-corner {
    display: none !important;
    background: transparent !important;
}
