Your duplicates are because you're joining multiple tables but not accounting for mismatched joins.
I built my suggestions based on you saying you wanted product_ids. Not complete product details. I assumed since you were only returning 1 item in your examples that you were intending to do a separate query for the rest of any truly needed data.
Bookmarks