/**
 * v2 헤더 공통 레이아웃 (메인·서브 동일)
 * - header.css absolute/flex/grid 충돌을 한곳에서 해소
 * - 색상·히어로 투명 등은 index-home-v2.css / site-header-v2.css 에서만 덮어씀
 */
@import url('/img/Pretendard-1.3.8/web/variable/pretendardvariable.css');

header.header-v2 {
  height: 110px !important;
  min-height: 110px !important;
  overflow: visible;
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

header.header-v2 .container {
  display: grid !important;
  /* 좌·우 1fr 대칭 → GNB가 헤더 가로 중앙에 위치 */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: 'logo nav actions';
  column-gap: clamp(16px, 2vw, 40px);
  align-items: center;
  justify-content: stretch;
  position: relative;
  width: 100%;
  max-width: none !important;
  min-width: 0 !important;
  height: 110px;
  margin: 0 !important;
  padding: 0 clamp(16px, 4vw, 70px);
  box-sizing: border-box;
  overflow: visible;
}

header.header-v2 .logo {
  grid-area: logo;
  flex-shrink: 0;
  width: auto !important;
  max-width: 173px;
  justify-self: start;
  z-index: 2;
}

header.header-v2 .logo img {
  height: clamp(36px, 3.2vw, 50px);
  width: auto;
  max-width: 100%;
  transition: height 0.2s ease;
}

header.header-v2 .index-header-custom.index-header-custom--v2 {
  display: flex !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  inset: auto !important;
  transform: none !important;
  grid-area: nav !important;
  justify-self: center;
  align-self: center;
  flex: none;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 3vw, 56px);
  width: auto;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  pointer-events: auto;
  z-index: 1;
  box-sizing: border-box;
}

header.header-v2 .index-header-links--legacy {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  width: auto;
  max-width: none;
  min-width: 0;
  flex: 0 0 auto;
  flex-shrink: 0;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  column-gap: 0 !important;
  font-family: inherit;
  font-size: clamp(16px, 1.05vw, 20px);
  font-weight: 400;
  pointer-events: auto;
}

header.header-v2 .index-header-links--legacy > li.index-header-service-highlight,
header.header-v2 .index-header-links--legacy > li.index-header-sep:last-of-type {
  display: none !important;
}

header.header-v2 .index-header-links--legacy > li.index-header-sep {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: auto !important;
  max-width: none !important;
  justify-self: auto !important;
  padding: 0 clamp(12px, 1.5vw, 24px);
  pointer-events: none;
  user-select: none;
}

header.header-v2 .index-header-links--legacy > li:not(.index-header-sep) {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: auto;
  width: auto;
  justify-self: auto !important;
  position: relative;
}

header.header-v2 .index-header-links--legacy > li > a {
  font-size: inherit;
  font-weight: 400;
  line-height: 130%;
  letter-spacing: -0.012em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, opacity 0.2s ease;
}

header.header-v2 .index-header-links--legacy > li.index-header-sep span {
  font-size: clamp(10px, 0.25rem + 0.6vw, 14px);
}

header.header-v2 .index-header-links--legacy .index-header-submenu {
  z-index: 1002;
}

header.header-v2 .index-header-v2-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 40px);
  flex-wrap: nowrap;
  max-width: 100%;
  min-width: 0;
  flex-shrink: 0;
}

header.header-v2 .index-header-v2-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 49px;
  height: auto;
  margin-left: 0;
  padding: 10px 28px;
  border: none;
  border-radius: 999px;
  border-bottom: none;
  background: #40798c;
  box-shadow: 0 8px 20px rgba(64, 121, 140, 0.28);
  text-decoration: none;
  color: #ffffff;
  box-sizing: border-box;
  isolation: isolate;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

header.header-v2 .index-header-v2-search:hover {
  background: #356778;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(64, 121, 140, 0.34);
}

header.header-v2 .index-header-v2-search__icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  color: inherit;
}

header.header-v2 .index-header-v2-search__label {
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 700;
  line-height: 140%;
  letter-spacing: -0.012em;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  padding-bottom: 0;
  border-bottom: none;
  color: inherit;
}

header.header-v2 .index-header-v2-search__short {
  display: none;
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 700;
  line-height: 140%;
  letter-spacing: -0.012em;
  white-space: nowrap;
  flex: 0 0 auto;
  color: inherit;
}

