/**
 * 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;
  grid-template-columns: minmax(120px, 173px) minmax(0, 1fr) auto;
  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: stretch;
  align-self: center;
  flex: none;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 3vw, 56px);
  width: 100%;
  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;
  gap: 6px;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: auto;
  max-width: min(220px, 28vw);
  min-width: 0;
  margin-left: 0;
  height: auto;
  padding-bottom: 0;
  border-bottom: none;
  text-decoration: none;
  box-sizing: border-box;
  isolation: isolate;
}

header.header-v2 .index-header-v2-search__icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

header.header-v2 .index-header-v2-search__label {
  font-size: clamp(16px, 1.05vw, 20px);
  font-weight: 800;
  line-height: 140%;
  letter-spacing: -0.012em;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 1px;
}

header.header-v2 .index-header-actions.index-header-actions--v2 {
  position: static !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  grid-area: actions !important;
  flex-shrink: 0;
  min-width: 0;
  margin-left: 0;
  justify-self: end;
  align-self: center;
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(12px, 1.2vw, 24px);
  z-index: 2;
}

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: clamp(4px, 0.5vw, 6px);
  min-height: 40px;
  height: 40px;
  padding: 0 clamp(8px, 0.8vw, 12px);
  border: 0;
  border-radius: 999px;
  background: transparent !important;
  font-size: clamp(12px, 0.3rem + 0.55vw, 16px);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 1;
  white-space: nowrap;
}

header.header-v2 .index-header-btn-login .index-header-btn__icon--account {
  font-size: 28px;
  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,
  header.header-v2 > .container > .mo-btn {
    display: none !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  header.header-v2 .index-header-v2-nav {
    display: none !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;
  }

  header.header-v2 .index-header-actions--v2 .index-header-lang-switch {
    order: 1;
  }

  header.header-v2 .index-header-actions--v2 .index-header-btn--inquiry {
    order: 2;
  }

  header.header-v2 .index-header-actions--v2 .index-header-btn--quick-request {
    order: 3;
  }

  header.header-v2 .index-header-actions--v2 .index-header-btn-login {
    order: 4;
  }
}

@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: min(180px, 24vw);
  }

  header.header-v2 .index-header-v2-search__label {
    font-size: clamp(14px, 0.95vw, 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__label {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 모바일: GNB 숨김, 빠른 의뢰 + 언어 + 햄버거 */
@media (max-width: 840px) {
  header.header-v2 {
    height: 70px !important;
    min-height: 70px !important;
  }

  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;
  }

  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: clamp(8px, 2.5vw, 12px);
    margin-left: auto !important;
    flex-shrink: 0;
    min-width: 0;
    position: static !important;
  }

  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: 4px;
    font-size: 13px;
    padding: 0;
  }

  header.header-v2 .index-header-lang-switch__icon {
    display: none;
  }

  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 {
    display: none !important;
  }

  header.header-v2 .index-header-btn-solid,
  header.header-v2 .index-header-btn--quick-request {
    min-height: 32px;
    height: 32px;
    padding: 0 16px;
    font-size: 14px;
  }

  header.header-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 nav[role="navigation"] {
    display: flex !important;
  }
}

/* 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;
  }
}
