/**
 * Estilos para el formulario de checkout - Aislado de temas
 */

/* Reset específico para nuestro contenedor */
#rer-checkout,
#rer-checkout * {
    box-sizing: border-box !important;
}

/* Estilos base */
#rer-checkout.rer-checkout {
    font-family: 'Barlow', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    min-height: 100vh !important;
    background-color: #f9fafb !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Títulos y elementos destacados con Montserrat */
#rer-checkout h1,
#rer-checkout h2,
#rer-checkout h3,
#rer-checkout h4,
#rer-checkout .rer-title,
#rer-checkout button,
#rer-checkout .btn {
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-weight: 600 !important;
}

/* Ajustes para inputs y selects */
#rer-checkout input[type="text"],
#rer-checkout input[type="email"],
#rer-checkout input[type="tel"],
#rer-checkout input[type="date"],
#rer-checkout input[type="time"],
#rer-checkout select,
#rer-checkout textarea {
    appearance: none !important;
    background-color: #fff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    color: #111827 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease-in-out !important;
    width: 100% !important;
    margin: 0 !important;
}

#rer-checkout input:focus,
#rer-checkout select:focus,
#rer-checkout textarea:focus {
    outline: none !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Estilos para labels */
#rer-checkout label {
    display: block !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    color: #374151 !important;
    font-size: 0.875rem !important;
}

/* Contenedores principales */
#rer-checkout .max-w-full {
    max-width: 100% !important;
}

#rer-checkout .mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

#rer-checkout .px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

#rer-checkout .py-8 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Grid layout */
#rer-checkout .lg\\:grid {
    display: grid !important;
}

#rer-checkout .lg\\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#rer-checkout .lg\\:gap-x-12 {
    column-gap: 3rem !important;
}

#rer-checkout .gap-5 {
    gap: 1.25rem !important;
}

/* Tarjetas */
#rer-checkout .bg-white {
    background-color: #ffffff !important;
    transition: box-shadow 0.3s ease !important;
}

#rer-checkout .rounded-lg {
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}

#rer-checkout .shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

#rer-checkout .p-6 {
    padding: 1.5rem !important;
}

/* Títulos */
#rer-checkout h1 {
    font-size: 1.875rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 2rem 0 !important;
}

#rer-checkout h2 {
    font-size: 1.125rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
    margin: 0 0 1.5rem 0 !important;
}

#rer-checkout h3 {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
    margin: 0 0 1rem 0 !important;
}

/* Espaciado */
#rer-checkout .space-y-6 > * + * {
    margin-top: 1.5rem !important;
}

#rer-checkout .space-y-4 > * + * {
    margin-top: 1rem !important;
}

#rer-checkout .space-y-3 > * + * {
    margin-top: 0.75rem !important;
}

#rer-checkout .space-y-2 > * + * {
    margin-top: 0.5rem !important;
}

#rer-checkout .gap-y-6 {
    row-gap: 1.5rem !important;
}

#rer-checkout .gap-x-4 {
    column-gap: 1rem !important;
}

#rer-checkout .mb-2 {
    margin-bottom: 0.5rem !important;
}

#rer-checkout .mb-3 {
    margin-bottom: 0.75rem !important;
}

#rer-checkout .mb-4 {
    margin-bottom: 1rem !important;
}

#rer-checkout .mb-6 {
    margin-bottom: 1.5rem !important;
}

#rer-checkout .mt-1 {
    margin-top: 0.25rem !important;
}

#rer-checkout .mt-4 {
    margin-top: 1rem !important;
}

#rer-checkout .mt-6 {
    margin-top: 1.5rem !important;
}

#rer-checkout .mt-8 {
    margin-top: 2rem !important;
}

#rer-checkout .mt-10 {
    margin-top: 2.5rem !important;
}

/* Grid interno */
#rer-checkout .grid {
    display: grid !important;
}

#rer-checkout .grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

#rer-checkout .sm\\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Flexbox */
#rer-checkout .flex {
    display: flex !important;
}

#rer-checkout .items-center {
    align-items: center !important;
}

#rer-checkout .justify-between {
    justify-content: space-between !important;
}

