<?xml version="1.0"?>
<!--
    Pedido para regalo — fuera del fieldset de pago (evita submit/modales)
    y justo después de la sección de pago.
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <!-- Datos de contacto: los mensajes del componente (p. ej. "Email o contraseña incorrectos." del login en
             línea, Guest Details → Enable login) debajo del formulario, bajo el botón Acceder, y no encima del título -->
        <move element="component-messenger-guest-details"
              destination="checkout.guest-details.section"
              after="checkout.guest-details"/>

        <referenceContainer name="column.main">
            <block name="checkout.gift.wrap"
                   after="checkout.payment.section"
                   template="Yeboyebo_CheckoutShopify::checkout/gift-wrap.phtml">
                <arguments>
                    <argument name="magewire" xsi:type="object">
                        \Yeboyebo\CheckoutShopify\Magewire\Checkout\GiftWrap
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

        <!-- Lista de artículos y totales se repintan al añadir/quitar el sobre regalo (gift_wrap_updated) -->
        <referenceBlock name="price-summary.total-segments">
            <arguments>
                <argument name="magewire" xsi:type="object">
                    \Yeboyebo\CheckoutShopify\Magewire\Checkout\PriceSummary
                </argument>
            </arguments>
        </referenceBlock>

        <referenceBlock name="price-summary.cart-items">
            <arguments>
                <argument name="magewire" xsi:type="object">
                    \Yeboyebo\CheckoutShopify\Magewire\Checkout\PriceSummary\CartItems
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>
