 :root {
     --primary: #4a90e2;
     --secondary: #6c757d;
     --success: #28a745;
     --danger: #dc3545;
     --warning: #ffc107;
     --info: #17a2b8;
     --light: #f8f9fa;
     --dark: #343a40;
     --muted: #6c757d;
     --white: #ffffff;
     --bg-color: #f4f7f6;
     --card-bg: #ffffff;
     --text-color: #2c3e50;
     --border-color: #e0e0e0;
     --font-main: 'Outfit', sans-serif;
 }

 * {
     box-sizing: border-box;
     margin: 0;
     padding: 0;
 }

 body {
     font-family: var(--font-main);
     background-color: var(--bg-color);
     color: var(--text-color);
     line-height: 1.6;
     display: flex;
     flex-direction: column;
     min-height: 100vh;
 }

 header {
     background-color: var(--white);
     padding: 1rem 2rem;
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
     display: flex;
     justify-content: space-between;
     align-items: center;
     position: sticky;
     top: 0;
     z-index: 100;
 }

 header h1 {
     font-size: 1.5rem;
     color: var(--primary);
     font-weight: 700;
 }

 nav a {
     text-decoration: none;
     color: var(--secondary);
     margin-left: 1.5rem;
     font-weight: 500;
     transition: color 0.3s;
 }

 nav a:hover,
 nav a.active {
     color: var(--primary);
 }

 main {
     flex: 1;
     padding: 2rem;
     max-width: 1400px;
     margin: 0 auto;
     width: 100%;
 }

 .card {
     background-color: var(--card-bg);
     border-radius: 12px;
     padding: 1.5rem;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
     margin-bottom: 2rem;
     border: 1px solid var(--border-color);
 }

 h2 {
     margin-bottom: 1.5rem;
     font-weight: 600;
     color: var(--dark);
 }

 /* Tablas responsivas optimizadas */
 @media (max-width: 768px) {
     .table-responsive thead {
         display: none;
     }

     .table-responsive tr {
         display: block;
         margin-bottom: 1.5rem;
         border: 1px solid var(--border-color);
         border-radius: 12px;
         overflow: hidden;
         background: var(--white);
         box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
     }

     .table-responsive td {
         display: flex;
         justify-content: space-between;
         align-items: center;
         padding: 0.8rem 1rem;
         border-bottom: 1px solid #f1f5f9;
         font-size: 0.85rem;
         text-align: right !important;
         /* Forzar alineación de valores */
     }

     .table-responsive td:first-child {
         background: #f8fafc;
         border-bottom: 2px solid var(--light);
         padding-top: 1rem;
         padding-bottom: 1rem;
         display: flex;
         flex-direction: column;
         align-items: flex-start;
         text-align: left !important;
     }

     .table-responsive td[data-label="Modelo"]::before {
         content: "Producto";
         display: block;
         font-size: 0.7rem;
         color: var(--secondary);
         text-transform: uppercase;
         letter-spacing: 0.5px;
         margin-bottom: 0.2rem;
     }

     .table-responsive td:not(:first-child)::before {
         content: attr(data-label);
         font-weight: 600;
         color: var(--secondary);
         font-size: 0.75rem;
         text-align: left;
         flex: 1;
     }

     .table-responsive td:last-child {
         border-bottom: none;
         justify-content: center;
         background: #fdfdfd;
         padding: 1.2rem;
     }

     .table-responsive td:last-child .btn {
         width: 100%;
         padding: 0.8rem !important;
         font-size: 0.9rem !important;
     }

     .table-responsive td:last-child::before {
         display: none;
     }

     .table-responsive tr:hover {
         background-color: var(--white);
         /* Desactivar hover de fila desktop */
     }
 }

 .btn {
     display: inline-block;
     padding: 0.6rem 1.2rem;
     border-radius: 8px;
     text-decoration: none;
     font-weight: 600;
     transition: all 0.3s;
     cursor: pointer;
     border: none;
 }

 .btn-primary {
     background-color: var(--primary);
     color: var(--white);
 }

 .btn-sm {
     padding: 0.3rem 0.6rem;
     font-size: 0.75rem;
 }

 /* Filtros */
 .filter-bar {
     display: flex;
     flex-direction: column;
     gap: 1.5rem;
     background: var(--white);
     padding: 1.5rem;
     border-radius: 12px;
     margin-bottom: 2rem;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
     border: 1px solid var(--border-color);
 }

 .filter-section {
     display: flex;
     flex-wrap: wrap;
     gap: 1rem;
     width: 100%;
 }

 .search-section {
     border-top: 1px solid var(--light);
     padding-top: 1rem;
     display: flex;
     justify-content: space-between;
     align-items: center;
 }

 .filter-group {
     display: flex;
     flex-direction: column;
     gap: 0.5rem;
     min-width: 180px;
     flex: 1;
 }

 .filter-group label {
     font-size: 0.85rem;
     font-weight: 600;
     color: var(--secondary);
 }

 .filter-input {
     padding: 0.6rem;
     border-radius: 8px;
     border: 1px solid var(--border-color);
     font-family: inherit;
     font-size: 0.9rem;
     outline: none;
     transition: border-color 0.2s;
 }

 .filter-input:focus {
     border-color: var(--primary);
 }

 /* Agrupación */
 .group-header {
     background: #edf2f7;
     padding: 0.5rem 1rem;
     border-radius: 8px;
     margin: 1.5rem 0 0.5rem;
     display: flex;
     justify-content: space-between;
     align-items: center;
     border-left: 5px solid var(--primary);
 }

 .group-title {
     font-weight: 700;
     font-size: 0.95rem;
     color: var(--dark);
 }

 .group-count {
     font-size: 0.75rem;
     color: var(--secondary);
 }

 /* Benchmark Table (Refined Aesthetics) */
 .benchmark-table {
     width: 100%;
     border-collapse: collapse;
     font-size: 0.8rem;
     background: var(--white);
 }

 .benchmark-table th {
     background: #f1f5f9;
     color: var(--secondary);
     padding: 0.6rem 0.5rem;
     text-align: center;
     border-bottom: 2px solid var(--border-color);
 }

 .benchmark-table td {
     padding: 0.6rem 0.5rem;
     border-bottom: 1px solid var(--light);
     vertical-align: middle;
     text-align: center;
 }

 .benchmark-table tr:hover {
     background-color: #f8fafc;
 }

 .benchmark-table td:first-child {
     text-align: left;
     padding-left: 1rem;
 }

 .price-col {
     color: var(--success);
     font-weight: 700;
 }

 .tech-col,
 .promo-col {
     font-size: 0.75rem;
     line-height: 1.2;
 }

 .promo-col {
     color: #e65100;
 }

 /* Modal Estilos Fix */
 .modal {
     display: none;
     position: fixed;
     z-index: 2000;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.7);
     backdrop-filter: blur(4px);
     overflow: auto;
 }

 .modal-content {
     background-color: var(--white);
     margin: 5vh auto;
     padding: 1.5rem;
     border-radius: 12px;
     width: 95%;
     max-width: 800px;
     /* Un poco más ancho para specs */
     position: relative;
     box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
 }

 .modal-body {
     display: flex;
     gap: 2rem;
     margin-top: 1rem;
 }

 @media (max-width: 600px) {
     .modal-body {
         flex-direction: column;
     }
 }

 .modal-image-container {
     flex: 1;
     display: flex;
     align-items: center;
     justify-content: center;
     background: #f8fafc;
     border-radius: 8px;
     padding: 1rem;
 }

 .modal-specs-container {
     flex: 1;
 }

 .specs-table {
     width: 100%;
     border-collapse: collapse;
     font-size: 0.85rem;
 }

 .specs-table td {
     padding: 0.4rem 0.2rem;
     border-bottom: 1px solid var(--light);
 }

 .specs-table td:first-child {
     font-weight: 600;
     color: var(--secondary);
     width: 40%;
 }

 .close {
     position: absolute;
     right: 15px;
     top: 10px;
     font-size: 24px;
     font-weight: bold;
     cursor: pointer;
     color: var(--secondary);
     line-height: 1;
 }

 #ficha-img {
     width: 100%;
     max-width: 300px;
     height: auto;
     border-radius: 6px;
     display: block;
 }

 /* Paginación */
 .pagination {
     display: flex;
     justify-content: center;
     align-items: center;
     gap: 0.5rem;
     margin-top: 2rem;
     padding: 1rem;
 }

 .page-btn {
     padding: 0.4rem 0.8rem;
     border: 1px solid var(--border-color);
     background: var(--white);
     border-radius: 6px;
     cursor: pointer;
     font-size: 0.85rem;
     transition: all 0.2s;
     color: var(--text-color);
 }

 .page-btn:hover:not(:disabled) {
     background: var(--light);
     border-color: var(--primary);
     color: var(--primary);
 }

 .page-btn.active {
     background: var(--primary);
     color: var(--white);
     border-color: var(--primary);
     font-weight: bold;
 }

 .page-btn:disabled {
     opacity: 0.4;
     cursor: not-allowed;
 }

 .tech-tag {
     font-size: 0.7rem;
     background: #f0f4f8;
     color: #475569;
     padding: 1px 5px;
     border-radius: 3px;
     margin: 1px;
     display: inline-block;
 }