Back in the pre-smartphone days, I used to take some code printouts and a legal pad -- whatever I needed to reference while I was thinking, and space to write down my thoughts -- and go out to lunch solo at a sit-down restaurant. Going to a separate space where I didn't have either my IDE or any distractions like a web browser seemed to give me better space to think through a problem.
Lunch dragged on for a couple of hours sometimes, but I generally had a flexible enough schedule that it worked ok.