/**
 * 💳 ESTILOS PARA SISTEMA DE PAGOS - E-COMMERCE GENERICO
 * Estilos para la integración con Transbank Webpay
 */

/* Modal de pagos */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.payment-modal .modal-content {
    background: var(--panel, #0d1a22);
    border: 1px solid var(--border, #183245);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.payment-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border, #183245);
}

.payment-modal .modal-header h2 {
    margin: 0;
    color: var(--ink, #e8f2ff);
    font-size: 1.5rem;
    font-weight: 700;
}

.payment-modal .modal-close {
    background: none;
    border: none;
    color: var(--muted, #a7c0d4);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.payment-modal .modal-close:hover {
    background: var(--border, #183245);
    color: var(--ink, #e8f2ff);
}

.payment-modal .modal-body {
    padding: 20px;
}

/* Estados de pago */
.payment-loading {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border, #183245);
    border-top: 4px solid var(--brand, #16d26b);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.payment-loading p {
    color: var(--muted, #a7c0d4);
    margin: 10px 0;
    font-size: 1rem;
}

.payment-success {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.payment-success h3 {
    color: var(--brand, #16d26b);
    margin: 0 0 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.payment-success p {
    color: var(--ink, #e8f2ff);
    margin: 10px 0;
    font-size: 1rem;
}

.payment-details {
    background: var(--bg, #08131a);
    border: 1px solid var(--border, #183245);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.payment-details p {
    margin: 8px 0;
    color: var(--ink, #e8f2ff);
    font-size: 0.95rem;
}

.payment-details strong {
    color: var(--brand, #16d26b);
    font-weight: 600;
}

.payment-error {
    text-align: center;
    padding: 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: errorShake 0.6s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.payment-error h3 {
    color: #ff6b6b;
    margin: 0 0 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.payment-error p {
    color: var(--ink, #e8f2ff);
    margin: 10px 0;
    font-size: 1rem;
}

/* Botón de pago */
.payment-button {
    background: linear-gradient(135deg, var(--brand, #16d26b), #14b85a);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(22, 210, 107, 0.3);
}

.payment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 210, 107, 0.4);
    background: linear-gradient(135deg, #14b85a, var(--brand, #16d26b));
}

.payment-button:active {
    transform: translateY(0);
}

.payment-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.payment-button .icon {
    font-size: 1.2rem;
}

/* Formulario de pago */
.payment-form {
    background: var(--panel, #0d1a22);
    border: 1px solid var(--border, #183245);
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
}

.payment-form h3 {
    color: var(--ink, #e8f2ff);
    margin: 0 0 20px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.payment-form .form-group {
    margin-bottom: 20px;
}

.payment-form label {
    display: block;
    color: var(--muted, #a7c0d4);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.payment-form input,
.payment-form select,
.payment-form textarea {
    width: 100%;
    background: var(--bg, #08131a);
    border: 1px solid var(--border, #183245);
    border-radius: 8px;
    color: var(--ink, #e8f2ff);
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.payment-form input:focus,
.payment-form select:focus,
.payment-form textarea:focus {
    outline: none;
    border-color: var(--brand, #16d26b);
    box-shadow: 0 0 0 3px rgba(22, 210, 107, 0.1);
}

.payment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Resumen de pago */
.payment-summary {
    background: var(--bg, #08131a);
    border: 1px solid var(--border, #183245);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.payment-summary h4 {
    color: var(--ink, #e8f2ff);
    margin: 0 0 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.payment-summary .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #183245);
}

.payment-summary .summary-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand, #16d26b);
}

.payment-summary .summary-item span {
    color: var(--ink, #e8f2ff);
}

/* Responsive */
@media (max-width: 768px) {
    .payment-modal .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .payment-modal .modal-header {
        padding: 15px;
    }
    
    .payment-modal .modal-body {
        padding: 15px;
    }
    
    .payment-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-button {
        width: 100%;
        justify-content: center;
    }
}

/* Animaciones adicionales */
.payment-success .payment-details {
    animation: slideInUp 0.5s ease-out 0.3s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga */
.payment-loading .loading-spinner {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mejoras de accesibilidad */
.payment-modal:focus-within {
    outline: none;
}

.payment-button:focus {
    outline: 2px solid var(--brand, #16d26b);
    outline-offset: 2px;
}

.payment-form input:focus,
.payment-form select:focus,
.payment-form textarea:focus {
    outline: 2px solid var(--brand, #16d26b);
    outline-offset: 2px;
}

/* ===== ESTILOS PARA NUEVOS MODALES DE PAGO ===== */

/* Modales de opciones de pago */
.payment-options-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.payment-options-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.payment-options-content h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-option {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.payment-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.payment-cancel {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-cancel:hover {
    background: #cbd5e0;
}

/* Modal de confirmación de pago */
.payment-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.payment-modal-content h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.payment-total {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.payment-total p {
    margin: 0;
    font-size: 1.2rem;
    color: #2d3748;
}

.payment-total strong {
    color: #2b6cb0;
    font-size: 1.4rem;
}

.payment-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.payment-actions .btn-primary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.payment-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

.payment-actions .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-actions .btn-secondary:hover {
    background: #cbd5e0;
}
