<!-- tabla-contenedora -->
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" style="width: 100%; max-width: 100%; ">
    <tr>

        <td align="left" valign="top" style="padding-bottom: 16px;" bgcolor="#FAF9F9">

            <!-- contenida-tabla -->

            <?php if ($compra['precios'] != '') {
            ?>

                <!-- sm-title -->
                <table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" style="width: 100%; max-width: 100%; ">
                    <tr>
                        <td class="sm-title" valign="top" align="left" style="font-family:'Montserrat', serif !important; text-transform:uppercase; line-height: 24px; font-style: normal;  font-weight: 500; font-size: 18px; letter-spacing: 0.03em; color: #353535; padding: 0 8px 8px;border-bottom: 1px dashed #dddddd;">

                        Panier d'extras précédent

                        </td>
                    </tr>
                </table>
                <!-- sm-title -->

                <!-- space -->
                <table border="0" width="100%" align="center" cellpadding="0" cellspacing="0" style="width:100%;max-width:100%;">
                    <tr>
                        <td valign="middle" align="center" height="16" style="font-size: 16px; line-height: 16px;">&nbsp;</td>
                    </tr>
                </table>
                <!-- space -->


                <table style="width:100%; max-width:100%;" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
                    <tbody>
                        <tr>
                            <td class="title desplazar-derecha" valign="middle" align="left" style="padding: 0 20px;">

                                <table style="width:100%; max-width:100%;" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">

                                    <tr style="font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 500; line-height: 20px; font-style: normal; color: #473d37; text-decoration: none; letter-spacing: 1px;">
                                        <th style="font-weight: 500; text-transform: uppercase; padding-bottom: 4px;" align="left">UNITÉS</th>
                                        <th style="font-weight: 500; text-transform: uppercase; padding-bottom: 4px;" align="left">CARACTÉRISTIQUES SUPPLÉMENTAIRES</th>
                                        <th style="font-weight: 500; text-transform: uppercase; padding-bottom: 4px;" align="right">PRIX</th>
                                    </tr>

                                    <?php foreach ($compra['extras_seleccionados_ant'] as $key => $extra) : ?>

                                        <tr style="font-family: 'Inter', sans-serif; font-size: 12px; line-height: 20px; color: #1d2331; text-decoration: none; letter-spacing: 1px; padding-top: 10px;">

                                            <td>
                                                <?php echo $extra['cantidad']; ?>
                                            </td>

                                            <td>
                                                <?php  echo $extra['nombre'] ?>
                                            </td>

                                            <td align="right">
                                                <?php
                                                if (!is_string($extra['precio'])) {
                                                    $value_format = number_format($extra['precio'], 2);
                                                    echo $value_format . ' €';
                                                } else {
                                                    echo $extra['precio'];
                                                }
                                                ?>
                                            </td>

                                        </tr>

                                    <?php endforeach; ?>
              

                                    <?php if ($compra['cupon'] != '') { ?>
                                        <tr style=" font-family: 'Inter', sans-serif; font-size: 12px; line-height: 20px; color: #1d2331; text-decoration: none; letter-spacing: 1px; padding-top: 10px;">
                                            <td>1</td>
                                            <td><?php echo "Cupón: " . $compra['cupon']['codigo']; ?></td>
                                            <?php
                                            if ($compra['cupon']['porcentual'] == 1) {
                                                $simbolo = "%";
                                            } else {
                                                $simbolo = "€";
                                            }
                                            ?>
                                            <td style="text-align:right;"><?php echo "- " . $compra['cupon']['cantidad'] . ' ' . $simbolo; ?></td>
                                        </tr>
                                    <?php } ?>

                                    <?php if ($compra['descuento_coste_realizado'] != '' && $compra['descuento_coste_realizado'] != 0 ) { ?>
                                        <tr style="">
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                        <tr style=" font-family: 'Inter', sans-serif; font-size: 12px; line-height: 20px; color: #1d2331; text-decoration: none; letter-spacing: 1px; padding-top: 10px;">
                                            <td></td>
                                            <td><strong><?php echo $compra['tipo_aplicado']; ?></strong></td>
                                            <td align="right"><?php echo $compra['descuento_coste_realizado'] . ' €'; ?> descuento_coste_realizado </td>
                                        </tr>
                                    <?php } ?>

                                    <tr height="40px">
                                        <?php if ($compra['descuento_coste'] != '' && $compra['descuento_coste'] != 0) { ?>
                                            <td>
                                                <strong><?php echo $compra['descuento_coste']; ?></strong> descuento_coste
                                            </td>
                                        <?php } elseif ($compra['pago_parcial'] != '') { ?>
                                            <td>
                                            </td>
                                        <?php } ?>
                                        <td colspan="3" style="font-size: 16px; font-family: 'Inter', sans-serif; font-weight: 600; text-align: right; color: #353535;">

                                            <?php
                                            if (!is_string($compra['total_ant'])) {
                                                $compra_total = number_format($compra['total_ant'], 2);
                                                echo $compra_total . ' €';
                                            } else {
                                                echo $compra['total_ant'];
                                            }
                                            ?>

                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            <?php } ?>

            <!-- space -->
            <table border="0" width="100%" align="center" cellpadding="0" cellspacing="0" style="width:100%;max-width:100%;">
                <tr>
                    <td valign="middle" align="center" height="10" style="font-size:10px;line-height:10px;">&nbsp;</td>
                </tr>
            </table>
            <!-- space -->

            <!-- space -->
            <table border="0" width="100%" align="center" cellpadding="0" cellspacing="0" style="width:100%;max-width:100%;">
                <tr>
                    <td valign="middle" align="center" height="10" style="font-size:10px;line-height:10px;">&nbsp;</td>
                </tr>
            </table>
            <!-- space -->

            <!-- fin-contenida-tabla -->
        </td>
    </tr>
</table>