Two-scale modeling for failure analysis of textile composites