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

?>
<?php
/**
 * Product list toolbar
 *
 * @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
 * @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
 */
use Magento\Catalog\Model\Product\ProductList\Toolbar;
$totalProducts = $block->getTotalNum();
?>
<div class="toolbar-amount" id="toolbar-amount">
    <div class="amount-wrap"><?php if ($block->getLastPageNum() > 1): ?>
        <?= $block->escapeHtml(
            __(
                'Items %1-%2 of %3',
                '<span class="toolbar-number">' . $localeFormatter->formatNumber($block->getFirstNum()) . '</span>',
                '<span class="toolbar-number">' . $localeFormatter->formatNumber($block->getLastNum()) . '</span>',
                '<span class="toolbar-number">' . $localeFormatter->formatNumber($block->getTotalNum()) . '</span>'
            ),
            ['span']
        ) ?>
    <?php elseif ($totalProducts == 1): ?>
        <?= $block->escapeHtml(__('%1 Item',
           '<span class="toolbar-number">' . $localeFormatter->formatNumber($totalProducts) . '</span>'),
            ['span']
		) ?>
    <?php else: ?>
        <?= $block->escapeHtml(__('%1 Items',
            '<span class="toolbar-number">' . $localeFormatter->formatNumber($totalProducts) . '</span>'),
            ['span']
		) ?>
    <?php endif; ?>
	</div>
	<?php if( $totalProducts > 0 ) { 
		$progress_line = ( $block->getLastNum() / $totalProducts ) * 100; 		
	} else { 
		$progress_line= 0; 		
	}; ?>
	<div class="amount-count-line"><span style="width: <?= $block->escapeHtmlAttr($progress_line) ?>%;"></span></div>
</div>
