<style>
.whitefoot {
    top: -56px;
}
.blckfootpd {
    padding: 0px 0px 20px 0px;
}
</style>


<!--start footer-->
<footer class="desk">
    <div class="auto-container" style="background: #193778;">
        <div class="container">
            <div class="row footwht">
                <div class="col-md-4">
                    <h3>Patient Care</h3>
                    <a href="#"><p>Book Appointment</p></a>
                    <a href="#"><p>Find a Doctor</p></a>
                    <a href="#"><p>Insurance & TPA</p></a>
                    <a href="#"><p>Tariff</p></a>
                    <a href="#"><p>Health Check Packages</p></a>
                    <a href="#"><p>Patient Testimonials</p></a>
                    <a href="#"><p>Patient Brochure</p></a>
                    <a href="#"><p>Complaints & Feedback Form</p></a>
                    <a href="#"><p>Floor Directory</p></a>
                </div>
                <div class="col-md-4">
                    <h3>Useful Links</h3>
                    <a href="#"><p>Centers of Excellence</p></a>
                    <a href="#"><p>Corporate & Partnerships</p></a>
                    <a href="#"><p>News & Press Releases</p></a>
                    <a href="#"><p>Download Centre</p></a>
                    <a href="#"><p>Work with us</p></a>
                    <a href="#"><p>Procedures</p></a>
                    <a href="#"><p>About us</p></a>
                    <a href="#"><p>Specialities</p></a>
                </div>
                <div class="col-md-4">
                    <h3>Services</h3>
                    <a href="#"><p>Emergency & Trauma Care</p></a>
                    <a href="#"><p>OPD & IPD</p></a>
                    <a href="#"><p>Diagnostic</p></a>
                    <a href="#"><p>Pharmacy(24*7)</p></a>
                    <a href="#"><p>Home Care Services</p></a>
                    <a href="#"><p>Pain Clinic</p></a>
                    <a href="#"><p>Retinal Clinic</p></a>
                    <a href="#"><p>Child & Adolescent Guidance</p></a>
                </div>
            </div>
        </div>
        <!--<img src="images/footer-img.png" class="img100 mt-30">-->
    </div>
    <div class="blackfoot">
        <div class="container">
            <div class="whitefoot">
                <div class="rg">
                    <button class="footbtn">Get appointment </button>
                    <button class="footbtn">24*7 Emergency </button>
                    <button class="footbtn">Get Direction </button>
                </div>
                <div class="row">
                    <div class="col-md-4">
                        <img src="images/logonew.webp" class="logoimg">
                    </div>
                    <div class="col-md-2"></div>
                    <div class="col-md-6">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="row">
                                    <div class="col-md-2">
                                        <i class="fas fa-location fafaicon"></i>
                                        <!--<img src="images/location.png">-->
                                    </div>
                                    <div class="col-md-10 pl0">
                                        <p>St Andrew’s Road,<br>Bandra (West),<br>Mumbai – 400 050. <br>Maharashtra, India.</p>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="row mb-10">
                                    <div class="col-md-2">
                                        <i class="fa-solid fa-phone fafaicon"></i>
                                        <!--<img src="images/mail.png">-->
                                    </div>
                                    <div class="col-md-10 pl0">
                                        <p>022-62670366</p>
                                    </div>
                                </div>
                                <div class="row pt10">
                                    <div class="col-md-2">
                                        <i class="fa-solid fa-envelope fafaicon"></i>
                                        <!--<img src="images/callfoot.png">-->
                                    </div>
                                    <div class="col-md-10 pl0">
                                        <p>info@holyfamilyhospital.in</p>
                                    </div>
                                </div>
                                <div class="row fllowimg">
                                    <div class="col-md-2"></div>
                                    <div class="col-md-10 pl0 pt-10">
                                        <p><b>Follow us on</b></p>
                                        <i class="fab fa-facebook-f fafaicon"></i>
                                        <i class="fab fa-twitter fafaicon"></i>
                                        <i class="fab fa-instagram fafaicon"></i>
                                        <i class="fa-brands fa-youtube fafaicon"></i>
                                        <i class="fab fa-linkedin-in fafaicon"></i>

                                        <!--<img src="images/facebook.png">-->
                                        <!--<img src="images/twt.png">-->
                                        <!--<img src="images/insta.png">-->
                                        <!--<img src="images/yt.png">-->
                                        <!--<img src="images/ln.png">-->
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <div class="row blckfootpd">
                <div class="col-md-9">
                    <p>2025 Holy Family Hospital & Medical Research Center | Designed, Developed by : HashTAGit.</p>
                </div>
                <div class="col-md-3">
                    <p class="fr">Managed by : HashTAGit.</p>
                </div>
            </div>
        </div>
    </div>
</footer>

<!--footer end-->







