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

/**
 * @var $block \Magento\Tax\Block\Checkout\Grandtotal
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 * @see \Magento\Tax\Block\Checkout\Grandtotal
 */
?>
<?php if ($block->includeTax() && $block->getTotalExclTax() >= 0): ?>
    <tr id="grand-total-exclude-tax" class="row-totals">
        <td class="admin__total-mark" colspan="<?= (int) $block->getColspan() ?>">
            <strong><?= $block->escapeHtml(__('Grand Total Excl. Tax')) ?></strong>
        </td>
        <td class="admin__total-amount">
            <strong><?= /* @noEscape */ $block->formatPrice($block->getTotalExclTax()) ?></strong>
        </td>
    </tr>
    <?php if ($block->escapeHtmlAttr($block->getStyle())): ?>
        <?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
            $block->escapeHtmlAttr($block->getStyle()),
            'tr#grand-total-exclude-tax td.admin__total-mark'
        ) ?>
        <?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
            $block->escapeHtmlAttr($block->getStyle()),
            'tr#grand-total-exclude-tax td.admin__total-amount'
        ) ?>
    <?php endif; ?>
    <?= /* @noEscape */ $block->renderTotals('taxes', $block->getColspan()) ?>
    <tr id="grand-total-include-tax" class="row-totals">
        <td class="admin__total-mark" colspan="<?= (int) $block->getColspan() ?>">
            <strong><?= $block->escapeHtml(__('Grand Total Incl. Tax')) ?></strong>
        </td>
        <td class="admin__total-amount">
            <strong><?= /* @noEscape */ $block->formatPrice($block->getTotal()->getValue()) ?></strong>
        </td>
    </tr>
    <?php if ($block->escapeHtmlAttr($block->getStyle())): ?>
        <?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
            $block->escapeHtmlAttr($block->getStyle()),
            'tr#grand-total-include-tax td.admin__total-mark'
        ) ?>
        <?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
            $block->escapeHtmlAttr($block->getStyle()),
            'tr#grand-total-include-tax td.admin__total-amount'
        ) ?>
    <?php endif; ?>
    <?php else: ?>
    <tr id="grand-total" class="row-totals">
        <td class="admin__total-mark" colspan="<?= (int) $block->getColspan() ?>">
            <strong><?= $block->escapeHtml($block->getTotal()->getTitle()) ?></strong>
        </td>
        <td class="admin__total-amount">
            <strong><?= /* @noEscape */ $block->formatPrice($block->getTotal()->getValue()) ?></strong>
        </td>
    </tr>
        <?php if ($block->escapeHtmlAttr($block->getStyle())): ?>
            <?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
                $block->escapeHtmlAttr($block->getStyle()),
                'tr#grand-total-include-tax td.admin__total-mark'
            ) ?>
            <?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
                $block->escapeHtmlAttr($block->getStyle()),
                'tr#grand-total-include-tax td.admin__total-amount'
            ) ?>
    <?php endif; ?>
<?php endif;?>
