Autocomplete Hits Mobile and Desktop

Good morning everyone,

I need to change the number of products displayed in autocomplete to be 6 desktop products and 3 products for screens smaller than 1024px, this transition should be smooth in case the user shrinks the screen size via browser.
Through the dashboard, I can change this value but it is reflected for all screen sizes.
I’m trying to change via javascript by algolia_autocomplete.js.liquid file, but still without success.

Has anyone been through the same situation?

Thanks