<!--infrastructure-->
<script>
    document.addEventListener("DOMContentLoaded", function () {
  // Configuration - dynamic based on screen size
  let itemsPerSlide = window.innerWidth < 720 ? 1 : 1;
  const totalItems = document.querySelectorAll(
    ".multi-carousel-item:not(.clone)"
  ).length;
  let slideBy = 1;
  const maxCenterWidth = 700;

  // DOM elements
  const carousel = document.getElementById("multiCarousel");
  const carouselInner = document.getElementById("carouselInner");
  const prevBtn = document.getElementById("prevBtn");
  const nextBtn = document.getElementById("nextBtn");
  const carouselTitle = document.getElementById("carouselTitle");

  // Progress bar and timing variables
  const progressDuration = 10000; // 10 seconds
  let currentSlideStartTime = null;
  let pausedElapsedTime = 0;
  let autoAdvanceTimeout = null;
  let progressAnimationTimeout = null;

  // State variables
  let userHasInteracted = false;
  let isHoverPaused = false;
  let userInactivityTimeout = null;
  let isDragging = false;
  let isInitialized = false; // Flag to track initial setup
  let isFirstLoad = true; // Flag to track first load
  let currentCenterSlideNumber = -1; // Track current center slide number
  let initialLoadComplete = false; // Flag to track if initial load is complete
  let lastDirection = "none"; // Track last navigation direction

  // Function to calculate slide widths based on container width
  function calculateSlideWidths() {
    const containerWidth = carousel.offsetWidth;
    const isMobile = window.innerWidth < 720;
    if (isMobile) {
      document.documentElement.style.setProperty("--slide-width", "100%");
      return { slideWidthPercent: 100, translateOffset: 0 };
    }
    let centerWidthPercent;
    if (containerWidth <= maxCenterWidth) {
      centerWidthPercent = 75;
    } else {
      centerWidthPercent = (maxCenterWidth / containerWidth) * 100;
    }
    document.documentElement.style.setProperty(
      "--slide-width",
      `${centerWidthPercent}%`
    );
    const translateOffset = (100 - centerWidthPercent) / 2;
    return {
      slideWidthPercent: centerWidthPercent,
      translateOffset: translateOffset
    };
  }

  // Function to update configuration based on screen size
  function updateConfig() {
    itemsPerSlide = 1;
    slideBy = 1;
    return calculateSlideWidths();
  }

  // Function to reset all progress bars immediately without flicker
  function resetAllProgressBars() {
    const allProgressBars = document.querySelectorAll(".progress-bar-fill");
    allProgressBars.forEach((progressBar) => {
      progressBar.style.transition = "none";
      progressBar.style.width = "0%";
      void progressBar.offsetWidth; // Force reflow
    });
  }

  // Function to get the slide number (1, 2, 3) from an element
  function getSlideNumber(element) {
    if (!element) return -1;

    const itemNumber = element.querySelector(".item-number");
    if (itemNumber) {
      return parseInt(itemNumber.textContent, 10);
    }

    return -1;
  }

  // Function to reset all slides to default opacity
  function resetAllSlidesOpacity() {
    const allItems = document.querySelectorAll(".multi-carousel-item, .clone");
    allItems.forEach((item) => {
      // Remove any inline opacity styles that might override CSS
      item.style.opacity = "";
      item.classList.remove("center", "fade-in");
    });
  }

  // Function to update center item highlighting with fade-in effect
  function updateCenterItem() {
    const allItems = document.querySelectorAll(".multi-carousel-item, .clone");
    const centerIndex = Math.round(position);

    // Reset all slides first
    resetAllSlidesOpacity();

    if (allItems[centerIndex]) {
      const newCenterItem = allItems[centerIndex];

      // Get the slide number (1, 2, 3)
      const slideNumber = getSlideNumber(newCenterItem);

      // Add center class
      newCenterItem.classList.add("center");

      // Add fade-in effect only if:
      // 1. Initial load is complete
      // 2. This is a different slide than before
      if (initialLoadComplete && slideNumber !== currentCenterSlideNumber) {
        newCenterItem.classList.add("fade-in");

        // Remove fade-in class after animation completes
        setTimeout(() => {
          newCenterItem.classList.remove("fade-in");
        }, 600);
      }

      // Update current center slide number
      currentCenterSlideNumber = slideNumber;
    }
  }

  // Clear all timers
  function clearAllTimers() {
    if (autoAdvanceTimeout) clearTimeout(autoAdvanceTimeout);
    if (progressAnimationTimeout) clearTimeout(progressAnimationTimeout);
    if (userInactivityTimeout) clearTimeout(userInactivityTimeout);
    autoAdvanceTimeout = null;
    progressAnimationTimeout = null;
    userInactivityTimeout = null;
  }

  // Start new slide timer (always from zero)
  function startSlideTimerDelayed(delay = 150) {
    setTimeout(() => {
      startSlideTimer();
    }, delay);
  }

  function startSlideTimer() {
    if (isHoverPaused || isDragging) return;
    clearAllTimers();

    const centerItem = document.querySelector(
      ".multi-carousel-item.center, .clone.center"
    );
    if (!centerItem) return;

    const progressFill = centerItem.querySelector(".progress-bar-fill");
    if (!progressFill) return;

    // Reset bar with no transition first
    progressFill.style.transition = "none";
    progressFill.style.width = "0%";
    void progressFill.offsetWidth; // force reflow

    currentSlideStartTime = Date.now();
    pausedElapsedTime = 0;

    // Apply transition after reset
    setTimeout(() => {
      if (isHoverPaused || isDragging) return;
      progressFill.style.transition = `width ${progressDuration}ms linear`;
      progressFill.style.width = "100%";
    }, 10);

    autoAdvanceTimeout = setTimeout(() => {
      if (!isHoverPaused && !isDragging) {
        next();
      }
    }, progressDuration);
  }

  // Pause timer (for hover)
  function pauseSlideTimer() {
    if (!currentSlideStartTime || isHoverPaused) return;
    clearAllTimers();
    pausedElapsedTime = Date.now() - currentSlideStartTime;
    isHoverPaused = true;

    const centerItem = document.querySelector(
      ".multi-carousel-item.center, .clone.center"
    );
    if (centerItem) {
      const progressFill = centerItem.querySelector(".progress-bar-fill");
      if (progressFill) {
        const computedStyle = window.getComputedStyle(progressFill);
        const currentWidth = computedStyle.width;
        progressFill.style.transition = "none";
        progressFill.style.width = currentWidth;
      }
    }
  }

  // Resume timer (after hover)
  function resumeSlideTimer() {
    if (!isHoverPaused || isDragging) return;
    isHoverPaused = false;

    const centerItem = document.querySelector(
      ".multi-carousel-item.center, .clone.center"
    );
    if (centerItem) {
      const progressFill = centerItem.querySelector(".progress-bar-fill");
      if (progressFill) {
        const remainingTime = Math.max(0, progressDuration - pausedElapsedTime);
        const computedStyle = window.getComputedStyle(progressFill);
        const currentWidth = computedStyle.width;
        progressFill.style.transition = `width ${remainingTime}ms linear`;
        progressFill.style.width = "100%";

        currentSlideStartTime = Date.now() - pausedElapsedTime;
        autoAdvanceTimeout = setTimeout(() => {
          if (!isHoverPaused && !isDragging) {
            next();
          }
        }, remainingTime);
      }
    }
  }

  // Mark user interaction
  function markUserInteraction(isDragAction = false) {
    if (!isDragAction) userHasInteracted = true;
    isHoverPaused = false;
    pausedElapsedTime = 0;
    clearAllTimers();

    const centerItem = document.querySelector(
      ".multi-carousel-item.center, .clone.center"
    );
    if (centerItem) {
      const progressFill = centerItem.querySelector(".progress-bar-fill");
      if (progressFill) {
        const computedStyle = window.getComputedStyle(progressFill);
        const currentWidth = computedStyle.width;
        progressFill.style.transition = "none";
        progressFill.style.width = currentWidth;
      }
    }

    if (!isDragAction) {
      userInactivityTimeout = setTimeout(() => {
        userHasInteracted = false;
        if (!isHoverPaused && !isDragging) {
          startSlideTimer();
        }
      }, 10000);
    }
  }

  function handleDragInteraction() {
    clearAllTimers();
    const centerItem = document.querySelector(
      ".multi-carousel-item.center, .clone.center"
    );
    if (centerItem) {
      const progressFill = centerItem.querySelector(".progress-bar-fill");
      if (progressFill) {
        const computedStyle = window.getComputedStyle(progressFill);
        const currentWidth = computedStyle.width;
        progressFill.style.transition = "none";
        progressFill.style.width = currentWidth;
      }
    }
  }

  function restartProgressAfterDrag() {
    isHoverPaused = false;
    pausedElapsedTime = 0;
    currentSlideStartTime = null;
    startSlideTimerDelayed(100);
  }

  // Dynamically add clone elements for infinite loop effect
  function initializeClones() {
    const originalItems = Array.from(
      document.querySelectorAll(".multi-carousel-item:not(.clone)")
    );
    document.querySelectorAll(".clone").forEach((clone) => clone.remove());

    const clonesNeeded = 2;

    // Prepend end clones
    originalItems
      .slice(-clonesNeeded)
      .reverse()
      .forEach((item) => {
        const clone = item.cloneNode(true);
        clone.classList.add("clone");
        // Remove any inline styles that might interfere with CSS opacity
        clone.style.opacity = "";
        const progressFill = clone.querySelector(".progress-bar-fill");
        if (progressFill) {
          progressFill.style.transition = "none";
          progressFill.style.width = "0%";
        }
        carouselInner.prepend(clone);
      });

    // Append start clones
    originalItems.slice(0, clonesNeeded).forEach((item) => {
      const clone = item.cloneNode(true);
      clone.classList.add("clone");
      // Remove any inline styles that might interfere with CSS opacity
      clone.style.opacity = "";
      const progressFill = clone.querySelector(".progress-bar-fill");
      if (progressFill) {
        progressFill.style.transition = "none";
        progressFill.style.width = "0%";
      }
      carouselInner.append(clone);
    });
  }

  // Set carousel height - now uses calc to account for margins
  function setCarouselHeight() {
    // Set a CSS variable for carousel height that accounts for the margins
    document.documentElement.style.setProperty(
      "--carousel-height",
      "calc(100vh - 5rem)" // 2.5rem top + 2.5rem bottom = 5rem total
    );
  }

  // Update carousel position visually
  let slideConfig = updateConfig();
  initializeClones();
  setCarouselHeight();

  let currentIndex = 0;
  let position = 2;
  let isAnimating = false;

  // Pre-load all images to prevent flash on first slide
  function preloadImages() {
    const allImages = document.querySelectorAll(
      ".multi-carousel-item img, .clone img"
    );
    return Promise.all(
      Array.from(allImages).map((img) => {
        return new Promise((resolve) => {
          if (img.complete) {
            resolve();
          } else {
            img.onload = () => resolve();
            img.onerror = () => resolve();
          }
        });
      })
    );
  }

  function updateCarouselPosition(animate = true) {
    // If this is the first position update on page load, don't animate
    if (!isInitialized) {
      animate = false;
    }

    carouselInner.style.transition = animate ? "transform 0.5s ease" : "none";
    const { slideWidthPercent, translateOffset } = slideConfig;
    const translateX = -position * slideWidthPercent + translateOffset;
    carouselInner.style.transform = `translateX(${translateX}%)`;

    setTimeout(
      () => {
        updateCenterItem();
      },
      animate ? 50 : 0
    );
  }

  // Preload images and then initialize carousel properly
  preloadImages().then(() => {
    // Set initial position without animation
    updateCarouselPosition(false);

    // Update center item immediately
    updateCenterItem();

    // Make carousel visible after everything is positioned
    setTimeout(() => {
      carouselInner.classList.add("initialized");
      isInitialized = true;
      isFirstLoad = false;

      // After a delay, allow all slides to have fade-in effect
      setTimeout(() => {
        initialLoadComplete = true;
      }, 1000);
    }, 50);

    // Start the first timer after everything is loaded
    setTimeout(() => {
      startSlideTimer();
    }, 1000);
  });

  carouselInner.addEventListener("transitionend", function (event) {
    if (event.target !== carouselInner || event.propertyName !== "transform")
      return;
    isAnimating = false;

    const oldPosition = position;

    if (position >= totalItems + 2) {
      // When we reach the end clones, jump to the real slides without animation
      position = 2 + (position - (totalItems + 2));
      carouselInner.style.transition = "none";
      const { slideWidthPercent, translateOffset } = slideConfig;
      const translateX = -position * slideWidthPercent + translateOffset;
      carouselInner.style.transform = `translateX(${translateX}%)`;

      // Force reflow to ensure the transition is applied
      void carouselInner.offsetWidth;

      // Update center item immediately after position change
      updateCenterItem();
    } else if (position < 2) {
      // When we reach the beginning clones, jump to the real slides without animation
      position = totalItems + position;
      carouselInner.style.transition = "none";
      const { slideWidthPercent, translateOffset } = slideConfig;
      const translateX = -position * slideWidthPercent + translateOffset;
      carouselInner.style.transform = `translateX(${translateX}%)`;

      // Force reflow to ensure the transition is applied
      void carouselInner.offsetWidth;

      // Update center item immediately after position change
      updateCenterItem();
    }

    if (position !== oldPosition) {
      resetAllProgressBars();
      if (!isHoverPaused) {
        startSlideTimerDelayed(100);
      }
    } else {
      currentIndex = (position - 2 + totalItems) % totalItems;
      if (!isHoverPaused) {
        startSlideTimerDelayed(100);
      }
    }
  });

  function next() {
    if (isAnimating) return;
    isAnimating = true;
    position += slideBy;
    lastDirection = "next";
    initialLoadComplete = true; // Ensure animations are enabled after user interaction

    clearAllTimers();
    userHasInteracted = false;
    isHoverPaused = false;
    pausedElapsedTime = 0;
    currentSlideStartTime = null;

    resetAllProgressBars();
    updateCarouselPosition();
  }

  function prev() {
    if (isAnimating) return;
    isAnimating = true;
    position -= slideBy;
    lastDirection = "prev";
    initialLoadComplete = true; // Ensure animations are enabled after user interaction

    clearAllTimers();
    userHasInteracted = false;
    isHoverPaused = false;
    pausedElapsedTime = 0;
    currentSlideStartTime = null;

    resetAllProgressBars();
    updateCarouselPosition();
  }

  // Event listeners...
  nextBtn.addEventListener("click", next);
  prevBtn.addEventListener("click", prev);

  // Mouse drag functionality
  let startX = 0;
  let startPosition = 0;

  const carouselImages = document.querySelectorAll("#carouselInner img");
  carouselImages.forEach((img) => {
    img.addEventListener("dragstart", (e) => e.preventDefault());
    img.style.pointerEvents = "none";
  });

  carousel.addEventListener("mousedown", startDrag);
  carousel.addEventListener("touchstart", startDrag, { passive: true });
  carousel.addEventListener("mousemove", drag);
  carousel.addEventListener("touchmove", drag, { passive: true });
  carousel.addEventListener("mouseup", endDrag);
  carousel.addEventListener("touchend", endDrag);
  carousel.addEventListener("mouseleave", endDrag);

  function startDrag(e) {
    if (e.target.closest("button")) return;
    if (isAnimating) return;
    isDragging = true;
    startX = e.type.includes("mouse") ? e.clientX : e.touches[0].clientX;
    startPosition = position;
    carousel.classList.add("dragging");
    carouselInner.style.transition = "none";
    document.body.style.cursor = "grabbing";
    document.body.style.userSelect = "none";
    handleDragInteraction();
  }

  function drag(e) {
    if (!isDragging) return;
    const x = e.type.includes("mouse") ? e.clientX : e.touches[0].clientX;
    const walk = (x - startX) / carousel.offsetWidth;
    const { slideWidthPercent, translateOffset } = slideConfig;
    const newPosition = startPosition - walk * (100 / slideWidthPercent);
    const translateX = -newPosition * slideWidthPercent + translateOffset;
    carouselInner.style.transform = `translateX(${translateX}%)`;
  }

  function endDrag(e) {
    if (!isDragging) return;
    isDragging = false;
    carousel.classList.remove("dragging");
    document.body.style.cursor = "";
    document.body.style.userSelect = "";

    const x = e.type?.includes("mouse")
      ? e.clientX
      : e.changedTouches
      ? e.changedTouches[0].clientX
      : startX;
    const walk = (x - startX) / carousel.offsetWidth;

    if (Math.abs(walk) > 0.2) {
      initialLoadComplete = true; // Ensure animations are enabled after user interaction
      if (walk > 0) {
        lastDirection = "prev";
        prev();
      } else {
        lastDirection = "next";
        next();
      }
      setTimeout(() => {
        restartProgressAfterDrag();
      }, 600);
    } else {
      updateCarouselPosition();
      restartProgressAfterDrag();
    }
  }

  // Keyboard navigation
  document.addEventListener("keydown", function (e) {
    if (
      carousel.offsetParent === null ||
      document.activeElement.tagName === "INPUT" ||
      document.activeElement.tagName === "TEXTAREA" ||
      document.activeElement.isContentEditable
    )
      return;
    switch (e.key) {
      case "ArrowLeft":
        e.preventDefault();
        prev();
        break;
      case "ArrowRight":
        e.preventDefault();
        next();
        break;
    }
  });

  // Hover events
  carousel.addEventListener(
    "mouseenter",
    (event) => {
      const targetSlide = event.target.closest(".multi-carousel-item, .clone");
      if (
        targetSlide &&
        targetSlide.classList.contains("center") &&
        !isDragging
      ) {
        pauseSlideTimer();
      }
    },
    true
  );

  carousel.addEventListener(
    "mouseleave",
    (event) => {
      const currentCenter = document.querySelector(
        ".multi-carousel-item.center, .clone.center"
      );
      if (
        currentCenter &&
        !currentCenter.contains(event.relatedTarget) &&
        !isDragging
      ) {
        resumeSlideTimer();
      }
    },
    true
  );

  // General activity
  carousel.addEventListener("click", (e) => {
    if (!e.target.closest("button") && !isDragging) {
      markUserInteraction();
    }
  });

  carousel.addEventListener("wheel", () => {
    markUserInteraction();
  });

  // Resize handler
  window.addEventListener("resize", function () {
    slideConfig = updateConfig();
    setCarouselHeight();
    clearAllTimers();
    isHoverPaused = false;
    pausedElapsedTime = 0;
    resetAllProgressBars();
    updateCarouselPosition(false);
    markUserInteraction();
  });
});

