/**
 * CHECKOUT PAGO - CSS
 * Estilos para el módulo de checkout y procesamiento de pagos
 */

/* Utilidades básicas */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 0.5rem; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.5rem; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 0.5rem; }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; padding: 0 0.5rem; }

@media (max-width: 768px) {
    .col-md-6, .col-md-4, .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.gap-3 { gap: 1rem; }

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.checkout-header {
    margin-bottom: 2rem;
    text-align: center;
}

.checkout-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 1rem;
    font-weight: 500;
    color: #6c757d;
}

.step.active {
    color: #28a745;
}

.step.completed {
    color: #007bff;
}

.step-number {
    background: #e9ecef;
    color: #6c757d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
}

.step.active .step-number {
    background: #28a745;
    color: white;
}

.step.completed .step-number {
    background: #007bff;
    color: white;
}

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

@media (max-width: 768px) {
    .checkout-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Formularios */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
}

.form-section h3 i {
    margin-right: 0.5rem;
    color: #007bff;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-control.is-invalid + .invalid-feedback {
    display: block;
}

/* Resumen de pedido */
.order-summary {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.order-summary h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.order-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
}

.item-details {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0.25rem 0 0 0;
}

.item-price {
    font-weight: 500;
    color: #28a745;
}

.order-totals {
    border-top: 2px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.total-line.final {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Métodos de pago */
.payment-methods {
    display: grid;
    gap: 1rem;
}

.payment-method {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.payment-method:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.payment-method.selected {
    border-color: #007bff;
    background: #e7f3ff;
}

.payment-method input[type="radio"] {
    margin-right: 1rem;
}

.payment-method-info {
    flex: 1;
}

.payment-method-name {
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
}

.payment-method-desc {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0.25rem 0 0 0;
}

.payment-method-note {
    font-size: 0.75rem;
    color: #dc3545;
    margin: 0.25rem 0 0 0;
    font-style: italic;
}

.payment-method.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #dee2e6;
}

.payment-method.disabled:hover {
    border-color: #dee2e6;
    background: #f8f9fa;
}

.payment-notice {
    margin-top: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Botones */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1.5;
    box-sizing: border-box;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.btn-outline-dark {
    background: transparent;
    color: #343a40;
    border: 1px solid #343a40;
}

.btn-outline-dark:hover {
    background: #343a40;
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #000;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Loader */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Alertas */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.float-end {
    float: right;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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