/* ================================
       ROOT & HEADER BASE
    ================================ */
:root {
  --header-h: 90px;
  --header-logo: 52px;
}

.header {
  position: fixed;
  z-index: 99;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--header-h);
  transition: height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  color: #ffffff;
}

.header.is-scrolled {
  background-color: #ffffff;
  color: #222222;
}

.header.is-open {
  background-color: #ffffff;
  color: #222222;
  overflow: hidden;
}

/* ★ fix: 두 클래스 동시 상태 명시 */
.header.is-scrolled.is-open {
  background-color: #ffffff;
  color: #222222;
}

/* ================================
       INNER — grid 3열
       가운데 gnb가 항상 정확히 중앙
    ================================ */
.header .inner {
  display: grid;
  grid-template-columns: 0.5fr auto 0.1fr;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}

/* ================================
       LOGO
    ================================ */
.header h1 {
  display: flex;
  align-items: center;
}

.header h1 a {
  display: flex;
  align-items: center;
  position: relative;
  /* 두 로고 겹치기 위한 기준 */
}

.header h1 img {
  height: var(--header-logo);
  display: block;
  transition: opacity 0.35s ease;
}

/* 컬러 로고는 기본 로고 위에 절대 위치로 겹침 */
.header h1 .logo-color {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* 헤더가 흰 배경 상태(스크롤 또는 서브 열림)일 때 컬러 로고로 전환 */
.header.is-scrolled .logo-default,
.header.is-open .logo-default {
  opacity: 0;
}

.header.is-scrolled .logo-color,
.header.is-open .logo-color {
  opacity: 1;
}

/* ================================
       GNB
    ================================ */
.header_gnb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 5vw, 80px);
  height: var(--header-h);
}

.header_gnb > li > a {
  display: flex;
  align-items: center;
  height: var(--header-h);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: currentColor;
  position: relative;
  transition: opacity 0.2s;
}

/* .header_gnb > li > a::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.25s ease;
} */

.header_gnb > li.is-active > a::after,
.header_gnb > li > a:hover::after {
  width: 100%;
}

.header_gnb > li > a > svg {
  height: 0.9rem;
  margin-left: 4px;
}

/* ================================
        HEADER BUTTONS
    ================================ */
.header_btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

/* --- 언어 버튼 --- */
.header_lang {
  position: relative;
  z-index: 100;
}

.header_lang__current {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: currentColor;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 4px;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.header_lang__current:hover {
  opacity: 0.7;
}

.header_lang__current svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.header_lang__drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.header_lang__drop.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header_lang__drop a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.05em;
  transition: background 0.15s;
  white-space: nowrap;
}

.header_lang__drop a:hover {
  background: #f5f5f5;
}

