/* ============================================
   CHECKOUT PERSONALIZADO - ESTILOS
   ============================================ */

.custom-checkout-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 3rem 0;
}

/* Empty Cart */
.empty-cart-section {
    background: white;
    padding: 4rem 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

/* Contenedores Principales */
.checkout-form-container {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.order-summary-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    top: 20px;
}

/* Títulos */
.section-title {
    color: #3f111c;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #3f111c;
}

.summary-title {
    color: #3f111c;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

/* Secciones del Formulario */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    color: #3f111c;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    background: linear-gradient(135deg, #3f111c 0%, #5a1a2e 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Labels */
.form-label {
    font-weight: 600;
    color: #3f111c;
    margin-bottom: 0.5rem;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

/* Inputs */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #3f111c;
    box-shadow: 0 0 0 0.2rem rgba(63, 17, 28, 0.1);
    outline: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Opciones de Radio (Cédula y Comprobante) */
.cedula-type-option,
.comprobante-option {
    cursor: pointer;
    display: block;
}

.cedula-type-option input,
.comprobante-option input {
    display: none;
}

.option-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
}

.option-card i {
    color: #3f111c;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.option-card h5 {
    margin: 0.75rem 0 0.25rem;
    color: #3f111c;
    font-weight: 600;
}

.option-card:hover {
    border-color: #3f111c;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(63, 17, 28, 0.15);
}

.cedula-type-option input:checked ~ .option-card,
.comprobante-option input:checked ~ .option-card {
    border-color: #3f111c;
    background: linear-gradient(135deg, rgba(63, 17, 28, 0.05) 0%, rgba(90, 26, 46, 0.05) 100%);
    box-shadow: 0 4px 15px rgba(63, 17, 28, 0.2);
}

.cedula-type-option input:checked ~ .option-card i,
.comprobante-option input:checked ~ .option-card i {
    opacity: 1;
    transform: scale(1.1);
}

/* Métodos de Pago */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-method-option {
    cursor: pointer;
    display: block;
}

.payment-method-option input {
    display: none;
}

.payment-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    background: white;
}

.payment-card:hover {
    border-color: #3f111c;
    box-shadow: 0 4px 15px rgba(63, 17, 28, 0.15);
}

.payment-method-option input:checked ~ .payment-card {
    border-color: #3f111c;
    background: linear-gradient(135deg, rgba(63, 17, 28, 0.03) 0%, rgba(90, 26, 46, 0.03) 100%);
    box-shadow: 0 4px 15px rgba(63, 17, 28, 0.2);
}

.payment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.payment-header i {
    color: #3f111c;
}

.payment-card.sinpe .payment-header i {
    color: #007bff;
}

.payment-card.transferencia .payment-header i {
    color: #6c757d;
}

.payment-card.compraclick .payment-header i {
    color: #28a745;
}

.payment-card.onvo .payment-header i {
    color: #00B074;
}

.payment-card.paypal .payment-header i {
    color: #003087;
}

.payment-header h5 {
    margin: 0;
    font-weight: 600;
    color: #3f111c;
}

.payment-description {
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.payment-details {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Botones */
.btn-checkout {
    background: linear-gradient(135deg, #3f111c 0%, #5a1a2e 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(63, 17, 28, 0.3);
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #5a1a2e 0%, #3f111c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 17, 28, 0.4);
    color: white;
}

.btn-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-checkout.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-checkout.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.btn-wine {
    background: #3f111c;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 50px;
}

.btn-wine:hover {
    background: #5a1a2e;
    color: white;
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    font-weight: 600;
    border-radius: 50px;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* Resumen del Pedido */
.cart-items-summary {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.summary-item .item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-item .item-image i {
    font-size: 1.5rem;
    color: #3f111c;
    opacity: 0.3;
}

.summary-item .item-info {
    flex: 1;
}

.summary-item .item-info h6 {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: #3f111c;
    font-size: 0.95rem;
}

.summary-item .item-meta {
    margin: 0;
    color: #6c757d;
    font-size: 0.85rem;
}

.summary-item .item-total {
    font-weight: 700;
    color: #3f111c;
    font-size: 1.1rem;
}

/* Totales */
.summary-totals {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #e9ecef;
}

.total-row:last-child {
    border-bottom: none;
}

.total-row.total-final {
    border-top: 2px solid #3f111c;
    padding-top: 1rem;
    margin-top: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.total-row.total-final .total-amount {
    color: #3f111c;
    font-size: 1.6rem;
}

/* Security Badges */
.security-badges {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.badge-item {
    text-align: center;
}

.badge-item i {
    font-size: 1.5rem;
    color: #28a745;
    margin-bottom: 0.5rem;
    display: block;
}

.badge-item span {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

/* Mensajes */
#checkout-messages {
    margin-bottom: 1.5rem;
}

#checkout-messages .alert {
    border-radius: 8px;
    padding: 1rem;
    animation: slideDown 0.3s ease;
}

/* Responsive */
@media (max-width: 992px) {
    .order-summary-container {
        position: static !important;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .checkout-form-container,
    .order-summary-container {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .form-section-title {
        font-size: 1.1rem;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .payment-methods {
        gap: 0.75rem;
    }
    
    .security-badges {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Scrollbar personalizada */
.cart-items-summary::-webkit-scrollbar {
    width: 6px;
}

.cart-items-summary::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cart-items-summary::-webkit-scrollbar-thumb {
    background: #3f111c;
    border-radius: 10px;
}

.cart-items-summary::-webkit-scrollbar-thumb:hover {
    background: #5a1a2e;
}

/* PayPal Button Container */
#paypal-button-container {
    margin-top: 1rem;
    min-height: 50px;
}

.paypal-buttons-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#paypal-actions-container {
    margin-top: 1rem;
}

.payment-card.paypal {
    border: 2px solid #003087;
}

.payment-card.paypal .payment-header i {
    color: #003087;
}

input[name="metodo_pago"]:checked ~ .payment-card.paypal {
    border-color: #009cde;
    background: linear-gradient(135deg, rgba(0, 48, 135, 0.03) 0%, rgba(0, 156, 222, 0.03) 100%);
    box-shadow: 0 0 15px rgba(0, 156, 222, 0.3);
}

/* Spinner de carga para PayPal */
.paypal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #003087;
}

.paypal-loading i {
    font-size: 2rem;
}

/* Mensajes de PayPal */
.paypal-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.paypal-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.paypal-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.paypal-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ============================================
   ONVO PAY - ESTILOS
   ============================================ */

.payment-card.onvo {
    border: 2px solid #00B074;
}

.payment-card.onvo .payment-header i {
    color: #00B074;
}

input[name="metodo_pago"]:checked ~ .payment-card.onvo {
    border-color: #00B074;
    background: linear-gradient(135deg, rgba(0, 176, 116, 0.03) 0%, rgba(0, 176, 116, 0.06) 100%);
    box-shadow: 0 0 15px rgba(0, 176, 116, 0.3);
}

.onvo-payment-container {
    min-height: 400px;
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.onvo-payment-container .fa-spinner {
    color: #00B074;
}

/* Estilos para el SDK de ONVO */
#onvo-container {
    width: 100%;
}

#onvo-container iframe {
    width: 100%;
    border: none;
    min-height: 400px;
}

/* Loading state para ONVO */
.onvo-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: #00B074;
}

.onvo-loading i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.onvo-loading p {
    font-size: 1.1rem;
    color: #6c757d;
}

/* Mensajes de ONVO */
.onvo-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.onvo-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.onvo-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.onvo-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ============================================
   BAC CREDOMATIC - ESTILOS
   ============================================ */

.payment-card.bac-credomatic {
    border: 2px solid #003d6d;
}

input[name="metodo_pago"]:checked + .payment-card.bac-credomatic {
    border-color: #003d6d;
    box-shadow: 0 0 15px rgba(0, 61, 109, 0.3);
}

/* Features de BAC */
.bac-features {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.bac-features .feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

.bac-features .feature-item i {
    font-size: 1.2rem;
}

/* Badges en el título */
.payment-header .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .bac-features {
        flex-direction: column;
    }
    
    .bac-features .feature-item {
        width: 100%;
    }
}
