{"id":6864,"date":"2023-06-16T13:10:20","date_gmt":"2023-06-16T16:10:20","guid":{"rendered":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/"},"modified":"2026-03-03T12:46:38","modified_gmt":"2026-03-03T15:46:38","slug":"test-drive","status":"publish","type":"page","link":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/","title":{"rendered":"Solicitud de Test Drive"},"content":{"rendered":"<h2 class=\"mt-5 mb-5 text-center\">Solicitud de Test Drive<\/h2>\n        <script>\n            \/\/ Defin\u00eds la base de la API con la URL correcta\n            const API_BASE = \"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/testdrive\/v1\/\";\n            const BLOQUEO_DE_DIAS = \"2\";\n            const FORMULARIO_HTML = \"\\n<div class=\\\"wpcf7 no-js\\\" id=\\\"wpcf7-f134472-o1\\\" lang=\\\"es-AR\\\" dir=\\\"ltr\\\" data-wpcf7-id=\\\"134472\\\">\\n<div class=\\\"screen-reader-response\\\"><p role=\\\"status\\\" aria-live=\\\"polite\\\" aria-atomic=\\\"true\\\"><\\\/p> <ul><\\\/ul><\\\/div>\\n<form action=\\\"\\\/mardelplata\\\/wp-json\\\/wp\\\/v2\\\/pages\\\/6864#wpcf7-f134472-o1\\\" method=\\\"post\\\" class=\\\"wpcf7-form init\\\" aria-label=\\\"Formulario de contacto\\\" novalidate=\\\"novalidate\\\" data-status=\\\"init\\\">\\n<fieldset class=\\\"hidden-fields-container\\\"><input type=\\\"hidden\\\" name=\\\"_wpcf7\\\" value=\\\"134472\\\" \\\/><input type=\\\"hidden\\\" name=\\\"_wpcf7_version\\\" value=\\\"6.1.6\\\" \\\/><input type=\\\"hidden\\\" name=\\\"_wpcf7_locale\\\" value=\\\"es_AR\\\" \\\/><input type=\\\"hidden\\\" name=\\\"_wpcf7_unit_tag\\\" value=\\\"wpcf7-f134472-o1\\\" \\\/><input type=\\\"hidden\\\" name=\\\"_wpcf7_container_post\\\" value=\\\"0\\\" \\\/><input type=\\\"hidden\\\" name=\\\"_wpcf7_posted_data_hash\\\" value=\\\"\\\" \\\/>\\n<\\\/fieldset>\\n<div class=\\\"wpcf7-turnstile cf-turnstile\\\" data-sitekey=\\\"0x4AAAAAACEmE8F2rAWPL-vw\\\" data-response-field-name=\\\"_wpcf7_turnstile_response\\\"><\\\/div>\\n\\n<input class=\\\"wpcf7-form-control wpcf7-hidden\\\" value=\\\"si\\\" type=\\\"hidden\\\" name=\\\"send_crm\\\" \\\/>\\n<div style=\\\"display:grid; grid-template-columns:1fr 1fr; gap:10px;\\\">\\n\\t<div>\\n\\t\\t<p><label>Nombre<br \\\/>\\n<span class=\\\"wpcf7-form-control-wrap\\\" data-name=\\\"nombre\\\"><input size=\\\"40\\\" maxlength=\\\"400\\\" class=\\\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\\\" aria-required=\\\"true\\\" aria-invalid=\\\"false\\\" placeholder=\\\"Nombre*\\\" value=\\\"\\\" type=\\\"text\\\" name=\\\"nombre\\\" \\\/><\\\/span><br \\\/>\\n<\\\/label>\\n\\t\\t<\\\/p>\\n\\t<\\\/div>\\n\\t<div>\\n\\t\\t<p><label>Apellido<br \\\/>\\n<span class=\\\"wpcf7-form-control-wrap\\\" data-name=\\\"apellido\\\"><input size=\\\"40\\\" maxlength=\\\"400\\\" class=\\\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\\\" aria-required=\\\"true\\\" aria-invalid=\\\"false\\\" placeholder=\\\"Apellido*\\\" value=\\\"\\\" type=\\\"text\\\" name=\\\"apellido\\\" \\\/><\\\/span><br \\\/>\\n<\\\/label>\\n\\t\\t<\\\/p>\\n\\t<\\\/div>\\n\\t<div>\\n\\t\\t<p><label>Tel\\u00e9fono<br \\\/>\\n<span class=\\\"wpcf7-form-control-wrap\\\" data-name=\\\"telefono\\\"><input size=\\\"40\\\" maxlength=\\\"400\\\" class=\\\"wpcf7-form-control wpcf7-tel wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-tel\\\" aria-required=\\\"true\\\" aria-invalid=\\\"false\\\" placeholder=\\\"Tel\\u00e9fono*\\\" value=\\\"\\\" type=\\\"tel\\\" name=\\\"telefono\\\" \\\/><\\\/span><br \\\/>\\n<\\\/label>\\n\\t\\t<\\\/p>\\n\\t<\\\/div>\\n\\t<div>\\n\\t\\t<p><label>Email<br \\\/>\\n<span class=\\\"wpcf7-form-control-wrap\\\" data-name=\\\"email\\\"><input size=\\\"40\\\" maxlength=\\\"400\\\" class=\\\"wpcf7-form-control wpcf7-email wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-email\\\" aria-required=\\\"true\\\" aria-invalid=\\\"false\\\" placeholder=\\\"Email*\\\" value=\\\"\\\" type=\\\"email\\\" name=\\\"email\\\" \\\/><\\\/span><br \\\/>\\n<\\\/label>\\n\\t\\t<\\\/p>\\n\\t<\\\/div>\\n\\t<div style=\\\"grid-column:1 \\\/ span 2;\\\">\\n\\t\\t<p><label><span class=\\\"wpcf7-form-control-wrap\\\" data-name=\\\"licencia\\\"><span class=\\\"wpcf7-form-control wpcf7-checkbox\\\"><span class=\\\"wpcf7-list-item first last\\\"><input type=\\\"checkbox\\\" name=\\\"licencia[]\\\" value=\\\"Tengo licencia\\\" \\\/><span class=\\\"wpcf7-list-item-label\\\">Tengo licencia<\\\/span><\\\/span><\\\/span><\\\/span><\\\/label>\\n\\t\\t<\\\/p>\\n\\t<\\\/div>\\n\\t<div style=\\\"grid-column:1 \\\/ span 2;\\\">\\n\\t\\t<p><label>Comentario<br \\\/>\\n<span class=\\\"wpcf7-form-control-wrap\\\" data-name=\\\"comentario\\\"><textarea cols=\\\"40\\\" rows=\\\"2\\\" maxlength=\\\"2000\\\" class=\\\"wpcf7-form-control wpcf7-textarea\\\" aria-invalid=\\\"false\\\" placeholder=\\\"Comentarios\\\" name=\\\"comentario\\\"><\\\/textarea><\\\/span><br \\\/>\\n<\\\/label>\\n\\t\\t<\\\/p>\\n\\t<\\\/div>\\n<\\\/div>\\n<div style=\\\"margin-top:12px;\\\">\\n\\t<p><input class=\\\"wpcf7-form-control wpcf7-submit has-spinner btn-main btn-form\\\" type=\\\"submit\\\" value=\\\"Enviar solicitud\\\" \\\/>\\n\\t<\\\/p>\\n<\\\/div><input type='hidden' class='wpcf7-pum' value='{\\\"closepopup\\\":false,\\\"closedelay\\\":0,\\\"openpopup\\\":false,\\\"openpopup_id\\\":0}' \\\/><div class=\\\"wpcf7-response-output\\\" aria-hidden=\\\"true\\\"><\\\/div>\\n<\\\/form>\\n<\\\/div>\\n\";\n        <\/script>\n        <div id=\"test-drive-app\" class=\"dex_testdrive_turnos container my-5\">\n            <div class=\"row\">\n                <!-- Sidebar de pasos -->\n                <div class=\"col-12 col-md-2\">\n                    <div class=\"dextdbkg--steps-line\">\n                        <div class=\"timeline-block\">\n                            <div class=\"marker marker-step-1 step-active\">1<\/div>\n                        <\/div>\n                        <div class=\"timeline-block\">\n                            <div class=\"marker marker-step-2\">2<\/div>\n                        <\/div>\n                        <div class=\"timeline-block\">\n                            <div class=\"marker marker-step-3\">3<\/div>\n                        <\/div>\n                        <div class=\"timeline-block\">\n                            <div class=\"marker marker-step-4\">4<\/div>\n                        <\/div>\n                    <\/div>\n                <\/div>\n\n                <!-- Contenido din\u00e1mico -->\n                <div class=\"col-12 col-md-10\">\n                    <div id=\"dex-step\" class=\"row\" style=\"justify-content: center;\"><\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div id=\"dex-loading\" style=\"\n            display:none;\n            position:fixed;\n            top:0;\n            left:0;\n            width:100%;\n            max-width:100%;\n            height:100%;\n            background:rgba(255,255,255,0.8);\n            z-index:9999;\n            text-align:center;\n            padding-top:20%;\n            font-size:20px;\n            color:#333;\n            \">\n            <div class=\"spinner\" style=\"\n                border:6px solid #f3f3f3;\n                border-top:6px solid var(--brand-primary);\n                border-radius:50%;\n                width:40px;height:40px;\n                animation: spin 1s linear infinite;\n                margin:auto;\n            \"><\/div>\n            <p>Cargando...<\/p>\n        <\/div>\n\n        <style>\n            @keyframes spin {\n                0% {\n                    transform: rotate(0deg);\n                }\n\n                100% {\n                    transform: rotate(360deg);\n                }\n            }\n        <\/style>\n\n        \n        <script>\n            const WP_NONCE = \"1a28098a7a\";\n        <\/script>\n\n        <script>\n            function showLoading() {\n                document.getElementById('dex-loading').style.display = 'block';\n            }\n\n            function hideLoading() {\n                document.getElementById('dex-loading').style.display = 'none';\n            }\n\n            function irAlTop() {\n                const el = document.getElementById('test-drive-app');\n                if (!el) return;\n\n                const offset = 200; \/\/ \ud83d\udd25 cuanto m\u00e1s grande, m\u00e1s arriba se frena\n\n                const y = el.getBoundingClientRect().top + window.pageYOffset - offset;\n\n                window.scrollTo({\n                    top: y,\n                    behavior: 'smooth'\n                });\n            }\n\n            (function() {\n                const app = document.getElementById('dex-step');\n\n                const MODELOS = {\"225287\":{\"id\":225287,\"title\":\"600 Hybrid\",\"brand\":\"fiat\",\"model\":\"600 Hybrid\",\"version\":\"MHEV\",\"product_code\":\"364B242\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/Fiat-600-jelly-Blanco-Gelatto.png\",\"cantidad\":1,\"unidades\":[{\"vin\":\"ZFA5FBAT7SJ080345\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false},\"225288\":{\"id\":225288,\"title\":\"ARGO Drive MT\",\"brand\":\"fiat\",\"model\":\"ARGO Drive MT\",\"version\":\"Drive MT\",\"product_code\":\"358AF21\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/Argo_Negro_Vulcano.png\",\"cantidad\":4,\"unidades\":[{\"vin\":\"9BD358AF2TYP52440\",\"sucursal\":\"6776\"},{\"vin\":\"9BD358AF2TYP52462\",\"sucursal\":\"127272\"},{\"vin\":\"9BD358AF2TYP51718\",\"sucursal\":\"6776\"},{\"vin\":\"9BD358AF2TYP52164\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false},\"225290\":{\"id\":225290,\"title\":\"CRONOS DRIVE PLUS 1.3 CVT\",\"brand\":\"fiat\",\"model\":\"CRONOS DRIVE PLUS 1.3 CVT\",\"version\":\"DRIVE PLUS 1.3 CVT\",\"product_code\":\"359AFK1\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/Cronos_MY26_drive_CVTpackplus_pretovulcano.png\",\"cantidad\":1,\"unidades\":[{\"vin\":\"8AP359AFKSU392709\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false},\"225292\":{\"id\":225292,\"title\":\"TITANO FREEDOM PLUS AT8 AWD\",\"brand\":\"fiat\",\"model\":\"TITANO FREEDOM PLUS AT8 AWD\",\"version\":\"FREEDOM PLUS AT8 AWD\",\"product_code\":\"5791H63\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/freedom-negro-vulcano.png\",\"cantidad\":1,\"unidades\":[{\"vin\":\"8AP5791H6TU701079\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false},\"225297\":{\"id\":225297,\"title\":\"CRONOS PRECISION CVT\",\"brand\":\"fiat\",\"model\":\"CRONOS PRECISION CVT\",\"version\":\"PRECISION CVT\",\"product_code\":\"359AHK1\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/Cronos_MY26_Precision_pretovulcano.png\",\"cantidad\":3,\"unidades\":[{\"vin\":\"8AP359AHKTU464913\",\"sucursal\":\"6776\"},{\"vin\":\"8AP359AHKTU464799\",\"sucursal\":\"6776\"},{\"vin\":\"9BD376B38TYC37644\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false},\"225298\":{\"id\":225298,\"title\":\"FASTBACK TURBO 270 AT6\",\"brand\":\"fiat\",\"model\":\"FASTBACK TURBO 270 AT6\",\"version\":\"TURBO 270 AT6\",\"product_code\":\"376BM61\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/Fiat-Fastback-Blanco-Banchisa-bicolor-1.png\",\"cantidad\":2,\"unidades\":[{\"vin\":\"9BD376B38RYB68876\",\"sucursal\":\"6776\"},{\"vin\":\"9BD376B38TYC36621\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false},\"225483\":{\"id\":225483,\"title\":\"TORO VOLCANO 2.2TD AT9 4x4\",\"brand\":\"fiat\",\"model\":\"TORO VOLCANO 2.2TD AT9 4x4\",\"version\":\"VOLCANO 2.2TD AT9 4x4\",\"product_code\":\"2265ST2\",\"product_year\":\"2026\",\"image\":\"https:\\\/\\\/centralfiat.dexst.com.ar\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/VolcanoT270-AzulJazz.png\",\"cantidad\":1,\"unidades\":[{\"vin\":\"9882265STTKG75720\",\"sucursal\":\"6776\"}],\"estado\":\"activado\",\"propio\":false}};\n                const SUCURSALES = [{\"nombre\":\"Mar del Plata\",\"telefonos\":[{\"nombre\":\"Ventas\",\"numero\":\"(0223) 462-1200\",\"numero_visible\":\"\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"},{\"nombre\":\"WhatsApp (Ivo)\",\"numero\":\"92236336604\",\"numero_visible\":\"(2236) 33-6604\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"},{\"nombre\":\"WhatsApp (Ignacio)\",\"numero\":\"92235198815\",\"numero_visible\":\"(2235) 19-8815\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Ventas:  Lunes a Viernes de 9.00 a 18.00 hs  S\\u00e1bados 9.00 a 12.30 hs  |  Administraci\\u00f3n:  Lunes a Viernes de 8.30 a 16.30 hs<\\\/p>\\n\",\"direccion\":\"Av. Juan B. Justo 3457 - Mar del Plata, Buenos Aires\",\"latitud\":\"-57.5754933\",\"longitud\":\"-38.0168992\",\"id\":6776,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"infofiatgiama@giama.com.ar\"},{\"nombre\":\"PostVenta Mar del Plata\",\"telefonos\":[{\"nombre\":\"Servicios Programados <br> WhatsApp\",\"numero\":\"92235056433\",\"numero_visible\":\"(2235) 05-6433\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"},{\"nombre\":\"Post Venta\",\"numero\":\"0810-222-1030\",\"numero_visible\":\"\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Lunes a Viernes de 8.00 a 17.00 hs<\\\/p>\\n\",\"direccion\":\"Garay 6255 - Mar del Plata, Buenos Aires\",\"latitud\":\"-57.5930814\",\"longitud\":\"-37.9896212\",\"id\":6775,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"postventa@giama.com.ar\"},{\"nombre\":\"Repuestos Mar del Plata\",\"telefonos\":[{\"nombre\":\"WhatsApp (Repuestos)\",\"numero\":\"92233447064\",\"numero_visible\":\"(2233) 44-7064\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Lunes a Viernes de 8.00 a 17.00 hs<\\\/p>\\n\",\"direccion\":\"Champagnat 2745 - Mar del Plata, Buenos Aires\",\"latitud\":\"-57.5923059\",\"longitud\":\"-37.9892931\",\"id\":6774,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"postventa@giama.com.ar, repuestos@giama.com.ar\"},{\"nombre\":\"Pinamar Ventas\",\"telefonos\":[{\"nombre\":\"Whatsapp (Diego)\",\"numero\":\"92235896926\",\"numero_visible\":\"(2235) 89-6926\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"},{\"nombre\":\"Ventas\",\"numero\":\"02254409393\",\"numero_visible\":\"\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Ventas: Lunes a Viernes &#8211; 8.00 a 17.00 hs y Sa\\u0301bados &#8211; 9.30 a 12.30 hs | Administracio\\u0301n: Lunes a Viernes &#8211;\\u00a08.00\\u00a0a\\u00a017.00hs<\\\/p>\\n\",\"direccion\":\"RP11 5 kilo\\u0301metro 396, Pinamar\",\"latitud\":\"-56.87038161940872\",\"longitud\":\"-37.082599537790884\",\"id\":127272,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"infofiatgiama@giama.com.ar, info@giama.com.ar\"},{\"nombre\":\"Postventa Pinamar\",\"telefonos\":[{\"nombre\":\"Ventas y PostVenta\",\"numero\":\"(02254) 409393 \",\"numero_visible\":\"(02254) 409393 \",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"},{\"nombre\":\"WhatsApp\",\"numero\":\"92236915102\",\"numero_visible\":\"(2236) 91-5102\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Ventas:  Lunes a Viernes de 8.30 a 18.00 hs  S\\u00e1bados 9.00 a 12.30 hs | Administraci\\u00f3n: Lunes a Viernes de 8.00 a 13.00 hs y de 14.00 a 17.00 hs | Postventa Taller: Lunes a Viernes de 8.00 a 13.00 hs y de 14.00 a 17.00 hs<\\\/p>\\n\",\"direccion\":\"Ruta 11 Km 396 - Pinamar, Buenos Aires\",\"latitud\":\"-56.9103628\",\"longitud\":\"-37.1298824\",\"id\":6773,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"postventapinamar@giama.com.ar\"}];\n                const CONFIG = {\n                    diasDisponibles: [\"lunes\",\"martes\",\"mi\\u00e9rcoles\",\"jueves\",\"viernes\"],\n                    horaInicio: '09:00',\n                    horaFin: '19:00',\n                    intervalo: 30,\n                    diasBloqueados: 2                };\n\n                let step = 1;\n\n                function updateStepIndicator(step) {\n                    \/\/ Quitar la clase activa de todos los marcadores\n                    document.querySelectorAll('.marker').forEach(m => m.classList.remove('step-active'));\n\n                    \/\/ Agregar la clase activa al marcador correspondiente\n                    const active = document.querySelector(`.marker-step-${step}`);\n                    if (active) {\n                        active.classList.add('step-active');\n                    }\n                }\n\n                function attachStepNavigation() {\n                    document.querySelectorAll('.marker').forEach(marker => {\n                        marker.addEventListener('click', () => {\n                            \/\/ Detectar el n\u00famero del circulito\n                            const stepClicked = parseInt(marker.textContent.trim(), 10);\n\n                            \/\/ Solo permitir si es menor al step actual (volver atr\u00e1s)\n                            if (stepClicked < step) {\n                                step = stepClicked;\n                                switch (step) {\n                                    case 1:\n                                        renderStep1();\n                                        break;\n                                    case 2:\n                                        renderStep2();\n                                        break;\n                                    case 3:\n                                        renderStep3();\n                                        break;\n                                    case 4:\n                                        renderStep4();\n                                        break;\n                                }\n                            }\n                        });\n                    });\n                }\n\n                function renderStep1() {\n                    updateStepIndicator(1);\n\n                    const sucursales = [{\"nombre\":\"Mar del Plata\",\"telefonos\":[{\"nombre\":\"Ventas\",\"numero\":\"(0223) 462-1200\",\"numero_visible\":\"\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"},{\"nombre\":\"WhatsApp (Ivo)\",\"numero\":\"92236336604\",\"numero_visible\":\"(2236) 33-6604\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"},{\"nombre\":\"WhatsApp (Ignacio)\",\"numero\":\"92235198815\",\"numero_visible\":\"(2235) 19-8815\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Ventas:  Lunes a Viernes de 9.00 a 18.00 hs  S\\u00e1bados 9.00 a 12.30 hs  |  Administraci\\u00f3n:  Lunes a Viernes de 8.30 a 16.30 hs<\\\/p>\\n\",\"direccion\":\"Av. Juan B. Justo 3457 - Mar del Plata, Buenos Aires\",\"latitud\":\"-57.5754933\",\"longitud\":\"-38.0168992\",\"id\":6776,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"infofiatgiama@giama.com.ar\"},{\"nombre\":\"PostVenta Mar del Plata\",\"telefonos\":[{\"nombre\":\"Servicios Programados <br> WhatsApp\",\"numero\":\"92235056433\",\"numero_visible\":\"(2235) 05-6433\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"},{\"nombre\":\"Post Venta\",\"numero\":\"0810-222-1030\",\"numero_visible\":\"\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Lunes a Viernes de 8.00 a 17.00 hs<\\\/p>\\n\",\"direccion\":\"Garay 6255 - Mar del Plata, Buenos Aires\",\"latitud\":\"-57.5930814\",\"longitud\":\"-37.9896212\",\"id\":6775,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"postventa@giama.com.ar\"},{\"nombre\":\"Repuestos Mar del Plata\",\"telefonos\":[{\"nombre\":\"WhatsApp (Repuestos)\",\"numero\":\"92233447064\",\"numero_visible\":\"(2233) 44-7064\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Lunes a Viernes de 8.00 a 17.00 hs<\\\/p>\\n\",\"direccion\":\"Champagnat 2745 - Mar del Plata, Buenos Aires\",\"latitud\":\"-57.5923059\",\"longitud\":\"-37.9892931\",\"id\":6774,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"postventa@giama.com.ar, repuestos@giama.com.ar\"},{\"nombre\":\"Pinamar Ventas\",\"telefonos\":[{\"nombre\":\"Whatsapp (Diego)\",\"numero\":\"92235896926\",\"numero_visible\":\"(2235) 89-6926\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"},{\"nombre\":\"Ventas\",\"numero\":\"02254409393\",\"numero_visible\":\"\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Ventas: Lunes a Viernes &#8211; 8.00 a 17.00 hs y Sa\\u0301bados &#8211; 9.30 a 12.30 hs | Administracio\\u0301n: Lunes a Viernes &#8211;\\u00a08.00\\u00a0a\\u00a017.00hs<\\\/p>\\n\",\"direccion\":\"RP11 5 kilo\\u0301metro 396, Pinamar\",\"latitud\":\"-56.87038161940872\",\"longitud\":\"-37.082599537790884\",\"id\":127272,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"infofiatgiama@giama.com.ar, info@giama.com.ar\"},{\"nombre\":\"Postventa Pinamar\",\"telefonos\":[{\"nombre\":\"Ventas y PostVenta\",\"numero\":\"(02254) 409393 \",\"numero_visible\":\"(02254) 409393 \",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"No\",\"texto_whatasapp\":\"\"},{\"nombre\":\"WhatsApp\",\"numero\":\"92236915102\",\"numero_visible\":\"(2236) 91-5102\",\"has_internal_number\":false,\"internal_number\":\"\",\"telefono_whatsapp_sucursal\":\"Si\",\"texto_whatasapp\":\"\"}],\"horario\":\"<p>Ventas:  Lunes a Viernes de 8.30 a 18.00 hs  S\\u00e1bados 9.00 a 12.30 hs | Administraci\\u00f3n: Lunes a Viernes de 8.00 a 13.00 hs y de 14.00 a 17.00 hs | Postventa Taller: Lunes a Viernes de 8.00 a 13.00 hs y de 14.00 a 17.00 hs<\\\/p>\\n\",\"direccion\":\"Ruta 11 Km 396 - Pinamar, Buenos Aires\",\"latitud\":\"-56.9103628\",\"longitud\":\"-37.1298824\",\"id\":6773,\"facebook_sucursal\":\"\",\"instagram_sucursal\":\"\",\"correos_sucursal\":\"postventapinamar@giama.com.ar\"}] || [];\n\n                    \/\/ \ud83d\udea8 Si no hay modelos, mostrar aviso general\n                    if (!MODELOS || Object.keys(MODELOS).length === 0) {\n                        app.innerHTML = `\n                        <div class=\"notice notice-warning text-center my-4\" \n                            style=\"width: 100%;background: #e5e5e5;padding: 2rem;border-radius: 24px;text-transform: uppercase;\">\n                            <p>\u26a0\ufe0f No hay modelos para mostrar<\/p>\n                        <\/div>\n                    `;\n                        return;\n                    }\n\n                    const cards = Object.values(MODELOS).map(m => {\n                        let sucursal = null;\n                        let sucursal_id = (m.unidades && m.unidades.length > 0) ? m.unidades[0].sucursal : null;\n\n                        if (sucursal_id) {\n                            sucursal = sucursales.find(s => s.id == sucursal_id);\n                        }\n                        if (!sucursal && sucursales.length > 0) {\n                            sucursal = sucursales[0];\n                        }\n\n                        const sucursalNombre = sucursal ? sucursal.nombre : 'Sucursal no definida';\n                        const sucursalDireccion = sucursal ? sucursal.direccion : '';\n\n                        return `\n                    <article class=\"col-12 col-md-6 text-center\">\n                        <div class=\"dtdt--model-item\">\n                            <div class=\"dtdt--model-image\" style=\"text-align: center;\">\n                                <img decoding=\"async\" src=\"${m.image}\" alt=\"${m.title}\" loading=\"lazy\">\n                                <small style=\"color: gray;font-style: italic;\">Imagen a modo ilustrativo. Color sujeto a stock<\/small>\n                            <\/div>\n                            <div class=\"dtdt--model-title\">\n                                <span><strong>${m.title}<\/strong><\/span>\n                            <\/div>                           \n                            <div class=\"dtdt--model-button\">\n                                <button \n                                    data-id=\"${m.id}\" \n                                    data-nombre=\"${m.title}\" \n                                    data-sucursal-id=\"${sucursal ? sucursal.id : ''}\"\n                                    data-sucursal-nombre=\"${sucursalNombre}\"\n                                    data-sucursal-direccion=\"${sucursalDireccion}\"\n                                    class=\"dex-select-model my-4\">\n                                    <span>Seleccionar<\/span>\n                                <\/button>\n                            <\/div>\n                        <\/div>\n                    <\/article>\n                    `;\n                    }).join('');\n\n                    app.innerHTML = cards;\n\n                    attachStepNavigation();\n\n                    app.querySelectorAll('.dex-select-model').forEach(btn => {\n                        btn.addEventListener('click', () => {\n                            \/\/ Guardar en sessionStorage\n                            sessionStorage.setItem('modelo_id', btn.dataset.id);\n                            sessionStorage.setItem('modelo_nombre', btn.dataset.nombre);\n                            sessionStorage.setItem('sucursal_id', btn.dataset.sucursalId);\n                            sessionStorage.setItem('sucursal_nombre', btn.dataset.sucursalNombre);\n                            sessionStorage.setItem('sucursal_direccion', btn.dataset.sucursalDireccion);\n\n                            \/\/ \ud83d\ude80 Push al dataLayer (GA4-friendly)\n                            window.dataLayer = window.dataLayer || [];\n                            window.dataLayer.push({\n                                event: 'select_model',\n                                modelo_id: btn.dataset.id,\n                                modelo_nombre: btn.dataset.nombre,\n                                sucursal_id: btn.dataset.sucursalId,\n                                sucursal_nombre: btn.dataset.sucursalNombre,\n                                sucursal_direccion: btn.dataset.sucursalDireccion,\n                                step: 1\n                            });\n\n                            \/\/ Avanzar al paso 2\n                            step = 2;\n                            irAlTop();\n                            renderStep2();\n                        });\n                    });\n                }\n\n                function renderStep2() {\n                    updateStepIndicator(2);\n                    showLoading();\n\n                    const modeloId = sessionStorage.getItem('modelo_id');\n                    const modeloNombre = sessionStorage.getItem('modelo_nombre');\n\n                    \/\/ \ud83d\udc47 primero traemos datos del modelo (incluyendo imagen desde DB)\n                    fetch(`${API_BASE}modelo?id=${modeloId}&_dex_nonce=${WP_NONCE}`)\n                        .then(res => {\n                            if (!res.ok) throw new Error('Error en modelo');\n                            return res.json();\n                        })\n                        .then(modeloData => {\n\n                            const modeloImagen = modeloData.imagen;\n\n                            \/\/ luego traemos sucursales\n                            fetch(`${API_BASE}sucursales?modelo_id=${modeloId}&_dex_nonce=${WP_NONCE}`)\n                                .then(res => {\n                                    if (!res.ok) throw new Error('Error en sucursales');\n                                    return res.json();\n                                })\n                                .then(data => {\n\n                                    const sucursalesHTML = data.map(s => `\n                                    <button class=\"w-100 mb-3 dex-select-branch\" \n                                            data-id=\"${s.id}\" \n                                            data-nombre=\"${s.nombre}\" \n                                            data-direccion=\"${s.direccion}\">\n                                        <span>\n                                            <strong style=\"display:inline-flex;align-items:center;gap:4px;\">\n                                                <img decoding=\"async\" src=\"${window.location.origin}\/wp-content\/plugins\/dextdv-concesionario\/public\/img\/map-pin.svg\" \n                                                    alt=\"Icon Map\" style=\"width:16px;height:16px;\">\n                                                ${s.nombre}\n                                            <\/strong><br>\n                                            ${s.direccion}\n                                        <\/span>\n                                    <\/button>\n                                `).join('');\n\n                                    app.innerHTML = `\n                                    <div class=\"container\">\n                                        <div class=\"row\">\n                                            <div class=\"col-12 col-md-6\">\n                                                <div class=\"dtdt--model-list\">\n                                                    <article class=\"dtdt--model-item\">\n                                                        <div class=\"dtdt--model-title\">\n                                                            <span><strong>${modeloNombre}<\/strong><\/span>\n                                                        <\/div>\n                                                        <div class=\"dtdt--model-image\" style=\"text-align: center;\">\n                                                            <img decoding=\"async\" src=\"${modeloImagen}\" alt=\"${modeloNombre}\" loading=\"lazy\">\n                                                            <small style=\"color: gray;font-style: italic;\">\n                                                                Imagen a modo ilustrativo. Color sujeto a stock\n                                                            <\/small>\n                                                        <\/div>\n                                                    <\/article>\n                                                <\/div>\n                                            <\/div>\n                                            <div class=\"col-12 col-md-6\">\n                                                <ul class=\"dextdbkg--form--location p-0\">\n                                                    ${sucursalesHTML || '<li>No hay sucursales disponibles<\/li>'}\n                                                <\/ul>\n                                            <\/div>\n                                        <\/div>\n                                    <\/div>\n                                `;\n\n                                    attachStepNavigation();\n                                    hideLoading();\n\n                                    document.querySelectorAll('.dex-select-branch').forEach(btn => {\n                                        btn.addEventListener('click', () => {\n\n                                            sessionStorage.setItem('sucursal_id', btn.dataset.id);\n                                            sessionStorage.setItem('sucursal_nombre', btn.dataset.nombre);\n                                            sessionStorage.setItem('sucursal_direccion', btn.dataset.direccion);\n\n                                            window.dataLayer = window.dataLayer || [];\n                                            window.dataLayer.push({\n                                                event: 'select_branch',\n                                                modelo_id: modeloId,\n                                                modelo_nombre: modeloNombre,\n                                                sucursal_id: btn.dataset.id,\n                                                sucursal_nombre: btn.dataset.nombre,\n                                                sucursal_direccion: btn.dataset.direccion,\n                                                step: 2\n                                            });\n\n                                            step = 3;\n                                            irAlTop();\n                                            renderStep3();\n                                        });\n                                    });\n\n                                });\n                        })\n                        .catch(error => {\n                            console.error(error);\n                            hideLoading();\n                            app.innerHTML = '<p>Error cargando datos.<\/p>';\n                        });\n                }\n\n                function renderStep3() {\n                    updateStepIndicator(3);\n                    showLoading();\n\n                    const modeloId = sessionStorage.getItem('modelo_id');\n                    const modeloNombre = sessionStorage.getItem('modelo_nombre');\n\n                    \/\/ \ud83d\udc47 traemos imagen del modelo\n                    fetch(`${API_BASE}modelo?id=${modeloId}&_dex_nonce=${WP_NONCE}`)\n                        .then(res => {\n                            if (!res.ok) throw new Error('Error en modelo');\n                            return res.json();\n                        })\n                        .then(modeloData => {\n\n                            const modeloImagen = modeloData.imagen;\n\n                            app.innerHTML = `\n                            <div class=\"container\">\n                                <div class=\"col-12\">\n                                    <div class=\"row\">\n                                        <div class=\"col-12 col-md-6\">\n                                            <div class=\"dtdt--model-list\">\n                                                <article class=\"dtdt--model-item\">\n                                                    <div class=\"dtdt--model-title\">\n                                                        <span><strong>${modeloNombre}<\/strong><\/span>\n                                                    <\/div>\n                                                    <div class=\"dtdt--model-image\" style=\"text-align: center;\">\n                                                        <img decoding=\"async\" src=\"${modeloImagen}\" alt=\"${modeloNombre}\" loading=\"lazy\">\n                                                        <small style=\"color: gray;font-style: italic;\">\n                                                            Imagen a modo ilustrativo. Color sujeto a stock\n                                                        <\/small>\n                                                    <\/div>\n                                                <\/article>\n                                            <\/div>\n                                        <\/div>\n                                        <div class=\"col-12 col-md-6\">\n                                            <div style=\"margin-bottom:8px;\">\n                                                <input type=\"text\" id=\"dex-fecha\" placeholder=\"Eleg\u00ed una fecha\" style=\"min-width:280px;display:none\">\n                                            <\/div>\n                                            <div style=\"margin-bottom:8px;\">\n                                                <select id=\"dex-hora\" disabled>\n                                                    <option value=\"\">Seleccion\u00e1 un d\u00eda primero<\/option>\n                                                <\/select>\n                                            <\/div>\n                                            <button id=\"dex-continue-3\" disabled><span>Continuar<\/span><\/button>\n                                            <div id=\"dex-warn\" style=\"color:#c00; margin-top:8px;\"><\/div>\n                                        <\/div>\n                                    <\/div>\n                                <\/div>\n                            <\/div>\n                        `;\n\n                            attachStepNavigation();\n                            hideLoading();\n\n                            flatpickr(\"#dex-fecha\", {\n                                dateFormat: \"Y-m-d\",\n                                inline: true,\n                                minDate: \"today\",\n                                locale: \"es\",\n                                disable: [\n                                    function(date) {\n                                        const dias = ['domingo', 'lunes', 'martes', 'mi\u00e9rcoles', 'jueves', 'viernes', 's\u00e1bado'];\n                                        const nombre = dias[date.getDay()];\n                                        const bloqueo = BLOQUEO_DE_DIAS;\n                                        const hoy = new Date();\n                                        hoy.setHours(0, 0, 0, 0);\n\n                                        const diff = Math.floor((date - hoy) \/ (1000 * 60 * 60 * 24));\n\n                                        if (diff >= 0 && diff < bloqueo) {\n                                            return true;\n                                        }\n\n                                        return !CONFIG.diasDisponibles.includes(nombre);\n                                    }\n                                ],\n                                onChange: function(selectedDates, dateStr) {\n\n                                    const horaSelect = document.getElementById('dex-hora');\n                                    const btn = document.getElementById('dex-continue-3');\n\n                                    const sucursalId = sessionStorage.getItem('sucursal_id');\n\n                                    const params = new URLSearchParams({\n                                        modelo_id: modeloId,\n                                        sucursal_id: sucursalId,\n                                        fecha: dateStr,\n                                        _dex_nonce: WP_NONCE\n                                    });\n\n                                    sessionStorage.setItem('fecha', dateStr);\n\n                                    const url = `${API_BASE}horarios?${params.toString()}`;\n\n                                    fetch(url)\n                                        .then(res => {\n                                            if (!res.ok) throw new Error('Error en horarios');\n                                            return res.json();\n                                        })\n                                        .then(data => {\n\n                                            if (data.slots && data.slots.length > 0) {\n\n                                                const opciones = data.slots\n                                                    .filter(slot => slot.libres && slot.libres.length > 0)\n                                                    .map(slot => `\n                                                    <option value=\"${slot.hora}\" \n                                                            data-vins='${JSON.stringify(slot.libres)}'>\n                                                        ${slot.hora}\n                                                    <\/option>\n                                                `)\n                                                    .join('');\n\n                                                if (opciones) {\n                                                    horaSelect.innerHTML = opciones;\n                                                    horaSelect.disabled = false;\n                                                    btn.disabled = false;\n                                                } else {\n                                                    horaSelect.innerHTML = `<option value=\"\">No hay turnos disponibles<\/option>`;\n                                                    horaSelect.disabled = true;\n                                                    btn.disabled = true;\n                                                }\n\n                                            } else {\n                                                horaSelect.innerHTML = `<option value=\"\">No hay turnos disponibles<\/option>`;\n                                                horaSelect.disabled = true;\n                                                btn.disabled = true;\n                                            }\n                                        })\n                                        .catch(error => {\n                                            console.error(error);\n                                            horaSelect.innerHTML = `<option value=\"\">Error cargando horarios<\/option>`;\n                                            horaSelect.disabled = true;\n                                            btn.disabled = true;\n                                        });\n                                }\n                            });\n\n                            document.getElementById('dex-continue-3').addEventListener('click', () => {\n\n                                const sel = document.getElementById('dex-hora');\n                                const h = sel.value;\n                                if (!h) return;\n\n                                const vins = JSON.parse(sel.options[sel.selectedIndex].dataset.vins);\n\n                                sessionStorage.setItem('hora', h);\n                                sessionStorage.setItem('vin_libres', JSON.stringify(vins));\n\n                                const sucursalId = sessionStorage.getItem('sucursal_id');\n                                const sucursalNom = sessionStorage.getItem('sucursal_nombre');\n                                const sucursalDir = sessionStorage.getItem('sucursal_direccion');\n                                const fecha = sessionStorage.getItem('fecha');\n\n                                window.dataLayer = window.dataLayer || [];\n                                window.dataLayer.push({\n                                    event: 'select_datetime',\n                                    modelo_id: modeloId,\n                                    modelo_nombre: modeloNombre,\n                                    sucursal_id: sucursalId,\n                                    sucursal_nombre: sucursalNom,\n                                    sucursal_direccion: sucursalDir,\n                                    fecha: fecha,\n                                    hora: h,\n                                    step: 3\n                                });\n\n                                step = 4;\n                                irAlTop();\n                                renderStep4();\n                            });\n                        })\n                        .catch(error => {\n                            console.error(error);\n                            hideLoading();\n                            app.innerHTML = '<p>Error cargando datos.<\/p>';\n                        });\n                }\n\n                function renderStep4() {\n                    updateStepIndicator(4);\n                    showLoading();\n\n                    const modeloId = sessionStorage.getItem('modelo_id');\n                    const modeloNombre = sessionStorage.getItem('modelo_nombre');\n\n                    fetch(`${API_BASE}modelo?id=${modeloId}&_dex_nonce=${WP_NONCE}`)\n                        .then(res => {\n                            if (!res.ok) throw new Error('Error cargando modelo');\n                            return res.json();\n                        })\n                        .then(modeloData => {\n\n                            const modeloImagen = modeloData.imagen;\n\n                            app.innerHTML = `\n                            <div class=\"container\">\n                                <div class=\"row\">\n                                    <div class=\"col-12 col-md-6\">\n                                        <div class=\"dtdt--model-list\">\n                                            <article class=\"dtdt--model-item\">\n                                                <div class=\"dtdt--model-title\">\n                                                    <span><strong>${modeloNombre}<\/strong><\/span>\n                                                <\/div>\n                                                <div class=\"dtdt--model-image\">\n                                                    <img decoding=\"async\" src=\"${modeloImagen}\" alt=\"${modeloNombre}\">\n                                                <\/div>\n                                            <\/article>\n                                        <\/div>\n                                    <\/div>\n                                    <div class=\"col-12 col-md-6\">\n                                        ${FORMULARIO_HTML}\n                                        <div id=\"dex-result\" style=\"margin-top:10px;\"><\/div>\n                                    <\/div>\n                                <\/div>\n                            <\/div>\n                        `;\n\n                            attachStepNavigation();\n                            hideLoading();\n\n                            const form = app.querySelector('.wpcf7 form.wpcf7-form') || app.querySelector('form.wpcf7-form');\n                            const result = document.getElementById('dex-result');\n\n                            if (!form) {\n                                result.innerHTML = `<div style=\"color:#c00;\">No se encontr\u00f3 el formulario.<\/div>`;\n                                return;\n                            }\n\n                            \/\/ \ud83d\udd12 Bloqueo total CF7\n                            form.addEventListener('submit', function(e) {\n                                e.preventDefault();\n                                e.stopImmediatePropagation();\n                            }, true);\n\n                            const submitBtn = form.querySelector('input[type=\"submit\"], button.wpcf7-submit');\n\n                            if (submitBtn) submitBtn.type = 'button';\n\n                            const handleSend = () => {\n\n                                \/\/ Validaci\u00f3n HTML5\n                                if (!form.checkValidity()) {\n                                    const fakeSubmit = document.createElement('button');\n                                    fakeSubmit.type = 'submit';\n                                    fakeSubmit.style.display = 'none';\n                                    form.appendChild(fakeSubmit);\n                                    fakeSubmit.click();\n                                    form.removeChild(fakeSubmit);\n                                    return;\n                                }\n\n                                const vin_libres = JSON.parse(sessionStorage.getItem('vin_libres') || '[]');\n                                const vin = vin_libres.length > 0 ? vin_libres[0] : null;\n\n                                if (!vin) {\n                                    result.innerHTML = `<div style=\"color:#c00;\">No hay unidades disponibles en este horario.<\/div>`;\n                                    return;\n                                }\n\n                                const fd = new FormData(form);\n\n                                const payload = {\n                                    _dex_nonce: WP_NONCE,\n                                    modelo_id: modeloId,\n                                    modelo_nombre: modeloNombre,\n                                    sucursal_id: sessionStorage.getItem('sucursal_id'),\n                                    sucursal_nombre: sessionStorage.getItem('sucursal_nombre'),\n                                    sucursal_direccion: sessionStorage.getItem('sucursal_direccion'),\n                                    fecha: sessionStorage.getItem('fecha'),\n                                    hora: sessionStorage.getItem('hora'),\n                                    vin: vin,\n                                    nombre: fd.get('nombre') || '',\n                                    apellido: fd.get('apellido') || '',\n                                    telefono: fd.get('telefono') || '',\n                                    email: fd.get('email') || '',\n                                    licencia: fd.getAll('licencia[]').length > 0,\n                                    comentario: fd.get('comentario') || ''\n                                };\n\n                                if (submitBtn) {\n                                    submitBtn.disabled = true;\n                                    submitBtn.dataset.originalValue = submitBtn.value;\n                                    submitBtn.value = 'Enviando...';\n                                }\n\n                                fetch(`${API_BASE}solicitud`, {\n                                        method: 'POST',\n                                        headers: {\n                                            'Content-Type': 'application\/json'\n                                        },\n                                        body: JSON.stringify(payload)\n                                    })\n                                    .then(res => {\n                                        if (!res.ok) throw new Error('Error en la solicitud');\n                                        return res.json();\n                                    })\n                                    .then(data => {\n\n                                        if (data && data.status === 'ok') {\n\n                                            form.style.display = 'none';\n\n                                            result.innerHTML = `\n                                        <div style=\"border:2px solid var(--brand-primary); padding:20px; border-radius:8px; background:#f5faff;\">\n                                            <h3 style=\"color:var(--brand-primary);text-align:center\">\ud83c\udf89 \u00a1Felicidades!<\/h3>\n                                            <p><strong>Turno ID #${data.turno_id}<\/strong><\/p>\n                                            <p><strong>Fecha:<\/strong> ${payload.fecha}<\/p>\n                                            <p><strong>Hora:<\/strong> ${payload.hora}<\/p>\n                                            <p><strong>VIN asignado:<\/strong> ${payload.vin}<\/p>\n                                            <p><strong>Servicio:<\/strong> ${payload.modelo_nombre}<\/p>\n                                            <p><strong>Ubicaci\u00f3n:<\/strong> ${payload.sucursal_direccion}<\/p>\n                                            <p><strong>Nombre:<\/strong> ${payload.nombre} ${payload.apellido}<\/p>\n                                            <p><strong>Email:<\/strong> ${payload.email}<\/p>\n                                            <p><strong>Tel\u00e9fono:<\/strong> ${payload.telefono}<\/p>\n                                        <\/div>\n                                    `;\n\n                                            \/\/ \ud83d\ude80 GA4 push completo original\n                                            window.dataLayer = window.dataLayer || [];\n                                            window.dataLayer.push({\n                                                event: 'booking_completed',\n                                                turno_id: data.turno_id,\n                                                modelo_id: payload.modelo_id,\n                                                modelo_nombre: payload.modelo_nombre,\n                                                sucursal_id: payload.sucursal_id,\n                                                sucursal_nombre: payload.sucursal_nombre,\n                                                sucursal_direccion: payload.sucursal_direccion,\n                                                fecha: payload.fecha,\n                                                hora: payload.hora,\n                                                vin: payload.vin,\n                                                licencia: payload.licencia,\n                                                comentario: payload.comentario,\n                                                step: 4\n                                            });\n\n                                            window.dataLayer = window.dataLayer || [];\n                                            dataLayer.push({\n                                                event: \"generate_lead\",\n                                                contact_reason: \"test-drive\"\n                                            });\n\n                                            \/\/ Obtener slug de la p\u00e1gina\n                                            const slug = window.location.pathname\n                                                .replace(\/^\\\/|\\\/$\/g, '') \/\/ quita \/ del inicio y final\n                                                .split('\/').pop(); \/\/ toma el \u00faltimo segmento\n\n                                            \/\/ Evento solo si es landing\n                                            if (document.body.classList.contains('landings-template-template-landing7')) {\n                                                window.dataLayer = window.dataLayer || [];\n                                                window.dataLayer.push({\n                                                    event: \"landing_test_drive\",\n                                                    turno_id: data.turno_id,\n                                                    contact_reason: slug\n                                                });\n                                            }\n\n                                        } else {\n                                            throw new Error(data.message || 'Ocurri\u00f3 un error al enviar.');\n                                        }\n\n                                    })\n                                    .catch(err => {\n\n                                        result.innerHTML = `<div style=\"color:#c00;\">${err.message}<\/div>`;\n\n                                        if (submitBtn) {\n                                            submitBtn.disabled = false;\n                                            submitBtn.value = submitBtn.dataset.originalValue || 'Enviar solicitud';\n                                        }\n                                    });\n                            };\n\n                            if (submitBtn) {\n                                submitBtn.addEventListener('click', handleSend);\n                            } else {\n                                form.addEventListener('keydown', (e) => {\n                                    if (e.key === 'Enter') {\n                                        e.preventDefault();\n                                        e.stopImmediatePropagation();\n                                        handleSend();\n                                    }\n                                });\n                            }\n                        })\n                        .catch(error => {\n                            console.error(error);\n                            hideLoading();\n                            app.innerHTML = '<p>Error cargando datos.<\/p>';\n                        });\n                }\n\n                renderStep1();\n\n            })();\n        <\/script>\n    \n","protected":false},"excerpt":{"rendered":"<p>Solicitud de Test Drive<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-vacio.php","meta":{"_joinchat":[],"footnotes":""},"class_list":["post-6864","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Solicitud de Test Drive - GIAMA MAR DEL PLATA<\/title>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Solicitud de Test Drive - GIAMA MAR DEL PLATA\" \/>\n<meta property=\"og:description\" content=\"Solicitud de Test Drive\" \/>\n<meta property=\"og:url\" content=\"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/\" \/>\n<meta property=\"og:site_name\" content=\"GIAMA MAR DEL PLATA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GiamaAutos\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-03T15:46:38+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/giamafiat.com.ar\\\/mardelplata\\\/test-drive\\\/\",\"url\":\"https:\\\/\\\/giamafiat.com.ar\\\/mardelplata\\\/test-drive\\\/\",\"name\":\"Solicitud de Test Drive - GIAMA MAR DEL PLATA\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/#website\"},\"datePublished\":\"2023-06-16T16:10:20+00:00\",\"dateModified\":\"2026-03-03T15:46:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/giamafiat.com.ar\\\/mardelplata\\\/test-drive\\\/#breadcrumb\"},\"inLanguage\":\"es-AR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/giamafiat.com.ar\\\/mardelplata\\\/test-drive\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/giamafiat.com.ar\\\/mardelplata\\\/test-drive\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Inicio\",\"item\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Solicitud de Test Drive\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/#website\",\"url\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/\",\"name\":\"GIAMA MAR DEL PLATA\",\"description\":\"Concesionario Oficial Fiat\",\"publisher\":{\"@id\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es-AR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/#organization\",\"name\":\"Giama\",\"url\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es-AR\",\"@id\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/Fiat-Logo.png\",\"contentUrl\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/Fiat-Logo.png\",\"width\":3840,\"height\":2160,\"caption\":\"Giama\"},\"image\":{\"@id\":\"https:\\\/\\\/fiat19.dexst.com.ar\\\/mardelplata\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GiamaAutos\\\/\",\"https:\\\/\\\/www.instagram.com\\\/giama_fiat\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Solicitud de Test Drive - GIAMA MAR DEL PLATA","robots":{"index":"noindex","follow":"follow"},"og_locale":"es_ES","og_type":"article","og_title":"Solicitud de Test Drive - GIAMA MAR DEL PLATA","og_description":"Solicitud de Test Drive","og_url":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/","og_site_name":"GIAMA MAR DEL PLATA","article_publisher":"https:\/\/www.facebook.com\/GiamaAutos\/","article_modified_time":"2026-03-03T15:46:38+00:00","twitter_card":"summary_large_image","twitter_misc":{"Tiempo de lectura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/","url":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/","name":"Solicitud de Test Drive - GIAMA MAR DEL PLATA","isPartOf":{"@id":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/#website"},"datePublished":"2023-06-16T16:10:20+00:00","dateModified":"2026-03-03T15:46:38+00:00","breadcrumb":{"@id":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/#breadcrumb"},"inLanguage":"es-AR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/giamafiat.com.ar\/mardelplata\/test-drive\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Inicio","item":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/"},{"@type":"ListItem","position":2,"name":"Solicitud de Test Drive"}]},{"@type":"WebSite","@id":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/#website","url":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/","name":"GIAMA MAR DEL PLATA","description":"Concesionario Oficial Fiat","publisher":{"@id":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es-AR"},{"@type":"Organization","@id":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/#organization","name":"Giama","url":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/","logo":{"@type":"ImageObject","inLanguage":"es-AR","@id":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/#\/schema\/logo\/image\/","url":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/wp-content\/uploads\/2022\/05\/Fiat-Logo.png","contentUrl":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/wp-content\/uploads\/2022\/05\/Fiat-Logo.png","width":3840,"height":2160,"caption":"Giama"},"image":{"@id":"https:\/\/fiat19.dexst.com.ar\/mardelplata\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GiamaAutos\/","https:\/\/www.instagram.com\/giama_fiat\/"]}]}},"_links":{"self":[{"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/pages\/6864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/comments?post=6864"}],"version-history":[{"count":4,"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/pages\/6864\/revisions"}],"predecessor-version":[{"id":134480,"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/pages\/6864\/revisions\/134480"}],"wp:attachment":[{"href":"https:\/\/giamafiat.com.ar\/mardelplata\/wp-json\/wp\/v2\/media?parent=6864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}