/*
Theme Name: Hello Elementor Child
Template: hello-elementor
Author: Your Name
Version: 1.0
*/

.customer-slider-wrapper {
  overflow: hidden;
  direction: ltr;
  margin: 20px 0;
}

.customer-slider-track {
  display: flex;
  width: max-content;
  animation: scroll-slider 30s linear infinite;
}

.customer-slide {
  flex: 0 0 auto;
  padding: 0 20px;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.customer-slide:hover {
  filter: grayscale(0%);
}

.customer-slide img {
  height: 60px;
  object-fit: contain;
}

@keyframes scroll-slider {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}


.elementor-location-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}


html {
  scroll-behavior: smooth;
}



function custom_cursor_script() {
    ?>
    <script>
    const cursorDot = document.querySelector(".cursor-dot");
    const cursorOutline = document.querySelector(".cursor-outline");

    let mouseX = 0; // موقعیت لحظه‌ای موس
    let mouseY = 0;
    let outlineX = 0; // موقعیت دایره بیرونی
    let outlineY = 0;

    // گرفتن موقعیت موس
    window.addEventListener("mousemove", (e) => {
      mouseX = e.clientX;
      mouseY = e.clientY;

      // دایره کوچک (فوری به موس میچسبه)
      cursorDot.style.top = mouseY + "px";
      cursorDot.style.left = mouseX + "px";
    });

    // انیمیشن برای دایره بیرونی (با تاخیر)
    function animateOutline() {
      // مقدار 0.1 یعنی سرعت رسیدن (عدد کمتر → تاخیر بیشتر)
      outlineX += (mouseX - outlineX) * 0.03;
      outlineY += (mouseY - outlineY) * 0.03;

      cursorOutline.style.top = outlineY + "px";
      cursorOutline.style.left = outlineX + "px";

      requestAnimationFrame(animateOutline);
    }
    animateOutline();

    // افکت هاور روی لینک‌ها و دکمه‌ها
    document.querySelectorAll("a, button").forEach((el) => {
      el.addEventListener("mouseenter", () => {
        cursorOutline.style.transform = "translate(-50%, -50%) scale(1.5)";
        cursorOutline.style.borderColor = "#ECBA53"; // رنگ border دایره بیرونی در هاور
        cursorDot.style.backgroundColor = "#ECBA53"; // رنگ دایره کوچک در هاور
      });
      el.addEventListener("mouseleave", () => {
        cursorOutline.style.transform = "translate(-50%, -50%) scale(1)";
        cursorOutline.style.borderColor = "#454545"; // رنگ border پیش‌فرض
        cursorDot.style.backgroundColor = "#5E5E5E"; // رنگ دایره کوچک پیش‌فرض
      });
    });
    </script>
    <?php
}
add_action('wp_footer', 'custom_cursor_script');
