{"product_id":"danna-purple-pink","title":"Danna ( Purple \u0026 Pink )","description":"\u003csection id=\"fitfinder\" style=\"background:black;color:white;padding:50px 20px;text-align:center;\"\u003e\n  \u003ch2 style=\"font-size:2.5rem;margin-bottom:30px;\"\u003eFind Your Perfect Hat Size\u003c\/h2\u003e\n\n  \u003cdiv id=\"question-box\" style=\"max-width:700px;margin:auto;\"\u003e\n    \u003cp id=\"question\" style=\"font-size:1.6rem;margin-bottom:30px;\"\u003eHow would you describe your head size?\u003c\/p\u003e\n    \u003cdiv id=\"answers\"\u003e\u003c\/div\u003e\n  \u003c\/div\u003e\n\n  \u003cdiv id=\"result-box\" style=\"display:none;margin-top:50px;\"\u003e\n    \u003ch3 style=\"font-size:2rem;\"\u003eYour Recommended Size:\u003c\/h3\u003e\n    \u003cp id=\"size-result\" class=\"pulse\" style=\"font-size:3rem;font-weight:bold;color:lightblue;margin-top:20px;\"\u003e\u003c\/p\u003e\n    \u003cbutton class=\"ff-btn restart\" onclick=\"restartFitFinder()\"\u003eRestart\u003c\/button\u003e\n  \u003c\/div\u003e\n\u003c\/section\u003e\n\n\u003cstyle\u003e\n  .ff-btn {\n    background:white;\n    color:black;\n    border:none;\n    padding:15px;\n    margin:15px;\n    font-size:1.4rem;\n    cursor:pointer;\n    transition:0.3s;\n    border-radius:50%;\n    width:180px;\n    height:180px;\n    line-height:1.4;\n    display:inline-flex;\n    align-items:center;\n    justify-content:center;\n    text-align:center;\n    font-weight:bold;\n    white-space:normal;\n  }\n  .ff-btn:hover {\n    background:gray;\n    color:white;\n    transform:scale(1.05);\n  }\n  .ff-btn.selected {\n    background:lightblue !important;\n    color:black !important;\n    transform:scale(1.1);\n  }\n  .restart {\n    width:auto;\n    height:auto;\n    border-radius:8px;\n    padding:12px 28px;\n    font-size:1.2rem;\n  }\n\n  \/* Pulsing animation *\/\n  @keyframes pulseEffect {\n    0% { transform: scale(1); opacity: 1; }\n    50% { transform: scale(1.1); opacity: 0.8; }\n    100% { transform: scale(1); opacity: 1; }\n  }\n  .pulse {\n    animation: pulseEffect 1.2s infinite ease-in-out;\n  }\n\u003c\/style\u003e\n\n\u003cscript\u003e\n  let currentStep = 0;\n  let answers = {};\n\n  const questions = [\n    {\n      text: \"How would you describe your head size?\",\n      options: [\"Smaller than average\", \"Average\", \"Larger than average\"]\n    },\n    {\n      text: \"Do you have low cut, thick hair, dreads, or big curly hairstyle?\",\n      options: [\"Low cut\", \"Thick hair\", \"Dreads\", \"Big curly\"]\n    },\n    {\n      text: \"How do you prefer your hat to fit?\",\n      options: [\"Snug\", \"Comfortable\", \"Loose\"]\n    }\n  ];\n\n  function renderQuestion() {\n    const q = questions[currentStep];\n    document.getElementById(\"question\").textContent = q.text;\n    const answersDiv = document.getElementById(\"answers\");\n    answersDiv.innerHTML = \"\";\n    q.options.forEach(opt =\u003e {\n      const btn = document.createElement(\"button\");\n      btn.textContent = opt;\n      btn.className = \"ff-btn\";\n      btn.onclick = () =\u003e selectAnswer(btn, opt);\n      answersDiv.appendChild(btn);\n    });\n  }\n\n  function selectAnswer(button, opt) {\n    const buttons = document.querySelectorAll(\".ff-btn\");\n    buttons.forEach(b =\u003e b.classList.remove(\"selected\"));\n    button.classList.add(\"selected\");\n\n    setTimeout(() =\u003e {\n      handleAnswer(opt);\n    }, 300);\n  }\n\n  function handleAnswer(opt) {\n    answers[`q${currentStep}`] = opt;\n    currentStep++;\n    if (currentStep \u003c questions.length) {\n      renderQuestion();\n    } else {\n      calculateResult();\n    }\n  }\n\n  function calculateResult() {\n    const head = answers.q0;\n    const hair = answers.q1;\n    const fit = answers.q2;\n    let result = \"M\"; \/\/ default\n\n    if (head === \"Smaller than average\" \u0026\u0026 fit === \"Snug\") result = \"S\";\n    else if (head === \"Smaller than average\" \u0026\u0026 fit !== \"Snug\") result = \"M\";\n    else if (head === \"Average\" \u0026\u0026 (hair === \"Low cut\" || fit === \"Snug\")) result = \"M\";\n    else if (head === \"Average\" \u0026\u0026 (hair !== \"Low cut\" || fit === \"Loose\")) result = \"L\";\n    else if (head === \"Larger than average\" \u0026\u0026 (fit === \"Loose\" || hair === \"Dreads\" || hair === \"Big curly\")) result = \"XL\";\n    else if (head === \"Larger than average\") result = \"L\";\n\n    showResult(result);\n  }\n\n  function showResult(size) {\n    document.getElementById(\"question-box\").style.display = \"none\";\n    document.getElementById(\"result-box\").style.display = \"block\";\n    let desc = \"\";\n    if (size === \"S\") desc = \"Small – 22 inches\";\n    if (size === \"M\") desc = \"Medium – 23 inches\";\n    if (size === \"L\") desc = \"Large – 24 inches\";\n    if (size === \"XL\") desc = \"Extra Large – 25 inches\";\n    document.getElementById(\"size-result\").textContent = desc;\n  }\n\n  function restartFitFinder() {\n    currentStep = 0;\n    answers = {};\n    document.getElementById(\"question-box\").style.display = \"block\";\n    document.getElementById(\"result-box\").style.display = \"none\";\n    renderQuestion();\n  }\n\n  renderQuestion();\n\u003c\/script\u003e\n","brand":"Wilde","offers":[{"title":"Small 22\"","offer_id":59476436484382,"sku":null,"price":85.0,"currency_code":"USD","in_stock":true},{"title":"Medium 23\"","offer_id":59476436517150,"sku":null,"price":85.0,"currency_code":"USD","in_stock":true},{"title":"Large 24\"","offer_id":59476436549918,"sku":null,"price":85.0,"currency_code":"USD","in_stock":true},{"title":"Extra Large 25\"","offer_id":59476436582686,"sku":null,"price":85.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0788\/9462\/9150\/files\/IMG_6398.jpg?v=1781716127","url":"https:\/\/savethewilde.com\/products\/danna-purple-pink","provider":"Wilde","version":"1.0","type":"link"}