<?php
/**
 * Copyright © 2022 Codazon, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php if ((bool)$this->helper(\Codazon\ThemeLayoutPro\Helper\Data::class)->getConfig('mobile/general/disable_section_tabs')) : ?>
<?php
$group = $block->getGroupName();
$groupCss = $block->getGroupCss();
?>
<?php if ($detailedInfoGroup = $block->getGroupChildNames($group)):?>
    <div class="f-sections <?= $block->escapeHtmlAttr($groupCss) ?>">
        <?php $layout = $block->getLayout(); ?>
        <div class="f-<?= $block->escapeHtmlAttr($groupCss) ?>-items">
            <?php foreach ($detailedInfoGroup as $name):?>
                <?php
                    $html = $layout->renderElement($name);
                if (!trim($html) && ($block->getUseForce() != true)) {
                    continue;
                }
                    $alias = $layout->getElementAlias($name);
                    $label = $block->getChildData($alias, 'title');
                ?>
                <div class="f-<?= $block->escapeHtmlAttr($groupCss) ?>-item-title"><?= $label ?></div>
                <div class="f-<?= $block->escapeHtmlAttr($groupCss) ?>-item-content"
                     id="<?= $block->escapeHtmlAttr($alias) ?>"
                     data-role="content"><?= $html ?>
                </div>
            <?php endforeach;?>
        </div>
    </div>
<?php endif; ?>
<?php else : ?>
<?php include $block->getTemplateFile('Magento_Theme::html/sections.phtml') ?>
<?php endif ?>