header.header-v2 .index-header-actions.index-header-actions--v2 {
  position: static !important;
  right: auto !important;
  top: auto !important;
  grid-area: actions !important;
  flex-shrink: 0;
  min-width: 0;
  margin-left: 0;
  /* 검색 CTA를 우측 끝에서 살짝 안쪽(좌측)으로 */
  justify-self: end;
  align-self: center;
  transform: translateX(clamp(-36px, -2.4vw, -16px));
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(12px, 1.2vw, 24px);
  z-index: 2;
}

header.header-v2 .index-header-account {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  flex-shrink: 0;
  max-width: none;
  padding-top: 2px;
}

header.header-v2 .index-header-guest-lookup {
  display: block;
  margin: 0;
  padding: 0;
  max-width: none;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.1px;
  color: #e4e4e7;
  text-decoration: underline;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
  white-space: nowrap;
  overflow: visible;
  transition: opacity 0.2s;
}

header.header-v2 .index-header-guest-lookup:hover {
  opacity: 0.75;
}

header.header-v2 .index-header-actions--v2 .index-header-btn {
  min-width: 0;
  width: auto;
  max-width: none;
  font-family: inherit;
  font-weight: 500;
}

header.header-v2 .index-header-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(13px, 0.35rem + 0.5vw, 15px);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 2px;
}

header.header-v2 .index-header-lang-switch__link {
  display: inline;
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
  font-weight: 500;
  transition: opacity 0.2s;
}

header.header-v2 .index-header-lang-switch__link:hover {
  opacity: 0.85;
}

header.header-v2 .index-header-lang-switch__sep {
  opacity: 0.45;
  font-size: 0.85em;
  user-select: none;
}

header.header-v2 .index-header-lang-switch__icon {
  font-size: 20px;
  opacity: 0.9;
  flex-shrink: 0;
}

header.header-v2 .index-header-lang-switch__current {
  font-weight: 600;
}

header.header-v2 .index-header-btn-outline,
header.header-v2 .index-header-btn--inquiry {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.5vw, 6px);
  min-height: 40px;
  height: 40px;
  padding: 0 clamp(8px, 1vw, 16px);
  font-size: clamp(12px, 0.3rem + 0.55vw, 16px);
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

header.header-v2 .index-header-btn-solid,
header.header-v2 .index-header-btn--quick-request {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.5vw, 6px);
  min-height: 40px;
  height: 40px;
  padding: 0 clamp(8px, 1vw, 16px);
  font-size: clamp(12px, 0.3rem + 0.55vw, 16px);
  font-weight: 500;
  box-shadow: none;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

header.header-v2 .index-header-btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.15px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
}

header.header-v2 .index-header-btn-login .index-header-btn__icon--account {
  font-size: 20px;
  line-height: 1;
}

header.header-v2 .index-header-btn__label--short {
  display: inline;
}

header.header-v2 .mo-btn {
  display: none !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  filter: none !important;
}

header.header-v2 .mo-btn__icon {
  display: block;
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
}

header.header-v2 .mo-btn:has(.mo-btn__icon) img {
  display: none !important;
}

