/* =========================
   Global Fix
========================= */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  font-family: "Pretendard", sans-serif;
}

/* =========================
   Header Base
========================= */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

#header.scrolled {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

/* =========================
   Inner
========================= */
#header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================
   Logo
========================= */
#header .logo-img {
  width: 150px;
  margin-top: 8px;
}

#header.scrolled .logo-img {
  content: url("/assets/img/logo_b.png");
}

/* =========================
   Navigation (PC)
========================= */
#header .gnb > ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

#header .gnb > ul > li {
  position: relative;
}

#header .gnb > ul > li > a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 32px;
  font-size: 18px;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

#header.scrolled .gnb > ul > li > a {
  color: #111827;
}

#header .gnb > ul > li > a:hover {
  color: #6fa8ff;
}

/* =========================
   Submenu (PC)
========================= */
@media (min-width: 769px) {
  .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 50;
    list-style: none;
    padding: 0;
  }

  .submenu li {
    border-bottom: 1px solid #f1f5f9;
    list-style: none;
  }

  .has-sub > a > i {
    display: none;
  }

  .submenu li:last-child {
    border-bottom: none;
  }

  .submenu a {
    display: block;
    padding: 14px 18px;
    font-size: 15px;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
  }

  .submenu a:hover {
    background: #f1f5ff;
    color: #6fa8ff;
  }

  /* hover 시 submenu 노출 */
  .has-sub:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* PC에서는 chevron 고정 */
  .has-sub i {
    font-size: 12px;
  }
}

/* =========================
   Mobile Toggle Button
========================= */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #ffffff;
}

#header.scrolled .menu-toggle {
  color: #111827;
}

/* =========================
   Mobile
========================= */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  #header .inner {
    height: 60px;
  }

  #header .logo-img {
    width: 140px;
  }

  /* Mobile Menu Panel */
  #header .gnb {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    height: calc(100vh - 60px);
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.25s ease;
  }

  #header .gnb.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  #header .gnb > ul {
    flex-direction: column;
    padding: 24px 20px;
  }

  #header .gnb > ul > li {
    border-bottom: 1px solid #e5e7eb;
  }

  #header .gnb > ul > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 16px;
    color: #111827;
  }

  /* chevron */
  .has-sub i {
    font-size: 14px;
    transition: transform 0.25s ease;
  }

  .has-sub.open i {
    transform: rotate(180deg);
  }

  /* submenu (mobile accordion) */
  .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    list-style: none;
    padding: 0;
  }

  .has-sub.open .submenu {
    max-height: 400px;
  }

  .submenu a {
    display: block;
    padding: 12px 12px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
  }
}
