Customize Popup Search Form Basic and Advanced

Good morning to everybody
I am looking for a solution to the following problem
I would like to be able to change the layout of the search popups with basic and advanced filters in the list view for all modules!
I found a small solution yes, but it does not convince me much, since it is a subsequent load on the screen that I do through javascript:

in: /include/SearchForm/tpls/headerPopup.tpl

I add as last line at the end:
" < script type=“text/javascript” src=“custom/include/searchForm.js?t=’.uniqid().’” >< / script > "

in the javascript write the code:

$(document).ready(function () {
    format();
    $('li[class*="searchTabHandler"]').click(function() {
        format();  
    });    
});

function format() {
    setTimeout(() => {
        $.each($('div[id*="_searchSearchForm"] > div.row > div'), function (i, v) {
            if ((v != null)) {
                console.log(v.className);
                v.removeAttribute("class");
                v.setAttribute("class", "col-xs-6 col-advanced-search");  
                //v.setAttribute("id", i);
            }
        });
        $('div[id*="_searchSearchForm"] > div.row > div').last().removeClass('col-xs-6').addClass('col-xs-12');
    }, 1000);
}

but…

I would like to know if there is any way that these search filter modals can be BUILT in another way and with another design
And that applies to basic and advanced search as well.

Thank you!

I found another stronger solution
I went to the file: /include/SearchForm/SearchForm2.php
and in line 340, before the return
I added this:

    $return_txt = str_replace('col-xs-12 col-sm-4 col-md-4 col-lg-4 ', 'col-xs-6 ', $return_txt);
    $return_txt = str_replace('col-xs-12 col-sm-6 col-md-4 col-lg-4 ', 'col-xs-6 ', $return_txt);

And it works perfectly