Not illegal at all and widely practised. Single market does not mean prices have to be the same everywhere.
https://europa.eu/youreurope/citizens/consumers/unfair-treat...
Any exceptions have to be objectively justified, such as postage pricing. Definitely doesn't justify huge differences.
Companies have long flouted these rules, so they were recently tightened up.
Plus, shipping a laptop across Europe as a person, is at least 20 Euros (more with insurance)