<?php if (!defined('ABSPATH'))
    exit; // Exit if accessed directly 
$shop_name = kirbGetMeta("_shop_name");
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";
$host = isset($_SERVER['HTTP_HOST']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_HOST'])) : '';
$domain = $protocol . $host;
?>
<div class="tryon-popup modal fade position-fixed" id="diamond-tryon-modal" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="kirb-modal-content">
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            <iframe src="<?php echo esc_url(
                'https://engagement-ring-builder-o4hk8.kinsta.app/diamond-viewer?' .
                http_build_query([
                    'shop' => $shop_name,
                    'domain' => $domain,
                    'shape' => $diamond['shape'],
                    'carat' => $diamond['weight'],
                ])
            ); ?>" width="100%" height="100%">
            </iframe>

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