{# BLOCK LISTA #}
{% import 'blocks\\macros.html.twig' as macros %}
{% block content %}
{{ encore_entry_link_tags('close-to-you') }}
<section class="{{ blockSequence|default }} block-list close-to-you {% block skin_class %}bg-radius{% endblock %}" style="{{ macros.getStyles(settings) }}" {{ macros.getBlockDataAttributes(_context) }}>
<div class="radius" {% if settings.bgcolor|default %}style="--bg: {{settings.bgcolor}}"{% endif %}></div>
<div class="{% if settings.fullwidth|default(0) != 1 %}container{% else %}w-100{% endif %}">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center flex-wrap mb-5">
<div class="d-inline-flex align-items-center gap-2 flex-wrap close_to_you_block_btn">
{% block title_close_tou_you %}<h2>{{ 'close_to_you'|trans ({},'custom' )|html_entity_decode|raw }}</h2>{% endblock %}
<button id="close_to_you_btn" class="close_to_you_btn btn btn-green-blur" type="button"
data-user-municipality="{{ userMunicipality|default('Todo o País') }}"
data-set-location-url="{{ path('user_set_location') }}"
data-block-selector="section.{{ blockSequence|default }}">
<div class="d-inline-flex align-items-center gap-1">
{{ file_get_contents(asset('custom/location-pin-icon.svg', 'global'))|raw }}
<span class="cty-btn-text">{{ userMunicipality|default('Todo o País') }}</span>
</div>
</button>
<!-- Location Dropdown -->
<div id="close-to-you-select-box" style="display:none;" class="cty-dropdown close_to_you_select_box">
{# Hidden native select for graceful degradation #}
<select id="close_to_you_select" class="close-to-you-select" aria-hidden="true" tabindex="-1" style="position:absolute;left:-9999px;">
{% if location_values is defined %}
{% for loc in location_values %}
<option value="{{ loc.id }}">{{ loc.description ?: loc.machineName }}</option>
{% endfor %}
{% endif %}
</select>
<div class="cty-wrapper">
<div class="close-to-you-msg-wrapper">
{% if app.session.get('isInPortugal') is same as(false) %}
<div class="close-to-you-msg">
<span class="close-to-you-msg-body">
{{ 'is_out_portugal'|trans ({},'custom' )|default('Está fora de Portugal, mas contamos-lhe o que se passa por cá, ao minuto. Se preferir, pode escolher uma região da lista.') }}
</span>
</div>
{% endif %}
</div>
<div class="cty-panel">
<div class="cty-search">
<input id="cty-search-input" type="text" placeholder="Pesquise por concelho" autocomplete="off" />
<span class="cty-search-icon">{{ file_get_contents(asset('custom/search-icon.svg', 'global'))|default('🔍')|raw }}</span>
</div>
<ul class="cty-options" id="cty-options-list">
{% if location_values is defined %}
{% for loc in location_values %}
<li data-value="{{ loc.id }}" class="cty-option">{{ loc.description ?: loc.machineName }}</li>
{% endfor %}
{% endif %}
</ul>
</div>
</div>
<div class="close-to-you-loading" aria-hidden="true" style="display:none;">
<div class="spinner"></div>
<span class="loading-text">A atualizar localização…</span>
</div>
</div>
</div>
{% set moreUrl = fields.view_more_url|default('') %}
{% if moreUrl %}
<a href="{{ moreUrl }}" class="btn btn-primary btn-style-1 ver-mais-btn-top" rel="nofollow">
{{ 'see_all'|trans ({},'custom' )|default('Ver todos') }}
{{ file_get_contents(asset('custom/menu-icon.svg', 'global'))|default('≡')|raw }}
</a>
{% endif %}
</div>
</div>
</div>
{% if settings.carousel|default == '1' or settings.carousel_1175|default == '1' or settings.carousel_600|default == '1' or settings.carousel_480|default == '1' %}
{% import 'blocks\\block_list\\block_list.default.settings.twig' as slick_settings %}
<div class="row slick-carousel" data-slick='{{slick_settings.getSlick_Settings(settings)|replace({"\n":""})}}' style="--block-list-gap:{{ settings.items_gap|default('var(--margin)') }};">
{% else %}
<div class="row grid {{ settings.extra_class|default }}" style="--block-list-gap:{{ settings.items_gap|default('var(--margin)') }}; --block-list-cols:{{settings.column|default('3')}}">
{% endif %}
{% if blockscontent %}
{{ blockscontent|raw }}
{% else %}
<div class="col not-found">{{ 'zerorecords'|trans([],'studio') }}</div>
{% endif %}
</div>
{% if moreUrl %}
<div class="ver-mais-btn-bottom">
<a
href="{{ moreUrl }}"
class="btn btn-primary btn-style-1"
rel="nofollow">
{{ 'see_all'|trans ({},'custom' )|default('Ver todos') }}
{{ file_get_contents(asset('custom/menu-icon.svg', 'global'))|default('≡')|raw }}
</a>
</div>
{% endif %}
</div>
</section>
{{ encore_entry_script_tags('close-to-you') }}
{% endblock %}
{# @END BLOCK LISTA #}