/* Tabs dirección conversión */
.dir-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.dir-tab {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-soft);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.dir-tab.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Buscador de ingrediente */
.ingrediente-search-wrap {
    position: relative;
    margin-bottom: 0.4rem;
}

.ingrediente-search {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.88rem;
    background: var(--bg-soft);
    color: var(--text-color);
    transition: border-color var(--transition);
}

.ingrediente-search:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

.search-icon {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ingrediente-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1.5px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.ingrediente-dropdown.visible {
    display: block;
}

.ingrediente-option {
    padding: 0.5rem 0.9rem;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingrediente-option:last-child {
    border-bottom: none;
}

.ingrediente-option:hover {
    background: #eff6ff;
}

.ingrediente-option .dens {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Categorías rápidas */
.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.cat-chip {
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-soft);
    font-family: var(--font-primary);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.cat-chip.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Tabla de conversiones */
.tabla-conv {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-family: var(--font-primary);
}

.tabla-conv th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.8rem;
    text-align: right;
    border-bottom: 2px solid var(--border-color);
}

.tabla-conv th:first-child {
    text-align: left;
}

.tabla-conv td {
    padding: 0.45rem 0.8rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.tabla-conv td:first-child {
    text-align: left;
    font-weight: 600;
}

.tabla-conv tr.ing-actual td {
    background: #eff6ff;
    font-weight: 700;
    color: var(--primary-color);
}

.tabla-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Tarjeta de densidad */
.dens-card {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.dens-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 0.62rem;
    font-weight: 700;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.2;
}

.dens-badge strong {
    font-size: 1rem;
    display: block;
}

.dens-info {
    font-family: var(--font-primary);
}

.dens-nombre {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}

.dens-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Equivalencias rápidas */
.equiv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.equiv-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 0.8rem;
    text-align: center;
}

.equiv-medida {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.equiv-g {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.equiv-ml {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Indicador */
.conv-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-soft);
    margin-top: 1rem;
}

.conv-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: #dbeafe;
    color: #2563eb;
}

.conv-verdict {
    font-family: var(--font-primary);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-color);
}

.conv-verdict span {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}