in a state of (remaining)
This structure indicates that something remains in a certain state, expressed politely.
Examples
服を着たまま寝てしまいました。
I ended up sleeping while still wearing my clothes.
靴を履いたままで入らないでください。
Please do not enter while wearing shoes.
テレビをつけたまま外出しました。
I went outside while the TV was on.
Quick check
服を着___まま寝てしまいました。