Organized code, fixed for mobile when a sort is applied, and separated mobile/desktop pagination.