<?xml version="1.0"?>
<!--
    Reemplaza los 3 inputs separados (cupón, vale, tarjeta monedero) por
    UN único componente "Aplica tu código" que detecta el tipo en cascada.
    Mantiene reward-points-yeboyebo aparte (es cantidad numérica).
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="checkout.price-summary.section">
            <block name="unified-discount-code"
                   template="Yeboyebo_UnifiedDiscount::checkout/unified-code.phtml"
                   after="price-summary.cart-items">
                <arguments>
                    <argument name="magewire" xsi:type="object">
                        \Yeboyebo\UnifiedDiscount\Magewire\Checkout\UnifiedCode
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

        <!-- Esconder los 3 inputs independientes — el nuevo unified-discount
             los cubre. Reward points (numérico) se queda. -->
        <!-- Líneas de los totales para vale y tarjeta monedero: Hyvä solo pinta los totales con bloque propio -->
        <referenceBlock name="price-summary.total-segments">
            <block name="price-summary.total-segment.vales"
                   as="vales"
                   template="Yeboyebo_UnifiedDiscount::checkout/price-summary/total-segments/vales.phtml"/>
            <block name="price-summary.total-segment.tarjetasmonedero"
                   as="tarjetasmonedero"
                   template="Yeboyebo_UnifiedDiscount::checkout/price-summary/total-segments/tarjetasmonedero.phtml"/>
        </referenceBlock>

        <referenceBlock name="coupon-code" remove="true"/>
        <referenceBlock name="vales-yeboyebo" remove="true"/>
        <referenceBlock name="tarjeta-monedero-yeboyebo" remove="true"/>
    </body>
</page>
