Search function not working

Header <form> don’t have action="" attribute. So basically what form do, when you search, is append s=keyWord in current url, that is why you have url like this https://techcart.pk/product/8mm-led-10pcs/?s=abc.
What you need to to is to add action="" in <form>.
You can inspect element in sidebar search field and you can see this markup:

<form role="search" method="get" action="https://techcart.pk/">

So basically you need to do the same on header search. Just replace action URL to be dynamically, like this:

<form role="search" method="get" action="<?php echo esc_url( home_url() ); ?>">