/* --- Estilos para Plantilla Minimalista v6.2 (Checkout Moderno Apple/Stripe-like) MEJORADO --- */

:root {
    --ckfylt25-minimalista-text-primary: #374151;
    --ckfylt25-minimalista-text-secondary: #6b7280;
    --ckfylt25-minimalista-card-bg: #ffffff;
    --ckfylt25-minimalista-accent-blue: #3b82f6;
    --ckfylt25-minimalista-accent-hover: #2563eb;
    --ckfylt25-minimalista-success-color: #10b981;
    --ckfylt25-minimalista-error-color: #dc2626;
    --ckfylt25-minimalista-border-color: #d1d5db;
    --ckfylt25-minimalista-border-radius: 8px;
    --ckfylt25-minimalista-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ckfylt25-stripe-blue: #6772e5;
    --ckfylt25-stripe-blue-hover: #5346e0;
}

/* El fondo se maneja desde global-checkout-styles.css */
.ckfylt25-template-minimalista {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ckfylt25-minimalista-text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}
/* Box model seguro dentro de la plantilla */
.ckfylt25-template-minimalista, 
.ckfylt25-template-minimalista *, 
.ckfylt25-template-minimalista *::before, 
.ckfylt25-template-minimalista *::after {
    box-sizing: border-box;
}

/* Wrapper simple sin background (se muestra el del body) */
.ckfylt25-minimalista-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Contenedor Principal */
.ckfylt25-minimalista-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
    overflow: visible;
    background-color: var(--ckfylt25-minimalista-card-bg);
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Formulario debe mantener el diseño de dos columnas */
.ckfylt25-minimalista-container .checkout {
    display: flex;
    flex-direction: column;
    width: 100%;
}

@media (min-width: 1024px) {
    .ckfylt25-minimalista-container {
        flex-direction: row;
        gap: 0;
    }
    
    .ckfylt25-minimalista-container .checkout {
        display: flex;
        flex-direction: row;
        width: 100%;
    }
}

/* Columna Izquierda */
.ckfylt25-minimalista-main {
    padding: 40px;
    width: 100%;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 32px;
}

@media (min-width: 1024px) {
    .ckfylt25-minimalista-main {
        width: 55%;
    }
}

.ckfylt25-main-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--ckfylt25-minimalista-text-primary);
}

.ckfylt25-section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--ckfylt25-minimalista-text-primary);
}

/* Columna Derecha */
.ckfylt25-minimalista-sidebar {
    padding: 40px;
    background-color: var(--ckfylt25-minimalista-card-bg);
    width: 100%;
    border-top: 1px solid var(--ckfylt25-minimalista-border-color);
}

@media (min-width: 1024px) {
    .ckfylt25-minimalista-sidebar {
        width: 45%;
        border-top: none;
        border-left: 1px solid var(--ckfylt25-minimalista-border-color);
    }
}

.ckfylt25-sidebar-content {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.ckfylt25-sidebar-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--ckfylt25-minimalista-text-primary);
}

/* Formularios */
.ckfylt25-billing-container {
    width: 100%;
}

.ckfylt25-billing-fields {
    width: 100%;
}

.ckfylt25-template-minimalista .form-row {
    margin-bottom: 20px;
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

.ckfylt25-template-minimalista .form-row-first,
.ckfylt25-template-minimalista .form-row-last {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-bottom: 16px;
}

.ckfylt25-template-minimalista .form-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--ckfylt25-minimalista-text-primary);
}

.ckfylt25-template-minimalista .input-text,
.ckfylt25-template-minimalista select,
.ckfylt25-template-minimalista input[type="text"],
.ckfylt25-template-minimalista input[type="email"],
.ckfylt25-template-minimalista input[type="tel"],
.ckfylt25-template-minimalista input[type="password"],
.ckfylt25-template-minimalista textarea {
    width: 100% !important;
    height: 48px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--ckfylt25-minimalista-border-color);
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    font-size: 16px;
    box-sizing: border-box;
}

.ckfylt25-template-minimalista .input-text:focus,
.ckfylt25-template-minimalista select:focus {
    border-color: var(--ckfylt25-stripe-blue);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
    outline: none;
}

/* Métodos de Envío Mejorados */
.ckfylt25-shipping-section {
    width: 100%;
}

