@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
@using Dynamicweb.Ecommerce.ProductCatalog

@{
	ProductViewModel product = null;
	if (Dynamicweb.Context.Current.Items.Contains("ProductDetails"))
	{
		product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"];
	} else if (Pageview.IsVisualEditorMode) {
		product = new ProductViewModel();
		product.LongDescription = Translate("Explore our new arrivals that blend style and sustainability. Made from eco-friendly materials, our products not only enhances your space but also supports a greener planet. Discover designs that make a difference.");
	}
}

@if (product is object)
{
	bool hideTitle = Model.Item.GetBoolean("HideTitle");
	string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "display-4");
	string maxWidth = Model.Item.GetRawValueString("TextReadability", "max-width-on");
	maxWidth = maxWidth == "max-width-on" ? "mw-75ch d-inline-block" : maxWidth;
	maxWidth = maxWidth == "max-width-off" ? "" : maxWidth;

	<div class="h-100 item_@Model.Item.SystemName.ToLower()">
		@if (!hideTitle && !string.IsNullOrEmpty(Model.Item.GetString("Title")))
		{
			<div class="text-start pb-2 pb-lg-4">
				<h2 class="@titleFontSize @(maxWidth)">@Model.Item.GetString("Title")</h2>
			</div>
		}
		<div class="@(maxWidth)" itemprop="description">
			@product.LongDescription
		</div>
	</div>
}
