/* ESTILOS PARA BUSCADOR DE EQUIVALENCIAS */
#equivalencias-container {
    max-width: 1200px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
}

.equivalencias-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.equivalencias-header h3 {
    text-align: center;
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.search-row {
    display: flex;
    align-items: end;
    gap: 15px;
    flex-wrap: wrap;
}

.search-field, .filter-field {
    display: flex;
    flex-direction: column;
}

.search-field {
    flex: 1;
    min-width: 200px;
}

.search-field label, .filter-field label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.search-field input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-field select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

#search-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#search-btn:hover {
    background: #005a87;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-primary {
    background: #4a5568;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary {
    background: #718096;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover, .btn-secondary:hover {
    opacity: 0.9;
}

/* LEYENDA DE STOCK */
.stock-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f1f1f1;
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.no-stock {
    background: #e53e3e;
}

.dot.in-stock {
    background: #38a169;
}

.dot.partial-stock {
    background: #d69e2e;
}

/* TABLA DE RESULTADOS */
.equivalencias-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.equivalencias-table th {
    background: #4a5568;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-size: 12px;
    font-weight: bold;
}

.equivalencias-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    vertical-align: middle;
}

.equivalencias-table tr:nth-child(even) {
    background: #f7fafc;
}

.equivalencias-table tr:hover {
    background: #edf2f7;
}

/* COLUMNAS ESPECÍFICAS */
.codigo {
    font-weight: bold;
    color: #2d3748;
    min-width: 100px;
}

.marca {
    font-weight: 600;
    color: #4a5568;
}

.descripcion {
    max-width: 200px;
    word-wrap: break-word;
}

.stock {
    text-align: center;
    width: 60px;
}

.stock-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin: 0 auto;
}

.precio {
    font-weight: bold;
    color: #2b6cb0;
    text-align: right;
}

.cantidad {
    width: 100px;
}

/* CONTROLES DE CANTIDAD */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-input {
    width: 50px;
    padding: 4px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    text-align: center;
}

.add-to-cart-btn {
    background: #38a169;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.add-to-cart-btn:hover {
    background: #2f855a;
}

#no-results {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

/* RESPONSIVO */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
    }
    
    .search-field, .filter-field {
        width: 100%;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .equivalencias-table {
        font-size: 10px;
    }
    
    .equivalencias-table th,
    .equivalencias-table td {
        padding: 6px 4px;
    }
}

/* LOADING */
.loading {
    text-align: center;
    padding: 20px;
}

.loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}