<div class="container-desktop-vertical-margin" {% render 'overwrite-theme-style', desktop_settings: section.settings %}>
<div class="container-mobile-vertical-margin" {% render 'overwrite-theme-style', settings: section.settings %}>
<div {% render 'overwrite-theme-style', 
    background_color: section.settings.background_color, 
    padding_top: section.settings.padding_top, 
    padding_bottom: section.settings.padding_bottom %}>
<div class="container">
<div class="review-row">

    <div class="reviews-header-block reviews-header-block-average">
        <h3 class="reviews-header-block-headline">{{ 'sections.review-row.headline' | t }}</h3>
        <div class="reviews-header-block-big-number font-heading">
            {{ section.settings.stars | times: 1.0 }}
            {% render 'review-stars', stars: section.settings.stars, id: 'review-row-header' %}
        </div>
        <span class="reviews-header-block-info">{{ 'sections.review-row.info' | t: number_of_reviews: section.settings.number_of_reviews }}</span>
    </div>

    {%- for block in section.blocks -%}
        <div class="reviews-list-entry">
            {% render 'image', image: block.settings.image %}

            <div class="reviews-list-entry-header">
                <div class="reviews-list-entry-header-stars">
                    {% assign star_id = section.id | append: block.id %}
                    {% render 'review-stars', stars: block.settings.stars, id: star_id %}
                </div>

                {%- if block.settings.is_verified -%}
                    <div class="reviews-list-entry-header-verified">
                        {% render 'icon-checkmark' %}
                        {{ 'product.verified' | t }}
                    </div>
                {%- endif -%}
            </div>

            {%- if block.settings.headline != blank -%}
                <h4>{{ block.settings.headline }}</h4>
            {%- endif -%}

            <div class="reviews-list-entry-text">{{ block.settings.text }}</div>
            <span>{{ block.settings.author }}</span>
        </div>
    {%- endfor -%}

</div>
</div>
</div>
</div>
</div>

{% schema %}
{
    "name": "t:sections.section-review-row.name",
    "settings": [
        {
            "type": "range",
            "id": "stars",
            "label": "t:sections.section-reviews.blocks.review.settings.stars",
            "min": 0,
            "max": 5,
            "step": 0.1,
            "unit": "#",
            "default": 4.5
        },
        {
            "type": "number",
            "id": "number_of_reviews",
            "label": "t:sections.product-data.blocks.reviews.settings.number_of_reviews",
            "default": 428
        },
        {
            "type": "header",
            "content": "t:sections.section-multi-column.settings.header_background"
        },
        {
            "type": "color",
            "id": "background_color",
            "label": "t:sections.section-multi-column.settings.background_color",
            "default": "transparent"
        },
        {
            "type": "range",
            "id": "padding_top",
            "label": "t:sections.section-multi-column.settings.padding_top",
            "min": 0,
            "max": 100,
            "step": 1,
            "unit": "px",
            "default": 0
        },
        {
            "type": "range",
            "id": "padding_bottom",
            "label": "t:sections.section-multi-column.settings.padding_bottom",
            "min": 0,
            "max": 100,
            "step": 1,
            "unit": "px",
            "default": 0
        },
        {
            "type": "header",
            "content": "t:sections.general.mobile_margin"
        },
        {
            "type": "range",
            "id": "overwrite_theme_margin_top",
            "label": "t:sections.section-multi-column.settings.overwrite_theme_margin_top",
            "min": 0,
            "max": 100,
            "step": 1,
            "unit": "px",
            "default": 0
        },
        {
            "type": "range",
            "id": "overwrite_theme_margin_bottom",
            "label": "t:sections.section-multi-column.settings.overwrite_theme_margin_bottom",
            "min": 0,
            "max": 100,
            "step": 1,
            "unit": "px",
            "default": 0
        },
        {
            "type": "header",
            "content": "t:sections.general.desktop_margin"
        },
        {
            "type": "range",
            "id": "desktop_margin_top",
            "label": "t:sections.section-multi-column.settings.desktop_margin_top",
            "min": -200,
            "max": 200,
            "step": 5,
            "unit": "px",
            "default": 0
        },
        {
            "type": "range",
            "id": "desktop_margin_bottom",
            "label": "t:sections.section-multi-column.settings.desktop_margin_bottom",
            "min": -200,
            "max": 200,
            "step": 5,
            "unit": "px",
            "default": 0
        }
    ],
    "blocks": [
        {
            "type": "review",
            "limit": 3,
            "name": "t:sections.section-reviews.blocks.review.name",
            "settings": [
                {
                    "type": "image_picker",
                    "id": "image",
                    "label": "t:sections.section-reviews.blocks.review.settings.image"
                },
                {
                    "type": "range",
                    "id": "stars",
                    "label": "t:sections.section-reviews.blocks.review.settings.stars",
                    "min": 0,
                    "max": 5,
                    "step": 0.5,
                    "unit": "#",
                    "default": 5
                },
                {
                    "type": "text",
                    "id": "headline",
                    "label": "t:sections.section-reviews.blocks.review.settings.headline"
                },
                {
                    "type": "richtext",
                    "id": "author",
                    "label": "t:sections.section-reviews.blocks.review.settings.author"
                },
                {
                    "type": "richtext",
                    "id": "text",
                    "label": "t:sections.section-reviews.blocks.review.settings.text"
                },
                {
                    "type": "checkbox",
                    "id": "is_verified",
                    "label": "t:sections.section-reviews.blocks.review.settings.is_verified",
                    "default": true
                }
            ]
        }
    ],
    "presets": [
        {
            "name": "t:sections.section-review-row.name"
        }
    ]
}
{% endschema %}