"use client";

import Link from "next/link";
import { get } from "lodash";
import { useEffect, useState } from "react";
import { usePathname } from "next/navigation";
import Image from "next/image";

const Header = ({ global }: { global: any }) => {
  const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
  const pathname = usePathname();
  const logoUrl = get(global, ["Website", "logo", "url"]);
  const menus = get(global, ["menus"], []);
  const facebookLink = get(global, ["SocialLinks"], []).find(
    (link: any) => link.Socials === "Facebook"
  )?.link;

  const instagramLink = get(global, ["SocialLinks"], []).find(
    (link: any) => link.Socials === "Instagram"
  )?.link;
  const phoneNumber = get(global, ["SocialLinks"], []).find(
    (link: any) => link.Socials === "Phone"
  )?.link;

  const toggleMobileMenu = () => {
    setIsMobileMenuOpen(!isMobileMenuOpen);
  };

  const [scrollY, setScrollY] = useState(0);

  // Update the scroll position in the state when the user scrolls
  useEffect(() => {
    const handleScroll = () => {
      setScrollY(window.scrollY);
    };

    window.addEventListener("scroll", handleScroll);

    return () => {
      window.removeEventListener("scroll", handleScroll);
    };
  }, []);

  return (
    <header className="header-section">
      <div className={`container ${scrollY >= 1 ? "shrink" : ""}`}>
        <div className="logo">
          <Link href="/">
            {logoUrl ? (
              <Image src={logoUrl} alt="Logo" width={192} height={52} />
            ) : (
              <svg
                // className="logo"
                width="192"
                height="52"
                viewBox="0 0 192 52"
                fill="none"
                xmlns="http://www.w3.org/2000/svg"
              >
                <g clipPath="url(#clip0_441_397)">
                  <path
                    d="M15.0711 21.5881C15.0267 20.3374 14.8362 19.5518 13.2992 19.5518V19.1371H19.7456V50.8939H28.4339C32.6383 50.8939 36.0933 48.3548 37.0777 45.8535H37.5921L36.3791 51.4909H15.0711V21.5881Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M65.3782 51.4909H60.8498V29.0293H58.3285C50.3896 29.0732 46.1344 36.0556 46.1344 41.8313C46.1344 45.8975 48.2366 49.3667 52.5807 49.3667C56.1754 49.3667 58.9826 47.0539 59.8654 43.635V44.9737C58.3285 49.6432 55.0576 51.956 50.8088 51.956C44.4069 51.956 41.371 47.6133 41.371 42.6672C41.371 36.0556 46.7885 28.3819 57.1154 28.3819H65.3845V51.4909H65.3782Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M76.899 23.8066L77.9724 19.1371H103.618L104.742 23.8066H104.133C102.869 20.2934 98.1054 19.6901 94.8409 19.6901H93.1579V51.4909H88.4898V19.6901H86.8068C83.4915 19.6901 79.3315 20.4317 77.4643 23.8066H76.899Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M126.927 44.4646C131.036 41.5548 134.402 38.0856 135.24 36.2379V37.5325C133.557 39.5185 130.521 42.7111 126.927 45.577V51.4909H122.398V48.8074C119.318 50.6551 116.136 51.9497 113.151 51.9497C106.47 51.9497 102.831 47.695 102.831 42.8431C102.831 36.2316 108.527 28.3756 118.664 28.3756H126.933V44.4646H126.927ZM122.398 29.0293H119.877C111.843 29.0732 107.638 36.3321 107.638 42.1581C107.638 46.0861 109.976 49.6495 114.783 49.6495C117.07 49.6495 119.737 48.7257 122.398 47.3367V29.0293Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M133.564 51.4909V30.9712C133.564 29.6766 133.424 28.7967 131.836 28.7967V28.3819H138.143V51.4972H133.564V51.4909ZM138.606 36.0996C140.378 32.1213 144.634 28.2437 147.339 28.2437C149.956 28.2437 150.889 29.7206 150.889 31.342L148.882 34.8112C147.949 32.9635 146.59 32.2219 145.142 32.2219C142.576 32.2219 139.769 34.5347 138.6 36.9857V36.0996H138.606Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M162.429 48.7634C163.877 48.7634 165.745 47.5127 166.678 46.0358L166.913 46.2683C165.421 48.9959 163.598 51.956 160.842 51.956C157.571 51.956 155.659 50.4791 155.659 45.4827V28.8407H152.579V28.3819C156.269 28.3819 159.863 28.3819 159.863 24.3597H160.283V28.3819H165.7V28.8407H160.283V45.621C160.283 47.9338 161.216 48.7634 162.429 48.7634Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M190.971 37.5325V37.9033H186.017C190.266 39.1037 191.994 41.5547 191.994 43.7293C191.994 48.9519 186.525 52.0063 180.828 52.0063C174.617 52.0063 168.126 48.3988 168.126 39.9898C168.126 31.9956 174.896 28.1117 181.298 28.1117C187.186 28.1054 190.971 32.0334 190.971 37.5325ZM172.985 37.3503H185.738C185.878 36.7469 185.922 36.1939 185.922 35.6408C185.922 31.342 182.651 28.9413 179.291 28.9413C175.741 28.9413 172.096 31.6688 172.096 37.6771C172.096 45.8095 177.983 48.9519 183.261 48.9519C187.465 48.9519 191.295 46.9156 191.295 43.7733C191.295 41.693 189.288 38.9214 184.29 37.9033H173.029L172.985 37.3503Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M32.2317 7.50399C32.2317 7.50399 32.0221 7.36573 31.6347 7.10806C31.4442 6.97608 31.1902 6.83153 30.9044 6.66184C30.6186 6.48587 30.2629 6.30989 29.8818 6.11507C29.0943 5.73798 28.1162 5.32947 26.9476 5.00895C25.779 4.68214 24.4199 4.44961 22.9337 4.39304C19.9614 4.2485 16.4493 4.90211 13.134 6.52357C11.4827 7.34059 9.86952 8.37129 8.40242 9.62195C6.92261 10.8601 5.60159 12.3181 4.44569 13.8893C3.31519 15.4731 2.34347 17.1825 1.6385 18.9674C0.914477 20.746 0.444496 22.5874 0.196803 24.3974C-0.292231 28.03 0.215856 31.5243 1.30825 34.2645C1.84174 35.6408 2.5086 36.8349 3.19452 37.8279C3.88044 38.8209 4.58541 39.6065 5.20147 40.2224C5.51902 40.5241 5.79212 40.7943 6.05887 41.008C6.31926 41.228 6.52885 41.4165 6.71938 41.5485C7.09409 41.8313 7.29098 41.9758 7.29098 41.9758C5.69685 40.1093 4.40123 38.029 3.46762 35.8042C2.52766 33.5794 1.94335 31.2163 1.6512 28.7904C1.6512 28.7904 1.63215 28.6207 1.6004 28.3002C1.58134 28.1431 1.57499 27.942 1.55594 27.7095C1.54959 27.5963 1.54324 27.4706 1.53053 27.3324C1.52418 27.2004 1.52418 27.0558 1.51783 26.905C1.51783 26.7542 1.51148 26.5971 1.51148 26.4274C1.51148 26.2577 1.51783 26.088 1.52418 25.9057C1.53053 25.7235 1.53053 25.5349 1.54324 25.3401C1.56229 25.1453 1.57499 24.9442 1.58769 24.7305C1.6004 24.5168 1.63215 24.3031 1.65756 24.0832C1.68931 23.8632 1.70836 23.6307 1.75282 23.3981C1.79093 23.1656 1.83539 22.9268 1.87349 22.6754C1.9243 22.4303 1.98146 22.1852 2.03227 21.9275C2.26726 20.9094 2.59752 19.8221 3.04209 18.7097C3.48667 17.591 4.05192 16.4472 4.74419 15.3159C5.43011 14.1847 6.2494 13.0786 7.17031 12.029C8.09757 10.9795 9.13915 9.99904 10.276 9.12546C11.4065 8.25188 12.6322 7.47886 13.9025 6.8441C15.1727 6.20934 16.4937 5.70656 17.8211 5.35461C19.1421 5.00267 20.4632 4.79527 21.727 4.72614C22.9909 4.657 24.1976 4.71357 25.3027 4.87069C27.5129 5.18492 29.2785 5.88881 30.4534 6.46701C31.0377 6.76868 31.4887 7.02007 31.7872 7.20861C32.073 7.40344 32.2317 7.50399 32.2317 7.50399Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M3.93767 6.49844C3.93767 6.49844 3.95037 6.31618 3.96307 6.12764C3.97577 5.94538 3.98848 5.75684 3.98848 5.75684C3.98848 5.75684 3.94402 5.94538 3.89956 6.13392C3.8551 6.31618 3.81065 6.50472 3.81065 6.50472C3.75349 6.75611 3.68362 7.00122 3.62011 7.25261C3.5566 7.504 3.48039 7.75539 3.39782 7.99421C3.2327 8.47813 3.06122 8.97463 2.84528 9.44598C2.21652 10.9355 2.52137 11.9536 2.92149 12.5695C3.12473 12.8775 3.35972 13.0974 3.53755 13.2357C3.71538 13.3802 3.84875 13.4431 3.84875 13.4431C3.84875 13.4431 3.95672 13.3362 4.09009 13.1414C4.15996 13.0409 4.23617 12.9214 4.30603 12.7832C4.34414 12.7141 4.38224 12.6323 4.414 12.5569C4.45211 12.4752 4.49021 12.3935 4.52197 12.3055C4.59183 12.1296 4.64899 11.9285 4.69345 11.7148C4.7125 11.6079 4.73155 11.4948 4.73791 11.3754C4.75061 11.256 4.75696 11.1366 4.75696 11.0109C4.75696 10.7595 4.73791 10.4893 4.67439 10.1939C4.61088 9.90477 4.52197 9.59053 4.38859 9.27001C4.05199 8.42785 3.87416 7.47886 3.93767 6.49844Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M8.11668 3.62629C8.11668 3.62629 8.16114 3.4566 8.19925 3.28692C8.2183 3.20521 8.24371 3.11723 8.26276 3.05438C8.28181 2.99153 8.28816 2.94754 8.28816 2.94754C8.28816 2.94754 8.26911 2.98525 8.24371 3.0481C8.2183 3.11094 8.18019 3.19265 8.14209 3.27435C8.07223 3.43775 7.99601 3.60115 7.99601 3.60115C7.90075 3.82112 7.79913 4.04109 7.68481 4.26105C7.57684 4.48102 7.46887 4.70099 7.35455 4.91467C7.24023 5.12835 7.11321 5.33574 6.98619 5.54943C6.86552 5.76311 6.73214 5.9705 6.59242 6.17162C6.37648 6.47957 6.23041 6.78752 6.12879 7.07033C6.02717 7.35315 5.96366 7.61082 5.93826 7.85593C5.90015 8.34614 5.98907 8.75465 6.12244 9.07517C6.25581 9.39569 6.43364 9.6408 6.57972 9.79792C6.72579 9.96132 6.83376 10.043 6.83376 10.043C6.83376 10.043 6.94808 9.96132 7.10686 9.8042C7.18942 9.7225 7.27834 9.62194 7.37361 9.50253C7.46252 9.38312 7.57049 9.25114 7.6594 9.09402C7.75467 8.93691 7.84359 8.76722 7.9198 8.56611C7.99601 8.37128 8.06588 8.16388 8.11033 7.92506C8.19925 7.45999 8.2056 6.89436 8.06587 6.25332C7.97696 5.83852 7.9325 5.39859 7.93885 4.95866C7.93885 4.73241 7.95791 4.51244 7.98966 4.29248C8.02142 4.07879 8.05952 3.85254 8.11668 3.62629Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M12.4164 1.71573C12.4164 1.71573 12.4799 1.5649 12.5498 1.42035C12.6196 1.26952 12.6895 1.11868 12.6895 1.11868C12.6895 1.11868 12.5942 1.26323 12.499 1.4015C12.4037 1.53976 12.3084 1.68431 12.3084 1.68431C12.1814 1.87285 12.048 2.05511 11.9147 2.24365C11.7813 2.4322 11.6416 2.61445 11.5018 2.79043C11.3621 2.9664 11.2097 3.13609 11.0573 3.31206C10.9048 3.48803 10.7524 3.65772 10.5936 3.82112C10.3396 4.07251 10.1554 4.33019 10.0093 4.57529C9.86325 4.8204 9.76798 5.05294 9.70447 5.26662C9.5838 5.71283 9.5965 6.10249 9.66636 6.42301C9.73623 6.74353 9.8569 6.99492 9.96487 7.1709C10.0665 7.34687 10.1554 7.44114 10.1554 7.44114C10.1554 7.44114 10.2761 7.38458 10.4475 7.26517C10.5365 7.20232 10.6381 7.1269 10.7397 7.03263C10.8477 6.93836 10.962 6.8378 11.0763 6.70582C11.1906 6.58013 11.2986 6.4293 11.4002 6.26589C11.5018 6.0962 11.6034 5.92023 11.6797 5.70655C11.8448 5.29176 11.9401 4.77012 11.921 4.15422C11.902 3.34348 12.0544 2.50761 12.4164 1.71573Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M16.6335 0.672458C16.6335 0.672458 16.7224 0.546763 16.805 0.421068C16.8939 0.295373 16.9828 0.169678 16.9828 0.169678C16.9828 0.169678 16.8685 0.282803 16.7605 0.395929C16.6462 0.515339 16.5382 0.628464 16.5382 0.628464C16.3922 0.779298 16.2397 0.936417 16.0873 1.08725C15.9349 1.23808 15.7761 1.38263 15.6173 1.5209C15.4522 1.65916 15.2934 1.79743 15.122 1.93569C14.9568 2.06767 14.7853 2.19965 14.6075 2.32535C14.3344 2.51389 14.1185 2.72757 13.947 2.9224C13.7755 3.12351 13.6421 3.31834 13.5532 3.51316C13.369 3.90282 13.3182 4.26105 13.3309 4.569C13.3436 4.87695 13.4135 5.12834 13.4834 5.30432C13.5532 5.48029 13.6167 5.58084 13.6167 5.58084C13.6167 5.58084 13.7374 5.54942 13.9216 5.46772C14.0105 5.42373 14.1185 5.37345 14.2328 5.29803C14.3471 5.2289 14.4678 5.1472 14.5948 5.04664C14.7218 4.94609 14.8489 4.83296 14.9695 4.6947C15.0775 4.55643 15.1982 4.39931 15.3061 4.22334C15.5221 3.87139 15.6999 3.41261 15.7825 2.82813C15.8396 2.45733 15.9349 2.09281 16.0746 1.7283C16.2143 1.37006 16.3985 1.00555 16.6335 0.672458Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M20.6093 0.408509C20.6093 0.408509 20.7109 0.307953 20.8062 0.201112C20.9015 0.100556 21.0031 0 21.0031 0C21.0031 0 20.8824 0.0817017 20.7617 0.175973L20.5267 0.351946C19.8853 0.823302 19.2057 1.25066 18.4817 1.60261C18.2022 1.74088 17.9736 1.89171 17.7831 2.04883C17.5925 2.21223 17.4465 2.37563 17.3321 2.53904C17.0971 2.86584 16.9955 3.18008 16.9574 3.4629C16.9193 3.74571 16.9447 3.99081 16.9765 4.1605C17.0082 4.33648 17.0527 4.43703 17.0527 4.43703C17.0527 4.43703 17.0781 4.43703 17.1353 4.42446C17.1861 4.41189 17.2623 4.39932 17.3512 4.37418C17.529 4.33019 17.7767 4.24849 18.0371 4.09766C18.5579 3.81484 19.1549 3.28064 19.4979 2.25622C19.6058 1.92313 19.7519 1.59633 19.9424 1.28837C20.1139 0.980421 20.3426 0.685037 20.6093 0.408509Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M24.204 0.779297C24.204 0.779297 24.312 0.697595 24.4136 0.622178C24.5216 0.546761 24.6295 0.471344 24.6295 0.471344C24.6295 0.471344 24.5089 0.527907 24.3818 0.590754C24.3183 0.622178 24.2612 0.653602 24.2167 0.678741C24.1723 0.70388 24.1405 0.716449 24.1405 0.716449C23.8102 0.892422 23.48 1.04326 23.137 1.17524C22.7941 1.31978 22.4448 1.44548 22.0891 1.54604C21.816 1.63402 21.581 1.74086 21.3841 1.85399C21.1872 1.96711 21.0285 2.08652 20.8951 2.22479C20.6347 2.48875 20.4886 2.76528 20.4061 3.01667C20.3298 3.26806 20.3171 3.49431 20.3171 3.65143C20.3235 3.81483 20.3425 3.91539 20.3425 3.91539C20.3425 3.91539 20.4505 3.92167 20.622 3.90282C20.7935 3.88396 21.0285 3.83997 21.2889 3.75198C21.5493 3.664 21.8351 3.51316 22.1145 3.28063C22.3939 3.05437 22.667 2.73385 22.902 2.28764C23.0545 1.99854 23.2323 1.72829 23.4546 1.4769C23.6705 1.2318 23.9246 0.999263 24.204 0.779297Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M27.3288 1.65289C27.3288 1.65289 27.4368 1.59633 27.5447 1.53976C27.6527 1.4832 27.7607 1.43292 27.7607 1.43292C27.7607 1.43292 27.7289 1.43921 27.6845 1.45806C27.64 1.47063 27.5765 1.48949 27.5193 1.50834C27.3987 1.55233 27.278 1.59004 27.278 1.59004C26.9541 1.70317 26.6302 1.79115 26.2999 1.86657C25.9697 1.94827 25.633 2.01112 25.2964 2.05511C24.7693 2.13053 24.3882 2.29393 24.1088 2.48876C23.8293 2.68987 23.6579 2.92241 23.5499 3.13609C23.4419 3.34977 23.3975 3.55088 23.3721 3.70172C23.353 3.84627 23.3594 3.94054 23.3594 3.94054C23.3594 3.94054 23.4546 3.96568 23.6134 3.97196C23.696 3.97825 23.7912 3.97825 23.8928 3.97196C24.0008 3.97196 24.1151 3.95939 24.2422 3.94054C24.4898 3.89654 24.7756 3.79599 25.0614 3.63258C25.3472 3.46918 25.6457 3.21779 25.9188 2.84699C26.0078 2.72758 26.103 2.60817 26.2046 2.49504C26.3063 2.3882 26.4142 2.28136 26.5349 2.18709C26.7762 1.98598 27.0366 1.81001 27.3288 1.65289Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M29.9137 2.84072L30.3265 2.69617L29.8819 2.77158C29.7295 2.80301 29.5834 2.82186 29.431 2.84072C29.2785 2.86586 29.1261 2.88471 28.9737 2.89728C28.8213 2.90985 28.6688 2.92242 28.5101 2.92242C28.3576 2.92242 28.1989 2.9287 28.0464 2.9287C27.0811 2.92242 26.5857 3.31836 26.3316 3.6703C26.2046 3.84628 26.1347 4.02225 26.0966 4.15423C26.0585 4.28621 26.0522 4.36791 26.0522 4.36791C26.0522 4.36791 26.1347 4.39933 26.2808 4.43076C26.4205 4.46218 26.6238 4.48104 26.8524 4.48104C27.0811 4.48104 27.3478 4.43704 27.6336 4.31763C27.7035 4.28621 27.7797 4.25478 27.8495 4.21708C27.9194 4.17937 27.9956 4.14166 28.0655 4.09138C28.2116 3.99711 28.3576 3.8777 28.5101 3.72687C28.8848 3.35607 29.3675 3.03554 29.9137 2.84072Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M11.5781 14.6183C11.5781 14.6183 11.7241 14.656 11.8702 14.6937C12.0163 14.7377 12.156 14.7754 12.156 14.7754C12.156 14.7754 12.0163 14.7629 11.8702 14.744C11.7305 14.7314 11.5844 14.7189 11.5844 14.7189C11.3875 14.7 11.1907 14.6937 11.0001 14.7C10.8096 14.7063 10.6191 14.7252 10.4285 14.7566C10.0411 14.8069 9.68545 14.9263 9.32979 15.0645C9.19006 15.1211 9.06304 15.1714 8.92967 15.2154C8.79629 15.2594 8.66927 15.2971 8.5486 15.3222C8.29456 15.3788 8.05322 15.4039 7.82458 15.4102C7.3673 15.4228 6.94813 15.3473 6.59881 15.2279C6.2495 15.1085 5.97006 14.9577 5.77317 14.832C5.57629 14.7063 5.47467 14.612 5.47467 14.612C5.47467 14.612 5.53818 14.4926 5.67791 14.3229C5.74777 14.2349 5.83668 14.1407 5.94465 14.0401C5.99546 13.9898 6.05897 13.9396 6.12248 13.8893C6.18599 13.839 6.26221 13.795 6.33842 13.751C6.94177 13.3865 7.90079 13.1791 9.1456 13.7636C9.9649 14.1407 10.7778 14.4046 11.5781 14.6183Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M13.8581 12.5318C13.8581 12.5318 13.9851 12.5946 14.1121 12.6512C14.1757 12.6826 14.2392 12.714 14.29 12.7329C14.3344 12.758 14.3662 12.7706 14.3662 12.7706C14.3662 12.7706 14.3344 12.758 14.2836 12.7455C14.2392 12.7329 14.1693 12.714 14.1058 12.6952L13.8454 12.6198C13.6676 12.5695 13.4897 12.5318 13.3056 12.5003C13.1277 12.4752 12.9499 12.4626 12.7657 12.4564C12.5879 12.4501 12.4037 12.4501 12.2259 12.4689C12.048 12.4878 11.8702 12.5192 11.6924 12.5569C11.4193 12.6135 11.1652 12.6512 10.9239 12.6638C10.6826 12.67 10.4539 12.6512 10.238 12.6198C9.81245 12.5569 9.44409 12.4124 9.13924 12.2427C8.83438 12.0793 8.59939 11.8844 8.44697 11.7399C8.28819 11.5891 8.21198 11.4822 8.21198 11.4822C8.21198 11.4822 8.29454 11.3817 8.45332 11.2497C8.53588 11.1868 8.63115 11.1114 8.74547 11.036C8.85979 10.9606 9.00586 10.8977 9.16464 10.8412C9.31707 10.7846 9.4949 10.7406 9.68543 10.7092C9.86961 10.6778 10.0855 10.6841 10.3015 10.7155C10.7461 10.772 11.2287 10.948 11.7622 11.3314C12.1052 11.5765 12.4482 11.7965 12.8038 11.9913C12.9753 12.0856 13.1531 12.1861 13.331 12.2741C13.5088 12.3684 13.6803 12.4501 13.8581 12.5318Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M16.2779 10.9795C16.2779 10.9795 16.3858 11.0549 16.4938 11.1303C16.6018 11.2057 16.7097 11.2811 16.7097 11.2811C16.7097 11.2811 16.5954 11.2246 16.4875 11.168C16.3731 11.1114 16.2588 11.0612 16.2588 11.0612C16.1064 10.992 15.9413 10.9229 15.7825 10.8663C15.6237 10.8161 15.4586 10.7721 15.2934 10.7406C15.1283 10.7092 14.9568 10.6778 14.7917 10.6652C14.6266 10.6526 14.4551 10.6526 14.29 10.6589C14.0232 10.6652 13.7882 10.6589 13.5596 10.6275C13.3373 10.5961 13.1277 10.5395 12.9308 10.4704C12.5498 10.3447 12.2322 10.1499 11.9845 9.94247C11.7305 9.74136 11.5463 9.52768 11.432 9.35799C11.3113 9.19458 11.2542 9.08146 11.2542 9.08146C11.2542 9.08146 11.3431 8.99976 11.5145 8.90549C11.5971 8.85521 11.7051 8.80493 11.8258 8.75465C11.9464 8.71066 12.0861 8.66667 12.2449 8.64153C12.3973 8.61639 12.5688 8.59753 12.7467 8.60382C12.9245 8.6101 13.1214 8.64781 13.3183 8.71066C13.7184 8.83635 14.1375 9.08146 14.5567 9.51511C15.0966 10.0933 15.6809 10.5647 16.2779 10.9795Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M18.7167 9.94246C18.7167 9.94246 18.8056 10.0305 18.8945 10.1184L19.066 10.2944C19.066 10.2944 18.9707 10.2253 18.8755 10.1561C18.7802 10.087 18.6849 10.0179 18.6849 10.0179C18.5516 9.91732 18.4182 9.84191 18.2785 9.76649C18.1387 9.69107 17.9927 9.62823 17.8466 9.56538C17.7005 9.50253 17.5481 9.45854 17.3957 9.42083C17.2432 9.38312 17.0908 9.3517 16.932 9.33284C16.6907 9.30142 16.4684 9.25743 16.2652 9.18829C16.0619 9.12545 15.8778 9.03746 15.7126 8.94947C15.3824 8.76722 15.122 8.53468 14.9251 8.30843C14.7282 8.08218 14.5948 7.84964 14.5123 7.67995C14.4297 7.51027 14.3979 7.39714 14.3979 7.39714C14.3979 7.39714 14.4932 7.34058 14.6647 7.27773C14.7536 7.24631 14.8552 7.21488 14.9759 7.18974C15.0902 7.16461 15.2299 7.14575 15.376 7.15204C15.5221 7.15204 15.6809 7.17089 15.8396 7.20231C16.0048 7.24002 16.1699 7.29659 16.3477 7.39086C16.6907 7.57311 17.04 7.8685 17.3576 8.32728C17.5608 8.62895 17.7831 8.91805 18.0117 9.18201C18.2404 9.45225 18.4754 9.69736 18.7167 9.94246Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M21.0602 9.35799C21.0602 9.35799 21.1237 9.45226 21.1936 9.54653C21.2571 9.63452 21.3206 9.73508 21.3206 9.73508C21.3206 9.73508 21.2444 9.65338 21.1682 9.57796C21.092 9.50254 21.0157 9.42712 21.0157 9.42712C20.5966 9.00605 20.0885 8.69181 19.5296 8.52841C19.3137 8.46556 19.1231 8.38386 18.9453 8.28958C18.7738 8.2016 18.615 8.10104 18.4817 7.98792C18.2086 7.76795 18.0053 7.51028 17.8656 7.27146C17.7195 7.03264 17.637 6.80639 17.5862 6.6367C17.5353 6.46701 17.5226 6.36017 17.5226 6.36017C17.5226 6.36017 17.548 6.3476 17.5925 6.33503C17.637 6.32246 17.7005 6.30361 17.7894 6.29104C17.9545 6.2659 18.1895 6.24704 18.4563 6.28475C18.9897 6.37902 19.6439 6.7184 20.0758 7.67368C20.2155 7.98163 20.3743 8.27073 20.5394 8.55354C20.7045 8.83636 20.876 9.1066 21.0602 9.35799Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M23.2387 9.1506C23.2387 9.1506 23.2831 9.24487 23.3276 9.34543C23.372 9.4397 23.4165 9.54026 23.4165 9.54026C23.4165 9.54026 23.3593 9.45227 23.3022 9.37057C23.2768 9.32658 23.245 9.28887 23.226 9.25744C23.2069 9.22602 23.1878 9.20717 23.1878 9.20717C23.0291 8.9872 22.8449 8.78609 22.6417 8.60383C22.4384 8.43414 22.2098 8.28959 21.9748 8.1639C21.6001 7.98792 21.3206 7.75539 21.1047 7.51657C20.8887 7.27775 20.749 7.02007 20.6538 6.78125C20.5585 6.54243 20.514 6.32247 20.495 6.15906C20.4759 6.00194 20.4823 5.8951 20.4823 5.8951C20.4823 5.8951 20.5775 5.87625 20.73 5.86996C20.8824 5.86996 21.0983 5.87625 21.3333 5.96424C21.5683 6.05222 21.8224 6.1842 22.0446 6.42302C22.2669 6.66813 22.4638 7.0075 22.5908 7.46629C22.6734 7.76167 22.7687 8.05706 22.8766 8.33987C22.991 8.62897 23.1116 8.89921 23.2387 9.1506Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M25.2075 9.25742C25.2075 9.25742 25.2329 9.3517 25.2646 9.43968C25.2901 9.53395 25.3155 9.62822 25.3155 9.62822C25.3155 9.62822 25.3091 9.60937 25.2901 9.57795C25.2774 9.54652 25.2583 9.50253 25.2329 9.46482C25.1884 9.38312 25.1503 9.30142 25.1503 9.30142C25.036 9.08145 24.9026 8.86777 24.7375 8.67923C24.5787 8.49697 24.3945 8.32728 24.1977 8.18273C23.8865 7.96905 23.6642 7.72395 23.5054 7.46627C23.3466 7.22117 23.2577 6.96978 23.2069 6.73724C23.1561 6.50471 23.1497 6.29731 23.1561 6.15276C23.1624 6.00193 23.1815 5.91394 23.1815 5.91394C23.1815 5.91394 23.2704 5.90765 23.4101 5.92651C23.48 5.93279 23.5626 5.95165 23.6515 5.97679C23.7404 6.00821 23.842 6.04592 23.9373 6.10248C24.1342 6.21561 24.3437 6.36644 24.5152 6.62412C24.6803 6.87551 24.8137 7.21488 24.8582 7.64853C24.8772 7.78679 24.8899 7.93134 24.9153 8.06332C24.9344 8.20159 24.9598 8.33985 24.9916 8.47812C25.0551 8.74836 25.1249 9.01232 25.2075 9.25742Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M26.935 9.58423L26.9858 9.93617L26.8779 9.61565C26.8398 9.50881 26.8016 9.39568 26.7508 9.29513C26.7 9.19457 26.6429 9.1003 26.5857 9.00603C26.5222 8.91176 26.4587 8.81749 26.3888 8.7295C26.3507 8.68551 26.319 8.64152 26.2809 8.59752C26.2428 8.55981 26.2046 8.5221 26.1602 8.4844C26.0332 8.36499 25.9315 8.24558 25.8426 8.11988C25.7982 8.05703 25.7601 7.99419 25.7283 7.93134C25.6902 7.86849 25.6648 7.81193 25.633 7.74908C25.5251 7.50398 25.4806 7.26516 25.4679 7.05147C25.4552 6.83779 25.4806 6.64925 25.506 6.51727C25.5314 6.38529 25.5632 6.30359 25.5632 6.30359C25.5632 6.30359 25.6457 6.30987 25.7664 6.34758C25.8871 6.38529 26.0586 6.44814 26.2173 6.57383C26.3825 6.69953 26.5476 6.88179 26.6619 7.12061C26.6937 7.18345 26.7191 7.2463 26.7445 7.31543C26.7699 7.39085 26.7889 7.46627 26.8016 7.54797C26.8334 7.71137 26.8461 7.89363 26.8334 8.09474C26.8207 8.61009 26.8652 9.1003 26.935 9.58423Z"
                    fill="#BC955C"
                  />
                  <path
                    d="M31.7491 7.20861L32.1111 7.49771L31.7047 7.27146C31.5713 7.19604 31.4316 7.12691 31.2855 7.06406C31.1394 7.0075 30.9933 6.95722 30.8409 6.91323C30.6948 6.86923 30.5424 6.83152 30.3963 6.80638C30.2439 6.78125 30.0915 6.76868 29.939 6.76239C29.8184 6.75611 29.7104 6.74354 29.6088 6.73097C29.558 6.72468 29.5072 6.71211 29.4564 6.70583C29.4056 6.69954 29.3547 6.68697 29.3103 6.68069C29.1198 6.64298 28.9546 6.58013 28.8086 6.511C28.7323 6.47329 28.6688 6.43558 28.6053 6.39788C28.5418 6.36017 28.4783 6.32246 28.4211 6.27847C28.3068 6.19676 28.2052 6.10878 28.1226 6.01451C27.9512 5.82596 27.8305 5.64999 27.7543 5.51173C27.6781 5.37346 27.6463 5.27919 27.6463 5.27919C27.6463 5.27919 27.7289 5.22263 27.8749 5.1535C28.021 5.08436 28.237 5.00895 28.4973 4.99638C28.6307 4.98381 28.7704 4.99009 28.9292 5.00895C29.0054 5.01523 29.0816 5.03409 29.1642 5.05294C29.2468 5.07179 29.323 5.10322 29.4056 5.13464C29.5707 5.20377 29.7422 5.29176 29.9136 5.41117C29.9581 5.44259 29.9962 5.47402 30.0407 5.50544C30.0851 5.54315 30.1232 5.58086 30.1613 5.61857C30.2439 5.70027 30.3265 5.78826 30.4027 5.88253C30.5043 6.00822 30.6123 6.12135 30.7202 6.23447C30.8282 6.35388 30.9362 6.46701 31.0505 6.58013C31.1648 6.68697 31.2791 6.79382 31.3998 6.89437C31.5078 7.0075 31.6221 7.10805 31.7491 7.20861Z"
                    fill="#BC955C"
                  />
                </g>
                <defs>
                  <clipPath id="clip0_441_397">
                    <rect width="192" height="52" fill="white" />
                  </clipPath>
                </defs>
              </svg>
            )}
          </Link>
        </div>
        <input type="checkbox" id="menu-toggle" />
        <label htmlFor="menu-toggle" className="menu-icon">
          &#9776;
        </label>
        <div className="navbar">
          <nav className="navItem">
            <ul>
              {menus.map((menu: any) => {
                // Ensure URL starts with /
                const menuUrl = menu.url.startsWith("/")
                  ? menu.url
                  : `/${menu.url}`;

                return (
                  <li key={menu.id}>
                    <Link
                      href={menuUrl}
                      className={pathname == menuUrl ? "active" : ""}
                    >
                      {menu.name}
                    </Link>
                  </li>
                );
              })}
            </ul>
          </nav>
        </div>
        <div className="contactInfo">
          <div className="social-links">
            <a className="social" href={facebookLink} target="_blank">
              <svg
                width="32"
                height="32"
                viewBox="0 0 32 32"
                fill="none"
                xmlns="http://www.w3.org/2000/svg"
              >
                <path
                  d="M27.6667 2H4.33333C2.5 2 1 3.38889 1 5.08642V26.6914C1 28.3904 2.5 29.7778 4.33333 29.7778H16V18.9753H12.6667V15.1559H16V11.9923C16 8.65278 18.02 6.3071 22.2767 6.3071L25.2817 6.31018V10.3302H23.2867C21.63 10.3302 21 11.4815 21 12.5494V15.1574H25.28L24.3333 18.9753H21V29.7778H27.6667C29.5 29.7778 31 28.3904 31 26.6914V5.08642C31 3.38889 29.5 2 27.6667 2Z"
                  stroke="#BC955C"
                  strokeWidth="1.5"
                />
              </svg>
            </a>
            <a className="social" href={instagramLink} target="_blank">
              <svg
                width="32"
                height="32"
                viewBox="0 0 32 32"
                fill="none"
                xmlns="http://www.w3.org/2000/svg"
              >
                <g clipPath="url(#clip0_3225_684)">
                  <path
                    d="M23.5 1H8.5C4.35786 1 1 4.35786 1 8.5V23.5C1 27.6421 4.35786 31 8.5 31H23.5C27.6421 31 31 27.6421 31 23.5V8.5C31 4.35786 27.6421 1 23.5 1Z"
                    stroke="#BC955C"
                    strokeWidth="1.5"
                    strokeLinecap="round"
                    strokeLinejoin="round"
                  />
                  <path
                    d="M24.25 7.75H24.265M22 15.055C22.1852 16.3034 21.9719 17.5783 21.3907 18.6985C20.8094 19.8187 19.8898 20.7271 18.7625 21.2945C17.6352 21.8619 16.3577 22.0594 15.1117 21.8589C13.8657 21.6584 12.7147 21.0701 11.8223 20.1777C10.9299 19.2854 10.3416 18.1343 10.1412 16.8883C9.94065 15.6423 10.1381 14.3648 10.7055 13.2376C11.2729 12.1103 12.1813 11.1906 13.3015 10.6094C14.4217 10.0281 15.6967 9.81488 16.945 10C18.2184 10.1888 19.3973 10.7822 20.3076 11.6925C21.2179 12.6027 21.8112 13.7816 22 15.055Z"
                    stroke="#BC955C"
                    strokeWidth="1.5"
                    strokeLinecap="round"
                    strokeLinejoin="round"
                  />
                </g>
                <defs>
                  <clipPath id="clip0_3225_684">
                    <rect width="32" height="32" fill="white" />
                  </clipPath>
                </defs>
              </svg>
            </a>
          </div>

          {/* <form action="#" className="searchBar">
            <input type="text" placeholder=" Search" name="search" />
            <svg
              className="searchIcon"
              xmlns="http://www.w3.org/2000/svg"
              width="17"
              height="17"
              viewBox="0 0 17 17"
              fill="none"
            >
              <path
                fill-rule="evenodd"
                clip-rule="evenodd"
                d="M12.4838 7.05728C12.4838 7.73177 12.351 8.39967 12.0928 9.02282C11.8347 9.64597 11.4563 10.2122 10.9795 10.6891C10.5025 11.166 9.93629 11.5444 9.31313 11.8026C8.68998 12.0606 8.0221 12.1935 7.3476 12.1935C6.6731 12.1935 6.00521 12.0606 5.38205 11.8026C4.75891 11.5444 4.19269 11.166 3.71576 10.6891C3.23881 10.2122 2.86049 9.64597 2.60237 9.02282C2.34424 8.39967 2.2114 7.73177 2.2114 7.05728C2.2114 5.69507 2.75252 4.38866 3.71576 3.42544C4.67898 2.46221 5.98539 1.92108 7.3476 1.92108C8.7098 1.92108 10.0162 2.46221 10.9795 3.42544C11.9427 4.38866 12.4838 5.69507 12.4838 7.05728ZM11.5479 12.4674C10.1718 13.5357 8.44032 14.0394 6.70592 13.876C4.97151 13.7127 3.36458 12.8944 2.21225 11.5879C1.05992 10.2813 0.448825 8.58478 0.50336 6.84356C0.557906 5.10233 1.27398 3.44733 2.50582 2.2155C3.73766 0.98367 5.39265 0.267593 7.13387 0.213046C8.8751 0.158508 10.5717 0.769605 11.8782 1.92194C13.1847 3.07426 14.003 4.6812 14.1663 6.4156C14.3298 8.14999 13.8261 9.88147 12.7577 11.2576L16.2275 14.7273C16.3116 14.8058 16.3791 14.9003 16.4259 15.0053C16.4727 15.1103 16.4978 15.2236 16.4999 15.3385C16.5019 15.4535 16.4807 15.5676 16.4377 15.6742C16.3946 15.7808 16.3305 15.8776 16.2492 15.9589C16.1679 16.0403 16.0712 16.1043 15.9646 16.1473C15.858 16.1904 15.7438 16.2116 15.6289 16.2095C15.5139 16.2075 15.4005 16.1824 15.2956 16.1356C15.1906 16.0888 15.0961 16.0213 15.0177 15.9372L11.5479 12.4674Z"
                fill="#BC955C"
              />
            </svg>
          </form> */}

          <a
            href={`tel:${String(phoneNumber || "+8801929-333999")?.replace(
              /[ -]/g,
              ""
            )}`}
            className="phone"
          >
            <svg
              width="16"
              height="16"
              viewBox="0 0 16 16"
              fill="none"
              xmlns="http://www.w3.org/2000/svg"
            >
              <path
                fillRule="evenodd"
                clipRule="evenodd"
                d="M7.6097 8.39367C10.9339 11.717 11.6881 7.87227 13.8046 9.98735C15.8451 12.0273 17.0179 12.436 14.4326 15.0206C14.1088 15.2809 12.0513 18.4119 4.82042 11.1831C-2.41131 3.95334 0.717906 1.89371 0.978227 1.56997C3.56981 -1.02179 3.97147 0.157829 6.01199 2.19778C8.12856 4.31376 4.28547 5.07035 7.6097 8.39367Z"
                fill="#BC955C"
              />
            </svg>

            <p>{phoneNumber || "+8801929-333999"}</p>
          </a>
        </div>
      </div>
    </header>
  );
};

export default Header;