/**
 * Script to dynamically adjust carousel height based on heading element presence
 */

class CarouselHeightAdjuster {
  constructor() {
    this.headingElement = null;
    this.carouselContainer = null;
    this.observer = null;
    this.resizeObserver = null;

    this.init();
  }

  init() {
    // Wait for DOM to be fully loaded
    if (document.readyState === "loading") {
      document.addEventListener("DOMContentLoaded", () => this.setup());
    } else {
      this.setup();
    }
  }

  setup() {
    // Locate required elements
    this.headingElement = document.querySelector(".heading");
    this.carouselContainer = document.querySelector(
      ".multi-carousel-container"
    );

    if (!this.carouselContainer) {
      console.warn("Elemento .multi-carousel-container não encontrado");
      return;
    }

    if (!this.headingElement) {
      console.warn("Elemento .heading não encontrado");
      return;
    }

    // Setup observers
    this.setupMutationObserver();
    this.setupResizeObserver();

    // Perform initial adjustment
    this.adjustCarouselHeight();

    console.log("CarouselHeightAdjuster inicializado com sucesso");
  }

  setupMutationObserver() {
    // Observer to detect changes in heading element classes
    this.observer = new MutationObserver((mutations) => {
      mutations.forEach((mutation) => {
        if (
          mutation.type === "attributes" &&
          mutation.attributeName === "class"
        ) {
          this.adjustCarouselHeight();
        }
      });
    });

    // Observe changes in heading element class attribute
    this.observer.observe(this.headingElement, {
      attributes: true,
      attributeFilter: ["class"]
    });
  }

