/* =========================================================
   QuantEstate Header v2.0.0
   - PC(.qh-pc) / 모바일(.qh-mo) 마크업 완전 분리
   - 분기점: 1024px 이하 = 모바일, 1025px 이상 = PC
   - 모든 선택자는 html body .qh 로 시작 → 테마/페이지별 CSS 간섭 차단
========================================================= */

.qh {
  --qh-navy: #0b1f3a;
  --qh-line: #e5eaf0;
  --qh-soft: #f5f7fa;
  --qh-muted: #68788c;
  --qh-sub: #66758a;
  --qh-pc-h: 88px;
  --qh-mo-h: 72px;
  --qh-admin: 0px;
}

body.admin-bar .qh { --qh-admin: 32px; }
@media (max-width: 782px) {
  body.admin-bar .qh { --qh-admin: 46px; }
}
@media (max-width: 600px) {
  .qh { --qh-mo-h: 64px; }
}

/* =========================================================
   RESET — 테마 스타일이 헤더 안으로 새어 들어오지 않게
========================================================= */
html body .qh {
  position: fixed !important;
  top: var(--qh-admin) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  transform: none !important;
  filter: none !important;
  z-index: 9999 !important;
  font-family: inherit;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

html body .qh,
html body .qh *,
html body .qh *::before,
html body .qh *::after {
  box-sizing: border-box !important;
}

html body .qh ul,
html body .qh ol,
html body .qh li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  float: none !important;
  text-indent: 0 !important;
}

html body .qh li::before,
html body .qh li::after,
html body .qh a::before {
  content: none !important;
}

html body .qh a,
html body .qh a:link,
html body .qh a:visited,
html body .qh a:hover,
html body .qh a:focus,
html body .qh a:active {
  text-decoration: none !important;
  box-shadow: none !important;
  border: 0;
  outline-offset: 2px;
  text-transform: none !important;
}

html body .qh button,
html body .qh button:hover,
html body .qh button:focus,
html body .qh button:active {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  font: inherit !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  cursor: pointer !important;
}

html body .qh img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body .qh .qh-empty {
  margin: 0 !important;
  font-size: 13px !important;
}

/* 스페이서 (헤더 높이만큼 본문을 밀어줌 — spacer 속성 사용 시) */
.qh-spacer { display: none; }

/* =========================================================
   표시 분기 — 서로 절대 섞이지 않음
========================================================= */
@media (min-width: 1025px) {
  html body .qh .qh-mo { display: none !important; }
  .qh-spacer--all { display: block; height: 88px; }
}

@media (max-width: 1024px) {
  html body .qh .qh-pc { display: none !important; }
  .qh-spacer--all,
  .qh-spacer--mobile { display: block; height: 72px; }
}

@media (max-width: 600px) {
  .qh-spacer--all,
  .qh-spacer--mobile { height: 64px; }
}

