/* ═══════════════════════════════════════════
   header.css — 글로벌 헤더 & 모바일 사이드 메뉴
   fragments/header.html 에서 사용
═══════════════════════════════════════════ */

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Noto Sans KR', sans-serif; }

/* 히어로 없는 페이지 추가 밀림 방지 */
.contents-wrap { padding-top: 70px; }

/* ─── 헤더 ─── */
.header {
  background: #fff;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 70px;
  z-index: 1000;
}
.header > .vd-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.header a {
  display: inline-block;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 400;
  padding: 0;
  text-decoration: none;
}
.header a img { width: 100%; display: block; height: auto; }
.header .logo a { margin-top: 3px; }

/* ─── 왼쪽: 로고 + 네비 ─── */
.menu-left { display: flex; align-items: center; }

.menu-wrap ul {
  display: flex;
  justify-content: flex-start;
  margin-left: 4.6875rem;
  padding: 0; list-style: none;
}
.menu-wrap ul li a { margin-right: 40px; position: relative; }
.menu-wrap ul li:last-child a { margin-right: 0; }
.menu-wrap ul li a::after {
  content: "";
  width: 120%;
  height: 3px;
  background: var(--red);
  position: absolute;
  bottom: -2px; left: 50%;
  transform: translateX(-50%);
  display: none;
}
.menu-wrap ul li:hover a::after { display: block; }
.menu-wrap ul li.on a { color: var(--red); }
.menu-wrap ul li.on a::after { display: block; }

/* ─── 오른쪽: 버튼 ─── */
.menu-right.menu-wrap ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-right: 0;
  margin-left: 0;
}
.menu-right.menu-wrap ul li a,
.menu-right.menu-wrap ul li button {
  margin-right: 0;
  display: block;
  padding: 0.3125rem 0.9375rem;
  font-size: 0.875rem;
  border-radius: 99px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.menu-right.menu-wrap ul li a::after,
.menu-right.menu-wrap ul li button::after { display: none !important; }

.nav-login-btn-pc { background-color: var(--red) !important; color: #fff !important; transition: background-color 0.3s ease; }
.nav-login-btn-pc:hover { background-color: var(--red-dk) !important; }

.nav-join-btn-pc  { background-color: #e9e9e9 !important; color: var(--nav-gray) !important; transition: background-color 0.3s ease; }
.nav-join-btn-pc:hover  { background-color: #d9d9d9 !important; }

.logout-btn-pc    { background-color: #e9e9e9 !important; color: var(--nav-gray) !important; transition: background-color 0.3s ease; }
.logout-btn-pc:hover    { background-color: #d9d9d9 !important; }

.mypage-btn-pc    { background-color: #e9e9e9 !important; color: var(--nav-gray) !important; transition: background-color 0.3s ease; }
.mypage-btn-pc:hover    { background-color: #d9d9d9 !important; }

.vdesk-btn-pc     { background-color: var(--red) !important; color: #fff !important; transition: background-color 0.3s ease; }
.vdesk-btn-pc:hover     { background-color: var(--red-dk) !important; }

/* ─── 햄버거 ─── */
.mb-nav { display: none; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.3125rem;
  width: 36px; height: 36px;
  cursor: pointer;
  padding: 0.375rem;
  background: transparent;
  border: none;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--mid); border-radius: 2px; transition: all 0.3s ease; }
.hamburger.on span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.on span:nth-child(2) { opacity: 0; }
.hamburger.on span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── 모바일 사이드 메뉴 ─── */
.mob-nav {
  position: fixed;
  top: 0; right: -300px;
  width: 280px; height: 100vh;
  background: #fff;
  z-index: 999;
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
  transition: right 0.35s cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mb-nav.on .mob-nav { right: 0; }
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 998; }
.mb-nav.on .modal-bg { display: block; }

.mob-nav-top { padding: 20px 20px 16px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; }
.mob-nav-top .logo { width: 80px; }
.mob-nav-top .logo img { width: 100%; height: auto; }

.mob-nav-mid { display: flex; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.mob-nav-mid a,
.mob-nav-mid button {
  flex: 1;
  display: block;
  text-align: center;
  padding: 0.5rem 0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.mob-login-btn  { background: var(--red); color: #fff; border: none; }
.mob-join-btn   { background: #e9e9e9; color: var(--nav-gray); border: none; }
.mob-logout-btn { background: #e9e9e9; color: var(--nav-gray); border: none; }
.mob-mypage-btn { background: #e9e9e9; color: var(--nav-gray); border: none; }

.mob-nav-bottom { padding: 12px 20px; border-bottom: 1px solid var(--border-soft); }
.mob-nav-bottom a {
  display: block; text-align: center; padding: 10px;
  background: var(--red); color: #fff;
  border-radius: 8px; font-size: 0.875rem; font-weight: 700; text-decoration: none;
}

.mob-con { padding: 8px 0; }
.mob-con ul { padding: 0; list-style: none; margin: 0; }
.mob-con ul li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1.25rem; font-size: 0.95rem; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid #f5f5f5; font-weight: 500;
}
.mob-con ul li a:hover { background: #fafafa; color: var(--red); }
.mob-con ul li a i { font-size: 0.75rem; color: var(--gray-300); }

/* ─── 반응형 ─── */
@media (max-width: 768px) {
  .menu-left .menu-wrap,
  .menu-right { display: none !important; }
  .mb-nav { display: block; }

  /* 햄버거: 헤더와 독립된 fixed — 헤더가 올라가도 항상 표시 */
  .hamburger {
    display: flex !important;
    position: fixed;
    top: 17px; right: 16px;
    z-index: 1001;
    background: transparent;
  }

  /* 사이드바 열릴 때 헤더 위로 숨김 */
  .header { transition: transform 0.35s cubic-bezier(.16,1,.3,1); }
  body.mob-nav-open .header { transform: translateY(-100%); }

  /* 사이드바 로고: PC 헤더와 동일 높이 */
  .mob-nav-top .logo { width: auto; }
  .mob-nav-top .logo img { height: 32px; width: auto; }

  /* 사이드바 구분선 제거 */
  .mob-nav-top,
  .mob-nav-mid,
  .mob-nav-bottom { border-bottom: none !important; }
  .mob-con ul li a { border-bottom: none !important; }
}
