Close Results with Modal Close (WP/Bootstrap)

Hi, I’m hoping someone can help me.

I’m working on a Wordpress site and I have the search box working, using the WP Method Algolia reference which is great. I’ve styled the listing results and it reflects the design, but I’ve noticed the Modal it appears in (using Bootstrap 5) doesn’t close the results when you click the Modal Close button. So you get the following when closed, a hanging results box in the same place:

I’ve tried to find a solution, but it’s probably a bit above my head. Is it possible to close the result state when the Modal close button is clicked - or it this just a lot of work and scope using Wordpress and Bootstrap? (I can see lots of people have done this in React from viewing this forum).

Thank you in advance for any replies,