@model MrCMS.Web.Apps.Ecommerce.Pages.Product
@using MrCMS.Helpers
@using System.Linq
@using MrCMS.Web.Apps.Ecommerce.Entities.Products
@{
    var selectedVariant = ViewData["selected-variant"] as ProductVariant ?? Model.Variants.First();
    var productReviewsEnabled = (bool)ViewData["productreviews-enabled"];
    var hasSpecifications = Model.SpecificationValues.Any();
    
}
@Html.HiddenFor(x => x.UrlSegment)

<div itemscope itemtype="http://data-vocabulary.org/Product">
    @{ Html.RenderAction("Details", "ProductVariant", new { productVariant = selectedVariant });}
    <div class="margin-top-bottom-30">
        <div class="container">
            <div class="row" id="fulldescription">
                <div class="@(hasSpecifications ? "col-sm-6" : "col-sm-12")">
                    @if (!string.IsNullOrWhiteSpace(Model.BodyContent))
                    {
                        <div class="block-title">
                            <span>
                                <img src="/Apps/Ecommerce/Content/Images/description.png" alt="Description" />
                            </span>
                            @Resource("Full Description")
                        </div>
                        <span itemprop="description">
                            @Editable(Model, product => product.BodyContent, true)
                        </span>
                    }
                    <div class="clearfix"></div>
                    @{ RenderZone("Below Product Description"); }
                </div>
                @if (hasSpecifications)
                {

                    <div class="col-sm-6">
                        <div class="block-title">
                            <span>
                                <img src="/Apps/Ecommerce/Content/Images/specification.png" alt="Specifications" />
                            </span>
                            @Resource("Specifications")
                        </div>
                        @{
                    Html.RenderPartial("ProductSpecifications", Model);
                        }
                    </div>
                }
            </div>
        </div>
    </div>

    @if (productReviewsEnabled)
    {
        Html.RenderAction("ProductReviews", "ProductVariant", new { productVariantId = selectedVariant.Id });
    }
</div>

@{ RenderZone("Below Product Information"); }
@{
    Html.IncludeScript("~/Apps/Ecommerce/Content/Scripts/jquery.history.js");
    Html.IncludeScript("~/Apps/Ecommerce/Content/Scripts/custom/product.js");
}