  setupResizeObserver() {
    // Observer to detect changes in heading size (in case content changes)
    if (window.ResizeObserver) {
      this.resizeObserver = new ResizeObserver(() => {
        if (this.isHeadingVisible()) {
          this.adjustCarouselHeight();
        }
      });

      this.resizeObserver.observe(this.headingElement);
    }
  }

  isHeadingVisible() {
    if (!this.headingElement) return false;

    // Check if element is visible
    const style = window.getComputedStyle(this.headingElement);
    const hasDisplayNone = style.display === "none";
    const hasVisibilityHidden = style.visibility === "hidden";
    const hasOpacityZero = parseFloat(style.opacity) === 0;
    const hasDNoneClass = this.headingElement.classList.contains("d-none");

    return (
      !hasDisplayNone &&
      !hasVisibilityHidden &&
      !hasOpacityZero &&
      !hasDNoneClass
    );
  }

  getHeadingHeight() {
    if (!this.isHeadingVisible()) return 0;

    // Calculate total heading height including margins
    const rect = this.headingElement.getBoundingClientRect();
    const style = window.getComputedStyle(this.headingElement);

    const marginTop = parseFloat(style.marginTop) || 0;
    const marginBottom = parseFloat(style.marginBottom) || 0;

    return rect.height + marginTop + marginBottom;
  }