#rer-checkout .justify-center {
    justify-content: center !important;
}

/* Posicionamiento */
#rer-checkout .relative {
    position: relative !important;
}

#rer-checkout .sticky {
    position: sticky !important;
    top: 2rem !important;
}

#rer-checkout .top-8 {
    top: 2rem !important;
}

#rer-checkout .block {
    display: block !important;
}

/* Bordes */
#rer-checkout .border-b {
    border-bottom-width: 1px !important;
}

#rer-checkout .border-t {
    border-top-width: 1px !important;
}

#rer-checkout .border-gray-200 {
    border-color: #e5e7eb !important;
}

#rer-checkout .pb-4 {
    padding-bottom: 1rem !important;
}

#rer-checkout .pt-4 {
    padding-top: 1rem !important;
}

#rer-checkout .pt-6 {
    padding-top: 1.5rem !important;
}

/* Texto */
#rer-checkout .text-sm {
    font-size: 0.875rem !important;
}

#rer-checkout .text-base {
    font-size: 1rem !important;
}

#rer-checkout .text-xs {
    font-size: 0.75rem !important;
}

#rer-checkout .font-medium {
    font-weight: 500 !important;
}

#rer-checkout .font-semibold {
    font-weight: 600 !important;
}

#rer-checkout .text-gray-700 {
    color: #374151 !important;
}

#rer-checkout .text-gray-600 {
    color: #4b5563 !important;
}

#rer-checkout .text-gray-900 {
    color: #111827 !important;
}

#rer-checkout .text-green-600 {
    color: #059669 !important;
    font-weight: 700 !important;
}

#rer-checkout .text-blue-800 {
    color: #1e40af !important;
}

#rer-checkout .text-blue-700 {
    color: #1d4ed8 !important;
}

#rer-checkout .text-yellow-800 {
    color: #92400e !important;
}

/* Estilos para botones */
#rer-checkout button[type="submit"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    border-radius: 0.5rem !important;
    color: white !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    padding: 0.75rem 1.5rem !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out !important;
    width: 100% !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    font-size: 0.875rem !important;
    margin: 0 !important;
}

#rer-checkout button[type="submit"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

#rer-checkout button[type="submit"]:active {
    transform: translateY(0) !important;
}

#rer-checkout button[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Estilos para radio buttons */
#rer-checkout input[type="radio"] {
    width: 1rem !important;
    height: 1rem !important;
    color: #10b981 !important;
    background-color: #fff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    margin: 0 !important;
}

#rer-checkout input[type="radio"]:checked {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

#rer-checkout input[type="radio"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Estilos para el área de métodos de pago */
#rer-checkout .bg-blue-50 {
    background-color: #eff6ff !important;
    border: 1px solid #dbeafe !important;
    border-radius: 0.375rem !important;
    padding: 0.75rem !important;
}

#rer-checkout .bg-yellow-50 {
    background-color: #fffbeb !important;
    border: 1px solid #fed7aa !important;
    border-radius: 0.375rem !important;
    padding: 0.75rem !important;
}

/* Labels con radio buttons */
#rer-checkout label.flex {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
}

#rer-checkout label .ml-3 {
    margin-left: 0.75rem !important;
}

/* Mejoras de accesibilidad */
#rer-checkout button:focus,
#rer-checkout input:focus,
#rer-checkout select:focus,
#rer-checkout textarea:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
}

/* Estados de carga */
#rer-checkout .loading {
    position: relative !important;
    pointer-events: none !important;
}

#rer-checkout .loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 -10px !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    border-top-color: transparent !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Validación de formularios */
#rer-checkout input:invalid {
    border-color: #ef4444 !important;
}

#rer-checkout input:invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Estilos responsivos */
@media (max-width: 1024px) {
    #rer-checkout .sticky {
        position: static !important;
    }
    
    #rer-checkout .lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    #rer-checkout .lg\\:grid {
        display: block !important;
    }
}

@media (max-width: 640px) {
    #rer-checkout .sm\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    #rer-checkout .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    #rer-checkout .py-8 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    #rer-checkout h1 {
        font-size: 1.5rem !important;
    }
}