{"title":"Snadalias","description":"","products":[{"product_id":"sandalias-casuales-con-plataforma","title":"Sandalias Plataforma","description":"\u003cdiv class=\"c-sw\"\u003e\n  \u003cspan class=\"sw-lbl\"\u003eColor - \u003cspan id=\"selected-color-name\"\u003eNegro\u003c\/span\u003e\u003c\/span\u003e\n  \u003cdiv class=\"sg-sw\"\u003e\n    \u003cbutton type=\"button\" class=\"sw-btn active\" data-color=\"Negro\" data-slide-index=\"1\" style=\"--swatch-bg:#1a1a1a\" title=\"Negro\"\u003e\u003c\/button\u003e\n    \n    \u003cbutton type=\"button\" class=\"sw-btn\" data-color=\"Beige\" data-slide-index=\"2\" style=\"--swatch-bg:#e3d7c5\" title=\"Beige\"\u003e\u003c\/button\u003e\n  \u003c\/div\u003e\n\u003c\/div\u003e\n\n\u003cstyle\u003e\n  .c-sw {\n    margin: 20px 0;\n  }\n  .sw-lbl {\n    display: block;\n    font-size: 14px; \n    color: #2b2b2b;\n    margin-bottom: 12px;\n    font-family: \"New York\", -apple-system-serif, \"Playfair Display\", \"Georgia\", \"Times New Roman\", serif;\n    font-weight: 400;\n    letter-spacing: 0.1px;\n    -webkit-font-smoothing: antialiased;\n  }\n  #selected-color-name {\n    font-weight: 400;\n  }\n  .sg-sw {\n    display: flex;\n    gap: 12px;\n  }\n  .sw-btn {\n    width: 44px; \n    height: 44px;\n    border-radius: 9px;\n    border: 1px solid transparent;\n    background: var(--swatch-bg);\n    cursor: pointer;\n    position: relative;\n    box-sizing: border-box;\n    padding: 0;\n  }\n  .sw-btn.active {\n    border: 1.5px solid #8c867a !important; \n    box-shadow: inset 0 0 0 3px #ffffff;\n  }\n  .sw-btn:focus {\n    outline: none;\n  }\n\u003c\/style\u003e\n\n\u003cscript\u003e\n  (function() {\n    \/\/ Función que busca las miniaturas o diapositivas reales y activa la correcta\n    function moverCarruselPorPosicion(numeroFoto) {\n      const miniaturas = document.querySelectorAll('.product__thumbnail-item button, .thumbnail-list__item button, .product__thumb, .thumbnail-item');\n      \n      if (miniaturas \u0026\u0026 miniaturas.length \u003e= numeroFoto) {\n        miniaturas[numeroFoto - 1].click();\n      } else {\n        const diapositivas = document.querySelectorAll('.product__media-item, .swiper-slide, .slick-slide');\n        if (diapositivas \u0026\u0026 diapositivas.length \u003e= numeroFoto) {\n          diapositivas[numeroFoto - 1].scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });\n        }\n      }\n    }\n\n    \/\/ Oculta el selector nativo duplicado de la plantilla\n    function ocultarSelectorNativoColor() {\n      const etiquetas = document.querySelectorAll('label, span, legend, h4, .form__label');\n      etiquetas.forEach(el =\u003e {\n        const texto = (el.innerText || \"\").toLowerCase().trim();\n        if (texto === 'color' || texto.includes('color -')) {\n          const contenedor = el.closest('.product-form__input, .variant-wrapper, fieldset, div[class*=\"variant\"]');\n          if (contenedor \u0026\u0026 !contenedor.classList.contains('c-sw')) {\n            contenedor.style.setProperty('display', 'none', 'important');\n          }\n        }\n      });\n    }\n\n    setInterval(ocultarSelectorNativoColor, 100);\n\n    \/\/ Al hacer clic en tus botones personalizados\n    document.addEventListener('click', function(e) {\n      const boton = e.target.closest('.sw-btn');\n      if (!boton) return;\n      \n      e.preventDefault();\n      \n      document.querySelectorAll('.sw-btn').forEach(x =\u003e x.classList.remove('active'));\n      boton.classList.add('active');\n      document.getElementById('selected-color-name').textContent = boton.dataset.color;\n      \n      \/\/ Mueve el carrusel a la posición asignada (1 o 2)\n      moverCarruselPorPosicion(parseInt(boton.getAttribute('data-slide-index')));\n\n      \/\/ Sincroniza la variante con Shopify de forma nativa\n      const colorOriginal = boton.dataset.color.toLowerCase();\n      const opcionesNativas = document.querySelectorAll('.product-form__input input, .product-form__input label, .swatch-element, [class*=\"variant\"] option, [class*=\"swatch\"], [class*=\"color-swatch\"]');\n      \n      opcionesNativas.forEach(el =\u003e {\n        const textoEl = (el.innerText || el.value || el.getAttribute('aria-label') || \"\").toLowerCase().trim();\n        if (\/\\d\/.test(textoEl)) return; \/\/ Ignora las tallas\n\n        if (textoEl.includes(colorOriginal)) {\n          if (el.tagName === 'INPUT') {\n            el.checked = true;\n            el.dispatchEvent(new Event('change', { bubbles: true }));\n          } else if (el.tagName === 'OPTION') {\n            let select = el.closest('select');\n            if(select) {\n              select.value = el.value;\n              select.dispatchEvent(new Event('change', { bubbles: true }));\n            }\n          } else {\n            el.click();\n          }\n        }\n      });\n    });\n  })();\n\u003c\/script\u003e","brand":"Mi tienda","offers":[{"title":"36 \/ Negro","offer_id":57665872855422,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"36 \/ Beige","offer_id":57665872658814,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Negro","offer_id":57665872888190,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Beige","offer_id":57665872691582,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Negro","offer_id":57665872920958,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Beige","offer_id":57665872724350,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Negro","offer_id":57665872953726,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Beige","offer_id":57665872757118,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":false},{"title":"40 \/ Negro","offer_id":57665872986494,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"40 \/ Beige","offer_id":57665872789886,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"41 \/ Negro","offer_id":57665873019262,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":false},{"title":"41 \/ Beige","offer_id":57665872822654,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/negra_pro_2.jpg?v=1783631317"},{"product_id":"sandalias-casualaes","title":"Sandalías Casualaes","description":"\u003cdiv class=\"c-sw\"\u003e\n  \u003cspan class=\"sw-lbl\"\u003eColor - \u003cspan id=\"selected-color-name\"\u003eNegro\u003c\/span\u003e\u003c\/span\u003e\n  \u003cdiv class=\"sg-sw\"\u003e\n    \u003cbutton type=\"button\" class=\"sw-btn active\" data-color=\"Negro\" data-slide-index=\"1\" style=\"--swatch-bg:#1a1a1a\" title=\"Negro\"\u003e\u003c\/button\u003e\n    \n    \u003cbutton type=\"button\" class=\"sw-btn\" data-color=\"Blanco\" data-slide-index=\"2\" style=\"--swatch-bg:#ffffff; border: 1px solid #e1e1e1;\" title=\"Blanco\"\u003e\u003c\/button\u003e\n  \u003c\/div\u003e\n\u003c\/div\u003e\n\n\u003cstyle\u003e\n  .c-sw {\n    margin: 20px 0;\n  }\n  .sw-lbl {\n    display: block;\n    font-size: 14px; \n    color: #2b2b2b;\n    margin-bottom: 12px;\n    font-family: \"New York\", -apple-system-serif, \"Playfair Display\", \"Georgia\", \"Times New Roman\", serif;\n    font-weight: 400;\n    letter-spacing: 0.1px;\n    -webkit-font-smoothing: antialiased;\n  }\n  #selected-color-name {\n    font-weight: 400;\n  }\n  .sg-sw {\n    display: flex;\n    gap: 12px;\n  }\n  .sw-btn {\n    width: 44px; \n    height: 44px;\n    border-radius: 9px;\n    border: 1px solid transparent;\n    background: var(--swatch-bg);\n    cursor: pointer;\n    position: relative;\n    box-sizing: border-box;\n    padding: 0;\n  }\n  .sw-btn.active {\n    border: 1.5px solid #8c867a !important; \n    box-shadow: inset 0 0 0 3px #ffffff;\n  }\n  .sw-btn:focus {\n    outline: none;\n  }\n\u003c\/style\u003e\n\n\u003cscript\u003e\n  (function() {\n    \/\/ Función que busca las miniaturas reales de la plantilla y pulsa la que corresponda\n    function moverCarruselPorPosicion(numeroFoto) {\n      \/\/ Intentamos localizar los botones o elementos de las miniaturas del producto\n      const miniaturas = document.querySelectorAll('.product__thumbnail-item button, .thumbnail-list__item button, .product__thumb, .thumbnail-item');\n      \n      if (miniaturas \u0026\u0026 miniaturas.length \u003e= numeroFoto) {\n        \/\/ Hacemos clic en la miniatura exacta (el índice en programación empieza en 0, así que restamos 1)\n        miniaturas[numeroFoto - 1].click();\n      } else {\n        \/\/ Alternativa si el tema usa un slider continuo sin botones de miniaturas\n        const diapositivas = document.querySelectorAll('.product__media-item, .swiper-slide, .slick-slide');\n        if (diapositivas \u0026\u0026 diapositivas.length \u003e= numeroFoto) {\n          diapositivas[numeroFoto - 1].scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });\n        }\n      }\n    }\n\n    \/\/ Oculta el selector nativo duplicado de la plantilla\n    function ocultarSelectorNativoColor() {\n      const etiquetas = document.querySelectorAll('label, span, legend, h4, .form__label');\n      etiquetas.forEach(el =\u003e {\n        const texto = (el.innerText || \"\").toLowerCase().trim();\n        if (texto === 'color' || texto.includes('color -')) {\n          const contenedor = el.closest('.product-form__input, .variant-wrapper, fieldset, div[class*=\"variant\"]');\n          if (contenedor \u0026\u0026 !contenedor.classList.contains('c-sw')) {\n            contenedor.style.setProperty('display', 'none', 'important');\n          }\n        }\n      });\n    }\n\n    setInterval(ocultarSelectorNativoColor, 100);\n\n    \/\/ Al hacer clic en tus botones personalizados\n    document.addEventListener('click', function(e) {\n      const boton = e.target.closest('.sw-btn');\n      if (!boton) return;\n      \n      e.preventDefault();\n      \n      document.querySelectorAll('.sw-btn').forEach(x =\u003e x.classList.remove('active'));\n      boton.classList.add('active');\n      document.getElementById('selected-color-name').textContent = boton.dataset.color;\n      \n      \/\/ Llamamos a la función pasándole el número de foto (1 o 2)\n      moverCarruselPorPosicion(parseInt(boton.getAttribute('data-slide-index')));\n\n      \/\/ Sincroniza la variante con Shopify de forma nativa\n      const colorOriginal = boton.dataset.color.toLowerCase();\n      const opcionesNativas = document.querySelectorAll('.product-form__input input, .product-form__input label, .swatch-element, [class*=\"variant\"] option, [class*=\"swatch\"], [class*=\"color-swatch\"]');\n      \n      opcionesNativas.forEach(el =\u003e {\n        const textoEl = (el.innerText || el.value || el.getAttribute('aria-label') || \"\").toLowerCase().trim();\n        if (\/\\d\/.test(textoEl)) return; \/\/ Ignora tallas\n\n        if (textoEl.includes(colorOriginal)) {\n          if (el.tagName === 'INPUT') {\n            el.checked = true;\n            el.dispatchEvent(new Event('change', { bubbles: true }));\n          } else if (el.tagName === 'OPTION') {\n            let select = el.closest('select');\n            if(select) {\n              select.value = el.value;\n              select.dispatchEvent(new Event('change', { bubbles: true }));\n            }\n          } else {\n            el.click();\n          }\n        }\n      });\n    });\n  })();\n\u003c\/script\u003e","brand":"Mi tienda","offers":[{"title":"36 \/ Negro","offer_id":57667341681022,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"36 \/ Blanco","offer_id":57667341713790,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Negro","offer_id":57667341746558,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Blanco","offer_id":57667341779326,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Negro","offer_id":57667341812094,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Blanco","offer_id":57667341844862,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Negro","offer_id":57667341877630,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":false},{"title":"39 \/ Blanco","offer_id":57667341910398,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"40 \/ Negro","offer_id":57667341943166,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"40 \/ Blanco","offer_id":57667341975934,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"41 \/ Negro","offer_id":57667342008702,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"41 \/ Blanco","offer_id":57667342041470,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"42 \/ Negro","offer_id":57667342074238,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"42 \/ Blanco","offer_id":57667342107006,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"43 \/ Negro","offer_id":57667342139774,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":true},{"title":"43 \/ Blanco","offer_id":57667342172542,"sku":null,"price":16.99,"currency_code":"EUR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/1.avif?v=1783609696"},{"product_id":"sandalias-con-anillo","title":"Sandalias Con Anillo","description":"\u003cdiv class=\"c-sw\"\u003e\n  \u003cspan class=\"sw-lbl\"\u003eColor - \u003cspan id=\"selected-color-name\"\u003eNegro\u003c\/span\u003e\u003c\/span\u003e\n  \u003cdiv class=\"sg-sw\"\u003e\n    \u003cbutton type=\"button\" class=\"sw-btn active\" data-color=\"Negro\" data-slide-index=\"1\" style=\"--swatch-bg:#1a1a1a\" title=\"Negro\"\u003e\u003c\/button\u003e\n    \n    \u003cbutton type=\"button\" class=\"sw-btn\" data-color=\"Marrón\" data-slide-index=\"2\" style=\"--swatch-bg:#7A5C43\" title=\"Marrón\"\u003e\u003c\/button\u003e\n  \u003c\/div\u003e\n\u003c\/div\u003e\n\n\u003cstyle\u003e\n  .c-sw {\n    margin: 20px 0;\n  }\n  .sw-lbl {\n    display: block;\n    font-size: 14px; \n    color: #2b2b2b;\n    margin-bottom: 12px;\n    font-family: \"New York\", -apple-system-serif, \"Playfair Display\", \"Georgia\", \"Times New Roman\", serif;\n    font-weight: 400;\n    letter-spacing: 0.1px;\n    -webkit-font-smoothing: antialiased;\n  }\n  #selected-color-name {\n    font-weight: 400;\n  }\n  .sg-sw {\n    display: flex;\n    gap: 12px;\n  }\n  .sw-btn {\n    width: 44px; \n    height: 44px;\n    border-radius: 9px;\n    border: 1px solid transparent;\n    background: var(--swatch-bg);\n    cursor: pointer;\n    position: relative;\n    box-sizing: border-box;\n    padding: 0;\n  }\n  .sw-btn.active {\n    border: 1.5px solid #8c867a !important; \n    box-shadow: inset 0 0 0 3px #ffffff;\n  }\n  .sw-btn:focus {\n    outline: none;\n  }\n\u003c\/style\u003e\n\n\u003cscript\u003e\n  (function() {\n    \/\/ Función que busca las miniaturas o diapositivas reales y activa la correcta\n    function moverCarruselPorPosicion(numeroFoto) {\n      const miniaturas = document.querySelectorAll('.product__thumbnail-item button, .thumbnail-list__item button, .product__thumb, .thumbnail-item');\n      \n      if (miniaturas \u0026\u0026 miniaturas.length \u003e= numeroFoto) {\n        miniaturas[numeroFoto - 1].click();\n      } else {\n        const diapositivas = document.querySelectorAll('.product__media-item, .swiper-slide, .slick-slide');\n        if (diapositivas \u0026\u0026 diapositivas.length \u003e= numeroFoto) {\n          diapositivas[numeroFoto - 1].scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });\n        }\n      }\n    }\n\n    \/\/ Oculta el selector nativo duplicado de la plantilla\n    function ocultarSelectorNativoColor() {\n      const etiquetas = document.querySelectorAll('label, span, legend, h4, .form__label');\n      etiquetas.forEach(el =\u003e {\n        const texto = (el.innerText || \"\").toLowerCase().trim();\n        if (texto === 'color' || texto.includes('color -')) {\n          const contenedor = el.closest('.product-form__input, .variant-wrapper, fieldset, div[class*=\"variant\"]');\n          if (contenedor \u0026\u0026 !contenedor.classList.contains('c-sw')) {\n            contenedor.style.setProperty('display', 'none', 'important');\n          }\n        }\n      });\n    }\n\n    setInterval(ocultarSelectorNativoColor, 100);\n\n    \/\/ Al hacer clic en tus botones personalizados\n    document.addEventListener('click', function(e) {\n      const boton = e.target.closest('.sw-btn');\n      if (!boton) return;\n      \n      e.preventDefault();\n      \n      document.querySelectorAll('.sw-btn').forEach(x =\u003e x.classList.remove('active'));\n      boton.classList.add('active');\n      document.getElementById('selected-color-name').textContent = boton.dataset.color;\n      \n      \/\/ Mueve el carrusel a la posición asignada (1 o 2)\n      moverCarruselPorPosicion(parseInt(boton.getAttribute('data-slide-index')));\n\n      \/\/ Sincroniza la variante con Shopify de forma nativa\n      const colorOriginal = boton.dataset.color.toLowerCase();\n      const opcionesNativas = document.querySelectorAll('.product-form__input input, .product-form__input label, .swatch-element, [class*=\"variant\"] option, [class*=\"swatch\"], [class*=\"color-swatch\"]');\n      \n      opcionesNativas.forEach(el =\u003e {\n        const textoEl = (el.innerText || el.value || el.getAttribute('aria-label') || \"\").toLowerCase().trim();\n        if (\/\\d\/.test(textoEl)) return; \/\/ Ignora las tallas\n\n        if (textoEl.includes(colorOriginal)) {\n          if (el.tagName === 'INPUT') {\n            el.checked = true;\n            el.dispatchEvent(new Event('change', { bubbles: true }));\n          } else if (el.tagName === 'OPTION') {\n            let select = el.closest('select');\n            if(select) {\n              select.value = el.value;\n              select.dispatchEvent(new Event('change', { bubbles: true }));\n            }\n          } else {\n            el.click();\n          }\n        }\n      });\n    });\n  })();\n\u003c\/script\u003e","brand":"Mi tienda","offers":[{"title":"35.5 \/ Negro","offer_id":57667761701246,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"35.5 \/ Marrón","offer_id":57667761668478,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"36 \/ Negro","offer_id":57667761766782,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"36 \/ Marrón","offer_id":57667761734014,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Negro","offer_id":57667761832318,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Marrón","offer_id":57667761799550,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Negro","offer_id":57667761897854,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Marrón","offer_id":57667761865086,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Negro","offer_id":57667761963390,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Marrón","offer_id":57667761930622,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"40 \/ Negro","offer_id":57667762028926,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true},{"title":"40 \/ Marrón","offer_id":57667761996158,"sku":null,"price":22.99,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/negro_pr.png?v=1783621882"},{"product_id":"sandalias-hilo","title":"Sandalias Hilo","description":"\u003cdiv class=\"c-sw\"\u003e\n  \u003cspan class=\"sw-lbl\"\u003eColor - \u003cspan id=\"selected-color-name\"\u003eBeige\u003c\/span\u003e\u003c\/span\u003e\n  \u003cdiv class=\"sg-sw\"\u003e\n    \u003cbutton type=\"button\" class=\"sw-btn active\" data-color=\"Beige\" data-slide-index=\"1\" style=\"--swatch-bg: #caab84;\" title=\"Beige\"\u003e\u003c\/button\u003e\n    \n    \u003cbutton type=\"button\" class=\"sw-btn\" data-color=\"Negro\" data-slide-index=\"4\" style=\"--swatch-bg: #1a1a1a;\" title=\"Negro\"\u003e\u003c\/button\u003e\n  \u003c\/div\u003e\n\u003c\/div\u003e\n\n\u003cstyle\u003e\n  .c-sw {\n    margin: 20px 0;\n  }\n  .sw-lbl {\n    display: block;\n    font-size: 14px; \n    color: #2b2b2b;\n    margin-bottom: 12px;\n    font-family: \"New York\", -apple-system-serif, \"Playfair Display\", \"Georgia\", \"Times New Roman\", serif;\n    font-weight: 400;\n    letter-spacing: 0.1px;\n    -webkit-font-smoothing: antialiased;\n  }\n  #selected-color-name {\n    font-weight: 400;\n  }\n  .sg-sw {\n    display: flex;\n    gap: 12px;\n  }\n  .sw-btn {\n    width: 44px; \n    height: 44px;\n    border-radius: 9px;\n    border: 1px solid transparent;\n    background: var(--swatch-bg);\n    cursor: pointer;\n    position: relative;\n    box-sizing: border-box;\n    padding: 0;\n  }\n  .sw-btn.active {\n    border: 1.5px solid #8c867a !important; \n    box-shadow: inset 0 0 0 3px #ffffff;\n  }\n  .sw-btn:focus {\n    outline: none;\n  }\n\u003c\/style\u003e\n\n\u003cscript\u003e\n  (function() {\n    function inicializarSelectorColor() {\n      \/\/ Función para mover las imágenes del carrusel\n      function moverCarruselPorPosicion(numeroFoto) {\n        const miniaturas = document.querySelectorAll('.product__thumbnail-item button, .thumbnail-list__item button, .product__thumb, .thumbnail-item, .product-single__thumbnail');\n        \n        if (miniaturas \u0026\u0026 miniaturas.length \u003e= numeroFoto) {\n          miniaturas[numeroFoto - 1].click();\n        } else {\n          const diapositivas = document.querySelectorAll('.product__media-item, .swiper-slide, .slick-slide, .product-main-slide');\n          if (diapositivas \u0026\u0026 diapositivas.length \u003e= numeroFoto) {\n            diapositivas[numeroFoto - 1].scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });\n          }\n        }\n      }\n\n      \/\/ Oculta constantemente el selector nativo original del tema\n      function ocultarSelectorNativoColor() {\n        const etiquetas = document.querySelectorAll('label, span, legend, h4, .form__label');\n        etiquetas.forEach(el =\u003e {\n          const texto = (el.innerText || \"\").toLowerCase().trim();\n          if (texto === 'color' || texto.includes('color -') || texto.includes('beige')) {\n            const contenedor = el.closest('.product-form__input, .variant-wrapper, fieldset, div[class*=\"variant\"]');\n            if (contenedor \u0026\u0026 !contenedor.classList.contains('c-sw')) {\n              contenedor.style.setProperty('display', 'none', 'important');\n            }\n          }\n        });\n      }\n      setInterval(ocultarSelectorNativoColor, 100);\n\n      \/\/ Sincronización inversa: Mantiene el botón activo correcto si Shopify refresca la vista\n      function actualizarBotonesVisuales() {\n        const opcionesNativas = document.querySelectorAll('.product-form__input input:checked, [class*=\"variant\"] select, .swatch-element input:checked');\n        let colorActivoNativo = \"\";\n\n        opcionesNativas.forEach(el =\u003e {\n          if (el.tagName === 'SELECT') {\n            colorActivoNativo = el.options[el.selectedIndex]?.text || el.value || \"\";\n          } else {\n            colorActivoNativo = el.value || el.getAttribute('data-value') || \"\";\n          }\n        });\n\n        if (colorActivoNativo) {\n          colorActivoNativo = colorActivoNativo.trim().toLowerCase();\n          document.querySelectorAll('.sw-btn').forEach(btn =\u003e {\n            const btnColor = btn.dataset.color.trim().toLowerCase();\n            if (btnColor === colorActivoNativo) {\n              if (!btn.classList.contains('active')) {\n                document.querySelectorAll('.sw-btn').forEach(x =\u003e x.classList.remove('active'));\n                btn.classList.add('active');\n                document.getElementById('selected-color-name').textContent = btn.dataset.color;\n              }\n            }\n          });\n        }\n      }\n      document.addEventListener('change', actualizarBotonesVisuales);\n      setInterval(actualizarBotonesVisuales, 300);\n\n      \/\/ Evento principal al hacer clic en tus botones personalizados\n      document.addEventListener('click', function(e) {\n        const boton = e.target.closest('.sw-btn');\n        if (!boton) return;\n        \n        e.preventDefault();\n        \n        document.querySelectorAll('.sw-btn').forEach(x =\u003e x.classList.remove('active'));\n        boton.classList.add('active');\n        document.getElementById('selected-color-name').textContent = boton.dataset.color;\n        \n        \/\/ Mueve el carrusel a su foto (1 o 4)\n        moverCarruselPorPosicion(parseInt(boton.getAttribute('data-slide-index')));\n\n        \/\/ Sincroniza el cambio hacia Shopify nativo\n        const valorLimpio = boton.dataset.color.trim();\n        const opcionesNativas = document.querySelectorAll('.product-form__input input, .product-form__input label, .swatch-element, [class*=\"variant\"] option, [class*=\"swatch\"], [class*=\"color-swatch\"]');\n        \n        opcionesNativas.forEach(el =\u003e {\n          const textoEl = (el.innerText || el.value || el.getAttribute('aria-label') || el.getAttribute('data-value') || \"\").trim();\n          \n          if (\/\\d\/.test(textoEl) \u0026\u0026 textoEl.length \u003c 4) return; \/\/ Salta tallas\n\n          if (textoEl === valorLimpio || textoEl.toLowerCase() === valorLimpio.toLowerCase()) {\n            if (el.tagName === 'INPUT') {\n              el.checked = true;\n              el.dispatchEvent(new Event('change', { bubbles: true }));\n            } else if (el.tagName === 'OPTION') {\n              let select = el.closest('select');\n              if(select) {\n                select.value = el.value;\n                select.dispatchEvent(new Event('change', { bubbles: true }));\n              }\n            } else {\n              el.click();\n            }\n          }\n        });\n      });\n    }\n\n    if (document.readyState === 'loading') {\n      document.addEventListener('DOMContentLoaded', inicializarSelectorColor);\n    } else {\n      inicializarSelectorColor();\n    }\n  })();\n\u003c\/script\u003e","brand":"Mi tienda","offers":[{"title":"35.5 \/ Beige","offer_id":57668079321470,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"35.5 \/ Negro","offer_id":57668079354238,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"36 \/ Beige","offer_id":57668079387006,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"36 \/ Negro","offer_id":57668079419774,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Beige","offer_id":57668079452542,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"37 \/ Negro","offer_id":57668079485310,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Beige","offer_id":57668079518078,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"38 \/ Negro","offer_id":57668079550846,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Beige","offer_id":57668079583614,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":true},{"title":"39 \/ Negro","offer_id":57668079616382,"sku":null,"price":17.99,"currency_code":"EUR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/ChatGPTImage11jul2026_23_22_56.png?v=1783805585"},{"product_id":"tacon-bordado","title":"Tacón Bordado","description":"","brand":"Mi tienda","offers":[{"title":"36","offer_id":57676216959358,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"37","offer_id":57676216992126,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"38","offer_id":57676217024894,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"39","offer_id":57676217057662,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"40","offer_id":57676217090430,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"41","offer_id":57676217123198,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"42","offer_id":57676217155966,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/ChatGPTImage12jul2026_12_59_27.png?v=1783854075"},{"product_id":"tacones-abiertos","title":"Tacones Abiertos","description":"","brand":"Mi tienda","offers":[{"title":"35","offer_id":57676308185470,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"36","offer_id":57676308218238,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"37","offer_id":57676308251006,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"38","offer_id":57676308283774,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"39","offer_id":57676308316542,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"40","offer_id":57676308349310,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"41","offer_id":57676308382078,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true},{"title":"42","offer_id":57676308414846,"sku":null,"price":34.99,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/TACON1.png?v=1783862525"},{"product_id":"manoletina-baja-aflorada","title":"Bailarina Bordada","description":"","brand":"Mi tienda","offers":[{"title":"36","offer_id":57678389117310,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"38","offer_id":57678389150078,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"37","offer_id":57678389182846,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"39","offer_id":57678389215614,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"40","offer_id":57678389248382,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":false},{"title":"41","offer_id":57678389281150,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"42","offer_id":57678389313918,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/ChatGPTImage13jul2026_11_59_28.png?v=1783936841"},{"product_id":"tacon-punta-fiesta","title":"Tacon Brillante","description":"","brand":"Mi tienda","offers":[{"title":"35","offer_id":57678445478270,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":false},{"title":"36","offer_id":57678445511038,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"37","offer_id":57678445543806,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"38","offer_id":57678445576574,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"39","offer_id":57678445609342,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":true},{"title":"40","offer_id":57678445642110,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":false},{"title":"41","offer_id":57678445674878,"sku":null,"price":29.99,"currency_code":"EUR","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1008\/4804\/2366\/files\/ChatGPTImage13jul2026_12_14_48.png?v=1783937778"}],"url":"https:\/\/luzdemoda.com\/collections\/snadalias.oembed","provider":"LuzDeModa","version":"1.0","type":"link"}