/* =========================================
    HEADER (기본 다크/그라데이션 → product에서 라이트)
========================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99;

  /* 배경은 기본 흰색 위에 ::before 그라데이션을 올려두고
     theme--light에서 ::before의 opacity만 0으로 페이드 */
  background: transparent;
  /* 라이트 베이스 */
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);

  /* 공통 트랜지션 */
  transition: background .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

/* 그라데이션 오버레이 (기본: 보임, 라이트: 사라짐) */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 100%);
  opacity: 1;
  transition: opacity .3s ease;
}

.header__layout {
  max-width: 1700px;
  width: 100%;
  height: 80px;
  padding: 0 50px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==============================
          header__logo
============================== */
.header__logo {
  position: relative;
  /* 로고 페이드 스왑용 */
  line-height: 0;
  height: 36px;
  /* 높이 고정 */
}

.header__logo img {
  height: 36px;
  display: block;

  user-drag: auto;
  -webkit-user-drag: auto;
  user-select: auto;
  pointer-events: auto;

  /* 페이드 전환 */
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transition: opacity .3s ease;
}

.header__logo .logo--light {
  opacity: 1;
}

/* 기본(다크 배경) */
.header__logo .logo--dark {
  opacity: 0;
}

/* ==============================
          header__util
============================== */
.header__util {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang {
  position: relative;
  display: inline-block;
}

/* 버튼 */
.lang__btn {
  background: none;
  border: 0;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .3s ease;
  /* 트랜지션 */
}

.lang__btn .arrow {
  width: 10px;
  height: 6px;
  transition: transform .18s ease;
}

/* 드롭다운(글자만) */
.lang__list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding: 6px 0;
  z-index: 999;
}

.lang__list a {
  padding: 4px 0;
  font-size: 1rem;
  color: #fff;
  transition: color .15s ease;
}

.lang__list a:hover {
  color: #00f9c1;
}

/* hover 열림 */
.lang:hover .lang__list {
  display: block;
}

.lang:hover .arrow {
  transform: rotate(180deg);
}

/* 햄버거 */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 10px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 100;
}

.menu-btn span {
  display: block;
  height: 1px;
  background: #fff;
  border-radius: 2px;
  transform: translateY(0) rotate(0);
  transform-origin: center;
  transition: transform .22s ease, background .25s ease, opacity .2s ease;
}

/* 클릭 상태 */
.menu-btn.active span:first-child {
  transform: translateY(4px);
}

.menu-btn.active span:last-child {
  transform: translateY(-5px);
}

/* ==============================
            GNB / SUB
============================== */
.header__gnb {
  display: flex;
  gap: 60px;
}

.header__gnb > li {
  position: relative;
  height: 80px;
  line-height: 80px;
}

.header__gnb > li::before,
.header__gnb > li:last-child::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 1);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  transition: color .3s ease;
  /* 트랜지션 */
}

.header__gnb > li::before {
  content: "|";
  left: -30px;
}

.header__gnb > li:last-child::after {
  content: "|";
  right: -30px;
}

.header__gnb > li > a {
  position: relative;
  display: inline-block;
  padding: 0 24px;
  height: 80px;
  line-height: 80px;
  color: #fff;
  text-decoration: none;
  transition: color .3s ease;
  /* 트랜지션 */
}

.header__gnb > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: #00f9c1;
  opacity: 0;
  transition: opacity .25s ease, background .3s ease;
  /* 트랜지션 */
  transform: translateY(0.5px);
}

.header__gnb > li > a:hover::after,
.header__gnb > li:hover > a::after {
  opacity: 1;
}

/* === 서브 메뉴 === */
.header__sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.2);
  width: 300px;
  line-height: 40px;
  text-align: center;
  padding: 20px 0;
  transition: background .3s ease, box-shadow .3s ease;
  /* 트랜지션 */
}

.header__sub > li > a {
  color: rgba(255, 255, 255, 0.8);
  transition: color .2s ease;
}

