<style>
    .track-order-container {
        max-width: 600px;
        margin: auto;
        padding: 20px;
        border: 1px solid #ddd;
        background-color: #f9f9f9;
    }

    .tracking-details h2 {
        margin-top: 20px;
    }

    .tracking-details p {
        margin: 5px 0;
    }

    footer {
        margin-top: 20px;
        font-size: 0.9em;
        text-align: center;
    }

    footer img {
        display: block;
        margin: 10px auto;
    }
</style>

<div class="track-order-container">
    <form action="<?php echo $this->getUrl('bobgo/tracking/index'); ?>" method="post">
        <div class="field">
            <label for="order_reference"><?php echo __('Order Number/Tracking Reference:'); ?></label>
            <input type="text" id="order_reference" name="order_reference" required>
        </div>
        <br>
        <div class="actions-toolbar">
            <button type="submit" class="action submit primary"><?php echo __('Track Order'); ?></button>
        </div>
    </form>

<!--    --><?php //if ($response = $block->getResponse()): ?>
<!--        <div class="tracking-response">-->
<!--            <!-- Handle and display the API response -->-->
<!--            <h2>--><?php //echo __('Tracking Information'); ?><!--</h2>-->
<!--            <p>--><?php //echo __('Status: ' . $response['status']); ?><!--</p>-->
<!--            <!-- Add more fields as needed from the response -->-->
<!--        </div>-->
<!--    --><?php //endif; ?>

        <?php

//<!--    --><?php
//    $shipmentData = $block->getResponse();
//    if ($shipmentData && is_array($shipmentData)) {
//        foreach ($shipmentData as $shipment) {
//            echo '<div class="tracking-details">';
//            echo '<h2>' . __('Shipping Details') . '</h2>';
//            echo '<p>' . __('Shipment: ') . $shipment['shipment_tracking_reference'] . '</p>';
//            echo '<p>' . __('Order: ') . ltrim($shipment['order_number'], '0') . '</p>';
//            echo '<p>' . __('Courier: ') . $shipment['courier_name'] . '</p>';
//
//            echo '<h2>' . __('Tracking Details') . '</h2>';
//            echo '<p>' . __('Current Status: ') . $shipment['status_friendly'] . '</p>';
//
//            echo '<footer>';
//            echo '<p>' . __('For additional information, please contact BobGo (support@bobgo.co.za).') . '</p>';
//            echo '<img src="' . $shipment['courier_logo'] . '" alt="Courier Logo" style="width: 100px;"/>';
//            echo '</footer>';
//            echo '</div>';
//        }
//    } else {
//        echo '<p>No tracking data available.</p>';
//    }
//    ?>
</div>