Structural capacity of masonry walls under horizontal loads