  adjustCarouselHeight() {
    if (!this.carouselContainer) return;

    const headingHeight = this.getHeadingHeight();
    const containerMargins = 80; // 2.5rem top + 2.5rem bottom = 80px (assuming 1rem = 16px)

    let newHeight;

    if (headingHeight > 0) {
      // If heading is visible, subtract its height + container margins
      newHeight = `calc(100vh - ${containerMargins + headingHeight}px)`;
    } else {
      // If heading is not visible, use only container margins
      newHeight = `calc(100vh - ${containerMargins}px)`;
    }

    // Apply new height
    this.carouselContainer.style.height = newHeight;

    console.log(
      `Altura do carousel ajustada para: ${newHeight} (heading ${
        headingHeight > 0 ? "visível" : "oculto"
      })`
    );
  }

  // Method to force recalculation (useful for debugging or manual use)
  recalculate() {
    this.adjustCarouselHeight();
  }

  // Method to destroy observers (cleanup)
  destroy() {
    if (this.observer) {
      this.observer.disconnect();
      this.observer = null;
    }

    if (this.resizeObserver) {
      this.resizeObserver.disconnect();
      this.resizeObserver = null;
    }

    console.log("CarouselHeightAdjuster destruído");
  }
}

// Initialize adjuster automatically
const carouselHeightAdjuster = new CarouselHeightAdjuster();

