I feel your frustration!! I have a massive cabinet in which to store pans and it STILL ends up a mess because there are no corrals for each category. Stacking is a pain because then you have to unstack to get what you need, then stack it all again to put it back, then once again unstack/stack when the item gets returned.
Here’s what I have used to organize this area:
I bought something like this from IKEA along with metal S hooks. It’s now installed in my kitchen and I have pots, pans and strainers from it. I’m lucky in that I have a book of sorts where I could place it and it’s out of the way, but even if you don’t have that space available, I’d encourager you to consider finding a place to at least hang your most frequently-used pans, even if you have to put 3M removable hooks on the side of a cabinet or something.
Inside your cabinet, use a simple magazine holder (laid sideways with the opening facing you) to corral your aluminum foil and ziplock bags. Add a second one if you need to stow cutting boards and the like.
Use shallow baskets for the rest. It’s nice to be able to pull out a basket like it’s a drawer and find what you need. They also make various two-tier shelving solutions (although you’d have to remove that middle shelf to use them) that could work better.
You could also consider adding a piece of something sturdy (MDF? Very stiff cardboard) wedged vertically between the middle shelf and the top or bottom shelf to create kind of a cubby situation. Again, it’s whatever you can easily do to create corrals.
I hope that helps! Looking forward to seeing what you come up with.