.ckfylt25-shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ckfylt25-shipping-methods ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ckfylt25-shipping-methods li {
    background-color: #fff;
    border: 2px solid var(--ckfylt25-minimalista-border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.ckfylt25-shipping-methods li:hover {
    border-color: var(--ckfylt25-stripe-blue);
    box-shadow: 0 2px 8px rgba(99, 91, 255, 0.1);
}

.ckfylt25-shipping-methods li input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ckfylt25-shipping-methods li input[type="radio"]:checked + label {
    color: var(--ckfylt25-stripe-blue);
    font-weight: 600;
}

.ckfylt25-shipping-methods li input[type="radio"]:checked ~ * {
    border-color: var(--ckfylt25-stripe-blue);
}

.ckfylt25-shipping-methods li:has(input:checked) {
    border-color: var(--ckfylt25-stripe-blue);
    background-color: rgba(99, 91, 255, 0.02);
    box-shadow: 0 0 0 1px var(--ckfylt25-stripe-blue);
}

.ckfylt25-shipping-methods li label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Métodos de Envío Minimalista */
.shipping-methods-wrapper {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.shipping-methods-wrapper .woocommerce-shipping-methods {
    list-style: none;
    margin: 0;
    padding: 0;
}

.shipping-methods-wrapper .woocommerce-shipping-methods li {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.shipping-methods-wrapper .woocommerce-shipping-methods li:hover {
    border-color: #000;
    background-color: rgba(0,0,0,0.02);
}

.shipping-methods-wrapper .woocommerce-shipping-methods li input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 20px;
    height: 20px;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
}

.shipping-methods-wrapper .woocommerce-shipping-methods li label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    padding: 10px 0;
    user-select: none;
}

/* Lista de Productos Mejorada (Estilo Shopify/Stripe) */
.ckfylt25-order-products {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--ckfylt25-minimalista-border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.ckfylt25-order-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f1f3f4;
}

.ckfylt25-order-product:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ckfylt25-product-image {
    position: relative;
    flex-shrink: 0;
}

.ckfylt25-product-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--ckfylt25-minimalista-border-color);
}

.ckfylt25-product-qty {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--ckfylt25-minimalista-text-secondary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ckfylt25-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ckfylt25-product-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ckfylt25-minimalista-text-primary);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ckfylt25-product-price {
    font-size: 13px;
    color: var(--ckfylt25-minimalista-text-secondary);
}

.ckfylt25-product-total {
    font-size: 16px;
    font-weight: 600;
    color: var(--ckfylt25-minimalista-text-primary);
    text-align: right;
}

/* Totales Estilo Stripe/Shopify */
.ckfylt25-order-totals {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.ckfylt25-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.ckfylt25-total-label {
    color: var(--ckfylt25-minimalista-text-secondary);
    font-weight: 400;
}

.ckfylt25-total-amount {
    color: var(--ckfylt25-minimalista-text-primary);
    font-weight: 500;
}

.ckfylt25-total-line.ckfylt25-total {
    border-top: 1px solid var(--ckfylt25-minimalista-border-color);
    padding-top: 16px;
    font-size: 18px;
    font-weight: 700;
}

.ckfylt25-total-line.ckfylt25-total .ckfylt25-total-label,
.ckfylt25-total-line.ckfylt25-total .ckfylt25-total-amount {
    color: var(--ckfylt25-minimalista-text-primary);
    font-weight: 700;
}

/* Métodos de Pago */
.ckfylt25-payment-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--ckfylt25-minimalista-text-primary);
}

#payment {
    margin-top: 0;
}

#payment ul.payment_methods {
    padding: 0;
    border: none;
    margin: 0 0 24px 0;
    list-style: none;
}

#payment li.wc_payment_method {
    background-color: var(--ckfylt25-minimalista-bg);
    border: 1px solid var(--ckfylt25-minimalista-border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

#payment li.wc_payment_method:hover {
    background-color: #edf0f3;
    border-color: var(--ckfylt25-stripe-blue);
}

#payment li.wc_payment_method input[type="radio"]:checked + label {
    color: var(--ckfylt25-stripe-blue);
    font-weight: 600;
}

.place-order {
    margin-top: 0;
}

#place_order.button {
    width: 100%;
    height: 56px;
    background-color: var(--ckfylt25-stripe-blue);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

#place_order.button:hover {
    background-color: var(--ckfylt25-stripe-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

#place_order.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 91, 255, 0.3);
}

/* Ocultar elementos innecesarios de WooCommerce (excepto shipping) */
.woocommerce-checkout-review-order-table thead,
.woocommerce-checkout-review-order-table tbody,
.woocommerce-checkout-review-order-table .cart_item {
    display: none !important;
}