/* PC: 레거시 GNB + 검색, 드로어·햄버거는 그리드 밖 */
@media (min-width: 841px) {
  header.header-v2 > .container > nav[role="navigation"],
  header.header-v2 > .container > .dim {
    display: none !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  header.header-v2 .mo-btn {
    display: none !important;
  }

  header.header-v2 .index-header-v2-nav {
    display: none !important;
  }

  header.header-v2 .index-header-custom.index-header-custom--v2 {
    display: flex !important;
  }

  header.header-v2 .index-header-links--legacy,
  header.header-v2 .index-header-links.index-header-links--legacy {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Figma PC: [검색 필] [KR|EN] [로그인+비회원] — 문의/빠른의뢰는 모바일만 */
  header.header-v2 .index-header-actions--v2 .index-header-v2-search {
    order: 1;
  }

  header.header-v2 .index-header-actions--v2 .index-header-lang-switch {
    order: 2;
  }

  header.header-v2 .index-header-actions--v2 .index-header-btn--inquiry,
  header.header-v2 .index-header-actions--v2 .index-header-btn--quick-request {
    display: none !important;
  }

  header.header-v2 .index-header-actions--v2 .index-header-account {
    order: 3;
  }

  header.header-v2 .index-header-actions--v2 .mo-btn {
    order: 4;
  }

  header.header-v2 .container {
    display: grid !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: clamp(16px, 4vw, 70px) !important;
    padding-right: clamp(16px, 4vw, 70px) !important;
  }
}

@media (min-width: 768px) and (max-width: 1280px) {
  header.header-v2 .container {
    column-gap: clamp(10px, 1.2vw, 20px);
  }

  header.header-v2 .index-header-custom {
    gap: clamp(16px, 2vw, 32px);
  }

  header.header-v2 .index-header-actions .index-header-btn--inquiry {
    display: none !important;
  }

  header.header-v2 .index-header-links--legacy {
    font-size: clamp(14px, 0.95vw, 17px);
  }

  header.header-v2 .index-header-links--legacy > li.index-header-sep {
    padding: 0 clamp(8px, 1vw, 14px);
  }

  header.header-v2 .index-header-v2-search {
    max-width: none;
    min-height: 44px;
    padding: 8px 20px;
    gap: 8px;
  }

  header.header-v2 .index-header-v2-search__label {
    display: none;
  }

  header.header-v2 .index-header-v2-search__short {
    display: inline;
    font-size: clamp(15px, 1.15vw, 17px);
  }

  header.header-v2 .index-header-actions.index-header-actions--v2 {
    gap: clamp(8px, 0.8vw, 14px);
  }
}

@media (min-width: 1281px) {
  header.header-v2 .index-header-v2-search {
    max-width: none;
  }

  header.header-v2 .index-header-v2-search__label {
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }
}

@media (min-width: 1101px) and (max-width: 1280px) {
  header.header-v2 .index-header-v2-search {
    max-width: none;
  }

  header.header-v2 .index-header-v2-search__label {
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }
}

/* 모바일: GNB 숨김, 빠른 의뢰 + 언어 + 햄버거 */
@media (max-width: 840px) {
  header.header-v2 {
    height: 70px !important;
    min-height: 70px !important;
    overflow-x: clip;
  }

  header.header-v2 .container {
    height: 70px;
    padding: 0 16px;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 16px;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  header.header-v2 .logo {
    max-width: min(128px, 34vw);
    flex-shrink: 1;
    min-width: 0;
    margin-right: 0;
  }

  header.header-v2 .logo a {
    display: block;
    width: min(128px, 34vw);
    height: 40px;
    overflow: hidden;
  }

  header.header-v2 .logo img {
    width: min(128px, 34vw);
    height: 40px;
    object-fit: cover;
    object-position: left top;
  }

  header.header-v2 .index-header-v2-search,
  header.header-v2 .index-header-v2-nav,
  header.header-v2 .index-header-custom--v2,
  header.header-v2 .index-header-links--legacy {
    display: none !important;
  }

  header.header-v2 .index-header-actions--v2 {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: auto !important;
    flex-shrink: 1;
    min-width: 0;
    position: static !important;
    grid-area: auto !important;
    transform: none;
    max-width: calc(100% - min(110px, 30vw));
  }

  header.header-v2 .index-header-actions--v2 .index-header-btn--quick-request {
    order: 1;
  }

  header.header-v2 .index-header-actions--v2 .index-header-lang-switch {
    order: 2;
    display: inline-flex !important;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    padding: 0;
    letter-spacing: -0.02em;
  }

  header.header-v2 .index-header-actions--v2 .mo-btn {
    order: 3;
  }

  header.header-v2 .index-header-lang-switch__icon {
    display: none;
  }

  header.header-v2 .index-header-lang-switch__sep {
    margin: 0 1px;
    opacity: 0.45;
  }

  header.header-v2 .index-header-actions .index-header-btn-outline,
  header.header-v2 .index-header-actions .index-header-btn--inquiry,
  header.header-v2 .index-header-btn-login,
  header.header-v2 .index-header-account,
  header.header-v2 .index-header-guest-lookup {
    display: none !important;
  }

  header.header-v2 .index-header-btn-solid,
  header.header-v2 .index-header-btn--quick-request {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    gap: 4px;
    max-width: 42vw;
  }

  header.header-v2 .index-header-btn--quick-request .index-header-btn__icon--bolt {
    display: none;
  }

  header.header-v2 .index-header-actions--v2 .mo-btn,
  header.header-v2 .index-header-actions.index-header-actions--v2 > .mo-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
    margin: 0;
    padding: 0 !important;
    z-index: 10001 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
  }

  header.header-v2 > .container > .mo-btn {
    display: none !important;
  }

  header.header-v2 nav[role="navigation"] {
    display: flex !important;
  }
}

/* 좁은 폰: 헤더 언어 스위처 숨김(드로어에 KR/EN/ES 있음) — 의뢰·햄버거만 */
@media (max-width: 400px) {
  header.header-v2 .index-header-actions--v2 .index-header-lang-switch {
    display: none !important;
  }

  header.header-v2 .logo,
  header.header-v2 .logo a,
  header.header-v2 .logo img {
    max-width: min(108px, 32vw);
    width: min(108px, 32vw);
  }

  header.header-v2 .index-header-actions--v2 {
    max-width: none;
    gap: 8px;
  }
}

/* header.css 1024px min-width 무력화 */
@media (min-width: 1024px) {
  header.header-v2 .container {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }
}

/* header.css 840px — v2 중앙바 숨김 규칙 무력화 (PC) */
@media (min-width: 841px) {
  header.header-v2 .index-header-custom.index-header-custom--v2 {
    display: flex !important;
  }
}

/* Spanish / English — 긴 헤더 문구로 검색 CTA가 좌측 메뉴와 겹치지 않게 */
html[lang="es"] header.header-v2 .index-header-custom.index-header-custom--v2,
html[lang="en"] header.header-v2 .index-header-custom.index-header-custom--v2 {
  gap: clamp(12px, 1.4vw, 28px);
}

html[lang="es"] header.header-v2 .index-header-links--legacy,
html[lang="en"] header.header-v2 .index-header-links--legacy {
  font-size: clamp(13px, 0.85vw, 16px);
}

html[lang="es"] header.header-v2 .index-header-links--legacy > li.index-header-sep,
html[lang="en"] header.header-v2 .index-header-links--legacy > li.index-header-sep {
  padding: 0 clamp(6px, 0.8vw, 14px);
}

html[lang="es"] header.header-v2 .index-header-v2-nav__link,
html[lang="en"] header.header-v2 .index-header-v2-nav__link {
  font-size: clamp(13px, 0.85vw, 16px);
}

html[lang="es"] header.header-v2 .index-header-actions.index-header-actions--v2,
html[lang="en"] header.header-v2 .index-header-actions.index-header-actions--v2 {
  /* 기본 translateX(좌측 밀기)가 ES 긴 검색문구와 겹침 유발 → 완화 */
  transform: translateX(clamp(-12px, -0.8vw, 0px));
  gap: clamp(8px, 0.8vw, 16px);
}

html[lang="es"] header.header-v2 .index-header-v2-search,
html[lang="en"] header.header-v2 .index-header-v2-search {
  gap: 8px;
  padding: 8px 18px;
  min-height: 44px;
}

html[lang="es"] header.header-v2 .index-header-v2-search__label,
html[lang="en"] header.header-v2 .index-header-v2-search__label {
  display: none;
}

html[lang="es"] header.header-v2 .index-header-v2-search__short,
html[lang="en"] header.header-v2 .index-header-v2-search__short {
  display: inline;
  font-size: clamp(13px, 0.9vw, 16px);
  text-overflow: ellipsis;
}

html[lang="es"] header.header-v2 .index-header-btn-login .index-header-btn__label,
html[lang="en"] header.header-v2 .index-header-btn-login .index-header-btn__label {
  font-size: 14px;
}

@media (min-width: 768px) and (max-width: 1400px) {
  html[lang="es"] header.header-v2 .index-header-actions .index-header-btn--inquiry,
  html[lang="en"] header.header-v2 .index-header-actions .index-header-btn--inquiry,
  html[lang="es"] header.header-v2 .index-header-actions .index-header-btn--quick-request,
  html[lang="en"] header.header-v2 .index-header-actions .index-header-btn--quick-request {
    display: none !important;
  }

  html[lang="es"] header.header-v2 .index-header-actions.index-header-actions--v2,
  html[lang="en"] header.header-v2 .index-header-actions.index-header-actions--v2 {
    transform: none;
  }
}
