{% assign widget_id = section.settings.widget-identity | default: 'wgt_default' %}

<div class="whatmore-base" data-wht-widget="{{ widget_id }}" style="position: relative; overflow: hidden; min-height:{{ section.settings.min-height }}px">
  <div id="whatmoreShopId" data-wh="{{ shop.id }}"></div>

  <div id="whatmoreExtensionType" data-wh="product"></div>

  {%- if product -%}
    <div id="whatmoreProductId" data-wh="{{ product.id }}"></div>
  {%- else -%}
    <div id="whatmoreProductId" data-wh=""></div>
  {%- endif -%}

  {%- if section.settings.landscape-padding -%}
    <div id="whatmoreLandscapePadding" data-wh="{{ section.settings.landscape-padding }}"></div>
  {%- endif -%}

  {%- if section.settings.top-bottom-padding -%}
    <div id="whatmoreTopBottomPadding" data-wh="{{ section.settings.top-bottom-padding }}"></div>
  {%- endif -%}

  {%- if section.settings.scroll-video-tile-size -%}
    <div id="whatmoreVideoTileSize" data-wh="{{ section.settings.scroll-video-tile-size }}"></div>
  {%- endif -%}

  {%- if section.settings.scroll-video-tile-size-portrait -%}
    <div id="whatmoreVideoTileSizePortrait" data-wh="{{ section.settings.scroll-video-tile-size-portrait }}"></div>
  {%- endif -%}

  {%- if section.settings.template-type -%}
    <div class="whatmore-template-type" data-wh="{{ section.settings.template-type }}"></div>
  {%- endif -%}

  <div id="whatmoreWidgetIdentity" data-wh="{{ widget_id }}"></div>

  {% if request.design_mode %}
    <div id="whatmoreIsInDesignMode" data-wh="true"></div>
  {% else %}
    <div id="whatmoreIsInDesignMode" data-wh="false"></div>
  {% endif %}

  <div class="whatmore-widget" data-wh="carousel"></div>
  <div class="whatmore-render-root"></div>
</div>

{% schema %}
{
  "name": "Whatmore Product Carousel",
  "tag": "section",
  "class": "section",
  "settings": [
    {
      "type": "text",
      "id": "widget-identity",
      "label": "Widget ID",
      "default": "wgt_default",
      "info": "Paste the widget ID from whatmore dashboard. Leave empty for default carousel."
    },
    {
      "type": "select",
      "id": "template-type",
      "label": "Tile Type",
      "info": "Note: '2 tiles' and '3 tiles' refer to the layout in mobile view",
      "options": [
        { "value": "template-a",     "label": "Video Card-Img & Transparent Text Overlay-3 tiles" },
        { "value": "template-g",     "label": "Video Card-Img & Transparent Text Overlay-2 tiles" },
        { "value": "template-b",     "label": "Video Card-Img & Opaque Text Overlay-3 tiles" },
        { "value": "template-e",     "label": "Video Card-Single Tile (No Overlay)" },
        { "value": "template-h",     "label": "Video Card-Product Info Below tile-3 tiles" },
        { "value": "template-f",     "label": "Video Card-Product Info Below tile-2 tiles" },
        { "value": "template-a-1",   "label": "Video Card Feed-View More" },
        { "value": "template-feed-a","label": "Video Card Feed-On Scroll" },
        { "value": "template-c",     "label": "Video Card Grid-Theme Border" },
        { "value": "template-d",     "label": "Video Card Grid-No Border" },
        { "value": "template-i",     "label": "Video Card 3D Navigation" },
        { "value": "template-j",     "label": "Video Card Minimal" }
      ],
      "default": "template-a"
    },
    {
      "type": "number",
      "id": "landscape-padding",
      "label": "Horizontal padding in Desktop/Laptop",
      "default": 40
    },
    {
      "type": "number",
      "id": "top-bottom-padding",
      "label": "Vertical padding",
      "default": 20
    },
    {
      "type": "range",
      "id": "scroll-video-tile-size",
      "label": "Scroll-Video-Tile size (in percentage)",
      "default": 80,
      "step": 1,
      "min": 50,
      "max": 150
    },
    {
      "type": "range",
      "id": "scroll-video-tile-size-portrait",
      "label": "Scroll-Video-Tile size mobile (in percentage)",
      "default": 80,
      "step": 1,
      "min": 40,
      "max": 130
    },
    {
      "type": "range",
      "id": "min-height",
      "label": "Minimum Height (in pixels)",
      "default": 200,
      "step": 10,
      "min": 0,
      "max": 1000
    }
  ],
  "presets": [
    {
      "name": "Whatmore Product Carousel"
    }
  ]
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}