{% extends '_templates/base.twig' %}

{% block head %}
    <meta name="cs:page" content="product">
    <meta name="cs:description"
          content="name={{ tpPesquisa }}: {{ motor.origem ? motor.origem.nm ~ ' -> ' : '' }} {{ motor.destino.nm }}">
{% endblock %}

{% block title %}
    {{ page.page_title }}
{% endblock %}

{% block style %}
{% endblock %}

{% block content %}
    {% include '_templates/includes/header.twig' %}

    <section class="main detalhe">
        {% include 'detalhe/submenu.twig' %}

        {% include '_templates/includes/preloader.twig' %}

        <div data-b2c-content style="display: none">

            <section data-b2c-pagina-detalhe>
                {% include 'detalhe/detalhe.twig' %}
            </section>

            {% include 'hotel/hotel.twig' %}

            {% include 'aereo/aereo.twig' %}

            {% include 'servicos/servico.twig' %}

        </div>

        <div data-b2c-pagina-error style="display: none">
            <div style="text-align: center;width: 100%;font-size: 20px;margin-top: 10%;" class="conteudo" data-message>
                {{ __('nenhumResultadoEncontrado')|raw }}
            </div>
        </div>
    </section>

    {% include '_templates/includes/footer.twig' %}

    <div class="modal fade" id="modalMaps" tabindex="-1" role="dialog" aria-labelledby="modalMaps" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel"><span class="map-title"></span></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="maps">
                    <div id="b2c-map" style="height: 500px" data-b2c-mapa></div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block scripts %}


    <script type="text/javascript">
        /* <![CDATA[ */
        var motorBusca = new MotorBusca(CHAVE_MOTOR, Object.assign(motorConfig, {}));
        {% if tpPesquisa == 'hospedagem' %}
        motorBusca.motorHotel('.pnlMotor.hotel', {
            quarto: {value: '{{ params.config }}'}
        });
        {% elseif tpPesquisa == 'pacote_aereo' %}
        motorBusca.motorPacoteAereo('.pnlMotor.pacoteAereo', {
            quarto: {value: '{{ params.config }}'}
        });
        {% elseif tpPesquisa == 'pacote_hotel' %}
        motorBusca.motorPacoteHotel('.pnlMotor.pacoteHotel', null, {{ params.idPacote ? params.idPacote|replace({'P': ''}) : null }}, {
            quarto: {value: '{{ params.config }}'}
        });
        {% elseif tpPesquisa == 'pacote_dinamico' %}
        motorBusca.motorPacoteDinamico('.pnlMotor.pacoteDinamico', {
            quarto: {value: '{{ params.config }}'}
        });
        {% elseif tpPesquisa == 'rodo_hotel' or tpPesquisa == 'pacote_rodo_hotel' %}
        motorBusca.motorRodoHotel('.pnlMotor.rodoHotel', {
            quarto: {value: '{{ params.config }}'}
        });
        {% elseif tpPesquisa == 'rodo_servico' %}
        motorBusca.motorRodoServico('.pnlMotor.rodoServico', {
            quarto: {value: '{{ params.config }}'}
        });
        {% endif %}
        /*]]>*/
    </script>

    <script>
        (function () {
            B2C.detalhe.init('hospedagem');
        })();
    </script>
{% endblock %}