/* ═══════════════════════════════════════════════════════════════
   nav.css — 파란디자인 공통 헤더 (모든 페이지 공유, 단 1개 파일)
   수정 시 이 파일만 수정하면 전 페이지에 반영됨.
   build.js → <link href="/css/nav.css"> 태그로 주입
   ═══════════════════════════════════════════════════════════════ */

/* ── 메인 네비게이션 컨테이너 ─────────────────────────────────── */
#main-nav {
  background: #0a1248 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.12) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  will-change: transform;
  transform: translateZ(0);
  transition: box-shadow 0.3s ease !important;
  font-family: 'Pretendard Variable', 'Pretendard', 'Inter Tight', sans-serif;
  padding: 0 !important;
}

#main-nav.nav-scrolled {
  background: #0a1248 !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.35) !important;
  padding: 0 !important;
}

/* ── 활성 메뉴 항목 ───────────────────────────────────────────── */
.nv4-active {
  color: #fff !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

/* ── 내부 레이아웃 ────────────────────────────────────────────── */
.nv4-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 80px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── 로고 (레거시, 일부 페이지 호환) ────────────────────────── */
.nv4-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nv4-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* ── 브랜드 + 사이트 스위처 ───────────────────────────────── */
.nv4-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}
.nv4-co-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.nv4-co-icon {
  height: 38px;
  width: auto;
  max-width: 160px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}
.nv4-co-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.nv4-co-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.nv4-co-sub {
  font-size: 9.5px;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.03em;
}
.nv4-brand-sep {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,0.14);
  flex-shrink: 0;
}

/* ── 사이트 스위처 ────────────────────────────────────────── */
.nv4-sw { position: relative; }
.nv4-sw-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 20px;
  padding: 5px 10px 5px 9px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nv4-sw-btn:hover,
.nv4-sw.open .nv4-sw-btn {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
}
.nv4-sw-btn .nv4-chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.18s;
  opacity: 0.6;
}
.nv4-sw.open .nv4-sw-btn .nv4-chevron { transform: rotate(180deg); }

.nv4-sw-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nv4-sw-dot.design { background: #00BFFF; box-shadow: 0 0 4px rgba(0,191,255,0.6); }
.nv4-sw-dot.event  { background: #a78bfa; box-shadow: 0 0 4px rgba(167,139,250,0.5); }

/* Dropdown */
.nv4-sw-dd {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 170px;
  background: #0e1a58;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  z-index: 400;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.nv4-sw.open .nv4-sw-dd {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
}
.nv4-sw-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nv4-sw-opt:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nv4-sw-current { color: #fff; }
.nv4-sw-badge {
  margin-left: auto;
  font-size: 10px;
  background: rgba(0,191,255,0.15);
  color: #00BFFF;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nv4-sw-ext {
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: 1;
  color: #fff;
  flex-shrink: 0;
}

/* ── 데스크톱 메뉴 ────────────────────────────────────────────── */
.nv4-menu {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nv4-menu > li > a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  font-family: 'Pretendard Variable', 'Pretendard', 'Inter Tight', sans-serif !important;
  transition: color 0.2s;
}
.nv4-menu > li > a:hover { color: #fff !important; }

/* ── CTA 버튼 ─────────────────────────────────────────────────── */
.nv4-cta {
  background: #00BFFF !important;
  color: #0d1a6e !important;
  font-weight: 700 !important;
  padding: 9px 22px;
  border-radius: 50px;
  font-size: 14px !important;
  transition: opacity 0.2s !important;
}
.nv4-cta:hover { opacity: 0.88 !important; }

/* ── 서비스 드롭다운 ──────────────────────────────────────────── */
.nv4-dd-wrap { position: relative; }
.nv4-dd-wrap > a {
  display: flex !important;
  align-items: center;
  gap: 4px;
}
.nv4-chevron { width: 14px; height: 14px; transition: transform 0.2s; }
.nv4-dd-wrap:hover .nv4-chevron { transform: rotate(180deg); }
.nv4-dd {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding-top: 8px;
  z-index: 300;
  min-width: 210px;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.nv4-dd-panel {
  background: #101c5a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.nv4-dd-wrap:hover .nv4-dd {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}
.nv4-dd-panel a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nv4-dd-panel a:hover { background: rgba(255,255,255,0.07); color: #fff; }

.nv4-dd-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 14px 4px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 4px;
}
.nv4-dd-family {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}
.nv4-dd-family svg {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ── 모바일 햄버거 버튼 ───────────────────────────────────────── */
.nv4-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nv4-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── 모바일 메뉴 오버레이 ─────────────────────────────────────── */
#mobile-menu-v4 {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a1248;
  z-index: 999;
  overflow-y: auto;
  flex-direction: column;
}
#mobile-menu-v4.open { display: flex; }
.nv4-mob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.nv4-mob-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
}
.nv4-mob-body { padding: 24px; flex: 1; }
.nv4-mob-link {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}
.nv4-mob-link:hover { color: #00BFFF; }
.nv4-mob-services-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  color: #f1f5f9;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}
.nv4-mob-chevron { width: 20px; height: 20px; transition: transform 0.2s; }
.nv4-mob-submenu { display: none; padding: 4px 0 12px 16px; }
.nv4-mob-submenu.open { display: block; }
.nv4-mob-submenu a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}
.nv4-mob-submenu a:hover { color: #00BFFF; }
.nv4-mob-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 4px;
}
.nv4-mob-family { color: rgba(255,255,255,0.6) !important; }
.nv4-mob-family:hover { color: #00BFFF !important; }
.nv4-mob-cta {
  display: block;
  margin-top: 28px;
  text-align: center;
  padding: 14px 24px;
  background: #00BFFF;
  color: #0d1a6e;
  font-weight: 700;
  font-size: 15px;
  border-radius: 50px;
  text-decoration: none;
  font-family: 'Pretendard Variable', 'Pretendard', sans-serif;
}

/* ── 반응형 ───────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .nv4-inner { padding: 0 20px; }
  .nv4-menu { display: none; }
  .nv4-hamburger { display: flex; }
  .nv4-co-text { display: none; }
  .nv4-brand-sep { display: none; }
  .nv4-brand { gap: 8px; }
  .nv4-co-icon { height: 28px; width: auto; max-width: 120px; }
}
@media (max-width: 480px) {
  .nv4-inner { padding: 0 16px; }
  .nv4-co-icon { height: 24px; max-width: 100px; }
  .nv4-sw-btn { font-size: 12px; padding: 4px 8px 4px 7px; }
  .nv4-sw-btn .nv4-chevron { width: 12px; height: 12px; }
}
