/* =====================================================
   SPINNER PARA BOTÓN DESCARGAR
===================================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#j-download-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid #FFFFFF;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

#j-download-spinner.active {
    display: inline-block;
}

/* ==========================================
   GRID DE MÉTODOS DE PAGO - PASO 4
   ========================================== */

.j-payment-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#j-process-payment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.j-payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 40px 0 60px 0;
}

.j-payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: transparent;
    border: 2px solid #24B8C8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 30px;
    min-height: 50px;
    width: 100%;
    
}

.j-payment-method:hover {
    border-color: #adb5bd;
    background: #f1f3f5;
}

.j-payment-method.active {
    border-color: #24B8C8;
    background: #24B8C8;
    color: #FFFFFF;
}

/* Spinner de carga */
.j-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #FA299C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

/* ==========================================
   PANTALLA DE PAGO SEGURO
   ========================================== */
body.j-secure-pay-lock {
    overflow: hidden;
}

.j-secure-pay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483646;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    color: #1E2249;
}

.j-secure-pay.is-open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483646 !important;
}

.j-secure-pay__veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 480px at 50% -10%, rgba(36, 184, 200, 0.28), transparent 60%),
        radial-gradient(700px 420px at 100% 100%, rgba(250, 41, 156, 0.08), transparent 55%),
        linear-gradient(165deg, #f7fbfc 0%, #eef6f8 48%, #f4f7fb 100%);
}

.j-secure-pay__panel {
    position: relative;
    width: min(440px, 100%);
    padding: 36px 32px 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(36, 184, 200, 0.28);
    box-shadow:
        0 24px 60px rgba(30, 34, 73, 0.12),
        0 0 0 8px rgba(255, 255, 255, 0.45);
    text-align: center;
    animation: jSecurePayIn 0.45s ease;
}

@keyframes jSecurePayIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.j-secure-pay__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e7f7f8;
    color: #14848f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.j-secure-pay__gif {
    display: block;
    width: 148px;
    height: 148px;
    margin: 4px auto 12px;
    object-fit: contain;
    background: transparent;
}

.j-secure-pay__panel h2 {
    margin: 0 0 8px;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: #1E2249;
}

.j-secure-pay__panel p,
.j-secure-pay__timeout p {
    margin: 0 auto;
    max-width: 34ch;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #5D5D5D;
}

.j-secure-pay__steps {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 26px 0 0;
    padding: 0;
}

.j-secure-pay__steps li {
    flex: 1;
    position: relative;
    padding-top: 16px;
    font-size: 11px;
    font-weight: 700;
    color: #9aa3b2;
}

.j-secure-pay__steps li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: #d5dde6;
}

.j-secure-pay__steps li.is-done {
    color: #14848f;
}

.j-secure-pay__steps li.is-done::before {
    background: #24B8C8;
}

.j-secure-pay__steps li.is-active {
    color: #1E2249;
}

.j-secure-pay__steps li.is-active::before {
    background: #FA299C;
    box-shadow: 0 0 0 4px rgba(250, 41, 156, 0.16);
}

.j-secure-pay__verify,
.j-secure-pay__ghost {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    cursor: pointer;
    border-radius: 999px;
}

.j-secure-pay__verify {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    padding: 12px 22px;
    border: 0;
    background: #24B8C8;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.j-secure-pay__verify:hover {
    background: #1aa3b2;
}

.j-secure-pay__ghost {
    margin-top: 10px;
    padding: 10px 18px;
    border: 1px solid #c9d3dc;
    background: transparent;
    color: #1E2249;
    font-size: 14px;
    font-weight: 700;
}

.j-secure-pay__timeout-title {
    margin-bottom: 6px !important;
    font-size: 18px !important;
    font-weight: 800;
    color: #1E2249 !important;
}

.j-secure-pay__timeout-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.j-secure-pay__trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 26px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid #e6eef2;
}

.j-secure-pay__trust li {
    padding: 5px 10px;
    border-radius: 999px;
    background: #f4f7fb;
    color: #3d4a63;
    font-size: 11px;
    font-weight: 700;
}

.j-secure-pay.is-timeout .j-secure-pay__gif {
    display: none;
}

@media (max-width: 480px) {
    .j-secure-pay__panel {
        padding: 28px 18px 22px;
        border-radius: 22px;
    }

    .j-secure-pay__panel h2 {
        font-size: 22px;
    }

    .j-secure-pay__steps li {
        font-size: 10px;
    }
}

/* ==========================================
   TARJETA - CON TEXTO EN LA MISMA LÍNEA
   ========================================== */
.j-payment-method-with-label {
    flex-direction: row !important;
    gap: 10px;
    padding: 12px 16px;
    height: 20px;
    min-height: 50px;
}