/* Forzar ancho completo para campos de facturación */
.ckfylt25-template-minimalista .woocommerce-billing-fields,
.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper,
.ckfylt25-template-minimalista .form-row,
.ckfylt25-template-minimalista .form-row-first,
.ckfylt25-template-minimalista .form-row-last {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-bottom: 16px !important;
}

.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper .form-row {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}



/* Texto de expiración */
.ckfylt25-expiration-text {
    color: var(--ckfylt25-minimalista-danger);
    font-size: 14px;
    margin-top: 16px;
    font-weight: 500;
    text-align: right;
}

/* Testimonios */
.ckfylt25-minimalista-main .ckfylt25-testimonials-container {
    margin-top: 40px;
    border-top: 1px solid var(--ckfylt25-minimalista-border-color);
    padding-top: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -3px rgba(0, 0, 0, 0.05);
}

.ckfylt25-testimonial {
    display: flex;
    gap: 16px;
    align-items: center;
}

.ckfylt25-testimonial__image img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.ckfylt25-testimonial__content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ckfylt25-minimalista-text-secondary);
}

.ckfylt25-testimonial__author {
     margin-top: 12px;
     font-weight: 500;
     font-size: 14px;
     color: var(--ckfylt25-minimalista-text-primary);
 }
 
 /* Beneficios (sidebar) */
 .ckfylt25-benefits-section {
     border-top: 1px solid var(--ckfylt25-minimalista-border-color);
     padding-top: 20px;
     margin-top: 20px;
 }
 
 .ckfylt25-benefits-section h4 {
     font-size: 16px;
     font-weight: 600;
     margin: 0 0 12px 0;
     color: var(--ckfylt25-minimalista-text-primary);
 }
 
 .ckfylt25-benefits-list {
     list-style: none;
     margin: 0;
     padding: 0;
     display: flex;
     flex-direction: column;
     gap: 10px;
 }
 
 .ckfylt25-benefits-list li {
     display: flex;
     align-items: flex-start;
     gap: 8px;
     font-size: 14px;
     color: var(--ckfylt25-minimalista-text-secondary);
 }
 
 .ckfylt25-benefit-icon {
     color: var(--ckfylt25-minimalista-success-color);
     font-weight: 700;
     flex-shrink: 0;
 }
 
 /* Responsive */
@media (max-width: 1023px) {
    .ckfylt25-minimalista-wrapper {
        padding: 20px 16px;
    }
    
    .ckfylt25-minimalista-main,
    .ckfylt25-minimalista-sidebar {
        padding: 24px;
    }
    
    .ckfylt25-main-title {
        font-size: 24px;
    }
    
    .ckfylt25-sidebar-title {
        font-size: 20px;
    }
    
    .ckfylt25-product-thumb {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 767px) {
    .ckfylt25-template-minimalista .form-row-first,
    .ckfylt25-template-minimalista .form-row-last {
        width: 100% !important;
        float: none !important;
        margin-bottom: 16px;
    }
    
    .ckfylt25-order-product {
        padding: 12px 0;
    }
    
    .ckfylt25-product-details {
        gap: 2px;
    }
    
    .ckfylt25-product-name {
        font-size: 13px;
    }
    
    .ckfylt25-product-total {
        font-size: 14px;
    }
}

/* Override de estilos de tema para campos de facturación */
.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper .form-row,
.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper .form-row-first,
.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper .form-row-last {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
}

/* Evitar overflow horizontal en contenedores principales */
.ckfylt25-minimalista-container,
.ckfylt25-minimalista-main,
.ckfylt25-minimalista-sidebar,
.ckfylt25-sidebar-content,
.ckfylt25-order-summary,
#payment,
.wc_payment_methods {
    max-width: 100%;
}

/* Asegurar que medios no generen overflow */
.ckfylt25-template-minimalista img,
.ckfylt25-template-minimalista video,
.ckfylt25-template-minimalista svg {
    max-width: 100%;
    height: auto;
}

/* Prevenir nowrap de precios que causen desbordes */
.ckfylt25-shipping-methods .shipping-price,
.woocommerce-Price-amount.amount,
.woocommerce-Price-amount bdi {
    white-space: normal !important;
}

.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper .form-row {
    display: block !important;
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-bottom: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Asegurar que los labels se muestren */
.ckfylt25-template-minimalista .woocommerce-billing-fields__field-wrapper label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Estilos para Order Bump en plantilla Minimalista */
.ckfylt25-minimalista-main .ckfylt25-order-bump-container {
    width: 100%;
    margin: 20px 0;
    border-radius: var(--ckfylt25-minimalista-border-radius);
    overflow: hidden;
    box-shadow: var(--ckfylt25-minimalista-box-shadow);
    border: 1px solid var(--ckfylt25-minimalista-border-color);
    background-color: var(--ckfylt25-minimalista-card-bg);
}

.ckfylt25-minimalista-main .ckfylt25-order-bump-container .ckfylt25-order-bump-btn {
    border-radius: var(--ckfylt25-minimalista-border-radius);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.ckfylt25-minimalista-main .ckfylt25-order-bump-container .ckfylt25-order-bump-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.15), 0 4px 10px -3px rgba(0, 0, 0, 0.1);
}

/* Responsive para Order Bump en Minimalista */
@media (max-width: 768px) {
    .ckfylt25-minimalista-main .ckfylt25-order-bump-container {
        margin: 16px 0;
        border-radius: 6px;
    }
}

/* --- ASEGURAR ACCESIBILIDAD DEL PAGO EN MINIMALISTA --- */
/* Prevenir que overlays bloqueen el botón de pago */
.ckfylt25-minimalista-wrapper #place_order {
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    background: var(--ckfylt25-minimalista-accent-blue) !important;
    color: white !important;
    border: none !important;
    padding: 16px 32px !important;
    border-radius: var(--ckfylt25-minimalista-border-radius) !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.ckfylt25-minimalista-wrapper #place_order:hover {
    background: var(--ckfylt25-minimalista-accent-hover) !important;
    transform: translateY(-1px) !important;
}

