<!-- Product Recommendations CSS -->
<link type="text/css" rel="stylesheet" href="{$BASE_PATH_CSS}/recommendations.min.css" property="stylesheet" />
<!-- Core CSS -->
<link rel="stylesheet" type="text/css" href="{assetPath file="style.css"}" property="stylesheet" />
<script>
    jQuery(document).ready(function() {
        jQuery('#btnShowSidebar').click(function() {
            if (jQuery(".product-selection-sidebar").is(":visible")) {
                jQuery('.row-product-selection').css('left', '0');
                jQuery('.product-selection-sidebar').fadeOut();
                jQuery('#btnShowSidebar').html('<i class="fas fa-arrow-circle-right"></i> {$LANG.showMenu}');
            } else {
                jQuery('.product-selection-sidebar').fadeIn();
                jQuery('.row-product-selection').css('left', '300px');
                jQuery('#btnShowSidebar').html('<i class="fas fa-arrow-circle-left"></i> {$LANG.hideMenu}');
            }
        });
    });
</script>

{if $showSidebarToggle}
    <button type="button" class="theme-btn --fill-primary --btn-size-sm --shadow-off" id="btnShowSidebar" data-gap-x="10px">
        <i class="fas fa-arrow-circle-right"></i>
        {$LANG.showMenu}
    </button>
{/if}

<div class="row row-product-selection">
    <div class="col-md-3 sidebar product-selection-sidebar" id="premiumComparisonSidebar">
        {include file="orderforms/standard_cart/sidebar-categories.tpl"}
    </div>
    <div class="col-md-12">

        <div id="hostgate-plan-a">
            <div class="main-container price-01">
                <div class="products-headline">
                    <h3 class="title-1">
                        {if $productGroup.headline}
                            {$productGroup.headline}
                        {else}
                            {$productGroup.name}
                        {/if}
                    </h3>
                    {if $productGroup.tagline}
                        <h5 class="title-2">
                            {$productGroup.tagline}
                        </h5>
                    {/if}
                    {if $errormessage}
                        <div class="alert alert-danger">
                            {$errormessage}
                        </div>
                    {elseif !$productGroup}
                        <div class="alert alert-info">
                            {lang key='orderForm.selectCategory'}
                        </div>
                    {/if}
                </div>
                <div id="products" class="price-table-container">
                    <!-- row -->
                    <div class="row justify-content-center" data-gap-y="30px">
                        {foreach $products as $product}
                            {$idPrefix = ($product.bid) ? ("bundle"|cat:$product.bid) : ("product"|cat:$product.pid)}
                            {* col *}
                            <div class="col-xl-3 col-md-6" id="{$idPrefix}">
                                {* price-table *}
                                <div class="price-table {if $product.isFeatured}popular-plan{/if}">
                                    {* top-head *}
                                    <div class="top-head">
                                        <div class="top-area">
                                            <h4 id="{$idPrefix}-name" class="plan-title">{$product.name}</h4>
                                        </div>
                                        {* tagLine *}
                                        {if $product.tagLine}
                                            <p id="{$idPrefix}-tag-line">{$product.tagLine}</p>
                                        {/if}
                                        {* price-area *}
                                        <div class="price-area">
                                            <div class="plan-price" id="{$idPrefix}-price">
                                                {if $product.bid}
                                                    {$LANG.bundledeal}
                                                    {if $product.displayprice}
                                                        <br /><br /><span>{$product.displayPriceSimple}</span>
                                                    {/if}
                                                {elseif $product.paytype eq "free"}
                                                    <span>{$LANG.orderfree}</span>
                                                {elseif $product.paytype eq "onetime"}
                                                    <span class="text">{$product.pricing.onetime}</span><br />
                                                    {$LANG.orderpaymenttermonetime}
                                                {else}
                                                    {if $product.pricing.hasconfigoptions}
                                                        {$LANG.from}
                                                    {/if}
                                                    {$product.pricing.minprice.cycleText}
                                                    <br>
                                                    {if $product.pricing.minprice.setupFee}
                                                        <small>{$product.pricing.minprice.setupFee->toPrefixed()}
                                                            {$LANG.ordersetupfee}</small>
                                                    {/if}
                                                {/if}
                                            </div>
                                            {* hr *}
                                            <hr class="my-4">
                                            {if $product.qty eq "0"}
                                                <span id="{$idPrefix}-unavailable" class="order-button unavailable">{$LANG.outofstock}</span>
                                            {else}
                                                <a href="{$product.productUrl}" class="theme-btn --fill-primary --has-icon w-100" id="{$idPrefix}-order-button">
                                                    {if $product.hasRecommendations} data-has-recommendations="1" {/if}
                                                    <img src="{assetPath ns="img" file="shopping-cart-add-w.png"}" class="icon mr--sm-2 img-fluid" alt="icon">
                                                    {$LANG.ordernowbutton}
                                                </a>
                                            {/if}

                                        </div>
                                    </div>
                                    <div class="fea-sec">
                                        <h5 class="fea-title">Top Features</h5>
                                        {foreach $product.features as $feature => $value}
                                            <div class="item" id="{$idPrefix}-feature{$value@iteration}">
                                                <img src="{assetPath ns="img" file="checked.png"}" class="icon mr--sm-2 img-fluid" alt="icon">
                                                {$value} {$feature}
                                            </div>
                                        {foreachelse}
                                            {assign var="descriptionLines" value=explode("\n", $product.description)}
                                            {foreach $descriptionLines as $line}
                                                <div class="item">
                                                    <img src="{assetPath ns="img" file="checked.png"}" class="icon mr--sm-2 img-fluid" alt="icon">
                                                    {$line}
                                                </div>
                                            {/foreach}
                                        {/foreach}
                                    </div>
                                </div>
                            </div>
                        {/foreach}
                    </div>
                </div>
            </div>
            {if count($productGroup.features) > 0}
                {* se-footer *}
                <div class="se-footer mt-3">
                    {* se-footer-title *}
                    <div class="se-footer-title">{$LANG.orderForm.includedWithPlans}</div>
                    {* row *}
                    <div class="row" data-gap-y="15px">
                        {foreach $productGroup.features as $features}
                            <div class="col-lg-4 col-md-6">
                                <!-- line -->
                                <div class="line d-flex align-items-center justify-content-start">
                                    <img src="{assetPath ns="img" file="checked-2.png"}" class="icon mr--sm-2 img-fluid" alt="Check">
                                    <span class="text">
                                        {$features.feature}
                                    </span>
                                </div>
                            </div>
                        {/foreach}
                    </div>
                </div>
            {/if}
        </div>

    </div>
</div>

{include file="orderforms/hostgate_plan_a/recommendations-modal.tpl"}

<script src="{$BASE_PATH_JS}/whmcs/recommendations.min.js"></script>