/* Scoped to: saas-template-contactfaq */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="saas-template-contactfaq"]');
  componentRoots.forEach(function(componentRoot) {
    // Helper to query within component, with fallback to document for sibling elements
    var $ = function(sel) { 
      return componentRoot.querySelector(sel) || document.querySelector('[data-component-slug="saas-template-contactfaq"] ~ ' + sel) || document.querySelector(sel);
    };
    var $$ = function(sel) { 
      var results = componentRoot.querySelectorAll(sel);
      return results.length ? results : document.querySelectorAll(sel);
    };
    // Original component JS runs in this scope
    document.querySelectorAll(".accordion").forEach((item) => { const btn = item.querySelector(".accordion-toggle"); const content = item.querySelector(".accordion-content"); const icon = btn.querySelector("svg"); if (item.classList.contains("open")) { content.style.maxHeight = content.scrollHeight + "px"; icon.classList.add("rotate-180"); } btn.addEventListener("click", () => { const open = item.classList.contains("open"); document.querySelectorAll(".accordion").forEach((i) => { i.classList.remove("open", "bg-[#F8FAFB]"); i.querySelector(".accordion-content").style.maxHeight = "0px"; i.querySelector(".accordion-toggle svg").classList.remove("rotate-180"); }); if (!open) { item.classList.add("open", "bg-[#F8FAFB]"); content.style.maxHeight = content.scrollHeight + "px"; icon.classList.add("rotate-180"); } }); });
  });
})();