The deal is a response to the UK’s red lines of leaving the customs union and single market