I have had the sidebar on the left side for a long time but want to switch it to the right to get more impact to see the product image the first thing. When I do that the sidebar ends up below the product details on the computer rather on the right side. And there is no effect switching for mobile mode where I want the side bar to show up below the details of a product.
Can you check why it behaves like this. I like to keep the sidebar on the left side on the Product Grid Page so no need to check there).
Now the position looks good in single product view for both desktop and mobile.
But the code you wrote also move the sidebar to the right on the Product Page Layout (even if it looks like it is left side in the settings).
I want the sidebar tool be on the left side for Product Page Layout and on the right side for the Single Product Page.