<?php
header("Content-Type: application/xml; charset=utf-8");

$baseUrl = "https://www.esimdeck.com";
$date = date("Y-m-d");

$staticPages = [
    "/" => "1.00",
    "/shop" => "0.90",
    "/about-us" => "0.80",
    "/contact-us" => "0.80",
    "/privacy-policy" => "0.50",
    "/terms-and-conditions" => "0.50",
    "/refund-policy" => "0.50",
];

// Add your country/region eSIM pages here
$esimPages = [
    "/esim/australia",
    "/esim/new-zealand",
    "/esim/united-states",
    "/esim/united-kingdom",
    "/esim/europe",
    "/esim/asia",
    "/esim/oceania",
    "/esim/africa",
    "/esim/north-america",
    "/esim/latin-america",
    "/esim/caribbean-islands",
    "/esim/middle-east-and-north-africa",
];

echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
echo '<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";

foreach ($staticPages as $page => $priority) {
    echo "  <url>\n";
    echo "    <loc>{$baseUrl}{$page}</loc>\n";
    echo "    <lastmod>{$date}</lastmod>\n";
    echo "    <changefreq>weekly</changefreq>\n";
    echo "    <priority>{$priority}</priority>\n";
    echo "  </url>\n";
}

foreach ($esimPages as $page) {
    echo "  <url>\n";
    echo "    <loc>{$baseUrl}{$page}</loc>\n";
    echo "    <lastmod>{$date}</lastmod>\n";
    echo "    <changefreq>daily</changefreq>\n";
    echo "    <priority>0.85</priority>\n";
    echo "  </url>\n";
}

echo '</urlset>';