  // --- Navigation Menu Interactions ---
        function toggleMobileMenu() {
            document.getElementById('mobile-menu').classList.toggle('open');
        }
        function closeMobileMenu() {
            document.getElementById('mobile-menu').classList.remove('open');
        }
        function toggleMobileDropdown() {
            const panel = document.getElementById('mobile-services-panel');
            const icon = document.getElementById('mobile-dropdown-icon');
            panel.classList.toggle('open');
            icon.style.transform = panel.classList.contains('open') ? 'rotate(180deg)' : 'rotate(0deg)';
        }

        // --- Hero Carousel Component ---
        const heroSlides = document.querySelectorAll('.hero-slide');
        let currentHeroIdx = 0;
        function showHeroSlide(index) {
            heroSlides.forEach((slide, idx) => slide.classList.toggle('active', idx === index));
        }
        function nextHeroSlide() {
            currentHeroIdx = (currentHeroIdx + 1) % heroSlides.length;
            showHeroSlide(currentHeroIdx);
        }
        function prevHeroSlide() {
            currentHeroIdx = (currentHeroIdx - 1 + heroSlides.length) % heroSlides.length;
            showHeroSlide(currentHeroIdx);
        }
        setInterval(nextHeroSlide, 5000);

        // --- Dynamic UNBROKEN Infinite Loop Services Slider Engine ---
        const track = document.getElementById('services-track');
        let originalCards = Array.from(track.children);
        let cardsInView = getCardsInView();
        
        // Clone nodes upfront to create seamless infinite wrap-around
        originalCards.forEach(card => {
            let clone = card.cloneNode(true);
            track.appendChild(clone);
        });
        originalCards.forEach(card => {
            let clone = card.cloneNode(true);
            track.insertBefore(clone, track.firstChild);
        });

        let serviceIndex = originalCards.length; // Start index at the beginning of true elements
        let isTransitioning = false;

        function getCardsInView() {
            if (window.innerWidth >= 1024) return 3;
            if (window.innerWidth >= 640) return 2;
            return 1;
        }

        function updateSliderPosition(animate = true) {
            const cards = track.children;
            const cardWidth = cards[0].getBoundingClientRect().width;
            const gap = 24;
            
            if (animate) {
                track.style.transition = 'transform 0.5s ease-in-out';
            } else {
                track.style.transition = 'none';
            }
            track.style.transform = `translateX(-${serviceIndex * (cardWidth + gap)}px)`;
        }

        // Initialize slider position instantly without animation frame stutter
        setTimeout(() => updateSliderPosition(false), 50);

        function slideServices(direction) {
            if (isTransitioning) return;
            isTransitioning = true;

            if (direction === 'next') {
                serviceIndex++;
                updateSliderPosition(true);
            } else {
                serviceIndex--;
                updateSliderPosition(true);
            }
        }

        // Monitor track transitions to snap positions infinitely back to reference anchors
        track.addEventListener('transitionend', () => {
            isTransitioning = false;
            const totalOriginals = originalCards.length;

            if (serviceIndex >= totalOriginals * 2) {
                serviceIndex = totalOriginals;
                updateSliderPosition(false);
            } else if (serviceIndex < totalOriginals) {
                serviceIndex = (totalOriginals * 2) - 1;
                updateSliderPosition(false);
            }
        });

        // Auto Scroll Services Loop Trigger
        let servicesInterval = setInterval(() => slideServices('next'), 3500);
        
        document.querySelector('.services-section').addEventListener('mouseenter', () => clearInterval(servicesInterval));
        document.querySelector('.services-section').addEventListener('mouseleave', () => {
            clearInterval(servicesInterval);
            servicesInterval = setInterval(() => slideServices('next'), 3500);
        });

        window.addEventListener('resize', () => {
            serviceIndex = originalCards.length;
            updateSliderPosition(false);
        });

        // --- FAQ Functional Behavior ---
        document.querySelectorAll('.faq-trigger').forEach(trigger => {
            trigger.addEventListener('click', () => {
                const card = trigger.parentElement;
                const panel = card.querySelector('.faq-panel');
                const symbol = card.querySelector('.faq-symbol');
                const isActive = card.classList.contains('active-card');

                document.querySelectorAll('.faq-card').forEach(c => {
                    c.classList.remove('active-card');
                    c.querySelector('.faq-panel').style.maxHeight = null;
                    c.querySelector('.faq-symbol').textContent = '+';
                });

                if (!isActive) {
                    card.classList.add('active-card');
                    panel.style.maxHeight = panel.scrollHeight + "px";
                    symbol.textContent = '-';
                }
            });
        });

        // --- Window Scroll Utilities ---
        const goTopTrigger = document.getElementById('go-top-trigger');
        window.addEventListener('scroll', () => {
            goTopTrigger.style.display = (window.scrollY > 400) ? 'flex' : 'none';
        });
        function scrollToTop() {
            window.scrollTo({ top: 0, behavior: 'smooth' });
        }











        document.addEventListener("DOMContentLoaded", function(){

    const slides = document.querySelectorAll(".voe-slide");
    const nextBtn = document.querySelector(".voe-next-btn");
    const prevBtn = document.querySelector(".voe-prev-btn");

    let current = 0;
    let autoSlide;

    function showSlide(index){
        slides.forEach(slide=>{
            slide.classList.remove("active");
        });

        slides[index].classList.add("active");
    }

    function nextSlide(){
        current++;
        if(current >= slides.length){
            current = 0;
        }
        showSlide(current);
    }

    function prevSlide(){
        current--;
        if(current < 0){
            current = slides.length - 1;
        }
        showSlide(current);
    }

    nextBtn.addEventListener("click", ()=>{
        nextSlide();
        resetAuto();
    });

    prevBtn.addEventListener("click", ()=>{
        prevSlide();
        resetAuto();
    });

    function startAuto(){
        autoSlide = setInterval(nextSlide, 5000);
    }

    function resetAuto(){
        clearInterval(autoSlide);
        startAuto();
    }

    showSlide(current);
    startAuto();
});