/**
 * CSS File: header.css
 * 2026-05-20 | Final checked
 */

.p-header {
  position: fixed;
  top: -80px;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  z-index: var(--z_200-header);
  display: flex;
  align-items: center;
  transition: top 0.4s ease;
  transform: translateZ(0);
  will-change: transform;
}

.p-header.is-show {
  top: 0;
}

.p-header__inner {
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.p-header__logo img {
  height: 28px;
  width: auto;
  display: block;
}

.p-header__trigger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.p-header__trigger span {
  width: 100%;
  height: 2px;
  background-color: #4a5568;
  transition: all 0.3s;
  display: block;
}

.p-header__nav {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background-color: rgba(255, 255, 255, 0.9);
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.p-header__nav.is-open {
  display: flex;
}

.p-header__nav-item {
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid #f7f7f7;
  color: #4a5568;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
}

.p-header__mega-menu {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: #fff;
  display: none;
  overflow-y: auto;
}

.p-header__mega-menu.is-active {
  display: block;
}

.p-header__mega-menu-inner {
  padding: 20px;
}

.p-header__mega-menu-item a {
  display: block;
  padding: 15px 0;
  color: #4a5568;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;

  font-weight: 700;
  font-size: 0.9375rem;
}

.p-header__icon-arrow::before {
  content: "∨";
  font-size: 0.625rem;
  margin-left: 4px;
}
.icon-external::before {
  content: "↗";
  font-size: 0.75rem;
  margin-left: 4px;
}

.p-header__trigger.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.p-header__trigger.is-active span:nth-child(2) {
  opacity: 0;
}

.p-header__trigger.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.p-header__trigger.is-submenu-open span:nth-child(1) {
  width: 18px;
  margin-left: auto;
  transform: translateX(-10px) translateY(15px) rotate(-45deg);
}

.p-header__trigger.is-submenu-open span:nth-child(2) {
  opacity: 0;
}

.p-header__trigger.is-submenu-open span:nth-child(3) {
  width: 18px;
  margin-left: auto;
  transform: translateX(3px) translateY(-2px) rotate(45deg);
}

.p-header__mega-menu-item {
  color: #f69381;
  font-weight: bold;
}

@media screen and (min-width: 768px) {
  .p-header {
    height: 75px;
  }

  .p-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
  }

  .p-header__logo img {
    height: 36px;
  }

  .p-header__trigger {
    display: none;
  }

  .p-header__nav {
    display: flex;
    position: static;
    flex-direction: row;
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    gap: 32px;
    overflow: visible;
  }

  .p-header__nav-item {
    position: relative;
    display: inline-block;
    width: auto;
    padding: 0;
    border: none;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .p-header__nav-item.is-current::after,
  .p-header__nav-item.is-active::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #f69381;
  }

  .p-header__mega-menu {
    position: fixed;
    top: 75px;
    left: 0;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eee;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s ease;
  }

  .p-header__mega-menu.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .p-header__mega-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 50px;
  }

  .p-header__mega-menu-item a {
    border-bottom: 1px solid #f7f7f7;
    padding: 10px 0;
    transition: color 0.3s;
  }

  .p-header__mega-menu-item a:hover {
    color: #f69381;
  }

  .p-header__nav-item.is-current {
    color: #f69381;
    pointer-events: auto;
  }

  .p-header__nav-item.is-current::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #f69381;
  }
}

@media screen and (min-width: 1024px) {
  .p-header__nav {
    gap: 40px;
  }

  .p-header__nav-item {
    font-size: 0.9375rem;
  }
}
