(?php
/** Optional workshop request templates; uses the existing AVM contact message field. */
defined('ABSPATH') || exit;
add_action('wp_footer', static function () {
    if (!is_page(11741) || is_admin()) { return; }
    $services = [
        'reparaturen' => ['Kfz-Reparaturen', "Anliegen: Kfz-Reparatur\nHersteller / Modell:\nBaujahr / Motorisierung:\nKilometerstand:\nBeobachtetes Problem / Warnmeldung:\nWann tritt es auf?:\nGewünschter Zeitraum / Rückkontakt:"],
        'getriebeoelservice' => ['Getriebeölservice – Beratung zu Wechsel oder Spülung', "Anliegen: Getriebeölservice – passende Methode prüfen\nHersteller / Modell:\nBaujahr / Motorisierung:\nGetriebevariante (falls bekannt):\nKilometerstand:\nLetzter Getriebeölservice:\nSchaltverhalten / bekannte Fehler:\nGewünschter Zeitraum:"],
        'inspektion' => ['Inspektion nach Herstellervorgaben', "Anliegen: Inspektion nach Herstellervorgaben\nHersteller / Modell:\nBaujahr / Motorisierung:\nKilometerstand:\nLetzte Inspektion / Wartungsstand:\nGewünschter Zeitraum:"],
        'getriebeoelwechsel' => ['Getriebeölwechsel', "Anliegen: Getriebeölwechsel\nHersteller / Modell:\nBaujahr / Motorisierung:\nGetriebevariante (falls bekannt):\nKilometerstand:\nLetzter Getriebeölservice:\nSchaltverhalten / bekannte Fehler:\nGewünschter Zeitraum:"],
        'getriebeoelspuelung' => ['Getriebeölspülung', "Anliegen: Getriebeölspülung – technische Eignung prüfen\nHersteller / Modell:\nBaujahr / Motorisierung:\nGetriebevariante (falls bekannt):\nKilometerstand:\nLetzter Getriebeölservice:\nSchaltverhalten / bekannte Fehler:\nGewünschter Zeitraum:"],
    ];
    $selected = isset($_GET['avm_service']) && is_scalar($_GET['avm_service']) ? sanitize_key(wp_unslash($_GET['avm_service'])) : '';
    if (isset($services[$selected])) {
        $services = [$selected => $services[$selected]] + $services;
    }
    ?>
 section id="avm-workshop-contact-fallback" class="ax-wrap ax-prose" style="padding-top:2rem;padding-bottom:2rem">
 div id="avmar-anfrage-fallback"> h2>Werkstatt-Anfrage vorbereiten h2>
 p>Wählen Sie Ihr Anliegen und ergänzen Sie die Fahrzeugdaten in WhatsApp oder in Ihrer E-Mail. Der Link bereitet nur eine Nachricht vor. Technische Eignung, Arbeitsumfang, Gesamtpreis und Termin stimmen wir separat ab. p>
 ?php foreach ($services as $key => $service): ?>
 article style="border-top:1px solid #ddd;padding:1rem 0">
 h3>
 ?php echo esc_html($service[0]); ?> h3>
 p>
 ?php if ($key === 'reparaturen'): ?>Bitte nennen Sie Fahrzeug, Baujahr, Kilometerstand, das beobachtete Problem und wann es auftritt.
 ?php else: ?>Bitte nennen Sie Fahrzeug, Baujahr, Motorisierung, Kilometerstand und den bisherigen Wartungsstand
 ?php if (strpos($key, 'getriebe') === 0): ?> sowie die Getriebevariante, falls bekannt
 ?php endif; ?>.
 ?php endif; ?> p>
 div class="ax-actions">
 a class="ax-btn ax-btn--dark" target="_blank" rel="noopener noreferrer" href="
 ?php echo esc_url('https://wa.me/4916099785497?text=' . rawurlencode(str_replace("\n", "; ", $service[1]))); ?>">Per WhatsApp vorbereiten a>
 a class="ax-btn ax-btn--dark" href="
 ?php echo esc_url('mailto:info@avm-car-performance.de?subject=' . rawurlencode($service[0] . ' – Fahrzeuganfrage') . '&body=' . rawurlencode($service[1])); ?>">Per E-Mail vorbereiten a>
 div> article>
 ?php endforeach; ?>
 div> section>
 script id="avm-workshop-contact-20261011">
 (function(){
 'use strict';
 var form=document.querySelector('form[data-'+'avmar-form]');
 var fallback=document.getElementById('avm-workshop-contact-fallback');
 if(!form){
 var main=document.getElementById('main');
 if(main && fallback){
 main.appendChild(fallback);
 var anchor=document.getElementById('avmar-anfrage-fallback');
 function focusRequest(){if(window.location.hash==='#avmar-anfrage' && anchor){window.requestAnimationFrame(function(){anchor.scrollIntoView({block:'start'});});}}
 focusRequest();
 if(document.readyState!=='complete')window.addEventListener('load',focusRequest,{once:true});
 window.addEventListener('hashchange',focusRequest);
 }
 return;
 }
 if(fallback)fallback.remove();
 var formAnchor=document.getElementById('avmar-anfrage');
 function focusForm(){if(window.location.hash==='#avmar-anfrage' && formAnchor){window.requestAnimationFrame(function(){formAnchor.scrollIntoView({block:'start'});});}}
 focusForm();
 if(document.readyState!=='complete')window.addEventListener('load',focusForm,{once:true});
 window.addEventListener('hashchange',focusForm);
 if(document.getElementById('avm-workshop-topic')) return;
 var message=form.querySelector('textarea[name="message"]');
 if(!message) return;
 var topics=
 ?php
 $topics = [];
 foreach ($services as $key => $service) $topics[$key] = ['title' => $service[0], 'text' => $service[1]];
 echo wp_json_encode($topics, JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT);
 ?>;
 var wrap=document.createElement('div');wrap.id='avm-workshop-request-helper';wrap.style.margin='0.5rem 0';
 var label=document.createElement('label');label.htmlFor='avm-workshop-topic';label.textContent='Anliegen (optional)';
 var select=document.createElement('select');select.id='avm-workshop-topic';select.style.width='100%';
 var empty=document.createElement('option');empty.value='';empty.textContent='Anliegen wählen';select.appendChild(empty);
 Object.keys(topics).forEach(function(key){var option=document.createElement('option');option.value=key;option.textContent=topics[key].title;select.appendChild(option);});
 label.appendChild(select);wrap.appendChild(label);
 var button=document.createElement('button');button.type='button';button.textContent='Vorlage übernehmen';button.style.margin='0.5rem 0';button.disabled=true;wrap.appendChild(button);
 var status=document.createElement('p');status.style.margin='0';status.style.fontSize='0.9rem';status.setAttribute('role','status');status.setAttribute('aria-live','polite');wrap.appendChild(status);
 var fieldLabel=message.closest('label');form.insertBefore(wrap,form.firstChild);
 function apply(focus){
 var chosen=topics[select.value];if(!chosen)return;
 if(message.value.indexOf(chosen.text)===-1){
 var current=message.value.trim();var next=current ? current+'\n\n'+chosen.text : chosen.text;
 var limit=message.maxLength>0 ? message.maxLength : 6000;
 if(next.length>limit){status.textContent='Bitte ergänzen Sie das Anliegen direkt in Ihrer vorhandenen Nachricht.';return;}
 message.value=next;message.dispatchEvent(new Event('input',{bubbles:true}));message.dispatchEvent(new Event('change',{bubbles:true}));
 }
 status.textContent=focus ? 'Vorlage ergänzt. Bitte Fahrzeugdaten eintragen.' : '';
 if(focus)message.focus();
 }
 select.addEventListener('change',function(){button.disabled=!topics[select.value];status.textContent='';});
 button.addEventListener('click',function(){apply(true);});
 var initial=new URLSearchParams(window.location.search).get('avm_service');
 if(initial && topics[initial]){select.value=initial;button.disabled=false;if(!message.value.trim())apply(false);}
 })();
 script>
 ?php
}, 40);<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://avm-car-performance.de/?fahrzeuge=bmw-5-series-f10-f11-5-series-535d-299ps-600nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-124-spider-124-1-4-170ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-500-new-2007-1-4-esseesse-160ps-206nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-500-new-2007-1-4-tjet-135ps-180nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-595-competizione-595-1-4-tjet-160ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-595-competizione-595-1-4-tjet-180ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-595-turismo-595-1-4-16v-tjet-160ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-punto-grande-punto-1-4-tjet-155ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=abarth-punto-grande-punto-1-4-tjet-ss-180ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alfa-romeo-159-939-159-2-0-jtdm-136ps-350nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b3-3-0-bi-turbo-462ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b3-b3-biturbo-410ps-600nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b4-b4-biturbo-410ps-600nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b5-4-4-v8-bi-turbo-608ps-800nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b5-b5-bi-turbo-540ps-730nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b6-b6-biturbo-540ps-730nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-b7-b7-bi-turbo-540ps-730nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-d3-2-0d-200ps-410nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-d3-d3-biturbo-350ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-d4-d4-biturbo-350ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-d5-d5-biturbo-350ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-d5-s-3-0d-388ps-770nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=alpina-xd3-xd3-biturbo-350ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-db11-4-0-v8-biturbo-510ps-675nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-db11-5-2-v12-biturbo-608ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-db9-5-9-v12-455ps-570nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-db9-5-9-v12-517ps-620nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-db9-6-0-v12-477ps-600nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-dbs-5-9-v12-517ps-570nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-dbx-4-0-v8-bi-turbo-550ps-700nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-rapide-6-0-v12-477ps-600nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-vantage-4-7-v8-426ps-470nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-vantage-4-7-v8-s-436ps-490nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-vantage-6-0-v12-517ps-570nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=aston-martin-vantage-6-0-v12-s-573ps-620nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-100-2-8-v6-174ps-225nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-100-s4-2-2-quattro-turbo-aan-230ps-350nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-80-2-8-e-174ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-80-1-9-tdi-90ps-182nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-0-tsi-82ps-160nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-0-tsi-95ps-160nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-2-tsi-86ps-160nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-4-tfsi-140ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-4-tfsi-150ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-4-tfsi-185ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-2-0-tfsi-quattro-256ps-350nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-2-0-tsi-s1-231ps-370nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-6-tdi-116ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-6-tdi-cr-105ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-1-6-tdi-cr-90ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-8x-2-0-tdi-cr-143ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-gb-25-tfsi-1-0t-95ps-175nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-gb-30-tfsi-1-0t-116ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-gb-35-tfsi-150ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a1-gb-40-tfsi-200ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a2-8z-1-4-16v-75ps-126nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a2-8z-1-6-fsi-110ps-155nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a2-8z-1-2-tdi-pd-61ps-140nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a2-8z-1-4-tdi-pd-75ps-195nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a2-8z-1-4-tdi-pd-90ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-6-102ps-145nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-8-20v-125ps-170nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-8-20v-s3-turbo-210ps-270nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-8-20v-turbo-150ps-210nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-8-20v-turbo-180ps-235nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-9-tdi-110ps-235nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8l-1-9-tdi-pd-130ps-310nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-2-tfsi-105ps-175nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-4-tfsi-125ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-6-8v-102ps-145nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-6-fsi-116ps-155nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-8-tfsi-160ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-fsi-150ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-tfsi-200ps-280nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-tfsi-s3-265ps-350nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-5-tfsi-rs3-340ps-450nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-3-2-v6-250ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-6-tdi-cr-105ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-6-tdi-cr-90ps-230nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-1-9-tdi-pd-105ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-tdi-cr-140ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-tdi-cr-170ps-350nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-tdi-pd-140ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8p-2-0-tdi-pd-170ps-350nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-0-tsi-115ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-2-tsi-105ps-175nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-2-tsi-110ps-175nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-4-tfsi-125ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-4-tfsi-140ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-4-tfsi-150ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-4-tgi-110ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-4-tsi-122ps-200nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-1-8-tfsi-180ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-2-0-tfsi-s3-300ps-380nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-2-0-tfsi-s3-310ps-380nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-35-tfsi-150ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-40-tfsi-190ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a3-8v-e-tron-150ps-250nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=audi-a5-8f-8t-a5-1-8-tfsi-170ps-320nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=bmw-3-series-f30-f31-3-series-320d-190ps-400nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=bmw-7-series-f01-f02-7-series-740d-313ps-630nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=mazda-2-mk1-dy-1-4-mzr-cd-68ps-160nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=mazda-6-gg-2-0-mzr-cd-136ps-310nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=mazda-6-gg-2-0-mzr-cd-143ps-360nm</loc></url><url><loc>https://avm-car-performance.de/?fahrzeuge=volkswagen-golf-6-gti-2-0-tsi-211ps-280nm</loc></url></urlset>