.header__sub > li > a:hover {
  color: rgba(255, 255, 255, 1);
  font-weight: 600;
}

.header__gnb > li > a:hover + .header__sub,
.header__gnb > li .header__sub:hover {
  display: block;
}

/* =========================================
    Header Light Theme (product 섹션 전용)
    - 클래스만 토글하면 전부 부드럽게 바뀜
========================================= */
.header.theme--light {
  /* 라이트일 땐 그라데이션 오버레이를 페이드아웃 */
  color: #111;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
}

.header.theme--light::before {
  opacity: 0;
}

/* ★ 핵심: 배경 전환 페이드 */

/* 로고 스왑(페이드) */
.header.theme--light .logo--light {
  opacity: 0;
}

.header.theme--light .logo--dark {
  opacity: 1;
}

/* 햄버거 색상 */
.header.theme--light .menu-btn span {
  background: #111;
}

/* GNB 텍스트/구분선/언더라인 색상 */
.header.theme--light .header__gnb > li::before,
.header.theme--light .header__gnb > li:last-child::after {
  color: rgba(0, 0, 0, 0.6);
}

.header.theme--light .header__gnb > li > a {
  color: #111;
}

.header.theme--light .header__gnb > li > a::after {
  background: #111;
}

/* 서브메뉴: 라이트에선 흰 배경 + 그림자, 검은 글자 */
.header.theme--light .header__sub {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.header.theme--light .header__sub > li > a {
  color: rgba(0, 0, 0, 0.8);
}

.header.theme--light .header__sub > li > a:hover {
  color: #111;
  font-weight: 600;
}

/* 언어 드롭다운/버튼 */
.header.theme--light .lang__btn {
  color: #111;
}

.header.theme--light .lang__list a {
  color: #111;
}

.header.theme--light .lang__list a:hover {
  color: #00a68b;
}

/* 1699↓ (~1440) */
@media (max-width:1699px) {
  .header__layout {
    max-width: 1440px;
    height: 78px;
    padding: 0 40px;
  }

  .header__gnb {
    gap: 48px;
  }

  .header__logo,
  .header__logo img {
    height: 34px;
  }
}

/* 1439↓ (~1280) */
@media (max-width:1439px) {
  .header__layout {
    max-width: 1280px;
    padding: 0 36px;
  }

  .header__gnb {
    gap: 40px;
  }

  .header__gnb > li::before,
  .header__gnb > li:last-child::after {
    font-size: 14px;
    left: -24px;
    right: -24px;
  }

  .header__gnb > li > a {
    padding: 0 18px;
  }
}

/* 1279↓ (~1024) : 태블릿 진입 */
@media (max-width:1279px) {
  .header__layout {
    max-width: 1024px;
    height: 72px;
    padding: 0 28px;
  }

  .header__logo,
  .header__logo img {
    height: 32px;
  }

  .header__gnb {
    gap: 28px;
  }

  .lang__btn {
    font-size: .95rem;
  }

  .header__sub {
    width: 260px;
    line-height: 38px;
    padding: 14px 0;
  }
}

/* 1023↓ (~768) : 모바일 전환 — GNB 오버레이 */
@media (max-width:1023px) {
  .header {
    border-bottom: 1px solid rgba(255, 255, 255, .2);
  }

  .header__layout {
    max-width: 768px;
    height: 64px;
    padding: 0 20px;
  }

  .header__logo,
  .header__logo img {
    height: 30px;
  }

  /* 햄버거 보이기(이미 보이는 상태 유지), GNB/언어 숨김 */
  .header__nav,
  .header__gnb,
  .lang {
    display: none;
  }

  /* 오버레이 네비(열릴 때) */
  .header.is-open {
    overflow: visible;
  }

  .header.is-open .header__nav {
    display: block;
  }

  .header__nav {
    position: fixed;
    inset: 64px 0 0 auto;
    width: 320px;
    height: calc(100vh - 64px);
    background: #0d0f12;
    box-shadow: -16px 0 40px rgba(0, 0, 0, .35);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform .28s ease;
  }

  .header.theme--light .header__nav {
    background: #fff;
  }

  .header.is-open .header__nav {
    transform: translateX(0);
  }

  /* 리스트 재정의 */
  .header__gnb {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 14px;
  }

  .header__gnb > li {
    height: auto;
    line-height: 1.2;
    padding: 6px 0;
  }

  .header__gnb > li::before,
  .header__gnb > li:last-child::after {
    content: none;
  }

  .header__gnb > li > a {
    display: block;
    height: auto;
    line-height: 1.2;
    padding: 14px 12px;
    border-radius: 8px;
    color: #fff;
  }

  .header.theme--light .header__gnb > li > a {
    color: #111;
  }

  .header__gnb > li > a::after {
    display: none;
  }

  /* 서브메뉴: 아코디언 스타일(항상 펼침 추천) */
  .header__sub {
    position: static;
    transform: none;
    display: block;
    width: auto;
    background: transparent;
    padding: 6px 0 0;
    box-shadow: none;
    text-align: left;
    line-height: 36px;
  }

  .header__sub > li > a {
    display: block;
    padding: 6px 14px;
    color: rgba(255, 255, 255, .85);
  }

  .header.theme--light .header__sub > li > a {
    color: rgba(0, 0, 0, .8);
  }
}

/* 767↓ (~390) : 소형폰 최적화 */
@media (max-width:767px) {
  .header__layout {
    max-width: 600px;
    height: 60px;
    padding: 0 16px;
  }

  .header__logo,
  .header__logo img {
    height: 28px;
  }

  .menu-btn {
    width: 32px;
    height: 10px;
  }

  .header__nav {
    width: 86vw;
  }

  .header__gnb > li > a {
    padding: 12px 10px;
    font-size: .95rem;
  }

  .header__sub > li > a {
    line-height: 34px;
    padding: 4px 12px;
    font-size: .92rem;
  }
}

/* 389↓ : 초소형 */
@media (max-width:389px) {
  .header__layout {
    padding: 0 12px;
  }

  .header__nav {
    width: 88vw;
  }

  .header__gnb > li > a {
    padding: 11px 10px;
    font-size: .9rem;
  }

  .header__sub > li > a {
    font-size: .88rem;
  }
}

/* 사이트맵 */

.sitemap {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2%);
  transition: opacity .28s ease, transform .28s ease;
  z-index: 98;
  /* 헤더(99) 아래, .menu-btn(z-index:100) 위로 */
}

