<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php 
	$themeSettingConfig = $this->helper('MGS\ThemeSettings\Helper\Config');
	$perRowDefault = $themeSettingConfig->getStoreConfig('themesettings/catalog_search/product_per_row');
	$perRowTablet = $themeSettingConfig->getStoreConfig('themesettings/catalog_search/product_per_row_tablet');
	$perRowMobile = $themeSettingConfig->getStoreConfig('themesettings/catalog_search/product_per_row_mobile');
?>
<?php if ($block->getResultCount()): ?>
<?= $block->getChildHtml('tagged_product_list_rss_link') ?>
<div class="search results">
    <?php if ($messages = $block->getNoteMessages()):?>
    <div class="message notice">
        <div>
            <?php foreach ($messages as $message):?>
                <?= /* @escapeNotVerified */ $message ?><br />
            <?php endforeach;?>
        </div>
    </div>
    <?php endif; ?>
	<div class="product-container search-product-container row-<?php echo $perRowDefault ?> row-tablet-<?php echo $perRowTablet ?> row-mobile-<?php echo $perRowMobile ?>">
		<?= $block->getProductListHtml() ?>
	</div>
</div>
<?php else: ?>

<div class="message notice">
    <div>
        <?= /* @escapeNotVerified */ ($block->getNoResultText()) ? $block->getNoResultText() : __('Your search returned no results.') ?>
        <?= $block->getAdditionalHtml() ?>
        <?php if ($messages = $block->getNoteMessages()):?>
            <?php foreach ($messages as $message):?>
                <br /><?= /* @escapeNotVerified */ $message ?>
            <?php endforeach;?>
        <?php endif; ?>
    </div>
</div>
<?php endif; ?>
