
    <style>
        .tradein-trigger-btn { background: #000; color: #fff; border: none; padding: 12px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; width: 100%; margin-top: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
        .trade-modal-overlay { display: none; position: fixed; z-index: 999999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
        .trade-modal-box { position: relative; background: #fff; max-width: 450px; margin: 50px auto; padding: 25px; border-radius: 20px; font-family: sans-serif; }
        .trade-close { position: absolute; right: 20px; top: 15px; font-size: 24px; cursor: pointer; color: #888; }
        .trade-field { margin-bottom: 15px; }
        .trade-field label { display: block; font-size: 12px; font-weight: bold; margin-bottom: 5px; color: #333; }
        .trade-field input, .trade-field select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; }
        .trade-row { display: flex; gap: 10px; }
        .trade-row div { flex: 1; }
        .estimate-bubble { background: #f2f2f7; padding: 15px; border-radius: 12px; text-align: center; margin-bottom: 15px; color: #0071e3; font-weight: bold; }
        .trade-submit { background: #25D366; color: white; border: none; padding: 15px; width: 100%; border-radius: 10px; font-weight: bold; cursor: pointer; font-size: 16px; }
    </style>

    <div id="tradeInModal" class="trade-modal-overlay">
        <div class="trade-modal-box">
            <span class="trade-close" onclick="closeTradeInModal()">&times;</span>
            <h2 style="margin-top:0; font-size: 20px;">iPhone Trade-In</h2>
            
            <div id="estDisplay" class="estimate-bubble">Enter details for a quote</div>

            <div class="trade-field">
                <label>Interested in Buyung:</label>
                <input type="text" id="target_item" value="" readonly>
            </div>

            <div class="trade-row">
                <div class="trade-field">
                    <label>Your Current Model</label>
                    <select id="my_model" onchange="updateEst()">
                        <option value="0">Select Model</option>
                        <option value="140000">iPhone 15 Pro Max</option>
                        <option value="120000">iPhone 15 Pro</option>
                        <option value="95000">iPhone 14 Pro Max</option>
                        <option value="85000">iPhone 14 Pro</option>
                        <option value="70000">iPhone 13 Pro Max</option>
                        <option value="55000">iPhone 12 Pro Max</option>
                    </select>
                </div>
                <div class="trade-field">
                    <label>Storage</label>
                    <select id="my_storage">
                        <option>128GB</option><option>256GB</option><option>512GB</option><option>1TB</option>
                    </select>
                </div>
            </div>

            <div class="trade-row">
                <div class="trade-field">
                    <label>Battery Health %</label>
                    <input type="number" id="my_battery" placeholder="e.g. 90">
                </div>
                <div class="trade-field">
                    <label>Color</label>
                    <input type="text" id="my_color" placeholder="Titanium">
                </div>
            </div>

            <div class="trade-field">
                <label>Condition</label>
                <select id="my_cond" onchange="updateEst()">
                    <option value="1">Mint (Perfect)</option>
                    <option value="0.85">Good (Light Scratches)</option>
                    <option value="0.5">Dents / Scratches</option>
                </select>
            </div>

            <button class="trade-submit" onclick="sendToWhatsapp()">Get Quote via WhatsApp</button>
        </div>
    </div>

    <script>
        function openTradeInModal() { document.getElementById('tradeInModal').style.display = 'block'; }
        function closeTradeInModal() { document.getElementById('tradeInModal').style.display = 'none'; }
        
        function updateEst() {
            const base = parseFloat(document.getElementById('my_model').value);
            const cond = parseFloat(document.getElementById('my_cond').value);
            if(base > 0) {
                const total = Math.round(base * cond);
                document.getElementById('estDisplay').innerHTML = "Estimated Value: KSh " + total.toLocaleString();
            }
        }

        function sendToWhatsapp() {
            const phone = "2547XXXXXXXX"; // PUT YOUR NUMBER HERE
            const target = document.getElementById('target_item').value;
            const model = document.getElementById('my_model').options[document.getElementById('my_model').selectedIndex].text;
            const storage = document.getElementById('my_storage').value;
            const battery = document.getElementById('my_battery').value;
            const cond = document.getElementById('my_cond').options[document.getElementById('my_cond').selectedIndex].text;

            const msg = `*New Trade-In Inquiry*%0A` +
                        `--------------------%0A` +
                        `*Wants:* ${target}%0A` +
                        `*Trading in:* ${model}%0A` +
                        `*Storage:* ${storage}%0A` +
                        `*Battery:* ${battery}%%0A` +
                        `*Condition:* ${cond}`;
            
            window.open(`https://wa.me/${phone}?text=${msg}`, '_blank');
        }
    </script>
    
}

// Enable the shortcode [iphone_tradein_button]
add_shortcode('iphone_tradein_button', function() {
    return '<button type="button" class="tradein-trigger-btn" onclick="openTradeInModal()"> Trade-in your old iPhone</button>';
});<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//www.allogadgets.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://www.allogadgets.com/post-sitemap.xml</loc>
		<lastmod>2025-12-08T16:15:08+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/page-sitemap.xml</loc>
		<lastmod>2026-05-08T18:31:35+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/product-sitemap.xml</loc>
		<lastmod>2026-05-07T15:27:26+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/product-sitemap2.xml</loc>
		<lastmod>2026-05-07T15:27:26+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/category-sitemap.xml</loc>
		<lastmod>2025-12-08T16:15:08+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/post_tag-sitemap.xml</loc>
		<lastmod>2024-07-25T14:06:10+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/cms_block_cat-sitemap.xml</loc>
		<lastmod>2026-05-09T10:16:04+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/woodmart_slider-sitemap.xml</loc>
		<lastmod>2025-12-30T12:48:51+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/product_brand-sitemap.xml</loc>
		<lastmod>2025-12-29T14:35:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/product_cat-sitemap.xml</loc>
		<lastmod>2026-05-07T14:48:20+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/product_tag-sitemap.xml</loc>
		<lastmod>2026-05-07T14:48:20+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.allogadgets.com/author-sitemap.xml</loc>
		<lastmod>2026-05-08T13:54:57+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->