    {include file="$template/includes/common/layouts-vars.tpl"}
    {if (
            !isset($skipMainBody) || !$skipMainBody
        ) && (
            !isset($isOnePageOrder) || !$isOnePageOrder
        ) && (
            $pageType != "website" || $activeDisplay != "CMS"
        ) || (
            $pageType == "website" && $activeDisplay == "CMS" && !$pageContent && $templatefile !="homepage" && !$skipMainBody
        )
    }
        {if !isset($inShoppingCart) || !$inShoppingCart}</div>{/if}
        {if (!isset($skipMainBodyContainer) || !$skipMainBodyContainer) && !$inShoppingCart}</div>{/if}
            </div>
        </div>
    {/if}

    {if file_exists("templates/$template/core/layouts/footer/{$RSThemes['footer-layouts'].name}/footer.tpl")}
        {include file="{$template}/core/layouts/footer/{$RSThemes['footer-layouts'].name}/footer.tpl"}
    {/if}

    {if isset($pageContent) && is_array($pageContent) && count($pageContent) > 0}
        {$lastSection = $pageContent|@end}
        {if is_array($lastSection) && isset($lastSection['variables'])}
            {if isset($lastSection['variables']['overlay']) && $lastSection['variables']['overlay']}
                {$hasOverlay = true}
            {elseif isset($lastSection['variables']['combined']) && $lastSection['variables']['combined']}
                {$isCombined = true}
            {/if}
        {/if}
    {/if}
    {if !isset($skipMainFooter) || (isset($skipMainFooter) && !$skipMainFooter)}
        {$footerLayoutType = false}
        {if isset($RSThemes['footer-layouts']['vars']['type'])}
            {$footerLayoutType = $RSThemes['footer-layouts']['vars']['type']}
        {/if}
        {$footerClass = false}
        {if isset($RSThemes['footer-layouts']['vars']['footerClass'])}
            {$footerClass = $RSThemes['footer-layouts']['vars']['footerClass']}
        {/if}
        
        <div class="main-footer{if $footerLayoutType == 'extended'} main-footer-extended main-footer-extended-{if isset($extendedFooterStyle)}{$extendedFooterStyle}{/if} {/if}{if $footerClass} {$footerClass}{/if}{if isset($hasOverlay) && $hasOverlay} has-overlay{elseif isset($isCombined) && $isCombined} is-combined{/if}">
            {if $footerLayoutType == 'extended'}
            <div class="footer-top">
                <div class="container">
                    <div class="footer-brand d-flex flex-column">
                        <div class="footer-company">
                            <div class="footer-company-intro">
                                {include file="$template/includes/common/logo.tpl" customClass="footer-company-logo" ignoreMobileVersion="true" footerLogo=true}
                                {if is_array($RSThemes.addonSettings.footer_company_description_message) && isset($activeLocale.language)}
                                    {if empty($RSThemes.addonSettings.footer_company_description_message[$activeLocale.language])}
                                        {if isset($RSThemes.addonSettings.footer_company_description_message[\WHMCS\Config\Setting::getValue("Language")])}
                                            <p class="footer-company-desc">{$RSThemes.addonSettings.footer_company_description_message[\WHMCS\Config\Setting::getValue("Language")]|unescape:"html"}</p>
                                        {/if}
                                        <p class="footer-company-desc">{$rslang->trans('footer_extended.footer_desc')}</p>
                                    {else}
                                        <p class="footer-company-desc">{$RSThemes.addonSettings.footer_company_description_message[$activeLocale.language]|unescape:"html"}</p>
                                    {/if}
                                {else}
                                    <p class="footer-company-desc">{$rslang->trans('footer_extended.footer_desc')}</p>
                                {/if}
                            </div>
                            {include file="$template/includes/footer/footersocial.tpl"}
                        </div>
                        {if $RSThemes.addonSettings.show_footer_supported_payment_gateways == "displayed" && $RSThemes.addonSettings.footer_supported_payment_gateways_location == "default" }
                            <div class="footer-payment">
                                {if isset($activeLocale.language) && empty($RSThemes.addonSettings.footer_supported_payment_gateways_message[$activeLocale.language])}
                                    {if isset($RSThemes.addonSettings.footer_supported_payment_gateways_message[\WHMCS\Config\Setting::getValue("Language")])}
                                        <p class="footer-payment-header mb-0">{$RSThemes.addonSettings.footer_supported_payment_gateways_message[\WHMCS\Config\Setting::getValue("Language")]|unescape:"html"}</p>
                                    {/if}
                                {else if isset($activeLocale.language)}
                                    <p class="footer-payment-header mb-0">{$RSThemes.addonSettings.footer_supported_payment_gateways_message[$activeLocale.language]}</p>
                                {/if}
                                {if is_array($RSThemes.addonSettings.footer_supported_payment_gateways_icons) && !empty($RSThemes.addonSettings.footer_supported_payment_gateways_icons)}
                                    <div class="footer-payment-gateway">
                                        {foreach from=$RSThemes.addonSettings.footer_supported_payment_gateways_icons  item=$paymentIcon}
                                            {$iconTooltip = false}
                                            {if isset($paymentIcon.nameTranslations[$language]) && $paymentIcon.nameTranslations[$language] != ""}
                                                {$iconTooltip = $paymentIcon.nameTranslations[$language]}
                                            {elseif isset($paymentIcon.name) && $paymentIcon.name != ""}
                                                {$iconTooltip = $paymentIcon.name}
                                            {/if}
                                            {if $paymentIcon.iconType == "gateways"}
                                            <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body" {/if}>
                                                {include file="$template/assets/svg-gateways/{$paymentIcon.iconName}"}
                                                </i>
                                            {else if $paymentIcon.iconType == "media"}
                                                <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body" {/if}>
                                                    <img src="{$WEB_ROOT}/templates/{$template}/assets/img/page-manager/{$paymentIcon.iconName}" role="presentation">
                                               </i>
                                            {/if}
                                        {/foreach}
                                    </div>
                                {/if}
                            </div>
                        {/if}
                    </div>
                    {include file="$template/includes/footer/footerprimary.tpl"}
                </div>
            </div>
            {/if}
            <div class="footer-bottom">
                <div class="container">
                    <div class="footer-copyright">{lang key="copyrightFooterNotice" year=$date_year company=$companyname}</div>
                    {if isset($RSThemes.addonSettings.show_footer_supported_payment_gateways) && $RSThemes.addonSettings.show_footer_supported_payment_gateways == "displayed"  && is_array($RSThemes.addonSettings.footer_supported_payment_gateways_icons) && !empty($RSThemes.addonSettings.footer_supported_payment_gateways_icons)}
                        {if (isset($footerLayoutType) && $footerLayoutType != 'extended') || (isset($footerLayoutType) && $footerLayoutType == 'extended' && isset($RSThemes.addonSettings.footer_supported_payment_gateways_location) && $RSThemes.addonSettings.footer_supported_payment_gateways_location == "bottom") }
                            <div class="footer-payment-gateway">
                                {foreach from=$RSThemes.addonSettings.footer_supported_payment_gateways_icons  item=$paymentIcon}
                                    {$iconTooltip = false}
                                    {if isset($paymentIcon.nameTranslations[$language]) && $paymentIcon.nameTranslations[$language] != ""}
                                        {$iconTooltip = $paymentIcon.nameTranslations[$language]}
                                    {elseif isset($paymentIcon.name) && $paymentIcon.name != ""}
                                        {$iconTooltip = $paymentIcon.name}
                                    {/if}
                                    {if $paymentIcon.iconType == "gateways"}
                                        <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body"{/if}>
                                            {include file="$template/assets/svg-gateways/{$paymentIcon.iconName}"}
                                        </i>
                                    {else if $paymentIcon.iconType == "media"}
                                        <i class="gateway-icon {if $RSThemes.addonSettings.footer_supported_payment_gateways_icon_size == "large"}gateway-icon-lg{/if}" {if $iconTooltip}data-toggle="tooltip" data-title="{$iconTooltip}" data-container="body"{/if}>
                                            <img src="{$WEB_ROOT}/templates/{$template}/assets/img/page-manager/{$paymentIcon.iconName}" role="presentation">
                                        </i>
                                    {/if}
                                {/foreach}
                            </div>
                        {/if}
                    {/if}
                    {include file="$template/includes/footer/footersecondary.tpl"}
                </div>
            </div>
        </div>
    {/if}
