/* --- Estilos Generales --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Fuente moderna */
    margin: 0;
    padding: 0;
    background-color: #e9eff4; /* Fondo más suave */
    color: #343a40; /* Texto oscuro */
}

.container {
    width: 90%;
    max-width: 1000px; /* Ancho optimizado para formularios */
    margin: 30px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px; /* Esquinas más redondeadas */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Sombra suave y elegante */
}

h1 {
    color: #11579d; /* Azul corporativo */
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    font-weight: 300; 
    font-size: 2em;
}

h2 {
    color: #343a40;
    font-weight: 500;
    margin-top: 30px;
    margin-bottom: 15px;
}

hr {
    border: 0;
    border-top: 1px solid #f0f0f0;
    margin: 25px 0;
}

/* --- Mensajes de Base de Datos / Alertas --- */
.mensaje-bd p {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.mensaje-bd p[style*="color: green"] {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724 !important;
}
.mensaje-bd p[style*="color: red"] {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24 !important;
}
.mensaje-bd p[style*="color: orange"] {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404 !important;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85em;
    border-radius: 4px;
}

/* Colores de Botones */
.btn-primary, .btn-editar {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover, .btn-editar:hover { background-color: #0056b3; }

.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover { background-color: #5a6268; }

.btn-crear {
    background-color: #28a745;
    color: white;
}
.btn-crear:hover { background-color: #218838; }

.btn-eliminar {
    background-color: #dc3545;
    color: white;
}
.btn-eliminar:hover { background-color: #c82333; }

/* Botón deshabilitado para JS */
.btn-disabled {
    background-color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}


/* --- Navegación Superior (top-nav) --- */
.top-nav {
    background-color: #343a40;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.top-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.top-nav li {
    padding: 15px 15px;
}

.top-nav a {
    color: #adb5bd;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.top-nav a:hover {
    color: #fff;
}

/* --- Dashboard Cards (Tarjetas) --- */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-left: 5px solid #007bff;
    border-radius: 8px;
    padding: 20px;
    flex: 1 1 calc(25% - 20px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    transition: transform 0.3s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.card.alerta {
    border-left: 5px solid #dc3545;
    background-color: #fff0f0;
}

.card-title {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.card-value {
    font-size: 2.2em;
    font-weight: 700;
    color: #343a40;
}

/* --- Tablas --- */
table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Sombra suave para tablas */
    border-radius: 8px; /* Bordes redondeados para la tabla */
    overflow: hidden; /* Asegura que los bordes redondeados se apliquen al contenido */
}

table thead th {
    background-color: #f8f9fa; /* Fondo claro para el encabezado */
    color: #495057;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap; /* Evita que el texto se rompa */
}

table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Oculta el texto que desborda con puntos suspensivos */
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr:nth-child(even) {
    background-color: #f2f4f6; /* Rayas alternas para mejor legibilidad */
}

table tbody tr:hover {
    background-color: #e0e6eb; /* Resaltar fila al pasar el mouse */
}

/* Alineación de texto en tablas */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Iconos en botones/enlaces */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn-action:hover {
    transform: translateY(-1px);
}

.btn-edit { background-color: #ffc107; color: #343a40; } /* Amarillo para editar */
.btn-edit:hover { background-color: #e0a800; }

.btn-delete { background-color: #dc3545; color: white; } /* Rojo para eliminar */
.btn-delete:hover { background-color: #c82333; }

.btn-view { background-color: #17a2b8; color: white; } /* Azul cian para ver/detalle */
.btn-view:hover { background-color: #138496; }

/* Estilos de formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Grupo de botones al final de formularios */
.form-actions {
    margin-top: 30px;
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end; /* Alinear a la derecha */
    gap: 10px; /* Espacio entre botones */
}

/* Estilos específicos para la sección de Productos (manteniendo los que ya tenías y añadiendo mejoras) */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #343a40;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
}

/* Mensajes de feedback (usando las nuevas variables) */
.message {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-out; 
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Acciones CRUD y Búsqueda */
.acciones-crud {
    margin-bottom: 25px;
    display: flex;
    justify-content: flex-end; 
}
.btn-crear { /* Reusa el estilo de .btn-crear general, pero con gap para el icono */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-crear:hover { background-color: #218838; transform: translateY(-2px); }


/* Estilos para el contenedor de búsqueda y filtro */
.search-container {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap; /* Permitir que los elementos se envuelvan en pantallas pequeñas */
    align-items: center;
    gap: 15px; /* Espacio entre elementos */
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-light);
}
.search-container label {
    font-weight: 500;
    color: var(--dark-text);
    white-space: nowrap; /* Evita que la etiqueta se rompa */
}
/* Estilo para el combobox y el input de texto */
.search-container select,
.search-container input[type="text"] {
    flex: 1 1 auto; /* Permite que se expandan, con un mínimo */
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
}
.search-container select {
    appearance: none; /* Elimina el estilo predeterminado del sistema operativo */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2C197.352L146.202%2C27.054L5.404%2C197.352H287z%22%2F%3E%3C%2Fsvg%3E'); /* Flecha personalizada */
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}
.search-container select:focus,
.search-container input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* --- Estilos para la nueva vista de productos (LISTA) --- */
.product-list-container {
    margin-top: 20px;
}

.family-group {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-light);
    margin-bottom: 30px;
    overflow: hidden; 
    transition: all 0.3s ease;
}
.family-group.hidden {
    display: none; 
}

.family-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 25px;
    font-size: 1.6em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
}
.family-header:hover {
    background-color: #0056b3; 
}

.family-header .toggle-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}
.family-header.collapsed .toggle-icon {
    transform: rotate(-90deg); 
}
.family-header:not(.collapsed) .toggle-icon {
    transform: rotate(0deg); 
}

.family-content {
    padding: 0px; 
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
    overflow: hidden;
    background-color: var(--light-bg); 
}
.family-content.collapsed {
    max-height: 0 !important; /* Usar !important para asegurar que JS pueda modificarlo */
    opacity: 0;
}
 
.product-list-item-header { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    background-color: #e9ecef; 
    font-weight: 600;
    font-size: 0.9em;
    color: var(--dark-text);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap; 
}
/* Las columnas del encabezado usan flex-basis para darles un tamaño preferente */
.product-list-item-header .col-id { flex: 0 0 50px; text-align: left; }
.product-list-item-header .col-sku { flex: 0 0 100px; text-align: left; }
.product-list-item-header .col-name { flex: 2 1 200px; text-align: left; } /* Flexible, mínimo 200px */
.product-list-item-header .col-stock { flex: 0 0 70px; text-align: center; }
.product-list-item-header .col-minimo { flex: 0 0 60px; text-align: center; }
.product-list-item-header .col-unidad { flex: 0 0 70px; text-align: center; }
.product-list-item-header .col-pcompra { flex: 0 0 90px; text-align: right; }
.product-list-item-header .col-pventa { flex: 0 0 90px; text-align: right; }
.product-list-item-header .col-category { flex: 1 0 120px; text-align: left; } /* Mínimo 120px */
.product-list-item-header .col-provider { flex: 1 0 100px; text-align: left; } /* Mínimo 100px */
.product-list-item-header .col-actions { flex: 0 0 200px; text-align: right; } /* Fijo 200px */


.product-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    white-space: nowrap; 
}
.product-list-item:hover {
    background-color: #f0f0f0;
}
.product-list-item:last-child {
    border-bottom: none; 
}
.product-list-item.hidden {
    display: none;
}

/* Las columnas de los ítems siguen la misma estructura de flex-basis */
.product-list-item .col-id { flex: 0 0 50px; font-size: 0.8em; color: var(--secondary-color); }
.product-list-item .col-sku { flex: 0 0 100px; font-size: 0.85em; color: var(--secondary-color); }
.product-list-item .col-name { flex: 2 1 200px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.product-list-item .col-stock { flex: 0 0 70px; text-align: center; font-weight: 700; font-size: 1.1em; }
.product-list-item .col-minimo { flex: 0 0 60px; text-align: center; font-size: 0.9em; color: var(--secondary-color); }
.product-list-item .col-unidad { flex: 0 0 70px; text-align: center; font-size: 0.9em; }
.product-list-item .col-pcompra { flex: 0 0 90px; text-align: right; font-size: 0.9em; color: var(--info-color); }
.product-list-item .col-pventa { flex: 0 0 90px; text-align: right; font-size: 0.9em; color: var(--success-color); font-weight: 600; }
.product-list-item .col-category { flex: 1 0 120px; font-size: 0.9em; color: var(--secondary-color); overflow: hidden; text-overflow: ellipsis; }
.product-list-item .col-provider { flex: 1 0 100px; font-size: 0.9em; color: var(--secondary-color); overflow: hidden; text-overflow: ellipsis; }
.product-list-item .col-actions { 
    flex: 0 0 200px; /* Ancho fijo para las acciones */
    text-align: right;
    display: flex;
    gap: 5px;
    justify-content: flex-end; 
    flex-wrap: nowrap; /* Evita que los botones se envuelvan */
}


/* Alerta de stock bajo en la fila */
.product-list-item.stock-alert {
    background-color: #fff4e6; 
    border-left: 5px solid var(--warning-color); 
}
.product-list-item.stock-alert .col-stock {
    color: var(--danger-color); 
    font-weight: 700;
}
 
.btn-list-action {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap; 
}
.btn-list-action.adjust {
    background-color: var(--info-color);
    color: white;
}
.btn-list-action.adjust:hover {
    background-color: #138496;
    transform: translateY(-1px);
}
.btn-list-action.edit {
    background-color: var(--primary-color);
    color: white;
}
.btn-list-action.edit:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}
.btn-list-action.delete {
    background-color: var(--danger-color);
    color: white;
}
.btn-list-action.delete:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}
 
.no-products-message {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1.2em;
    padding: 40px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 30px;
    background-color: var(--card-bg);
}

/* --- Estilos Específicos para AJUSTE AVANZADO DE STOCK (NUEVO) --- */
/* Diseño de cuadrícula para los detalles de precios y stock (3 columnas) */
.detail-grid {
    display: grid; 
    grid-template-columns: repeat(3, 1fr); /* 3 columnas de igual ancho */
    gap: 20px;
    padding: 10px 0;
}
.detail-grid p {
    margin: 5px 0;
    font-size: 0.95em;
}
.detail-grid strong {
    color: #343a40;
}
.detail-grid .stock-info {
    text-align: right; 
    padding-left: 20px; 
    border-left: 1px dashed #e9ecef;
}


/* Diseño de cuadrícula para el formulario de ajuste (2 columnas) */
.form-grid {
    display: flex;
    gap: 30px;
    padding-top: 10px;
}
.form-column {
    flex: 1 1 45%; 
}

/* Caja para destacar los resultados de cálculo */
.result-box {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.result-box p {
    margin: 8px 0;
    font-size: 1.1em;
}
.result-box .change-value {
    font-weight: 700;
}
.result-box .new-stock-value {
    font-size: 1.2em;
    font-weight: 700;
}


/* --- Medias Queries para responsividad (MANTENIDOS Y AJUSTADOS) --- */
@media (max-width: 1200px) {
    /* En pantallas medianas, reducimos un poco el espacio de categoría y proveedor, y acciones */
    .product-list-item-header .col-category,
    .product-list-item .col-category {
        flex: 1 0 100px; /* Reducir mínimo */
    }
    .product-list-item-header .col-provider,
    .product-list-item .col-provider {
        flex: 1 0 80px; /* Reducir mínimo */
    }
    .product-list-item-header .col-actions,
    .product-list-item .col-actions {
        flex: 0 0 180px; /* Un poco menos de espacio, los botones aún caben bien */
    }
}

@media (max-width: 992px) {
    /* Tabletas: Ocultamos SKU, Mínimo, Unidad y Proveedor. Reducimos precios. */
    .product-list-item-header .col-sku,
    .product-list-item .col-sku,
    .product-list-item-header .col-minimo,
    .product-list-item .col-minimo,
    .product-list-item-header .col-unidad,
    .product-list-item .col-unidad,
    .product-list-item-header .col-provider,
    .product-list-item .col-provider {
        display: none; 
    }

    .product-list-item-header .col-name { flex: 3 1 180px; } /* Más espacio y un mínimo */
    .product-list-item .col-name { flex: 3 1 180px; }
    
    .product-list-item-header .col-stock { flex: 0 0 55px; } /* Reducir un poco stock */
    .product-list-item .col-stock { flex: 0 0 55px; }
    
    .product-list-item-header .col-pcompra,
    .product-list-item .col-pcompra,
    .product-list-item-header .col-pventa,
    .product-list-item .col-pventa {
        flex: 0 0 65px; /* Precios más compactos */
    }

    .product-list-item-header .col-category,
    .product-list-item .col-category {
        flex: 1 0 100px; /* Mantener categoría visible pero más compacta */
    }

    .product-list-item-header .col-actions,
    .product-list-item .col-actions {
        flex: 0 0 150px; /* Espacio para 3 botones más pequeños */
    }
    .btn-list-action {
        font-size: 0.7em; /* Texto más pequeño */
        padding: 4px 7px;
    }
}

@media (max-width: 768px) {
    .top-nav ul { flex-wrap: wrap; justify-content: center; }
    .top-nav li { margin: 5px; }
    .top-nav ul li:last-child { margin-left: initial; width: 100%; text-align: center; }
    .top-nav ul li:last-child a { border: 1px solid rgba(255,255,255,0.3); }

    .container { margin: 20px auto; padding: 15px; }
    h1 { font-size: 2em; }
    
    /* Responsive para el search-container en móviles */
    .search-container {
        flex-direction: column; /* Apilar elementos en pantallas pequeñas */
        align-items: stretch;
    }
    .search-container label {
        width: 100%; /* Las etiquetas ocupan todo el ancho */
        text-align: left;
    }
    .search-container select,
    .search-container input[type="text"] {
        flex: 1 1 auto; /* Permitir que se expandan */
    }

    /* Ajustes para la vista de AJUSTE STOCK AVANZADO */
    .detail-grid, .form-grid {
        grid-template-columns: 1fr; /* Apilar en una sola columna */
        flex-direction: column; 
        gap: 15px;
    }
    .detail-grid .stock-info {
        border-left: none; /* Eliminar la línea de división en móvil */
        text-align: left;
        padding-left: 0;
    }


    .family-header { font-size: 1.4em; padding: 12px 20px; }
    
    /* Móviles: Ocultamos casi todo excepto ID, Nombre, Stock, P. Venta y Acciones (solo iconos) */
    .product-list-item-header .col-sku,
    .product-list-item .col-sku,
    .product-list-item-header .col-minimo,
    .product-list-item .col-minimo,
    .product-list-item-header .col-unidad,
    .product-list-item .col-unidad,
    .product-list-item-header .col-pcompra, 
    .product-list-item .col-pcompra,
    .product-list-item-header .col-category, 
    .product-list-item .col-category,
    .product-list-item-header .col-provider, 
    .product-list-item .col-provider {
        display: none;
    }
    .product-list-item-header .col-id,
    .product-list-item .col-id {
        flex: 0 0 40px; /* ID más pequeño */
    }

    .product-list-item-header .col-name { flex: 2 1 100px; } /* Nombre más flexible, mínimo 100px */
    .product-list-item .col-name { flex: 2 1 100px; }
    
    .product-list-item-header .col-stock { flex: 0 0 50px; } /* Stock más pequeño */
    .product-list-item .col-stock { flex: 0 0 50px; }
    
    .product-list-item-header .col-pventa,
    .product-list-item .col-pventa {
        flex: 0 0 60px; /* P. Venta compacto */
    }

    /* Acciones: espacio fijo para 3 iconos */
    .product-list-item-header .col-actions,
    .product-list-item .col-actions {
        flex: 0 0 90px; /* 3 botones * ~30px cada uno */
        gap: 2px; /* Espacio mínimo entre botones */
    }
    .btn-list-action {
        padding: 3px 5px; /* Padding reducido para que quepan */
        flex: 1 1 28px; /* Intentar que cada botón ocupe un tercio del espacio total, con un mínimo */
        min-width: 28px; /* Ancho mínimo para el icono */
    }
    .btn-list-action span {
        display: none; /* Oculta el texto, solo se ven los iconos */
    }
    /* Mostrar solo el icono con pseudo-elementos */
    .btn-list-action.adjust::before { content: '✍️'; }
    .btn-list-action.edit::before { content: '✏️'; }
    .btn-list-action.delete::before { content: '🗑️'; }
}

@media (max-width: 480px) {
    /* Móviles muy pequeños: se prioriza aún más el espacio */
    .product-list-item-header .col-id,
    .product-list-item .col-id {
        display: none; /* Ocultar ID si el espacio es muy limitado */
    }
    .product-list-item-header .col-name { flex: 2 1 80px; } /* Nombre mínimo aún más pequeño */
    .product-list-item .col-name { flex: 2 1 80px; }

    .product-list-item-header .col-actions,
    .product-list-item .col-actions {
            flex: 0 0 84px; /* Un poco menos de espacio, 3 * 28px */
            gap: 1px;
    }
    .btn-list-action {
            padding: 2px 3px;
            min-width: 26px;
    }
}