<?xml version="1.0"?>
<!--
    El Ganso — Orden de la columna derecha (plantilla diseño sep-2026):
    TU BOLSA → cupón / puntos → totales → términos → botón pagar
    y debajo TUS ARTÍCULOS (lista del carrito).

    Va en un handle propio que se carga el ÚLTIMO del paso (ver
    etc/hyva_checkout.xml): hyva_checkout_default_payment vuelve a mover
    los términos (quote-actions) a column.main y el comentario al final,
    y hyva_checkout_layout_2columns mueve la navegación (botón pagar) a
    column.main. Un <move> posterior gana.
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
>
    <body>
        <referenceBlock name="checkout.quote-summary.title">
            <action method="setTitle">
                <argument name="title" translate="true" xsi:type="string">Tu bolsa</argument>
            </action>
        </referenceBlock>

        <move element="checkout.section.quote-actions" destination="checkout.price-summary.section" after="price-summary.total-segments"/>
        <move element="hyva.checkout.navigation" destination="checkout.price-summary.section" after="checkout.section.quote-actions"/>
        <move element="price-summary.cart-items" destination="checkout.price-summary.section" after="hyva.checkout.navigation"/>
        <!-- Descuentos (código y puntos) en una caja desplegable antes de los totales -->
        <referenceContainer name="checkout.price-summary.section">
            <block name="elg.checkout.discounts"
                   template="Yeboyebo_CheckoutShopify::checkout/discounts.phtml"
                   before="price-summary.total-segments"/>
        </referenceContainer>
        <!-- El orden lo da la plantilla por alias (el after del move no lo respetaba) -->
        <move element="unified-discount-code" destination="elg.checkout.discounts" as="code"/>
        <move element="reward-points-yeboyebo" destination="elg.checkout.discounts" as="points"/>

        <!-- Impuestos fuera de la tabla: van en pequeño bajo el total (grand-total.phtml) -->
        <referenceBlock name="price-summary.total-segment.tax" remove="true"/>

        <!-- Sin campo de comentario del pedido (no está en la plantilla) -->
        <referenceBlock name="checkout.order-comment" remove="true"/>

        <!-- Estado "listo para pagar" del botón (todo relleno) -->
        <referenceContainer name="before.body.end">
            <block name="elg.checkout.place-order.ready"
                   template="Yeboyebo_CheckoutShopify::place-order-ready.phtml"/>
            <!-- "Disponible en tienda" en la lista de artículos (antes de que arranque Alpine) -->
            <block name="elg.checkout.store-availability.js"
                   template="Yeboyebo_CheckoutShopify::checkout/store-availability-js.phtml"/>
        </referenceContainer>
    </body>
</page>