// Expose globally for manual use if needed
window.CarouselHeightAdjuster = CarouselHeightAdjuster;
window.carouselHeightAdjuster = carouselHeightAdjuster;

// Example of manual usage:
// carouselHeightAdjuster.recalculate(); // Force recalculation
// carouselHeightAdjuster.destroy(); // Remove observers

</script>




<script>
$(document).ready(function(){
  // Add smooth scrolling to all links
  $("a").on('click', function(event) {

    // Make sure this.hash has a value before overriding default behavior
    if (this.hash !== "") {
      // Prevent default anchor click behavior
      event.preventDefault();

      // Store hash
      var hash = this.hash;

      // Using jQuery's animate() method to add smooth page scroll
      // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
      $('html, body').animate({
        scrollTop: $(hash).offset().top
      }, 200, function(){
   
        // Add hash (#) to URL when done scrolling (default click behavior)
        window.location.hash = hash;
      });
    } // End if
  });
  
  $('.show_brand').click(function(){ 
            var brand_id = $(this).attr('id');
            if(brand_id == "all"){
                $('.hide_brand').show();
                $('.show_brand').removeClass('active');
                $('#all').addClass('active');
            }else{
                $('.hide_brand').hide();
                $('#show_brand'+brand_id).show();
                $('.show_brand').removeClass('active');
                $('#'+brand_id).addClass('active');
            }
        }); 
});
</script>


