{"title":"Promozione speciale","description":"","products":[{"product_id":"fruity-toothpaste-clean-teeth","title":"GlorySmile® FruitPaste 6 Flavors","description":"\u003cp\u003e\u003cstrong\u003eGlorySmile Fruity Toothpaste\u003c\/strong\u003e \u003cspan\u003ewith\u003c\/span\u003e \u003cspan\u003eFluoride+ offers deep cleaning, gentle whitening, and a fresh, exotic flavor: it removes plaque, prevents cavities, and makes oral hygiene a daily pleasure. Perfect for those who hate strong menthol flavors and are looking for \u003cstrong\u003edeep cleaning\u003c\/strong\u003e with gentle whitening benefits.\u003c\/span\u003e\u003c\/p\u003e","brand":"O Market","offers":[{"title":"Anguria tropicale","offer_id":41515136614533,"sku":"SU00062617-Island watermelon","price":25.99,"currency_code":"EUR","in_stock":true},{"title":"Tè alla pesca","offer_id":41515136647301,"sku":"SU00062617-Peach ice tea","price":25.99,"currency_code":"EUR","in_stock":true},{"title":"Menta glaciale","offer_id":41515136680069,"sku":"SU00062617-Snow melting mint","price":25.99,"currency_code":"EUR","in_stock":true},{"title":"Gelato al mango","offer_id":41515136712837,"sku":"SU00062617-Mango ice cream","price":25.99,"currency_code":"EUR","in_stock":true},{"title":"Cocco tropicale","offer_id":41515136745605,"sku":"SU00062617-Island coconut grove","price":25.99,"currency_code":"EUR","in_stock":true},{"title":"Torta Red Velvet","offer_id":41515136778373,"sku":"SU00062617-Red velvet cake","price":25.99,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0597\/0214\/9253\/files\/Untitled_-_2026-02-26T133328.webp?v=1781012379"},{"product_id":"glory-smile®-dent-led-teeth-whitening-kit-copie","title":"GlorySmile® LuxKit LED Pro ","description":"\u003cstyle\u003e\n  .vs-step {\n    display: flex;\n    align-items: center;\n    gap: 16px;\n    margin-bottom: 24px;\n    opacity: 0;\n    transform: translateY(8px);\n    transition: opacity 0.4s ease, transform 0.4s ease;\n  }\n  .vs-step.visible {\n    opacity: 1;\n    transform: translateY(0);\n  }\n  .vs-step-image {\n    width: 72px;\n    height: 72px;\n    border-radius: 50%;\n    object-fit: cover;\n    flex-shrink: 0;\n    background: #ebebeb;\n  }\n  .vs-step-text { flex: 1; }\n  .vs-step-title {\n    font-size: 14px;\n    font-weight: 700;\n    color: #222;\n    margin: 0 0 4px 0;\n  }\n  .vs-step-desc {\n    font-size: 12px;\n    color: #555;\n    margin: 0;\n    line-height: 1.5;\n  }\n\u003c\/style\u003e\n\n\u003cdiv id=\"vs-data\" style=\"display:none;\"\u003e\n\n\u003cdiv data-variant=\"Luxury Black\" data-image=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0597\/0214\/9253\/files\/Untitled_74.png?v=1770747204\" data-title=\"🖤 Luxury Black – 10 Shade\" data-desc='La versione più potente. Ideale per macchie intense da caffè, fumo o vino. LED ad alta intensità + gel PAP non-perossido per un risultato fino a 10 tonalità più bianche senza sensibilità. Perfetto per chi vuole il massimo effetto \"wow\".'\u003e\n\u003c\/div\u003e\n\n\u003cdiv data-variant=\"Dental White\" data-image=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0597\/0214\/9253\/files\/Untitled_73.png?v=1770747204\" data-title=\"🤍 Dental White – 8 Shade\" data-desc=\"Equilibrio perfetto tra efficacia e protezione. Formula Dental Grade ultra delicata, ideale per denti sensibili. Fino a 8 tonalità più bianche con massima sicurezza per lo smalto.\"\u003e\n\u003c\/div\u003e\n\n\u003cdiv data-variant=\"Dent Blue\" data-image=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0597\/0214\/9253\/files\/Untitled_72.png?v=1770747204\" data-title=\"💙 Dent Blue – 7 Shade\" data-desc=\"Tecnologia avanzata di nuova generazione. LED blu smart + PAP potenziato per un'azione rapida e profonda. Fino a 7 tonalità più bianche in meno sessioni. Perfetto per chi ama innovazione e velocità.\"\u003e\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\n\u003cdiv id=\"variant-steps-container\" style=\"margin-top:20px;min-height:120px;\"\u003e\u003c\/div\u003e\n\n\n\u003cscript\u003e\n(function() {\n\n  const container = document.getElementById(\"variant-steps-container\");\n  const dataItems = document.querySelectorAll(\"#vs-data \u003e div\");\n\n  \/\/ Index par nom exact (insensible à la casse)\n  const dataByKey = {};\n  dataItems.forEach(function(item) {\n    const key = item.getAttribute(\"data-variant\").toLowerCase().trim();\n    dataByKey[key] = {\n      image : item.getAttribute(\"data-image\"),\n      title : item.getAttribute(\"data-title\"),\n      desc  : item.getAttribute(\"data-desc\")\n    };\n  });\n\n  function showVariant(variantTitle) {\n    if (!variantTitle) return;\n    const lower = variantTitle.toLowerCase().trim();\n\n    \/\/ Cherche la meilleure correspondance\n    let data = null;\n    for (const key in dataByKey) {\n      if (lower.includes(key) || key.includes(lower)) {\n        data = dataByKey[key];\n        break;\n      }\n    }\n    if (!data) return;\n\n    container.innerHTML = \"\";\n\n    const imgHtml = data.image\n      ? `\u003cimg src=\"${data.image}\" alt=\"${data.title}\" class=\"vs-step-image\"\u003e`\n      : `\u003cdiv style=\"width:72px;height:72px;border-radius:50%;background:#ebebeb;\n                     display:flex;align-items:center;justify-content:center;\n                     font-size:22px;flex-shrink:0;\"\u003e🦷\u003c\/div\u003e`;\n\n    const el = document.createElement(\"div\");\n    el.className = \"vs-step\";\n    el.innerHTML = `\n      ${imgHtml}\n      \u003cdiv class=\"vs-step-text\"\u003e\n        \u003cp class=\"vs-step-title\"\u003e${data.title}\u003c\/p\u003e\n        ${data.desc ? `\u003cp class=\"vs-step-desc\"\u003e${data.desc}\u003c\/p\u003e` : \"\"}\n      \u003c\/div\u003e\n    `;\n    container.appendChild(el);\n    requestAnimationFrame(function() {\n      requestAnimationFrame(function() { el.classList.add(\"visible\"); });\n    });\n  }\n\n  \/\/ ── Méthode 1 : Shopify variant:changed (thèmes 2.0) ────────\n  document.addEventListener(\"variant:changed\", function(e) {\n    if (e.detail \u0026\u0026 e.detail.variant \u0026\u0026 e.detail.variant.title) {\n      showVariant(e.detail.variant.title);\n    }\n  });\n\n  \/\/ ── Méthode 2 : variantchange (thèmes anciens) ───────────────\n  document.addEventListener(\"variantchange\", function(e) {\n    if (e.detail \u0026\u0026 e.detail.variant \u0026\u0026 e.detail.variant.title) {\n      showVariant(e.detail.variant.title);\n    }\n  });\n\n  \/\/ ── Méthode 3 : écoute TOUS les selects et boutons radio ─────\n  document.addEventListener(\"change\", function(e) {\n    \/\/ Select classique\n    if (e.target.name === \"id\") {\n      const opt = e.target.options[e.target.selectedIndex];\n      if (opt) showVariant(opt.text);\n    }\n    \/\/ Boutons radio (certains thèmes)\n    if (e.target.type === \"radio\" \u0026\u0026 e.target.form) {\n      showVariant(e.target.value);\n    }\n  });\n\n  \/\/ ── Méthode 4 : MutationObserver sur le bouton Add to Cart ───\n  \/\/ Shopify met à jour data-variant-id sur le bouton quand on change\n  function watchAddToCartButton() {\n    const btn = document.querySelector(\n      'button[name=\"add\"], button[data-variant-id], .product-form__submit'\n    );\n    if (!btn) return;\n\n    const observer = new MutationObserver(function() {\n      const vid = btn.getAttribute(\"data-variant-id\")\n                || btn.getAttribute(\"data-id\");\n      if (vid) {\n        \/\/ Cherche le select pour récupérer le titre\n        const sel = document.querySelector(\"select[name='id']\");\n        if (sel) {\n          for (let i = 0; i \u003c sel.options.length; i++) {\n            if (sel.options[i].value === vid) {\n              showVariant(sel.options[i].text);\n              break;\n            }\n          }\n        }\n      }\n    });\n\n    observer.observe(btn, { attributes: true, attributeFilter: [\"data-variant-id\",\"data-id\"] });\n  }\n\n  \/\/ ── Méthode 5 : MutationObserver sur l'image principale ──────\n  \/\/ Quand la variante change, Shopify change le src de l'image produit\n  function watchProductImage() {\n    const img = document.querySelector(\n      \".product__media img, .product-single__photo img, [data-product-image]\"\n    );\n    if (!img) return;\n\n    let lastSrc = img.src;\n    const observer = new MutationObserver(function() {\n      if (img.src !== lastSrc) {\n        lastSrc = img.src;\n        \/\/ Relit le select pour le titre\n        const sel = document.querySelector(\"select[name='id']\");\n        if (sel \u0026\u0026 sel.options[sel.selectedIndex]) {\n          showVariant(sel.options[sel.selectedIndex].text);\n        }\n      }\n    });\n    observer.observe(img, { attributes: true, attributeFilter: [\"src\"] });\n  }\n\n  \/\/ ── Init ─────────────────────────────────────────────────────\n  window.addEventListener(\"load\", function() {\n    watchAddToCartButton();\n    watchProductImage();\n\n    \/\/ Variante initiale depuis le select\n    const sel = document.querySelector(\"select[name='id']\");\n    if (sel \u0026\u0026 sel.options[sel.selectedIndex]) {\n      showVariant(sel.options[sel.selectedIndex].text);\n    } else {\n      \/\/ Fallback : première variante\n      showVariant(\"Dent Blue\");\n    }\n  });\n\n})();\n\u003c\/script\u003e\n","brand":"O Market","offers":[{"title":"Dent Blue","offer_id":41515164565637,"sku":"SU00037042-Blue Suit","price":54.9,"currency_code":"EUR","in_stock":true},{"title":"Dental White","offer_id":41515164598405,"sku":"SU00037042-White Suit","price":59.9,"currency_code":"EUR","in_stock":true},{"title":"Luxury Black","offer_id":41515164663941,"sku":"SU00037042-GS Blue Suit","price":69.9,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0597\/0214\/9253\/files\/Untitled_-_2026-02-26T133436.webp?v=1781012519"}],"url":"https:\/\/www.glorysmileitaly.com\/en\/collections\/promozione-speciale.oembed","provider":"O Market","version":"1.0","type":"link"}