/* =========================================================
   PC (1025px ~)
========================================================= */
@media (min-width: 1025px) {
  html body .qh .qh-pc {
    --qh-fg: #ffffff;
    display: block !important;
    width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background-color .3s ease, box-shadow .3s ease !important;
  }

  /* 스크롤 / 흰배경 모드 */
  html body .qh.is-scrolled .qh-pc,
  html body .qh.qh--solid .qh-pc {
    --qh-fg: var(--qh-navy);
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 1px 0 rgba(11, 31, 58, .08), 0 8px 28px rgba(11, 31, 58, .05) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  html body .qh .qh-pc__inner {
    display: grid !important;
    grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr) !important;
    align-items: center !important;
    column-gap: 32px !important;
    width: 100% !important;
    max-width:1440px !important;
    height: var(--qh-pc-h) !important;
    margin: 0 auto !important;
    padding: 0 clamp(24px, 3.5vw, 50px) !important;
  }

  html body .qh.qh--pc-right .qh-pc__inner {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }

  /* 로고 */
  html body .qh .qh-pc__logo {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-self: start !important;
  }

  html body .qh .qh-pc__logo-img {
    max-width: 190px !important;
    max-height: 42px !important;
    transition: opacity .25s ease, visibility .25s ease !important;
  }

  html body .qh .qh-pc__logo-img--navy {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  html body .qh.is-scrolled .qh-pc__logo-img--white,
  html body .qh.qh--solid .qh-pc__logo-img--white {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  html body .qh.is-scrolled .qh-pc__logo-img--navy,
  html body .qh.qh--solid .qh-pc__logo-img--navy {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* 메뉴 */
  html body .qh .qh-pc__nav {
    display: flex !important;
    justify-content: center !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
  }

  html body .qh.qh--pc-right .qh-pc__nav {
    justify-content: flex-end !important;
  }

  html body .qh .qh-pc__menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: clamp(22px, 2.4vw, 46px) !important;
  }

  html body .qh .qh-pc__menu > li {
    position: relative !important;
    display: block !important;
  }

  html body .qh .qh-pc__menu > li > a,
  html body .qh .qh-pc__menu > li > a:link,
  html body .qh .qh-pc__menu > li > a:visited,
  html body .qh .qh-pc__menu > li > a:hover,
  html body .qh .qh-pc__menu > li > a:focus,
  html body .qh .qh-pc__menu > li > a:active {
    display: flex !important;
    align-items: center !important;
    height: var(--qh-pc-h) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    color: var(--qh-fg) !important;
    -webkit-text-fill-color: var(--qh-fg) !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
    letter-spacing: -.02em !important;
    white-space: nowrap !important;
    transition: color .25s ease, opacity .25s ease !important;
  }

  html body .qh .qh-pc__menu > li > a .qh-label {
    position: relative !important;
    display: inline-block !important;
  }

  html body .qh .qh-pc__menu > li > a .qh-label::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: -6px !important;
    height: 1.5px !important;
    background: currentColor !important;
    transform: scaleX(0) !important;
    transform-origin: left center !important;
    transition: transform .25s ease !important;
  }

  html body .qh .qh-pc__menu > li:hover > a .qh-label::after,
  html body .qh .qh-pc__menu > li > a:focus-visible .qh-label::after,
  html body .qh .qh-pc__menu > li.current-menu-item > a .qh-label::after,
  html body .qh .qh-pc__menu > li.current-menu-ancestor > a .qh-label::after {
    transform: scaleX(1) !important;
  }

  /* 드롭다운 */
  html body .qh .qh-pc__menu .sub-menu {
    position: absolute !important;
    top: calc(100% - 14px) !important;
    left: 50% !important;
    right: auto !important;
    z-index: 20 !important;
    display: block !important;
    min-width: 220px !important;
    width: max-content !important;
    margin: 0 !important;
    padding: 10px !important;
    border: 1px solid rgba(11, 31, 58, .07) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 18px 48px rgba(10, 30, 55, .14) !important;
    transform: translate(-50%, 8px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease !important;
  }

  html body .qh .qh-pc__menu li:hover > .sub-menu,
  html body .qh .qh-pc__menu li:focus-within > .sub-menu {
    transform: translate(-50%, 0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  html body .qh .qh-pc__menu .sub-menu li {
    position: relative !important;
    display: block !important;
  }

  html body .qh .qh-pc__menu .sub-menu a,
  html body .qh .qh-pc__menu .sub-menu a:link,
  html body .qh .qh-pc__menu .sub-menu a:visited,
  html body .qh .qh-pc__menu .sub-menu a:hover,
  html body .qh .qh-pc__menu .sub-menu a:focus,
  html body .qh .qh-pc__menu .sub-menu a:active {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 11px 13px !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--qh-navy) !important;
    -webkit-text-fill-color: var(--qh-navy) !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-weight: 500 !important;
    letter-spacing: -.015em !important;
    white-space: nowrap !important;
  }

  html body .qh .qh-pc__menu .sub-menu a:hover,
  html body .qh .qh-pc__menu .sub-menu a:focus,
  html body .qh .qh-pc__menu .sub-menu .current-menu-item > a {
    background: var(--qh-soft) !important;
  }

  html body .qh .qh-pc__menu .sub-menu .qh-label::after { content: none !important; }

  /* 3차 메뉴 */
  html body .qh .qh-pc__menu .sub-menu .sub-menu {
    top: -11px !important;
    left: calc(100% + 10px) !important;
    transform: translate(8px, 0) !important;
  }

  html body .qh .qh-pc__menu .sub-menu li:hover > .sub-menu,
  html body .qh .qh-pc__menu .sub-menu li:focus-within > .sub-menu {
    transform: translate(0, 0) !important;
  }

  /* 오른쪽 CTA (Contact Us) */
  html body .qh .qh-pc__actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    justify-self: end !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  html body .qh .qh-cta--pc,
  html body .qh .qh-cta--pc:link,
  html body .qh .qh-cta--pc:visited {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 22px !important;
    border: 1px solid var(--qh-fg) !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--qh-fg) !important;
    -webkit-text-fill-color: var(--qh-fg) !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    letter-spacing: -.01em !important;
    white-space: nowrap !important;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease !important;
  }

  html body .qh .qh-cta--pc:hover,
  html body .qh .qh-cta--pc:focus-visible {
    background: #fff !important;
    border-color: #fff !important;
    color: var(--qh-navy) !important;
    -webkit-text-fill-color: var(--qh-navy) !important;
  }

  html body .qh.is-scrolled .qh-cta--pc,
  html body .qh.qh--solid .qh-cta--pc {
    background: var(--qh-navy) !important;
    border-color: var(--qh-navy) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  html body .qh.is-scrolled .qh-cta--pc:hover,
  html body .qh.qh--solid .qh-cta--pc:hover,
  html body .qh.is-scrolled .qh-cta--pc:focus-visible,
  html body .qh.qh--solid .qh-cta--pc:focus-visible {
    background: #16325a !important;
    border-color: #16325a !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  html body .qh .qh-pc .qh-empty { color: var(--qh-fg) !important; }
}

/* =========================================================
   MOBILE / TABLET (~ 1024px)
========================================================= */
@media (max-width: 1024px) {
  html body .qh .qh-mo {
    display: block !important;
    width: 100% !important;
  }

  html body .qh .qh-mo__bar {
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    width: 100% !important;
    height: var(--qh-mo-h) !important;
    margin: 0 !important;
    padding: 0 20px !important;
    background: #fff !important;
    box-shadow: 0 1px 0 rgba(11, 31, 58, .08) !important;
  }

  html body .qh .qh-mo__logo {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
  }

  html body .qh .qh-mo__logo-img {
    max-width: min(160px, 52vw) !important;
    max-height: 34px !important;
  }

  /* 햄버거 */
  html body .qh .qh-mo__toggle {
    position: relative !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    margin-right: -10px !important;
    border-radius: 10px !important;
  }

  html body .qh .qh-mo__toggle span {
    position: absolute !important;
    left: 10px !important;
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: var(--qh-navy) !important;
    transition: transform .25s ease, opacity .25s ease, top .25s ease !important;
  }

  html body .qh .qh-mo__toggle span:nth-child(1) { top: 14px !important; }
  html body .qh .qh-mo__toggle span:nth-child(2) { top: 21px !important; }
  html body .qh .qh-mo__toggle span:nth-child(3) { top: 28px !important; }

  html body .qh.is-menu-open .qh-mo__toggle span:nth-child(1) { top: 21px !important; transform: rotate(45deg) !important; }
  html body .qh.is-menu-open .qh-mo__toggle span:nth-child(2) { opacity: 0 !important; }
  html body .qh.is-menu-open .qh-mo__toggle span:nth-child(3) { top: 21px !important; transform: rotate(-45deg) !important; }

  /* 전체 패널 */
  html body .qh .qh-mo__panel {
    position: fixed !important;
    top: calc(var(--qh-admin) + var(--qh-mo-h)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease !important;
  }

  html body .qh.is-menu-open .qh-mo__panel {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  html body .qh .qh-mo__nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 16px 22px 22px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: none !important;
  }

  html body .qh .qh-mo__menu {
    display: block !important;
    width: min(100%, 560px) !important;
    margin: 0 auto !important;
  }

  /* 1차 메뉴 행 */
  html body .qh .qh-mo__menu li {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  html body .qh .qh-mo__menu li.qh-has-children {
    grid-template-columns: minmax(0, 1fr) 40px !important;
  }

  html body .qh .qh-mo__menu > li > a,
  html body .qh .qh-mo__menu > li > a:link,
  html body .qh .qh-mo__menu > li > a:visited,
  html body .qh .qh-mo__menu > li > a:hover,
  html body .qh .qh-mo__menu > li > a:focus,
  html body .qh .qh-mo__menu > li > a:active {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    background: transparent !important;
    color: var(--qh-navy) !important;
    -webkit-text-fill-color: var(--qh-navy) !important;
    opacity: 1 !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
    letter-spacing: -.02em !important;
    text-align: left !important;
  }

  /* 하위메뉴 토글 버튼 */
  html body .qh .qh-mo__sub-toggle {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
  }

  html body .qh .qh-mo__sub-toggle span {
    display: block !important;
    width: 7px !important;
    height: 7px !important;
    border-right: 1.5px solid var(--qh-muted) !important;
    border-bottom: 1.5px solid var(--qh-muted) !important;
    transform: rotate(45deg) translate(-1px, -1px) !important;
    transition: transform .2s ease !important;
  }

  html body .qh .qh-mo__menu li.is-open > .qh-mo__sub-toggle span {
    transform: rotate(225deg) translate(-1px, -1px) !important;
  }

  /* 하위메뉴 (아코디언, 항목 수 상관없이 자동 높이) */
  html body .qh .qh-mo__menu .sub-menu {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    position: static !important;
    display: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 0 8px 16px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  html body .qh .qh-mo__menu li.is-open > .sub-menu {
    display: block !important;
  }

  html body .qh .qh-mo__menu .sub-menu a,
  html body .qh .qh-mo__menu .sub-menu a:link,
  html body .qh .qh-mo__menu .sub-menu a:visited,
  html body .qh .qh-mo__menu .sub-menu a:hover,
  html body .qh .qh-mo__menu .sub-menu a:focus,
  html body .qh .qh-mo__menu .sub-menu a:active {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    background: transparent !important;
    color: var(--qh-sub) !important;
    -webkit-text-fill-color: var(--qh-sub) !important;
    opacity: 1 !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
    letter-spacing: -.015em !important;
    text-align: left !important;
    white-space: normal !important;
  }

  html body .qh .qh-mo__menu .sub-menu .current-menu-item > a {
    color: var(--qh-navy) !important;
    -webkit-text-fill-color: var(--qh-navy) !important;
    font-weight: 600 !important;
  }

  html body .qh .qh-mo__menu .sub-menu .sub-menu a,
  html body .qh .qh-mo__menu .sub-menu .sub-menu a:link,
  html body .qh .qh-mo__menu .sub-menu .sub-menu a:visited {
    color: #7b8798 !important;
    -webkit-text-fill-color: #7b8798 !important;
    font-size: 14px !important;
  }

  /* 하단: CTA + 카피라이트 */
  html body .qh .qh-mo__bottom {
    flex: 0 0 auto !important;
    width: min(calc(100% - 44px), 560px) !important;
    margin: 0 auto !important;
    padding: 18px 0 calc(26px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--qh-line) !important;
  }

  html body .qh .qh-mo__cta {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 0 18px !important;
  }

  html body .qh .qh-cta--mo,
  html body .qh .qh-cta--mo:link,
  html body .qh .qh-cta--mo:visited,
  html body .qh .qh-cta--mo:hover,
  html body .qh .qh-cta--mo:focus {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 20px !important;
    border-radius: 10px !important;
    background: var(--qh-navy) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    letter-spacing: -.01em !important;
  }

  html body .qh .qh-mo__footer {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #aab2bd !important;
    font-size: 11px !important;
    line-height: 1.55 !important;
    font-weight: 500 !important;
  }

  html body .qh .qh-mo__footer span { display: block !important; }

  html body .qh .qh-mo .qh-empty {
    width: min(100%, 560px) !important;
    margin: 0 auto !important;
    color: var(--qh-navy) !important;
  }

  /* 메뉴 열렸을 때 본문 스크롤 잠금 */
  html.qh-lock,
  html.qh-lock body {
    overflow: hidden !important;
  }
}

@media (max-width: 600px) {
  html body .qh .qh-mo__bar { padding: 0 16px !important; }
  html body .qh .qh-mo__logo-img { max-width: 145px !important; max-height: 31px !important; }

  html body .qh .qh-mo__menu > li > a,
  html body .qh .qh-mo__menu > li > a:link,
  html body .qh .qh-mo__menu > li > a:visited { font-size: 15px !important; }

  html body .qh .qh-mo__menu .sub-menu a,
  html body .qh .qh-mo__menu .sub-menu a:link,
  html body .qh .qh-mo__menu .sub-menu a:visited { font-size: 14px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html body .qh *,
  html body .qh *::before,
  html body .qh *::after {
    transition: none !important;
  }
}
