{% assign show_content = true %}

{%- if hide_description == true and text == blank -%}
    {% assign show_content = false %}
{%- endif -%}

{%- if use_product_description == true and product.description != blank -%}
    {% assign show_content = true %}
{%- endif -%}

{%- if headline == blank -%}
    {% assign show_content = false %}
{%- endif -%}

{%- if show_content != blank -%}

    {%- capture image_style -%}
        width: {{ settings.image_size }}px;
        height: {{ settings.image_size }}px;
        flex: 0;
    {%- endcapture -%}

    <div class="product-collapsible-content-entry">
        
        <div class="product-collapsible-content-entry-header no-click-highlight">
            {% render 'image', image: image, style: image_style %}
            <span class="no-click-highlight">{{ headline }}</span>
            {% render 'icon-plus', class: 'plus' %}
            {% render 'icon-minus', class: 'minus' %}
        </div>

        {%- capture text_style -%}
            {%- if image != blank -%}
                margin-left: {{ settings.image_size }}px;
            {%- else -%}
                padding-left: 0px;
            {%- endif -%}
        {%- endcapture -%}

        <div class="product-collapsible-content-entry-text no-click-highlight" style="{{ text_style }}">
            {%- if use_product_description -%}
                {{ product.description }}
            {%- else -%}
                {{ text }}
            {%- endif -%}
        </div>

    </div>

{%- endif -%}