/* Naver-like header styling (scoped to #header-navbar only) */

/* #header-navbar .nvhd-top { padding: 10px 0; } */

/* === Header height slim === */
#header-navbar {
  min-height: 56px;           /* 기존보다 ↓ */
}


/* Desktop search bar */
#header-navbar .nvhd-search {
  max-width: 760px;
  width: 100%;
  display: flex;
  align-items: center;
  border: 2px solid var(--bs-primary);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
#header-navbar .nvhd-search-input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 10px 16px;
  font-size: 16px;
  background: transparent;
}
#header-navbar .nvhd-search-btn {
  border: 0;
  width: 46px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-primary);
  color: #fff;
  border-radius: 999px;
  margin: 2px;
}

/* Service menu row */
#header-navbar .nvhd-menu-row {
  padding: 6px 0 10px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
}

#header-navbar .nvhd-menu-wrap {
  position: relative;
  width: fit-content;      /* makes alignment work */
  max-width: 100%;
}

#header-navbar .nvhd-menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  position: relative; /* anchor the overlay panel to menu width */
}

#header-navbar .nvhd-menu-link {
  display: inline-block;
  padding: 6px 2px;
  font-size: 14px;
  color: var(--bs-body-color);
  text-decoration: none;
}
#header-navbar .nvhd-menu-link:hover { text-decoration: underline; }

/* Alignments driven by tmv (supports both ms/mx/me and left/center/right) */
#header-navbar .tmv-ms,
#header-navbar .tmv-left { display: flex; justify-content: flex-start; }
#header-navbar .tmv-mx,
#header-navbar .tmv-center { display: flex; justify-content: center; }
#header-navbar .tmv-me,
#header-navbar .tmv-right { display: flex; justify-content: flex-end; }

/* Ensure the inner wrap doesn't stretch so justification works */
#header-navbar .nvhd-menu-wrap { flex: 0 0 auto; }

/* More button + overlay panel */
#header-navbar .nvhd-more { position: static; } /* we'll anchor panel to .nvhd-menu */
#header-navbar .nvhd-more-btn {
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  border-radius: 10px;
  width: 34px;
  height: 30px;
  line-height: 1;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#header-navbar .nvhd-more-panel {
  position: absolute !important;
  left: 0 !important;
  top: 100% !important;          /* 붙어서 뜨게 */
  width: 100% !important;        /* 메뉴 폭과 동일 */
  margin-top: 0 !important;
  transform: none !important;    /* popper transform 제거 */
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
  z-index: 1060;
}

#header-navbar .nvhd-panel-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

#header-navbar .nvhd-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#header-navbar .nvhd-panel-item {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  color: var(--bs-body-color);
  text-decoration: none;
  background: #fff;
}
#header-navbar .nvhd-panel-item:hover {
  border-color: rgba(0,0,0,0.18);
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
  #header-navbar .nvhd-menu-row { display: none; }
}


/* Keep right icons pinned right on narrow widths */
@media (max-width: 767.98px) {
  #header-navbar .nvhd-top { gap: 10px; }
  #header-navbar .nvhd-top > .nvhd-logo { flex: 0 0 auto; }
  #header-navbar .nvhd-top > .ms-auto { margin-left: auto !important; }
}

/* === Fix: narrow width right icons stick to right edge === */
@media (max-width: 991.98px) {
  /* 헤더 1줄 래퍼(PC/모바일 공통으로 쓰는 실제 flex 컨테이너에 맞춰주세요)
     아래 셀렉터는 fix 패치들에서 쓰던 구조 기준입니다.
     만약 클래스명이 다르면 알려주면 그 이름으로 정확히 맞춰드릴게요. */
  #header-navbar .nvhd-top,
  #header-navbar .nvhd-top-inner,
  #header-navbar .nvhd-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  /* 우측 아이콘 래퍼는 절대 늘어나지 않게 */
  #header-navbar .nvhd-right,
  #header-navbar .nvhd-icons,
  #header-navbar .nariya-right {
    margin-left: auto !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  /* 로고는 좌측 고정 */
  #header-navbar .nvhd-brand,
  #header-navbar .navbar-brand {
    flex: 0 0 auto !important;
  }
}

/* === Mobile header slim only === */
@media (max-width: 991.98px) {

  #header-navbar {
    min-height: 48px;
  }

  #header-navbar .navbar,
  #header-navbar .nvhd-top {
    padding-top: 4px;
/*    padding-bottom: 4px; */
  }

  #header-navbar .navbar-brand {
    line-height: 1;
  }

  #header-navbar .nvhd-right button,
  #header-navbar .nvhd-right a {
    padding: 4px;
  }
}

/* =========================================
   🌙 헤더 서브 메뉴 & 전체서비스 다크모드 대응
========================================= */

