/* =========================
   Global Fix (중요)
========================= */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* =========================
   Header Base
========================= */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0; /* 핵심 */
  width: auto; /* 100% ❌ */
  z-index: 100;
  background: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#header.scrolled {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

/* =========================
   Inner (Top Bar)
========================= */
#header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  box-sizing: border-box;
}

/* =========================
   Logo
========================= */
#header .logo {
  margin: 0;
  display: flex;
}

#header .logo-img {
  width: 180px;
  transition: opacity 0.3s ease;
}

#header.scrolled .logo-img {
  content: url("/assets/img/logo_b.png");
}

/* =========================
   Navigation (PC)
========================= */
#header .gnb {
  display: block;
}

#header .gnb > ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

#header .gnb > ul > li > a {
  display: block;
  padding: 20px 32px;
  font-size: 18px;
  font-weight: 500;
  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: #007aff;
}

/* =========================
   Mobile Menu Button
========================= */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #ffffff;
}

#header.scrolled .menu-toggle {
  color: #111827;
}

/* =========================
   Mobile (Admin-style)
========================= */
@media (max-width: 768px) {
  /* Header */
  #header {
    left: 0;
    right: 0;
    width: auto;
  }

  /* Top Bar */
  #header .inner {
    height: 60px;
    max-width: 100%;
    padding: 0 10px 0 16px;
  }

  #header .logo-img {
    width: 140px;
  }

  /* Hamburger */
  .menu-toggle {
    display: block;
  }

  /* Mobile Menu Panel */
  #header .gnb {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - 60px);

    background: #ffffff;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  #header .gnb.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  #header .gnb > ul {
    flex-direction: column;
    padding: 24px 20px;
  }

  #header .gnb > ul > li {
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
  }

  #header .gnb > ul > li:last-child {
    border-bottom: none;
  }

  #header .gnb > ul > li > a {
    width: 100%;
    padding: 16px 0;
    font-size: 16px;
    color: #111827;
  }

  #header .gnb > ul > li > a:hover {
    color: #007aff;
  }
}
