<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2022-2024 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/** @var Mage_Core_Block_Template $this */
/** @var Mage_CatalogSearch_Helper_Data $catalogSearchHelper */
$catalogSearchHelper =  $this->helper('catalogsearch');
?>

<form id="search_mini_form" action="<?= $catalogSearchHelper->getResultUrl() ?>" method="get">
    <div class="input-box">
        <label for="search"><?= $this->__('Search:') ?></label>
        <input id="search" type="search" name="<?= $catalogSearchHelper->getQueryParamName() ?>" value="<?= $catalogSearchHelper->getEscapedQueryText() ?>" class="input-text required-entry" maxlength="<?= $catalogSearchHelper->getMaxQueryLength();?>" placeholder="<?= $this->quoteEscape($this->__('Search entire store here...')) ?>" />
        <button type="submit" title="<?= $this->quoteEscape($this->__('Search')) ?>" class="button search-button"><?= $this->__('Search') ?></button>
    </div>

    <div id="search_autocomplete" class="search-autocomplete"></div>
    <script type="text/javascript">
        var searchForm = new Varien.searchForm('search_mini_form', 'search', '');
        searchForm.initAutocomplete('<?= $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
    </script>
</form>