/* 1. 메뉴 전체를 감싸는 상단 얇은 구분선 */
html[data-bs-theme="dark"] #header-navbar .nvhd-menu-row {
    border-top: 1px solid var(--bs-border-color) !important;
}

/* 2. '더보기(...)' 버튼 다크모드화 */
html[data-bs-theme="dark"] #header-navbar .nvhd-more-btn {
    background: var(--bs-secondary-bg) !important; /* 살짝 어두운 배경 */
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

/* 3. 전체서비스 드롭다운 패널 (팝업 껍데기) */
html[data-bs-theme="dark"] #header-navbar .nvhd-more-panel {
    background-color: var(--bs-body-bg) !important; /* 팝업 배경을 어둡게 */
    border: 1px solid var(--bs-border-color) !important; /* 다크모드용 테두리 추가 */
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6) !important; /* 다크모드에 맞춰 그림자 농도 조절 */
}

/* 4. "전체서비스" 텍스트 제목 색상 */
html[data-bs-theme="dark"] #header-navbar .nvhd-panel-title {
    color: var(--bs-body-color) !important;
}

/* 5. 패널 안쪽 개별 서비스 아이템 박스들 */
html[data-bs-theme="dark"] #header-navbar .nvhd-panel-item {
    background-color: var(--bs-secondary-bg) !important; /* 버튼 속 배경 */
    border-color: var(--bs-border-color) !important; /* 버튼 테두리 */
    color: var(--bs-body-color) !important; /* 글자색 */
}

/* 6. 개별 서비스 아이템 박스 마우스 오버 시 효과 */
html[data-bs-theme="dark"] #header-navbar .nvhd-panel-item:hover {
    border-color: rgba(255, 255, 255, 0.25) !important; /* 마우스 올렸을 때 은은한 흰색 테두리 */
    background-color: rgba(255, 255, 255, 0.05) !important; /* 살짝 밝아지는 효과 */
}

/* =========================================
   🌙 다크모드 전환 안정화 및 글자 커짐 방지
========================================= */

/* 1. 다크모드 시 글자가 두꺼워지고 커 보이는 현상 방지 (핵심) */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. 다크모드에서만 폰트 굵기를 미세하게 줄여서 라이트모드와 똑같은 크기로 보이게 착시 상쇄 */
html[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] a,
html[data-bs-theme="dark"] span,
html[data-bs-theme="dark"] p,
html[data-bs-theme="dark"] div {
    text-shadow: 0 0 0 rgba(255,255,255,0.01) !important;
    /* 만약 폰트가 지원한다면 아래 속성으로 굵기를 살짝 뺄 수도 있습니다 */
    /* font-weight: 400 !important; */
}

/* 3. 테마 전환 시 레이아웃이 덜컹거리지 않도록 스르륵(0.3초) 변하게 애니메이션 처리 */
body, 
.site-navbar, 
.site-wrap, 
.swipe-menu, 
.nvhd-menu-link,
.text-body,
.form-control {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, fill 0.3s ease !important;
}

/* 4. 스크롤바가 생겼다 사라지면서 화면이 좌우로 밀리는 현상 방지 */
html {
    overflow-y: scroll;
}


/* =========================================
   🌙 다크모드 레이아웃/글자 커짐 강제 방지 (철통방어)
========================================= */

/* 1. 다크모드일 때 메뉴가 양쪽으로 찢어지는 현상 차단 (라이트모드와 동일하게 왼쪽 정렬 유지) */
html[data-bs-theme="dark"] #header-navbar .nvhd-menu-row,
html[data-bs-theme="dark"] #header-navbar .tmv-ms,
html[data-bs-theme="dark"] #header-navbar .tmv-left {
    display: flex !important;
    justify-content: flex-start !important; 
}

html[data-bs-theme="dark"] #header-navbar .nvhd-menu {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 18px !important; /* 메뉴 사이 간격 라이트모드와 똑같이 고정 */
}

/* 2. 다크모드일 때 글자가 커지거나 뚱뚱해지는 현상 차단 (크기와 굵기 강제 고정) */
html[data-bs-theme="dark"] #header-navbar .nvhd-menu-link {
    font-size: 14px !important; /* 라이트모드와 똑같은 14px 고정 */
    font-weight: 400 !important; /* 폰트 굵기 뚱뚱해짐 방지 */
    letter-spacing: 0px !important; /* 자간이 벌어지는 현상 방지 */
}

/* 3. 빛 번짐(안티앨리어싱) 착시 현상 방지 */
html[data-bs-theme="dark"] {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* naver-header_새로생성.css 맨 하단에 추가 */
@media (max-width: 767.98px) {
    html[data-bs-theme="dark"] #header-navbar .nvhd-menu-row {
        display: none !important;
    }
}