.sw365-wrapper {
    margin-top: 0;
    font-family: inherit;
}

.sw365-group-container {
    margin-bottom: 30px;
}

.sw365-group-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.sw365-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

/* Ocultar el radio button real */
.sw365-radio-input {
    position: absolute;
    opacity: 0;
    width: 0;
}

/* La Card */
.sw365-card-body {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sw365-card-body:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Card Seleccionada */
.sw365-radio-input:checked +
 .sw365-card-body {
    border-color: #f04e23; 
    background: #fffaf9;
    box-shadow: 0 4px 12px rgba(240, 78, 35, 0.15);
}

.sw365-card-img img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.sw365-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.sw365-price {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

/* Estilos para las descripciones de grupo */
.sw365-group-header {
    margin-bottom: 15px;
}

.sw365-group-desc-superior {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: -10px;
    margin-bottom: 15px;
    font-style: italic;
}

/* Icono de Tooltip */
.sw365-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    color: #94a3b8;
    cursor: help;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.sw365-info-icon:hover {
    color: #f04e23; 
}

/* Ajuste de precio en la tarjeta */
.sw365-price {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b; 
    margin-top: 4px;
}

.sw365-name {
    color: #475569;
}

/* Para añadir los archivos */
.sw365-flex-layout {
    display: flex !important;
    gap: 30px; 
    align-items: flex-start;
    flex-wrap: wrap; 
}

/* Columnas al 50% cada una */
.sw365-box-column {
    flex: 1 1 calc(50% - 15px); 
    min-width: 320px; 
    box-sizing: border-box;
}

/* Caja de archivos */
.sw365-archivos-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding-top: 0;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(240, 78, 35, 0.15);
}
.sw365-group-file {
    justify-content: center;
    text-align: center;       
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Botones personalizados para archivos */
.sw365-file-action {
    margin-bottom: 20px;
}

.sw365-btn-custom, .sw365-btn-custom-alt {
    display: block;
    width: 80%;
    margin-left: auto; 
    margin-right: auto; 
    text-align: center;
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;    
}

/* Botón Subir */
.sw365-btn-custom {
    background: #46b450;
    color: #fff;
    border: none;
}

.sw365-btn-custom:hover {
    background: #5ec269;
    transform: translateY(-2px);
}

/* Botón WeTransfer: Estilo secundario */
.sw365-btn-custom-alt {
    background: #fff;
    color: #409fff;
    border: 2px solid #409fff;
}

.sw365-btn-custom-alt:hover {
    background: #409fff;
    color: #fff;
    transform: translateY(-2px);
}

/* Espaciado de iconos en botones */
.sw365-btn-custom i, 
.sw365-btn-custom-alt i {
    margin-right: 8px;
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Alineación visual del texto del botón */
.sw365-btn-custom, 
.sw365-btn-custom-alt {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.sw365-file-action small {
    display: block;
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 8px;
    font-size: 12px;
}

@media (max-width: 600px) {
    .sw365-flex-layout {
        flex-wrap: wrap !important;
    }
    .sw365-box-column {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Aseguramos que el formulario no limite el ancho de su caja */
#sw365-form-cotizador {
    width: 100% !important;
}

/* Click boton wetransfer */
/* Estilo para el input de enlace WeTransfer */
.sw365-input-text {
    width: 80% ;
    margin: 0 auto; 
    margin-top: 25px;
    display: block;
    padding: 10px 15px ;
    border: 2px solid #e2e8f0;
    border-radius: 8px ;
    font-size: 14px ;
    outline: none;
    transition: border-color 0.3s ease ;
    box-sizing: border-box ;
   }

.sw365-input-text:focus {
    border-color: #409fff;
}

/* Clase para mostrar con suavidad (opcional para JS) */
.sw365-show {
    display: block !important;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estado del botón tras hacer clic */
.sw365-btn-wetransfer-active {
    opacity: 0.7;
    pointer-events: auto; /* Permitir que sigan haciendo clic si quieren subir más */
}

/* Clases de validación para el input */
.sw365-input-error {
    border-color: #f04e23; 
    background-color: #fffaf9;
}

.sw365-input-success {
    border-color: #46b450; 
    background-color: #f8fff9;
}

.sw365-text-success { 
    color: #46b450 !important; 
}
.sw365-text-error { 
    color: #f04e23 !important; 
}

/* Hacer que el botón de subida pueda mostrar bordes de validación */
.sw365-btn-custom {
    border: 2px solid transparent; /* Reserva el espacio para el borde */
    transition: all 0.3s ease;
}

/* Reutilizamos las clases que ya teníamos */
.sw365-btn-custom.sw365-input-error {
    border-color: #f04e23 !important;
    background-color: #fffaf9 !important;
    color: #f04e23 !important;
}

.sw365-btn-custom.sw365-input-success {
    border-color: #46b450 !important;
    background-color: #f8fff9 !important;
    color: #46b450 !important;
}

/* Vista previa */

/* Contenedor de la vista previa */
.sw365-preview-area {
    margin: 15px 0;
    display: none; 
}

.sw365-preview-area.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

/* Tarjeta del archivo */
.sw365-file-card {
    display: flex;
    gap: 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
/* canvas  */
.sw365-preview-canvas,
.sw365-file-thumbnail img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain; /* Ajusta el contenido sin recortar */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Ajuste del contenedor de miniatura */
.sw365-file-thumbnail {
    width: 130px;
    height: 170px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 5px; /* Pequeño respiro */
}
/* Detalles y Controles */
.sw365-file-details {
    flex: 1;
}

.sw365-file-details h6 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #1e293b;
    word-break: break-all;
}

.sw365-file-meta {
    margin-bottom: 15px;
}

.sw365-file-meta span {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Inputs y Textarea */
.sw365-file-controls {
    display: grid;
    gap: 12px;
}

.sw365-control-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #334155;
}

.sw365-input-copies {
    width: 70px !important;
    padding: 6px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
}

.sw365-file-controls textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: none;
}

/* Botón Eliminar */
.sw365-remove-file {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sw365-remove-file:hover {
    background: #ef4444;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilo sortable */
.sw365-sortable-placeholder {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 12px;
    height: 150px; 
    margin-bottom: 15px;
}

/* Cambiar el cursor  */
.sw365-drag-handle {
    cursor: grab;
    color: #94a3b8;
    display: flex;    
}

.sw365-drag-handle:active {
    cursor: grabbing;
}

/* Efecto visual en la tarjeta que se está moviendo */
.ui-sortable-helper {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2) !important;
    transform: rotate(2deg);
    cursor: grabbing;
}

/*Para el carrito */
/* Ocultamos el precio original de Elementor y el botón de añadir al carrito estándar */
.elementor-widget-woocommerce-product-price,
.single_add_to_cart_button,
.quantity {
    display: none !important;
}

/* Estilo para nuestro nuevo contenedor de precio "en vivo" */
.sw365-live-price-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    margin: 20px 0;
    text-align: center;
}

.sw365-live-price-label {
    display: block;
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
}

.sw365-live-price-amount {
    font-size: 28px;
    font-weight: bold;
    color: #28a745; 
}

/*Para el modal */
.sw365-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none; /* Se cambia a flex con JS */
    align-items: center;
    justify-content: center;
    padding: 15px; /* Margen para móviles */
}

.sw365-modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh; /* No permite que el modal sea más alto que la pantalla */
    overflow-y: auto; /* Scroll si el contenido es muy largo */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.sw365-close-modal {

    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.sw365-resumen-categoria strong {
    color: #555;
    text-transform: uppercase;
    font-size: 0.85em;
    margin-right: 5px;
}

.sw365-badge-resumen {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

/* --- SECCIONES DEL RESUMEN --- */
.sw365-resumen-seccion {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sw365-resumen-seccion:last-of-type {
    border-bottom: none;
}

.sw365-resumen-seccion h4 {
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- ARCHIVOS Y NOTAS --- */
.sw365-resumen-archivo {
    margin-bottom: 12px;
    border-left: 4px solid #28a745;
    padding-left: 12px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 0 6px 6px 0;
}

.sw365-resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    gap: 10px;
}

.sw365-resumen-nota {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #ddd;
}

/* --- BLOQUE DE PRECIO FINAL --- */
.sw365-resumen-total-bloque {
    text-align: right;
    padding-top: 10px;
}

.sw365-resumen-total-label {
    font-size: 16px;
    color: #7f8c8d;
}

.sw365-resumen-total-amount {
    font-size: 30px;
    font-weight: 800;
    color: #28a745;
    display: block;
}

/* --- RESPONSIVE --- */
@media (max-width: 480px) {
    .sw365-modal-content {
        padding: 20px;
    }
    .sw365-resumen-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .sw365-resumen-total-amount {
        font-size: 24px;
    }
}