/******* Do not edit this file *******
Simple Custom CSS and JS - by Silkypress.com
Saved: Oct 08 2025 | 11:49:52 */
<script>
(function(){
  if(window.innerWidth > 768) return;
  if(document.querySelector('.mobile-search-mounted')) return;

  // tenta clonar uma busca existente
  var existing = document.querySelector('form.search-form, .search-form, .woocommerce-product-search, input[type="search"]');
  var target = document.querySelector('.mobile-header, .header-mobile, .site-header, header, .main-header, .header-wrap, .site-top');

  if(!target) target = document.body;

  var form;
  if(existing && existing.closest('form')) {
    form = existing.closest('form').cloneNode(true);
  } else if (existing && existing.tagName === 'FORM') {
    form = existing.cloneNode(true);
  } else {
    // cria um formulário simples WordPress (action usa origin; funciona na maioria)
    form = document.createElement('form');
    form.className = 'search-form mobile-search-mounted';
    form.setAttribute('role','search');
    form.method = 'get';
    form.action = window.location.origin + '/';
    form.innerHTML = '<label><input type="search" name="s" class="search-field" placeholder="Pesquisar..." /></label><button type="submit" class="search-submit">Buscar</button>';
  }

  form.classList.add('mobile-search-mounted');
  // insere no topo do header para ficar visível
  target.prepend(form);

  // estilo rápido caso precise
  var style = document.createElement('style');
  style.innerHTML = '.mobile-search-mounted{display:block!important;margin:10px;padding:0 10px;} .mobile-search-mounted .search-field{width:100%;padding:10px;border-radius:8px;}';
  document.head.appendChild(style);
})();
</script>
