a massive drainage system for the southern end of the mountainous ridge that ran the length of north america and down through mexico , it consisted of dozens of large tributaries and mangrove swamps connected to isolated lagoons and fresh-water flood plains .