/* Maon header */
.site-header {
  position: sticky;
  top: 0;
  /* top: calc(var(--wp-admin--admin-bar--height, 0px) + env(safe-area-inset-top)); */
  z-index: 9999;
  box-shadow: var(--shadow-top-light-small);
  background: var(--surface50);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-top-light-medium);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "left logo right";
  align-items: center;
  gap: 24px;
  height: 98px;
  text-transform: uppercase;
}

.menu-left {
  grid-area: left;
  justify-self: start;
  display: flex;
  gap: 32px;
}

.menu-right {
  grid-area: right;
  justify-self: end;
  display: flex;
  gap: 32px;
}

.menu > li {
  position: relative;
}

.menu > li:has(> .sub-menu) > a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu > li:has(> .sub-menu) > a::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--surface700);
  border-bottom: 2px solid var(--surface700);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.3s ease;
}

.menu > li:hover > a::after {
  border-color: var(--primary500);
  transform: rotate(225deg) translateY(-1px);
}

.menu > li > .sub-menu {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface50);
  border: 1px solid var(--surface150);
  border-radius: 4px;
  padding: 12px 8px;
  text-transform: capitalize;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}

.menu > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu > li > .sub-menu > li > a {
  display: block;
  width: 100%;
  min-width: max-content;
  background: var(--surface50);
  border-radius: 4px;
  padding: 12px;
  transition: background-color 0.4s ease;
}

.menu > li > .sub-menu > li > a:hover {
  background: var(--surface150);
}

.menu > li > a {
  color: var(--surface700);
  transition: color 0.4s ease;
}

.menu > li > a:hover {
  color: var(--primary500);
}

.header-logo {
  grid-area: logo;
  justify-self: center;
  width: 137px;
  height: 50px;
}

.header-logo a {
  display: block;
  width: 100%;
  height: 100%;
}

.header-logo a img {
  width: 100%;
  height: 100%;
}

.header-nav-right {
  margin-left: auto;
}

.header-burger {
  display: none;
}

.mobile-menu {
  opacity: 0;
  visibility: hidden;
}
.mobile-menu {
  position: fixed;
  text-transform: uppercase;
  top: calc(
    var(--mob-header-h) + var(--wp-admin--admin-bar--height, 0px) +
      env(safe-area-inset-top)
  );
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface50);
  transform: translateX(100%);
  transition: 0.3s ease;
}

.site-header.is-scrolled .mobile-menu {
  top: calc(var(--mob-header-h) + env(safe-area-inset-top));
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 16px;
}
.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.mobile-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mobile-menu li a::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.submenu-back {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--surface700);
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
}

.submenu-back::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(-135deg);
}

/* Responsive */
@media (max-width: 1024px) {
  .header-inner {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "logo left right";
  }

  .header-logo {
    justify-self: start;
  }

  .menu-left {
    justify-self: center;
    gap: 24px;
  }

  .menu-right {
    justify-self: end;
    gap: 24px;
  }
}
@media (max-width: 768px) {
  .header-inner {
    height: 73px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .header-logo {
    width: 110px;
    height: 40px;
  }

  .header-nav-left,
  .header-nav-right {
    display: none;
  }

  .header-burger {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
  }

  .header-burger span {
    display: block;
    height: 2px;
    width: 26px;
    background: var(--surface700);
    transition: 0.3s ease;
  }

  .header-burger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .header-burger.is-open span:nth-child(2) {
    opacity: 0;
  }

  .header-burger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  body:has(.mobile-menu.is-open) {
    overflow: hidden;
  }

  .mobile-menu.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    border-top: 1px solid var(--surface150);
  }

  .mobile-menu .sub-menu {
    display: none;
    text-transform: capitalize;
  }

  .menu-item-has-children.open > .sub-menu {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--surface50);
    padding: 24px 16px;
    z-index: 9999;
  }
}
