ビバーク is a loanword from German 'Biwak' (bivouac), used in Japanese hiking/mountaineering parlance for emergency overnight camping. ~てたの is the casual contracted progressive ~ていたの with the feminine/inquisitive の. 大変だったね 'that must have been tough, huh' is a standard empathetic response.