.j-payment-method-with-label .j-payment-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 0;
}

.j-payment-method-with-label .j-payment-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #000000;
    text-align: left;
    white-space: nowrap;
}

.j-payment-method-with-label.active .j-payment-label {
    color: #FFFFFF;
}


/* ==========================================
   PAYPAL, GOOGLE PAY, APPLE PAY - SOLO ICONO
   ========================================== */
.j-payment-method:not(.j-payment-method-with-label) {
    flex-direction: column;
}

.j-payment-method:not(.j-payment-method-with-label) .j-payment-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0;
}

.j-payment-method:not(.j-payment-method-with-label) .j-payment-label {
    display: none;
}

.j-payment-method .paypal {
    width: 120px !important;
    height: 120px !important;
}

/* ==========================================
   RESPONSIVE - TABLET (2 × 2)
   ========================================== */
@media (max-width: 992px) and (min-width: 481px) {
    .j-payment-methods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   RESPONSIVE - MÓVIL (4 × 1)
   ========================================== */
@media (max-width: 480px) {
    .j-payment-methods-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .j-payment-method-with-label .j-payment-icon {
        width: 32px;
        height: 32px;
    }
    
    .j-payment-method-with-label .j-payment-label {
        font-size: 11px;
        white-space: normal;
    }
    
    .j-payment-method:not(.j-payment-method-with-label) .j-payment-icon {
        width: 60px;
        height: 60px;
    }
    
    /* PayPal responsivo */
    .j-payment-method .paypal {
        width: 80px !important;
        height: 80px !important;
    }
}

/* ==========================================
   RESUMEN Y DESCARGA
   ========================================== */
#juguemos-payment .j-pay-receipt {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid #d5eef2;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fcfd 100%);
    box-shadow: 0 16px 40px rgba(30, 34, 73, 0.07);
}

#juguemos-payment .j-pay-receipt__facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#juguemos-payment .j-pay-fact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 16px 16px 14px;
    border: 1px solid #e3f4f6;
    border-radius: 16px;
    background: #f4fbfc;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

#juguemos-payment .j-pay-fact span {
    color: #7d8b96;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#juguemos-payment .j-pay-fact strong {
    color: #1E2249;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

#juguemos-payment .j-pay-total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 0 0;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid #b7e8ec;
    background: #dff8f7;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

#juguemos-payment .j-pay-total span {
    color: #1FAFB4;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#juguemos-payment .j-pay-total strong {
    color: #FA299C;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    text-align: right;
}

#juguemos-payment .j-pay-download {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(520px, 100%);
    margin: 8px auto 0;
    padding: 36px 28px 28px;
    border: 1px solid rgba(36, 184, 200, 0.35);
    border-radius: 24px;
    background:
        radial-gradient(420px 180px at 50% 0%, rgba(36, 184, 200, 0.16), transparent 70%),
        #ffffff;
    box-shadow: 0 18px 40px rgba(30, 34, 73, 0.08);
    text-align: center;
}

#juguemos-payment .j-pay-download__mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #e7f7f8;
    color: #149aa6;
}

#juguemos-payment .j-pay-download__title {
    margin: 0 0 8px;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    color: #1E2249;
}

#juguemos-payment .j-pay-download__text {
    max-width: 38ch;
    margin: 0 0 22px;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #5d6770;
}

#juguemos-payment .j-pay-progress {
    display: none;
    width: 100%;
    max-width: 420px;
    margin-bottom: 18px;
}

#juguemos-payment .j-pay-progress__meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #1E2249;
}

#juguemos-payment .j-pay-progress__track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7eef2;
}

#juguemos-payment #j-pdf-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #24B8C8, #149aa6);
    transition: width 0.3s ease;
}

#juguemos-payment .j-pay-progress__status {
    margin: 8px 0 0;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 12px;
    color: #8a949c;
}

#juguemos-payment .j-btn-download {
    height: 52px;
    min-width: 220px;
    margin: 0;
    padding: 0 26px;
    border-radius: 999px;
    font-size: 16px;
    box-shadow: 0 10px 22px rgba(250, 41, 156, 0.22);
}

#juguemos-payment .j-btn-download:hover {
    box-shadow: none;
}

@media (max-width: 480px) {
    #juguemos-payment .j-pay-receipt__facts {
        grid-template-columns: 1fr;
    }

    #juguemos-payment .j-pay-total {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    #juguemos-payment .j-pay-total strong {
        font-size: 28px;
        text-align: left;
    }

    #juguemos-payment .j-pay-download {
        padding: 28px 16px 22px;
    }

    #juguemos-payment .j-pay-download__title {
        font-size: 22px;
    }
}

