<{{ cover_tag }}
class="routine__cover"
{% if cover_tag == 'a' %}
href="{{ cover_href }}"
{% endif %}
>
{% if section.settings.cover_image != blank %}
{{
section.settings.cover_image
| image_url: width: 1700
| image_tag:
alt: heading,
widths: '400, 800, 1200, 1700',
sizes: '(max-width: 1024px) calc(100vw - 30px), 50vw',
class: 'routine__cover-image',
loading: 'lazy'
}}
{% else %}

{% endif %}
{{ heading | escape | newline_to_br }}
{{ cover_tag }}>
{% for block in section.blocks %}
{% liquid
if block.settings.title != blank
assign step_title = block.settings.title
else
assign step_key = 'routine.steps.step_' | append: forloop.index
assign step_title = step_key | t
endif
assign step_url = block.settings.link
if step_url == blank
case forloop.index
when 1
assign step_url = '/collections/1-limpia'
when 2
assign step_url = '/collections/2-trata'
when 3
assign step_url = '/collections/3-hidrata'
when 4
assign step_url = '/collections/4-protege-bloqueadores-solares'
endcase
endif
if step_url != blank
assign step_tag = 'a'
else
assign step_tag = 'div'
endif
assign fallback_image = blank
case forloop.index
when 1
assign fallback_image = 'routine-limpia.avif'
when 2
assign fallback_image = 'routine-trata.avif'
when 3
assign fallback_image = 'routine-hidrata.avif'
when 4
assign fallback_image = 'routine-protege.avif'
endcase
%}
<{{ step_tag }}
class="routine__card"
{{ block.shopify_attributes }}
{% if step_tag == 'a' %}
href="{{ step_url }}"
{% endif %}
>
{% if block.settings.image != blank %}
{{
block.settings.image
| image_url: width: 900
| image_tag:
alt: step_title,
widths: '245, 415, 830',
sizes: '(max-width: 1024px) 245px, 25vw',
class: 'routine__image',
loading: 'lazy'
}}
{% elsif fallback_image != blank %}
{% endif %}
{{ step_title | escape }}
{{ step_tag }}>
{% else %}
{% if request.design_mode %}
{{ 'routine.empty' | t }}
{% endif %}
{% endfor %}