<?php
// @codingStandardsIgnoreFile
?>
<?php
    $theme = $this->helper('Infortis\Base\Helper\Data');
    $showTabs = $theme->getCfg('product_page/tabs'); //$block->getData('show_tabs');
    $containerClasses = '';
    $innerContainerClasses = '';
    if ($showTabs)
    {
        $containerClasses .= ' collateral-tabs';
        $innerContainerClasses .= 'product data items ' . $theme->getCfg('product_page/tabs_style');
    }
    else
    {
        $containerClasses .= ' collateral-stacked';
    }
?>
<?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?>
    <div class="product info detailed box-collateral collateral-container<?php echo $containerClasses; ?>">
        <?php $layout = $block->getLayout(); ?>
        <div class="<?php echo $innerContainerClasses; ?>" <?php if ($showTabs): ?>data-mage-init='{"tabs":{"openedState":"active"}}'<?php endif; ?>>
            <?php foreach ($detailedInfoGroup as $name):?>
                <?php
                    $html = $layout->renderElement($name);
                    if (!trim($html)) {
                        continue;
                    }
                    $alias = $layout->getElementAlias($name);
                    $label = $block->getChildData($alias, 'title');
                ?>
                <?php if ($showTabs): ?>
                    <div class="data item title"
                         aria-labeledby="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>-title"
                         data-role="collapsible" id="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>">
                        <a class="data switch"
                           tabindex="-1"
                           data-toggle="switch"
                           href="#<?php /* @escapeNotVerified */ echo $alias; ?>"
                           id="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>-title">
                            <?php /* @escapeNotVerified */ echo $label; ?>
                        </a>
                    </div>
                    <div class="data item content" id="<?php /* @escapeNotVerified */ echo $alias; ?>" data-role="content">
                        <?php /* @escapeNotVerified */ echo $html; ?>
                    </div>
                <?php else: ?>
                    <div class="block collateral-block collateral-block-<?php /* @escapeNotVerified */ echo $alias; ?>">
                        <div class="block-title">
                            <strong><?php /* @escapeNotVerified */ echo $label; ?></strong>
                        </div>
                        <div class="block-content" id="<?php /* @escapeNotVerified */ echo $alias; ?>">
                            <?php /* @escapeNotVerified */ echo $html; ?>
                        </div>
                    </div>
                <?php endif; ?>
            <?php endforeach;?>
        </div>
    </div>
<?php endif; ?>