.header_lang__flag {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.header_lang__flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* --- 햄버거 버튼 --- */
.header_menu {
  width: 28px;
  height: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  z-index: 101;
}

.header_menu span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ★ fix 4: 사이트맵 열린 상태에서 어떤 상황에도 버튼 흰색 유지 */
.header_menu.is-active {
  color: #000000 !important;
}

.header_menu.is-active span {
  background: #000000 !important;
}

.header_menu.is-active span:nth-child(1) {
  transform: translateY(8.25px) rotate(45deg);
}

.header_menu.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.header_menu.is-active span:nth-child(3) {
  transform: translateY(-8.25px) rotate(-45deg);
}

/* ================================
       SUBMENU
    ================================ */
.header_sub {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.header_sub_deco {
  position: absolute;
  left: 7%;
  bottom: 40px;
  width: 450px;
  opacity: 0;
  display: block;
  /* 사라질 때: 즉시 (또는 거의 즉시) */
  transition: opacity 0s ease;
}

.header.is-open .header_sub_deco {
  opacity: 1;
  /* 나타날 때: 천천히 */
  transition: opacity 0.3s ease 0.1s;
}

.header_sub__inner {
  position: relative;
  margin: 0 auto;
  padding: 28px 40px;
}

.header_sub__list {
  position: absolute;
  top: 6px;
  opacity: 0;
  /* transform: translateY(10px); */
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
  /* 숨겨진 상태에서 링크 클릭 방지 */
  pointer-events: none;
}

.header_sub__list.is-visible {
  opacity: 1;
  /* transform: translateY(0); */
  pointer-events: auto;
}

.header_sub__list li + li {
  margin-top: 22px;
}

.header_sub__list a {
  display: block;
  font-size: 1.1rem;
  font-weight: 400;
  padding: 5px 0;
  white-space: nowrap;
  transition: color 0.15s;
}

.header_sub__list a:hover {
  color: #111111;
}

/* ================================
       RESPONSIVE
       1440 / 1280 / 1024 / 768 / 480 / 360
    ================================ */

@media (max-width: 1440px) {
}

@media (max-width: 1280px) {
  .header_gnb {
    gap: clamp(20px, 3vw, 48px);
  }
}

@media (max-width: 1024px) {
  :root {
    --header-h: 70px;
    --header-logo: 42px;
  }

  .header_gnb {
    gap: clamp(14px, 3vw, 32px);
  }

  .header_gnb > li > a {
    font-size: 0.9375rem;
  }
}

/* 768 이하: gnb 숨김 */
@media (max-width: 768px) {
  :root {
    --header-h: 60px;
    --header-logo: 38px;
  }

  .header .inner {
    grid-template-columns: 1fr auto;
  }

  nav:has(.header_gnb),
  .header_sub {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --header-h: 56px;
    --header-logo: 34px;
  }

  .header_btn {
    gap: 16px;
  }

  .header_lang__current span {
    display: none;
  }
}

@media (max-width: 360px) {
  :root {
    --header-h: 52px;
    --header-logo: 30px;
  }

  .header .inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header_btn {
    gap: 12px;
  }
}

/* ================================
       SITEMAP
    ================================ */
.sitemap_wrap {
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  color: #000000;
  background-color: #ffffff;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.sitemap_wrap.is-open {
  opacity: 1;
  visibility: visible;
}

.sitemap_box {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.sitemap_side {
  width: 35%;
  min-height: 100vh;
  background: url(/assets/img/common/sitemap_side_bg.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  padding: 36px 150px;
  display: flex;
  flex-direction: column;
}

.sitemap_logo img {
  height: 50px;
}

.sitemap_info {
  margin-top: auto;
  margin-bottom: 80px;
  color: #ffffff;
  font-family: var(--font-preten);
  font-size: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sitemap_info li {
  display: flex;
  gap: 10px;
}

.sitemap_info li span {
  min-width: 70px;
}

.sitemap_info li:first-child {
  font-weight: 800;
}

.sitemap_nav {
  flex: 1;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 100px;
  padding-right: 150px;
  display: flex;
  flex-direction: column;
}

.sitemap_list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sitemap_list a {
  transform: translateY(0);
  transition: transform 0.3s;
}

.sitemap_list a:hover {
  transform: translateY(-5px);
}

.sitemap_sublist a {
  display: inline-block;
  transform: translateY(0);
  transition: transform 0.3s;
}

.sitemap_sublist a:hover {
  transform: translateY(-5px);
}

.sitemap_list > li {
  flex: 1;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
}

.sitemap_list > li > a {
  min-width: 30%;
  font-size: 2.25rem;
  font-weight: 600;
}

.sitemap_sublist {
  display: flex;
  gap: 80px;
}

.sitemap_sublist li {
  position: relative;
}

.sitemap_sublist li::after {
  content: "/";
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
}

.sitemap_sublist li:last-child::after {
  content: "";
}

.sitemap_sublist a {
  font-size: 1.25rem;
  font-weight: 500;
  color: #686868;
}

.sitemap_join {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sitemap_join svg {
  height: 28px;
}

/* ================================
       RESPONSIVE
       1440 / 1280 / 1024 / 768 / 480 / 360
    ================================ */
@media (max-width: 1700px) {
  .sitemap_sublist {
    gap: 60px;
  }

  .sitemap_sublist li::after {
    right: -30px;
  }
}

@media (max-width: 1600px) {
  .sitemap_nav {
    padding: 100px;
    padding-right: 100px;
  }

  .sitemap_sublist {
    gap: 50px;
  }

  .sitemap_sublist li::after {
    right: -25px;
  }
}

@media (max-width: 1440px) {
  .sitemap_side {
    width: 35%;
    padding: 36px 80px;
  }

  .sitemap_logo img {
    height: 46px;
  }

  .sitemap_info {
    margin-bottom: 40px;
  }
}

@media (max-width: 1280px) {
  .sitemap_nav {
    padding: 60px;
  }

  .sitemap_list li {
    flex-direction: column;
    justify-content: center;
    align-items: start;
    gap: 10px;
  }
}

@media (max-width: 1024px) {
  .sitemap_side {
    width: 40px;
  }

  .sitemap_logo,
  .sitemap_info {
    display: none;
  }
}

@media (max-width: 768px) {
  .header h1 a {
    z-index: 101;
  }

  .sitemap_box {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 20px;
    padding-top: var(--header-h);
  }

  .sitemap_side {
    width: 100%;
    height: 20vh;
    min-height: auto;
    overflow: hidden;
  }

  .sitemap_nav {
    min-height: 80vh;
    padding: 40px;
    padding-top: 0;
  }

  .sitemap_list > li {
    padding: 0 20px;
  }

  .sitemap_list > li > a {
    font-size: 2rem;
  }

  .sitemap_sublist {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
  }

  .sitemap_sublist li::after {
    right: -15px;
  }

  .sitemap_sublist a {
    font-size: 1.125rem;
  }

  .sitemap_join svg {
    height: 24px;
  }
}

@media (max-width: 480px) {
  .sitemap_nav {
    min-height: 70vh;
    padding: 20px;
  }

  .sitemap_list > li {
    padding: 0 10px;
  }

  .sitemap_list > li > a {
    font-size: 1.75rem;
  }

  .sitemap_sublist {
    gap: 6px 20px;
  }

  .sitemap_sublist li::after {
    right: -10px;
  }

  .sitemap_sublist a {
    font-size: 1rem;
  }

  .sitemap_join svg {
    height: 20px;
  }
}

@media (max-width: 360px) {
}

body:has(.sitemap_wrap.is-open) .header .logo-default {
  opacity: 0;
}

body:has(.sitemap_wrap.is-open) .header .logo-color {
  opacity: 1;
}