<script>
    // this function used to creat th countUp  animation for business websites
// use the three parameters to customize it 
// call it for every element
// note that may be small diffrance in the count 100 be 99 so chack it 
function numCounter(tagId,maxCount,speed){
    var initialNumber = 0;
    function counter(){
        document.getElementById(tagId).innerHTML = initialNumber;
        ++initialNumber;
    }
    var counterDelay = setInterval(counter,speed);
    function totalTime(){
        clearInterval(counterDelay);
    }
    var totalPeriod = speed * (maxCount);  
    setTimeout(totalTime, totalPeriod);
}

numCounter("Projects",83,100);
numCounter("Experienced",1250,10);
numCounter("Partners",20,10);
numCounter("Clinics",25,100);
numCounter("Happy",60000,1);

</script>






<script>
    const animatedEls = document.querySelectorAll("[data-animation]");

const observer = new IntersectionObserver((entries) => {
	entries.forEach((entry) => {
		const animation = entry.target.getAttribute("data-animation");

		if (entry.isIntersecting) {
			entry.target.classList.add("animated", `${animation}`);
		} else {
			entry.target.classList.remove("animated", `${animation}`);
		}
	});
});

animatedEls.forEach((el) => observer.observe(el));

</script>
<script>
    // interval is in milliseconds. 1000 = 1 second -> so 1000 * 10 = 10 seconds
$('.carousel').carousel({
  interval: 1000 * 10
});
</script>




<script>
    const buttonElement = document.querySelectorAll('.tablinks');
const tabContent = document.querySelectorAll(".tabcontent");

tabContent[0].style.display = "block";

buttonElement.forEach(function (i) {
    i.addEventListener('click', function (event) {

        for (let x = 0; x < buttonElement.length; x++) {
            if (event.target.id == buttonElement[x].id) {
                buttonElement[x].className = buttonElement[x].className.replace(" active", "");
                tabContent[x].style.display = "block";
                event.currentTarget.className += " active";
            } else {
                tabContent[x].style.display = "none";
                buttonElement[x].className = buttonElement[x].className.replace(" active", "");
            }
        }
        
    });
});
</script>
<script src="https://storage.ko-fi.com/cdn/scripts/overlay-widget.js"></script>

<script>
    let question = document.querySelectorAll(".question");

question.forEach(question => {
  question.addEventListener("click", event => {
    const active = document.querySelector(".question.active");
    if(active && active !== question ) {
      active.classList.toggle("active");
      active.nextElementSibling.style.maxHeight = 0;
    }
    question.classList.toggle("active");
    const answer = question.nextElementSibling;
    if(question.classList.contains("active")){
      answer.style.maxHeight = answer.scrollHeight + "px";
    } else {
      answer.style.maxHeight = 0;
    }
  })
})

</script>



<script>
    	$(function(){

		$.each($(".print-tab .print-tab-menu > li"), function(index, value){
			var menu = $(value).data('tab-menu');
			var tabID = $(value).parent().parent().data('tab-id');
			var hash = window.location.hash.split("#").join('');
			
			if(hash.length > 0){
					
				if(menu == hash){
					$('.print-tab[data-tab-id="' + tabID + '"] .print-tab-menu > li[data-tab-menu="' + menu + '"]').addClass('active');
					$('.print-tab[data-tab-id="' + tabID + '"] .print-tab-content > div[data-tab-content="' + menu + '"]').addClass('view');
				}
				
			}else{
				$('.print-tab[data-tab-id="' + tabID + '"] .print-tab-menu > li:eq(0)').addClass('active');
				$('.print-tab[data-tab-id="' + tabID + '"] .print-tab-content > div:eq(0)').addClass('view');
			}
		});
		


		$(".print-tab .print-tab-menu > li").click(function(event){
			var $this = $(this),
				$data = $this.data('tab-menu'),
				$tabID = $this.parent().parent().data('tab-id');
			if(!$(this).hasClass("active")){

				window.location.hash = $data;
				
				$('.print-tab[data-tab-id="' + $tabID + '"] .print-tab-menu > li').removeClass('active');
				$(this).addClass('active');
				
				$('.print-tab[data-tab-id="' + $tabID + '"] .print-tab-content > div.view').removeClass('view');
				$('.print-tab[data-tab-id="' + $tabID + '"] .print-tab-content > div[data-tab-content="' + $data + '"]').addClass('view');
			}
		});
	});
