A lot of the bunkhouses I've seen will have the top bunk hinged and allow it to fold up and be held in place by some type of latch. May want to visit a few dealerships to look around, I was thinking this is fairly common.
2016 Keystone Outback 328RL
2019 Chevy 3500HD DRW
1 Slobbering English Bulldog for ballast