I am currently working on a website that requires the ability to overwrite the document.cshtml file so that I can apply a specific CSS-class based on the user\'s current loc
Document.cshtml is a wrapper for the Layout shape. Wrappers don't support alternates. The only way to replace the document.cshtml template selectively is to remove the existing wrapper from the wrappers collection on the metadata of the layout shape and add your own.
But wait... I can't think of any good reason why you'd want to do that. What's in document.cshtml is boilerplate HTML that should be the same across the site. The solution described in your update is the way to go.