</div> {* close app main *}
    {if $RSThemes.addonSettings.show_cookie_box == 'displayed'}
        <div class="cookie-bar cookie-bar--{$RSThemes.addonSettings.cookie_box_position} {if $RSThemes.addonSettings.cookie_box_position == 'bottom'}container{/if}" data-cookie data-cookie-name="cookie_bar" data-cookie-exp-time="365" data-delay="2000">
            <div class="cookie-bar__content">
                <div class="cookie-bar__icon">
                    {include file="$template/includes/common/svg-icon.tpl" icon="cookie_bites"}
                </div>
                <div class="cookie-bar__desc">
                    {if isset($activeLocale.language) && empty($RSThemes.addonSettings.cookie_box_message[$activeLocale.language])}
                        {if isset($RSThemes.addonSettings.cookie_box_message[\WHMCS\Config\Setting::getValue("Language")])}
                            {$RSThemes.addonSettings.cookie_box_message[\WHMCS\Config\Setting::getValue("Language")]|unescape:"html"}
                        {/if}
                    {else if isset($activeLocale.language)}
                        {$RSThemes.addonSettings.cookie_box_message[$activeLocale.language]|unescape:"html"}
                    {/if}
                </div>
                <div class="cookie-bar__action">
                    <button tabindex="0" class="btn btn-primary" data-close>{$LANG.continue}</button>
                </div>
            </div>
        </div>
    {/if}
    <div id="fullpage-overlay" class="hidden">
        <div class="outer-wrapper">
            <div class="inner-wrapper">
                <img class="lazyload" data-src="{$WEB_ROOT}/assets/img/overlay-spinner.svg">
                <br>
                <span class="msg"></span>
            </div>
        </div>
    </div>
    <div class="modal system-modal fade" id="modalAjax" tabindex="-1" role="dialog" aria-hidden="true" style="display: none">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button tabindex="0" type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="lm lm-close"></i></button>
                    <h5 class="modal-title"></h5>
                </div>
                <div class="modal-body">
                    <div class="loader">
                        {include file="$template/includes/common/loader.tpl"}
                    </div>
                </div>
                <div class="modal-footer">
                    <button tabindex="0" type="button" class="btn btn-primary modal-submit">
                        {$LANG.submit}
                    </button>
                    <button tabindex="0" type="button" class="btn btn-default" data-dismiss="modal">
                    {$LANG.close}
                    </button>
                </div>
            </div>
        </div>
    </div>

    {if isset($lagomClientAlerts) && $lagomClientAlerts->footer}
        {$lagomClientAlerts->footer}
    {/if}
    {include file="$template/includes/generate-password.tpl"}
    {$footeroutput}
    <div class="overlay"></div>
    <script {if isset($activeDisplay) && $activeDisplay == 'CMS' && $pageType == "website" && isset($RSThemes['pageSettings'])}defer{/if} src="{$WEB_ROOT}/templates/{$template}/assets/js/vendor.js?v={$RSThemes['templateVersion']}-{$assetsCacheKey}"></script>
    <script {if isset($activeDisplay) && $activeDisplay == 'CMS' && $pageType == "website" && isset($RSThemes['pageSettings'])}defer{/if} src="{$WEB_ROOT}/templates/{$template}/assets/js/lagom-app.js?v={$RSThemes['templateVersion']}-{$assetsCacheKey}"></script>
    {if isset($activeDisplay) && $activeDisplay == 'CMS' && $pageType == "website" && isset($RSThemes['pageSettings'])}
    {else}
        <script src="{$WEB_ROOT}/templates/{$template}/assets/js/whmcs-custom.min.js?v={$RSThemes['templateVersion']}-{$assetsCacheKey}"></script>
    {/if}
</body>
</html>