/* 헤더 — HOME 전달 문서 02번 카드, Figma "01 / Header" (1920 · 740 · 360)
   메뉴 패널 — Figma "HEADER / 메뉴 패널 · 열기와 선택", "HEADER / 메뉴 항목 · 기본과 호버" */

.v2-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-surface-page);
}

/* 고정 헤더가 본문을 가리지 않도록 같은 높이의 자리 (Figma "Header / Flow Space") */
.v2-header-space { height: calc(var(--header-h) * var(--u)); }

/* ── 1920 ─────────────────────────────────────────────── */
.v2-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(113 * var(--u));
  padding: 0 var(--side);
  background: var(--color-surface-page);
}

.v2-header__logo {
  flex: none;
  font-weight: 900;
  font-size: calc(28 * var(--u));
  line-height: calc(39 * var(--u));
  white-space: nowrap;
  color: var(--color-text-default);
}

.v2-header__nav {
  display: flex;
  align-items: center;
  gap: calc(36 * var(--u));
}

.v2-header__link {
  font-weight: 400;
  font-size: calc(15 * var(--u));
  line-height: calc(21 * var(--u));
  white-space: nowrap;
  color: var(--color-text-default);
}
.v2-header__link:hover,
.v2-header__link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: calc(5 * var(--u));
  text-decoration-thickness: max(1px, calc(1 * var(--u)));
}

/* 로그인 후: SIGN IN 자리에 "MY PAGE" (Regular 18 / 25, 글자 폭만큼) — 2026-11-25 시안: 사용자명 대신 고정 문구 */
.v2-header__link--member {
  font-size: calc(18 * var(--u));
  line-height: calc(25 * var(--u));
}

.v2-header__contact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(157 * var(--u));
  height: calc(57 * var(--u));
  padding: 0 calc(20 * var(--u));
  background: var(--color-action-default);
  border: calc(1 * var(--u)) solid var(--color-action-border);
  border-radius: calc(5 * var(--u));
  font-weight: 400;
  font-size: calc(18 * var(--u));
  line-height: calc(25 * var(--u));
  white-space: nowrap;
  color: var(--color-text-on-action);
  transition: background-color 0.15s ease;
}
.v2-header__contact:hover  { background: var(--color-action-hover); }
.v2-header__contact:active { opacity: 0.85; }

.v2-header__toggle { display: none; }

/* ── 740 · 360 공통: 메뉴는 숨기고 햄버거 44×44 ───────── */
html:not([data-bp="d"]) .v2-header__nav { display: none; }

html:not([data-bp="d"]) .v2-header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  color: #272727;
}
.v2-header__toggle svg {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  overflow: visible;
}
.v2-header__toggle .v2-header__icon-close { display: none; }
.v2-header__toggle[aria-expanded="true"] .v2-header__icon-menu  { display: none; }
.v2-header__toggle[aria-expanded="true"] .v2-header__icon-close { display: block; }

html:not([data-bp="d"]) .v2-header__logo {
  font-size: calc(22 * var(--u));
  line-height: calc(26 * var(--u));
}

/* 740 */
html[data-bp="t"] .v2-header__bar { height: calc(84 * var(--u)); }

/* 360: 높이 116 = 상단 여백 52 + 44 + 하단 20 */
html[data-bp="m"] .v2-header__bar {
  height: calc(116 * var(--u));
  padding: calc(52 * var(--u)) var(--side) calc(20 * var(--u));
}

/* ── 메뉴 패널 (740 · 360) ───────────────────────────── */
.v2-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}
.v2-menu[hidden] { display: none; }
html[data-bp="d"] .v2-menu { display: none; }

.v2-menu__panel {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--u));
  max-height: calc(100vh - var(--header-h) * var(--u));
  padding: calc(12 * var(--u)) var(--side) calc(24 * var(--u));
  overflow-y: auto;
  background: var(--color-surface-page);
}

/* 패널 아래 빈 영역: 누르면 닫힘 (Figma "Backdrop / 닫기", 투명) */
.v2-menu__backdrop {
  display: block;
  width: 100%;
  height: 100vh;
  cursor: default;
}

.v2-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12 * var(--u));
  height: calc(52 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: calc(4 * var(--u));
  font-weight: 600;
  font-size: calc(18 * var(--u));
  line-height: calc(24 * var(--u));
  color: var(--color-text-default);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.v2-menu__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v2-menu__row::after {
  content: "";
  flex: none;
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  background: url("../../images/v2/common/menu_star_gray.png") center / contain no-repeat;
}
@media (hover: hover) {
  .v2-menu__row:hover { background: var(--color-menu-hover); }
}
/* 현재 페이지: 진한 배경 + 흰 글자 + 흰 별 (색만이 아니라 배경 면으로 구분) */
.v2-menu__row[aria-current="page"],
.v2-menu__row:active {
  background: var(--color-text-default);
  color: var(--color-text-on-action);
}
.v2-menu__row[aria-current="page"]::after,
.v2-menu__row:active::after {
  background-image: url("../../images/v2/common/menu_star_white.png");
}

.v2-menu__divider {
  flex: none;
  height: max(1px, calc(1 * var(--u)));
  background: var(--color-menu-divider);
}

.v2-menu__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: calc(44 * var(--u));
  padding: 0 calc(12 * var(--u));
  background: var(--color-action-default);
  border-radius: calc(4 * var(--u));
  font-weight: 700;
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
  color: var(--color-text-on-action);
  transition: background-color 0.15s ease;
}
@media (hover: hover) {
  .v2-menu__cta:hover { background: var(--color-action-hover); }
}
.v2-menu__cta:active { opacity: 0.85; }

/* 360: 항목 높이 48, 글자 16, 별 12 */
html[data-bp="m"] .v2-menu__row {
  height: calc(48 * var(--u));
  font-size: calc(16 * var(--u));
  line-height: calc(22 * var(--u));
}
html[data-bp="m"] .v2-menu__row::after {
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
}
