<div class="one-page-checkout" id="checkoutSteps">
  <div id="opc-billing" class="section allow active custom_login_input_box">
    <div id="checkout-step-billing">
      <?php if ($error_warning) { ?>
        <div class="warning"><?php echo $error_warning; ?></div>
      <?php } ?>
      <?php if ($shipping_methods) { ?>
        <?php foreach ($shipping_methods as $shipping_method) { ?>
          <span class="text-medium text-bold text-dark visible-block bottom-margin-small"><?php echo $shipping_method['title']; ?></span>

          <?php if (!$shipping_method['error']) { ?>
            <?php foreach ($shipping_method['quote'] as $quote) { ?>
              <label class="radio radio-small">
                <?php if (($quote['code'] == $code || !$code) || ($quote['code'] == $shipping_cart_chk)) { ?>
                  <?php $code = $quote['code']; ?>
                  <input class="radio-entry" type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" id="<?php echo $quote['code']; ?>" checked >
                <?php }    
                else { ?>
                  <input class="radio-entry" type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" id="<?php echo $quote['code']; ?>" >
                <?php } ?>
              
                <?php 
                  $isBold = false;
                  if (isset($free_module) && !empty($free_module)) {
                    foreach ($free_module as $free_data) {
                      if ($free_data['free_exibir_frete_gratis_negrito'] == '1' && $quote['title'] == $free_data['free_titlefutura']) {
                        $isBold = true;
                        break; 
                      }
                    }
                  }
                ?>
                  <span class="radio-text">
                    <?php if ($isBold) { ?>
                      <b><?php echo $quote['title']; ?></b>: <b><?php echo $quote['text']; ?></b>
                    <?php } else { ?>
                      <?php echo $quote['title']; ?>: <b><?php echo $quote['text']; ?></b>
                    <?php } ?>
                  </span>

                <?php if($quote['code'] == 'futura_frete_conta_cliente.futura_frete_conta_cliente'){ ?>
                  <?php if(!$this->config->get('futura_frete_conta_cliente_status')){ ?>
                      <label class="field field-medium top-margin-large">
                        <span class="field-label"><?php echo $text_comments; ?></span>
                        <textarea class="field-entry" name="comment" rows="5" MaxLength="1000"><?php echo $comment; ?></textarea>
                      </label>
                    <?php } else { ?>
                      <script type="text/javascript">
                        window.waitEvent('scripts_document', function() {
                        if($("input[name='shipping_method']:checked").val()=='futura_frete_conta_cliente.futura_frete_conta_cliente'){
                          $('#comment-exibe').css({
                            'display':'block'
                          })
                        }
                        $('input[type="radio"]').change(function() {
                          if ($(this).attr("id") == 'futura_frete_conta_cliente.futura_frete_conta_cliente'){
                            $('#comment-exibe').css({
                              'display':'block'
                            })
                          }else{
                            $('#comment-exibe').css({
                              'display':'none'
                            })
                          }
                        });
                      });
                    </script>
                      <div id="comment-exibe" class="top-margin-large" style="display:none;">
                        <b><?php echo $text_carrier; ?></b>
                        <input type="text" name="comment" id="comment" value="" MaxLength="250">
                      </div>
                  <?php } ?>
                <?php } ?>

                <?php if(!empty($quote['pickup_address'])){ ?>
                <span class="text-small text-gray top-margin-medium left-margin-large visible-block"><?php echo $text_address . ': ' . $quote['pickup_address']; ?></span>
                <?php } ?>

                <?php if(isset($quote['message'])){ ?>
                <span class="text-small text-gray top-margin-medium left-margin-large visible-block"><?php echo $quote['message']; ?></span>
                <?php } ?>
              </label>
              
            <?php } ?>
          <?php } else { ?>
            <span class="text-medium text-error">
              <?php echo $shipping_method['error']; ?>
            </span>
          <?php } ?>
          <hr class="bottom-border-gray vertical-margin-medium">
        <?php } ?>
      <?php } ?>

      <div class="flex middle-xs end-xs top-margin-large">
        <button type="button" id="button-shipping-method" class="btn-default btn-large">
          <span><?php echo $button_continue; ?></span>
        </button>
      </div>

    </div>
  </div>
</div>