/* 메뉴 버튼 활성화 시: 보이기 (CSS :has()로 JS 없이 제어) */
.header:has(.menu-btn.active) .sitemap {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* 열렸을 때 스크롤 잠금 */
body:has(.menu-btn.active) {
  overflow: hidden;
}

/* 컨테이너 */
.sitemap__inner {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 120px 20px 40px;
  color: #fff;
}

/* 헤더 */
.sitemap__head strong {
  font-size: 28px;
  letter-spacing: .08em;
}

.sitemap__head p {
  margin: 6px 0 24px;
  opacity: .8;
}

/* 그리드 */
.sitemap__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 40px;
}

/* 컬럼 */
.sitemap__col h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: .06em;
}

.sitemap__col h3 a {
  color: #00f9c1;
  /* 포인트 */
  text-decoration: none;
}

.sitemap__col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitemap__col li + li {
  margin-top: 10px;
}

.sitemap__col a {
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
  transition: opacity .15s ease;
}

.sitemap__col a:hover {
  opacity: .7;
}

/* 하단 */
.sitemap__foot {
  margin-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, .15);
  padding-top: 16px;
  color: rgba(255, 255, 255, .6);
}

/* 반응형 */
@media (max-width: 1024px) {
  .sitemap__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sitemap__inner {
    padding-top: 100px;
  }

  .sitemap__grid {
    grid-template-columns: 1fr;
    gap: 18px 0;
  }

  .sitemap__col h3 {
    font-size: 15px;
  }
}