<style>
    .table,
    .td,
    .th {
        border: 1px solid black;
        text-align: left;
    }

    .table {
        border-collapse: collapse;
        width: 100%;
    }

    .th,
    .td {
        padding: 10px;
        border-radius:20px;
    }
</style>

<div style="display:block; width: 100%;height:35px;">

    <?php foreach ($productos as $row) : ?>
    <div style="width:100%;background:#0b7c8b;">
        <h3 style="text-align: center; display:block; width: 100%;color:#fff;"><?= $row['nombre'] ?></h3>
    </div>

       <?php foreach ($row['productos'] as $pro) :   ?>

            <div style="float:left;width: 24.6%; height:24%; border:1px solid #0a6976;">
                <br>
                <table width="100%">
                    <tr>
                        <td style="text-align: center;"><img style="width: 100%; max-height: 100px" src="<?= $pro['imagen'] ?>"></td>
                    </tr>
                    <tr>
                        <td style="text-align: center;font-size:18px;font-weight:800;background: #21a6b8;color:#fff;border-top-left-radius: 80px 80px;"><?= $pro['tarifa'] ?></td>
                    </tr>
                    <tr>
                        <td style="text-align: center;padding:0px 15px;"><?= $pro['descripcion'] ?></td>
                    </tr>
                </table>
            </div>

        <?php endforeach; ?>
        
         <?php if (count($row['subcategorias'])>0) :  ?>
             <?php foreach ($row['subcategorias'] as $row1) : ?>
             <div style="width:100%;background:#0b7c8b;">
                <h3 style="text-align: center; display:block; width: 100%;color:#fff;"><?= $row1['subcategoria'] ?></h3>
            </div>
                <?php foreach ($row1['productos'] as $pro) :   ?>

                    <div style="float:left;width: 24.6%; height:24%; border:1px solid #0a6976;">
                        <br>
                        <table width="100%">
                            <tr>
                                <td style="text-align: center;"><img style="width: 100%; max-height: 100px" src="<?= $pro['imagen'] ?>"></td>
                            </tr>
                            <tr>
                                <td style="text-align: center;font-size:18px;font-weight:800;background: #21a6b8;color:#fff;border-top-left-radius: 80px 80px;"><?= $pro['tarifa'] ?></td>
                            </tr>
                            <tr>
                                <td style="text-align: center;padding:0px 15px;"><?= $pro['descripcion'] ?></td>
                            </tr>
                        </table>
                    </div>
        
                <?php endforeach; ?>
            
    
             <?php endforeach; ?>   
          <?php endif; ?>

        <br><br>

    <?php endforeach; ?>

</div>
