

<script type="application/ld+json">
  {{ section.settings.product | structured_data }}
</script>

{% capture media_gallery %}
  {% content_for 'block',
    type: '_featured-product-information-carousel',
    id: 'media-gallery'
  %}
{% endcapture %}

{% capture product_details %}
  {% content_for 'block',
    type: '_product-details',
    id: 'product-details'
  %}
{% endcapture %}

{% capture additional_blocks %}
  {% content_for 'blocks' %}
{% endcapture %}

<featured-product-information id="{{ section.id }}">
  <h2 class="visually-hidden">{{ 'accessibility.featured_product' | t }}</h2>
  {% render 'product-information-content',
    product: section.settings.product,
    section_id: section.id,
    settings: section.settings,
    media_gallery: media_gallery,
    product_details: product_details,
    additional_blocks: additional_blocks
  %}
</featured-product-information>

{% schema %}
{
  "name": "t:names.featured_product_information",
  "blocks": [
    {
      "type": "@theme"
    },
    {
      "type": "@app"
    }
  ],
  "disabled_on": {
    "groups": ["header", "footer"]
  },
  "settings": [
    {
      "type": "product",
      "id": "product",
      "label": "t:settings.product"
    },
    {
      "type": "header",
      "content": "t:content.layout"
    },
    {
      "type": "select",
      "id": "content_width",
      "label": "t:settings.width",
      "options": [
        {
          "value": "content-center-aligned",
          "label": "t:options.page"
        },
        {
          "value": "content-full-width",
          "label": "t:options.full"
        }
      ],
      "default": "content-center-aligned"
    },
    {
      "type": "select",
      "id": "desktop_media_position",
      "label": "t:settings.media_position",
      "options": [
        {
          "value": "left",
          "label": "t:options.left"
        },
        {
          "value": "right",
          "label": "t:options.right"
        }
      ],
      "default": "left"
    },
    {
      "type": "checkbox",
      "id": "equal_columns",
      "label": "t:settings.equal_columns",
      "default": false
    },
    {
      "type": "checkbox",
      "id": "limit_details_width",
      "label": "t:settings.limit_product_details_width",
      "default": false,
      "visible_if": "{{ section.settings.equal_columns }}"
    },
    {
      "type": "range",
      "id": "gap",
      "label": "t:settings.gap",
      "min": 0,
      "max": 48,
      "step": 4,
      "unit": "px",
      "default": 16
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:settings.background_color",
      "placeholder": "t:settings.default"
    },
    {
      "type": "header",
      "content": "t:content.padding"
    },
    {
      "type": "range",
      "id": "padding-block-start",
      "label": "t:settings.top",
      "min": 0,
      "max": 100,
      "step": 1,
      "unit": "px",
      "default": 0
    },
    {
      "type": "range",
      "id": "padding-block-end",
      "label": "t:settings.bottom",
      "min": 0,
      "max": 100,
      "step": 1,
      "unit": "px",
      "default": 0
    }
  ],
  "presets": [
    {
      "name": "t:names.featured_product_information",
      "category": "t:categories.products",
      "settings": {
        "gap": 48,
        "padding-block-start": 40,
        "padding-block-end": 40,
        "equal_columns": true
      },
      "blocks": {
        "media-gallery": {
          "type": "_featured-product-information-carousel",
          "static": true,
          "settings": {
            "constrain_to_viewport": true,
            "media_fit": "contain",
            "media_radius": 0,
            "extend_media": false,
            "hide_variants": true,
            "slideshow_controls_style": "counter",
            "slideshow_mobile_controls_style": "dots",
            "thumbnail_position": "bottom",
            "thumbnail_width": 44
          }
        },
        "product-details": {
          "type": "_product-details",
          "static": true,
          "settings": {
            "gap": 28,
            "sticky_details_desktop": true,
            "padding-block-start": 24,
            "padding-block-end": 24
          },
          "blocks": {
            "header": {
              "type": "group",
              "name": "t:names.header",
              "settings": {
                "gap": 12
              },
              "blocks": {
                "title": {
                  "type": "product-title",
                  "name": "t:names.title",
                  "settings": {
                    "type_preset": "rte"
                  }
                },
                "price": {
                  "type": "price",
                  "name": "t:names.product_price",
                  "settings": {
                    "show_installments": true,
                    "show_tax_info": true
                  }
                }
              },
              "block_order": ["title", "price"]
            },
            "review_stars": {
              "type": "review",
              "name": "t:names.product_review_stars"
            },
            "variant_picker": {
              "type": "variant-picker",
              "name": "t:names.product_variant_picker"
            },
            "buy_buttons": {
              "type": "buy-buttons",
              "name": "t:names.product_buy_buttons",
              "blocks": {
                "quantity": {
                  "type": "quantity",
                  "static": true
                },
                "add-to-cart": {
                  "type": "add-to-cart",
                  "static": true
                },
                "accelerated-checkout": {
                  "type": "accelerated-checkout",
                  "static": true
                }
              }
            }
          },
          "block_order": ["header", "review_stars", "variant_picker", "buy_buttons"]
        }
      }
    }
  ]
}
{% endschema %}
