<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes. All rights reserved.
 * See COPYING.txt for license details.
 */

declare(strict_types=1);

/** @var \Magento\Framework\View\Element\Template $block */
/** @var \Magento\Framework\Escaper $escaper */
/** @var \Magento\Eav\Model\Entity\Attribute $attribute */
/** @var \Magento\CatalogSearch\Helper\Data $catalogSearchHelper */
$catalogSearchHelper = $block->getData('catalogSearchHelper');

$code = $attribute->getAttributeCode();
$maxQueryLength = $catalogSearchHelper->getMaxQueryLength();
?>
<input type="text"
       name="<?= $escaper->escapeHtmlAttr($code) ?>"
       id="<?= $escaper->escapeHtmlAttr($code) ?>"
       value="<?= $escaper->escapeHtml($block->getAttributeValue($attribute)) ?>"
       title="<?= $escaper->escapeHtml($block->getAttributeLabel($attribute)) ?>"
       class="form-input w-full md:w-2/3 lg:w-1/2"
       maxlength="<?= $escaper->escapeHtmlAttr($maxQueryLength) ?>">