</script>



<script>
    const faqItems = document.querySelectorAll(".faq-item");

faqItems.forEach(item => {
  const btn = item.querySelector(".faq-question");

  btn.addEventListener("click", () => {
    // close other items
    faqItems.forEach(i => {
      if (i !== item) {
        i.classList.remove("active");
        i.querySelector(".icon").textContent = "+";
      }
    });

    // toggle current item
    item.classList.toggle("active");

    const icon = item.querySelector(".icon");
    icon.textContent = item.classList.contains("active") ? "–" : "+";
  });
});


</script>




<script>
    class Slider {
    constructor(slider) {
        this.slider = slider;
        this.display = slider.querySelector(".image-display");
        this.navButtons = Array.from(slider.querySelectorAll(".nav-button"));
        this.prevButton = slider.querySelector(".prev-button");
        this.nextButton = slider.querySelector(".next-button");
        this.sliderNavigation = slider.querySelector(".slider-navigation");
        this.currentSlideIndex = 0;
        this.preloadedImages = {};

        this.initialize();
    }

    initialize() {
        this.setupSlider();
        this.preloadImages();
        this.eventListeners();
    }

    setupSlider() {
        this.showSlide(this.currentSlideIndex);
    }

    showSlide(index) {
        this.currentSlideIndex = index;
        const navButtonImg = this.navButtons[
            this.currentSlideIndex
        ].querySelector("img");
        if (navButtonImg) {
            const imgClone = navButtonImg.cloneNode();
            this.display.replaceChildren(imgClone);
        }
        this.updateNavButtons();
    }

    updateNavButtons() {
        this.navButtons.forEach((button, buttonIndex) => {
            const isSelected = buttonIndex === this.currentSlideIndex;
            button.setAttribute("aria-selected", isSelected);
            if (isSelected) button.focus();
        });
    }

    preloadImages() {
        this.navButtons.forEach((button) => {
            const imgElement = button.querySelector("img");
            if (imgElement) {
                const imgSrc = imgElement.src;
                if (!this.preloadedImages[imgSrc]) {
                    this.preloadedImages[imgSrc] = new Image();
                    this.preloadedImages[imgSrc].src = imgSrc;
                }
            }
        });
    }

    eventListeners() {
        document.addEventListener("keydown", (event) => {
            this.handleAction(event.key);
        });

        this.sliderNavigation.addEventListener("click", (event) => {
            const targetButton = event.target.closest(".nav-button");
            const index = targetButton
                ? this.navButtons.indexOf(targetButton)
                : -1;
            if (index !== -1) {
                this.showSlide(index);
            }
        });

        this.prevButton.addEventListener("click", () =>
            this.handleAction("prev")
        );
        this.nextButton.addEventListener("click", () =>
            this.handleAction("next")
        );
    }

    handleAction(action) {
        if (action === "Home") {
            this.currentSlideIndex = 0;
        } else if (action === "End") {
            this.currentSlideIndex = this.navButtons.length - 1;
        } else if (action === "ArrowRight" || action === "next") {
            this.currentSlideIndex =
                (this.currentSlideIndex + 1) % this.navButtons.length;
        } else if (action === "ArrowLeft" || action === "prev") {
            this.currentSlideIndex =
                (this.currentSlideIndex - 1 + this.navButtons.length) %
                this.navButtons.length;
        }

        this.showSlide(this.currentSlideIndex);
    }
}

const ImageSlider = new Slider(document.querySelector(".image-slider"));

</script>

<script>
    
$('select').change(function(){
  $('.filter').hide();
});

$( ".filter-btn" ).click(function() {
  var type = $( ".filter-type option:selected" ).val();
  var brand = $( ".filter-brand option:selected" ).val();
  

if ($('.filter').hasClass(brand) && $('.filter').hasClass(type)) { 
  $('.' + brand + '' + '.' + type).show();
} else {
  $('.' + brand + '' + '.' + type).hide();
}

  
});
</script>

<script>
    
$('.btnNext').click(function() {
    $('.nav-pills .active').parent().next('li').find('a').trigger('click');
});

$('.btnPrevious').click(function() {
    $('.nav-pills .active').parent().prev('li').find('a').trigger('click');
});
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

  <script src="https://kit.fontawesome.com/1b59bc20c8.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" ></script>
<script src="js/loop.js" ></script>
</body>
</html>