/**
 * 세이피안 홈페이지 - 상단 메뉴
 *
 * PC(.centered-menu + .cta-button)와 모바일(.mobile-topbar + .mobile-slide-menu)
 * 두 벌이 한 파일 안에 있고, 1024px 를 경계로 서로를 숨긴다.
 */

/* ⚠ 푸터와 같은 이유(파일 맨 위 설명 참고)로, 물려받던 값을 여기서 직접 정한다.
   키즈 페이지에서는 메뉴가 `#kids-page` 안이라 그 쪽 font-family:'SUIT' 와
   line-height 1.5 를 받아 PC 메뉴 폭이 1px 어긋났다. */
.nav-wrapper,
.nav-wrapper *,
.mobile-topbar,
.mobile-topbar *,
.mobile-slide-menu,
.mobile-slide-menu * {
  box-sizing: border-box;
}

.nav-wrapper,
.mobile-topbar,
.mobile-slide-menu {
  font-family: 'SUIT-Regular', sans-serif;
  line-height: 1.3;
}

.nav-wrapper {
  position: fixed;
  top: 30px;
  left: 0;
  width: 100%;
  z-index: 9999;
}

/* ===== PC ===== */
.centered-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff9a;
  padding: 0.8% 3%;
  border-radius: 40px;
  display: flex;
  gap: 30px;
  align-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.centered-menu a {
  color: #000;
  text-decoration: none !important;
  font-weight: bold;
  font-size: 1.2em;
  transition: all 0.2s ease;
}

.centered-menu a:hover {
  color: #2ace48;
}

.cta-button {
  position: absolute;
  top: 0;
  right: 30px;
}

.cta-button a {
  background: #ffffff9a;
  padding: 12px 20px;
  border-radius: 40px;
  font-weight: bold;
  color: #000;
  font-size: 1.2em;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.cta-button a:hover {
  color: #2ace48;
}

.cta-button img {
  height: 14px;
}

/* ===== 드롭다운 서브 메뉴 ===== */
.menu-item-with-sub {
  position: relative;
  display: flex;
  align-items: center;
}

.menu-item-with-sub .submenu {
  display: none;
  position: absolute;
  top: calc(100% + 25px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 20px;
  padding: 10px 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  z-index: 1000;
  opacity: 0.85;
}

.menu-item-with-sub .submenu a {
  display: block;
  padding: 6px 0;
  font-size: 1.0em;
  text-align: center;
  color: #444;
  font-weight: normal;
  text-decoration: none;
}

.menu-item-with-sub .submenu a:hover {
  color: #2ace48;
  font-weight: bold;
}

/* 메뉴와 서브메뉴 사이 빈틈에서 hover 가 끊기지 않게 받쳐 주는 영역 */
.hover-bridge {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 999;
}

.menu-item-with-sub:hover .submenu,
.menu-item-with-sub:hover .hover-bridge {
  display: block;
}

/* ===== 모바일 ===== */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 10001;
}

.hamburger-icon span {
  height: 3px;
  background: #000;
  border-radius: 2px;
  transition: 0.3s ease;
}

.hamburger-icon.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-icon.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

.mobile-topbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  background: #ffffffbc;
  color: #000;
  border-radius: 40px;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10000;
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}

.mobile-topbar.expanded {
  width: 90%;
}

.mobile-topbar .logo {
  height: 30px;
}

/* 아래로 스크롤하면 위로 밀어내 숨긴다 */
.mobile-topbar.hide-topbar {
  transform: translate(-50%, -150px);
  opacity: 0;
  pointer-events: none;
}

.mobile-slide-menu {
  position: fixed;
  /* topbar(top 20px + 높이 60px) 아래 4px */
  top: calc(20px + 60px + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  background: #ffffffbc;
  color: #000;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  z-index: 9999;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: max-height 0.5s ease, opacity 0.4s ease, padding 0.4s ease;
}

.mobile-slide-menu.active {
  max-height: 500px;
  opacity: 1;
  padding: 20px;
}

.menu-group {
  margin-bottom: 30px;
}

.menu-group h4 {
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: bold;
  color: #000;
}

.menu-group a {
  display: block;
  font-size: 15px;
  padding: 4px 0;
  text-decoration: none !important;
  color: #392b2b;
}

.menu-group a:hover {
  color: #000;
}

.menu-group .submenu-link {
  padding-left: 25px;
}

/* ===== 경계 ===== */
@media screen and (min-width: 1025px) {
  .mobile-topbar,
  .mobile-slide-menu {
    display: none !important;
  }
}

@media screen and (max-width: 1024px) {
  .centered-menu,
  .cta-button {
    display: none !important;
  }
}
