{% if document.getProperty('searchPage').url() is defined %}
{% set searchTarget = document.getProperty('searchPage').url %}
<form
id="main-search-form"
method="get"
action="{{ searchTarget }}"
class="flex items-center h-[24px]"
x-data="{ searchOpen: false }"
>
<div class="hidden lg:flex">
<button class="flex items-center mr-3">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#323E48" fill-rule="evenodd" d="M1.641 6.43a4.79 4.79 0 1 1 4.79 4.79 4.794 4.794 0 0 1-4.79-4.79m14.135 8.217-4.307-4.307a6.409 6.409 0 1 0-1.13 1.13l4.308 4.306a.798.798 0 0 0 1.129-1.129"/></svg>
</button>
<input
x-bind:disabled="searchOpen"
type="text"
name="term"
placeholder="{{ 'Zoeken naar...' | trans }}"
class="py-0 text-blue-800 text-xs border-0 placeholder:text-opacity-70 focus:ring-0 focus:outline-none w-[65px] px-0"
/>
</div>
<div class="flex h-full lg:hidden">
<div
class="flex items-center px-5 transition-colors cursor-pointer lg:px-10 lg:border-white lg:border-l lg:border-opacity-20 hover:bg-blue-700"
@click="searchOpen = !searchOpen"
>
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"><path fill="#FFF" fill-rule="evenodd" d="M2.051 8.038a5.988 5.988 0 0 1 11.974 0 5.988 5.988 0 0 1-5.987 5.987 5.993 5.993 0 0 1-5.987-5.987m17.67 10.271-5.384-5.384a8.011 8.011 0 1 0-1.412 1.412l5.384 5.383a.998.998 0 0 0 1.411-1.41"/></svg>
</div>
<div
class="absolute left-[74px] top-0 bg-blue h-[74px] flex items-center w-[calc(100vw-74px)]"
x-show="searchOpen"
@click.outside="searchOpen = false"
x-on:resize.window="searchOpen = false"
>
<div class="flex-grow px-3.5 pr-8">
<input
x-bind:disabled="!searchOpen"
type="text"
name="term"
placeholder="{{ 'Zoeken naar...' | trans }}"
class="w-full p-2 border border-white rounded-md border-opacity-20 placeholder:text-white placeholder:text-opacity-70 focus:outline-none bg-blue"
/>
</div>
<button class="flex items-center h-full px-5 bg-blue-700 cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"><path fill="#FFF" fill-rule="evenodd" d="M2.051 8.038a5.988 5.988 0 0 1 11.974 0 5.988 5.988 0 0 1-5.987 5.987 5.993 5.993 0 0 1-5.987-5.987m17.67 10.271-5.384-5.384a8.011 8.011 0 1 0-1.412 1.412l5.384 5.383a.998.998 0 0 0 1.411-1.41"/></svg>
</button>
</div>
</div>
</form>
{% endif %}