.ckfylt25-minimalista-wrapper #place_order:disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Asegurar que los métodos de pago sean accesibles */
.ckfylt25-minimalista-wrapper #payment {
    position: relative !important;
    z-index: 999 !important;
    pointer-events: auto !important;
    background: var(--ckfylt25-minimalista-card-bg) !important;
    border: 1px solid var(--ckfylt25-minimalista-border-color) !important;
    border-radius: var(--ckfylt25-minimalista-border-radius) !important;
    padding: 24px !important;
    margin-top: 24px !important;
}

.ckfylt25-minimalista-wrapper .wc_payment_methods {
    position: relative !important;
    z-index: 999 !important;
    pointer-events: auto !important;
}

/* Prevenir que blockUI interfiera con el pago */
.ckfylt25-minimalista-wrapper .blockUI {
    z-index: 1 !important;
}

.ckfylt25-minimalista-wrapper .blockUI.blockOverlay {
    z-index: 1 !important;
}

/* Asegurar que el formulario de checkout sea accesible */
.ckfylt25-minimalista-wrapper form.checkout {
    position: relative !important;
    z-index: 10 !important;
}

/* Prevenir que otros overlays bloqueen elementos críticos */
.ckfylt25-minimalista-wrapper .ckfylt25-minimalista-container {
    position: relative !important;
    z-index: 10 !important;
}

/* Asegurar que el botón de pago mantenga su funcionalidad */
.ckfylt25-minimalista-wrapper #place_order:not(:disabled) {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Prevenir que elementos de loading interfieran */
.ckfylt25-minimalista-wrapper .woocommerce-checkout.processing #place_order {
    position: relative !important;
    z-index: 9999 !important;
    background: #9ca3af !important;
    cursor: not-allowed !important;
}

/* Asegurar que el título de pago sea visible */
.ckfylt25-minimalista-wrapper .ckfylt25-payment-title {
    position: relative !important;
    z-index: 999 !important;
    color: var(--ckfylt25-minimalista-text-primary) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
}

/* Extra small screens (<=480px) */
@media (max-width: 480px) {
    .ckfylt25-minimalista-container {
        padding: 16px;
    }
    .ckfylt25-minimalista-main,
    .ckfylt25-minimalista-sidebar {
        padding: 16px;
    }
    .ckfylt25-main-title {
        font-size: 22px;
    }
    .ckfylt25-sidebar-title {
        font-size: 18px;
    }
    .ckfylt25-product-thumb {
        width: 48px;
        height: 48px;
    }
    .ckfylt25-total-line {
        font-size: 15px;
    }
    .ckfylt25-shipping-methods li label {
        font-size: 15px;
    }
}

/* Safe area insets en iOS para mantener el contenedor visualmente centrado */
@supports (padding: max(0px)) {
    .ckfylt25-minimalista-wrapper {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}
