Totaled for sure if repairs > 60% of the value of the car, which is definitely the case with the $17k estimate you mentioned.
As long as you're ok, don't sweat it. Your only obstacles now are finding another BRZ and dealing with a premium increase on the insurance...regardless of fault
Really hope you put down a nice chunk of change when you bought the car, or have Gap insurance...
Good luck man. Hope it all works out.