<style>
  .bd-content .bd-search {
    margin-bottom: 0;
  }
  div[data-ds-theme] .meilisearch-autocomplete .dsb-dropdown-menu{
    overflow-y: initial;
  }
</style>
{% if theme_use_meilisearch %}
{%- extends "pydata_sphinx_theme/search.html" -%}
{% block docs_body %}
{{ super() }}
<script>
  document.addEventListener('DOMContentLoaded', function () {
  // Check if ACTIVE_MEILI_BACKEND is defined and true
  if (typeof ACTIVE_MEILI_BACKEND === 'undefined') {
    // Select all form elements with the specified classes and attributes
    var forms = document.querySelectorAll('form.bd-search.d-flex.align-items-center[action="#"]');

    // Remove the first form if it exists
    if (forms.length > 0) {
      forms[0].remove();
    }
  }
});
</script>
{%- endblock docs_body %}

{% else %}
  <!-- If there is no MeiliSearch enabled, use the PyData search -->
  {%- include "pydata_sphinx_theme/search.html" -%}
{% endif %}
