/* gnb.css - extracted from common.css (header/GNB/sub_nav/mobile/top button) */
/* NOTE: load after common.css */

.mobile { display: none; }

#nav_wrap {
  width: 100%;
  height: 95px; /* nav,subnav 높이 전체 */
  position: relative;
}

.header {
  width: 100%;
  transition: all 0.5s;
  position: fixed;
  z-index: 9000;
}

.static_top { position: absolute; }

.header .nav {
  width: 100%;
  height: 95px;
  top: 0;
  left: 0;
}

.header .nav-item {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.header .nav-item > img,
.header .nav-item > .nav-menu {
  position: absolute;
}

.header .nav-item > img {
  left: 15%;
  transform: translateX(-50%);
}

.header .nav-menu {
  width: 40vw;
  left: 52%;
  transform: translateX(-52%);
  display: flex;
  justify-content: space-between;
  position: relative;
  font-size: 2rem;
  font-weight: 600;
  overflow: hidden; /* 기본은 hidden 유지(열릴 때만 open에서 풀어줌) */
}

.header .nav-menu li {
  position: relative;
  cursor: pointer;
  width: 120px;
  text-align: center;
}

.header .nav-menu a:hover,
.header .nav-menu-sub > ul > li:hover {
  color: #0072bc;
}

.header .nav-menu > li > a {
  color: #ffffff;
  display: block;
  height: 95px;
  line-height: 95px;
}

/* --- 드롭다운(서브메뉴) 기본 상태: 접힘 --- */
.header .nav-menu-sub {
  position: absolute;
  padding-top: 34px;
  font-size: 19px;
  font-weight: 400;
  height: 0;
  overflow: hidden;
  transition: all 0.1s 0s;

  /* ✅ 뒤로 깔림 방지(열릴 때도 항상 위 레이어 준비) */
  z-index: 9001;
  background: transparent; /* 열릴 때 open에서 흰 배경으로 */
}

.header .nav-menu-sub > ul > li { height: 50px; }

.header .nav-menu-sub > ul a {
  font-size: 1.7rem;
  color: #666666;
}

.nav-menu > li .nav-menu-sub::before {
  content: "";
  position: absolute;
  top: 0px;
  width: 0;
  left: 50%;
  height: 3px;
  background-color: #0072bc;
  transform: translateX(-50%);
  transition: all 0.5s;
  z-index: 9990;
}

.nav-menu > li:hover .nav-menu-sub::before {
  width: calc(100% - 30px);
}

.header .logo { width: 160px; }

.header .searchBtn { color: #ffffff; }

.gnb-top-bg {
  width: 100%;
  height: 95px;
  position: absolute;
}

/* gnbBg(회색 배경) */
#gnbBg {
  overflow: hidden;
  width: 100%;
  height: 0;
  position: absolute;
  top: 95px;
  background-color: #f0f0f0;
  transition: height 0.3s ease-in-out;

  /* ✅ 드롭다운보다 아래로 */
  z-index: 9000;
}

.off-logo { display: none; }

/* open 상태에서 ul overflow 풀기(드롭다운 잘림 방지) */
.open .nav-menu { overflow: visible; }

/* ✅ open 상태에서 서브메뉴 제대로 펼치기 */
.open .nav-menu-sub {
  opacity: 1.0;
  visibility: visible;
  height: 360px;
  transition: height 0.4s ease-in-out, opacity 0.5s ease-in-out 0.2s;

  /* ✅ open일 때는 흰 배경 + 위 레이어 확실히 */
  z-index: 9001;
}

.open #gnbBg {
  height: 396px;
  z-index: 9000; /* 서브메뉴(9001)보다 아래 */
}

.open .gnb-top-bg,
.fix_top .gnb-top-bg,
.static_top .gnb-top-bg {
  background-color: #ffffff;
  transition: all 0.6s;
}

.open .nav-menu > li > a,
.fix_top .nav-menu > li > a,
.static_top .nav-menu > li > a {
  color: #000000;
}

.fix_top .off-logo,
.open .off-logo,
.static_top .off-logo {
  display: block;
}

.fix_top .on-logo,
.open .on-logo,
.static_top .on-logo {
  display: none;
}

/* ------------------------------
   Mobile toggle
------------------------------ */
.m_toggle_wrap .m_toggle {
  /* display: none; */
  height: 100vh;
  background-color: #ffffff;
  z-index: 9999;
  position: fixed;
  right: -100vw;
  transition: all 0.7s;
}

.m_toggle_wrap > .open {
  display: block;
  right: 0;
  transition: all 0.7s;
}

.m_toggle_wrap .m_toggle > .close_btn {
  width: 50px;
  height: 72px;
  font-size: 4rem;
  border: none;
  background: none;
  color: #666666;
  position: absolute;
  top: 14px;
  right: 21px;
  transform: translateX(-50px);
}

.m_toggle_wrap .m_toggle > .m-nav-menu {
  position: absolute;
  top: 100px;
  width: 76%;
  left: 50%;
  transform: translateX(-50%);
}

.m_toggle_wrap .m_toggle > .m-nav-menu > li {
  margin-bottom: 37px;
  position: relative;
}

.m_toggle_wrap .m_toggle > .m-nav-menu > li > a {
  font-size: 3rem;
  font-weight: 600;
  /* padding-bottom: 45px; */
}

.m_toggle_wrap .nav-menu-sub {
  height: 0;
  width: 100%;
  overflow: hidden;
  margin-top: 3px;
}

.m_toggle_wrap .nav-menu-sub > ul {
  border-top: 3px solid #404497;
  font-size: 2rem;
  font-weight: 300;
  background-color: #EFEFEF;
  padding: 20px 30px;
}

.m_toggle_wrap .nav-menu-sub > ul > li { margin-top: 4px; }

.m_toggle_wrap .nav-menu-sub > ul > li::before {
  content: "-";
  margin-right: 5px;
}

.m_toggle_wrap .m_toggle > .m-nav-menu > .active > a { color: #404497; }

.m_toggle_wrap .m_toggle > .m-nav-menu > .active > .nav-menu-sub { height: 100%; }

/* ------------------------------
   Sub nav (#sub_nav)
------------------------------ */
#sub_nav {
  position: absolute;
  top: 95px;
  left: 0;
  width: 100%;
  height: 65px;
  background-color: #f7f7f7;
  z-index: 50;
  border: 0;
}

#sub_nav > .inner {
  width: 100%;
  height: 64px;
  border-bottom: 1px solid #ddd;
  margin: 0 auto;

  display: block;       /* topMenu04는 float 기반 */
  position: relative;
}

#sub_nav > .inner > .home {
  float: left;
  width: 69px;
  height: 64px;
  text-align: center;
  position: relative;
  line-height: 62px;
  cursor: pointer;
}

#sub_nav > .inner > .home i {
  color: #5d5d5d;
  font-size: 15px;
  line-height: 64px;
  font-weight: 600;
}

#sub_nav .depth_wrap {
  position: relative;
  float: left;
  width: 200px;
  height: 64px;
}

#sub_nav .depth2_wrap { width: 250px; }

#sub_nav > .inner > .home:after,
#sub_nav .depth_wrap:after {
  position: absolute;
  content: "";
  width: 1px;
  height: 12px;
  background-color: #d8d8d8;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

#sub_nav .depth_wrap > ul {
  position: relative;
  width: 100%;
  height: 64px;
  padding: 0 40px;
  text-align: left;
  z-index: 99;
  background: transparent;
}

#sub_nav #now_page_01,
#sub_nav .now_page {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 64px;
  color: #5d5d5d;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.25px;

  position: relative;
  z-index: 100;
}

#sub_nav .select > span {
  position: absolute;
  top: 50%;
  right: 38px;
  width: 17px;
  height: 17px;
  margin-top: -10px;
  z-index: 101;
}

#sub_nav .select > span > img {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

#sub_nav .select_on > span > img { transform: rotate(180deg); }

#sub_nav .depth2_wrap { display: none; }
#sub_nav .active_depth { display: block; }

#sub_nav .depth_wrap .depth_list {
  opacity: 0;
  position: absolute;
  top: 63px;
  left: -1px;
  width: 100%;
  background-color: #fff;

  z-index: -1;
  height: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.2s;
}

#sub_nav .depth_wrap .depth_list:after {
  position: absolute;
  content: "";
  width: 100%;
  height: calc(100% + 64px);
  background-color: #fff;
  box-shadow: 2px 3px 13px 0px rgba(0, 0, 0, 0.17);
  top: -64px;
  left: 0;
  z-index: 0;
  border: 1px solid #bababa;
  box-sizing: border-box;
}

#sub_nav .depth_wrap .depth_list:before {
  position: absolute;
  content: "";
  width: calc(100% - 22px);
  height: 1px;
  background-color: #d8d8d8;
  top: 0;
  left: 11px;
  z-index: 9;
}

#sub_nav .depth_wrap .depth_list > li {
  position: relative;
  z-index: -99;
  text-align: left;
  padding: 7px 40px;
  display: none;
}

#sub_nav .depth_wrap .depth_list > li a {
  display: inline-block;
  font-size: 15px;
  word-break: keep-all;
  line-height: 1.5;
  color: #5d5d5d;
  letter-spacing: -0.25px;
  font-weight: 400;
  position: relative;
  z-index: 9;
}

#sub_nav .depth_wrap .depth_list > li a span {
  position: relative;
  display: inline-block;
}

#sub_nav .depth_wrap .depth_list > li.on a { color: #0072bc; }

#sub_nav .depth_wrap .depth_list > li.on a span:after {
  position: absolute;
  content: "";
  width: calc(100% + 10px);
  height: 1px;
  background-color: #0072bc;
  bottom: 0;
  left: -5px;
}

#sub_nav .depth_wrap.select_on .depth_list {
  opacity: 1;
  height: auto;
  padding: 15px 0;
  z-index: 9;
  overflow: visible;
}

#sub_nav .depth_wrap.select_on .depth_list > li {
  z-index: 9;
  display: block;
}

#sub_nav #now_page_01,
#sub_nav .now_page {
  height: 64px !important;
  line-height: 64px !important;
}

#sub_nav .depth_wrap.open .depth_list {
  opacity: 1 !important;
  height: auto !important;
  padding: 15px 0 !important;
  z-index: 9 !important;
  overflow: visible !important;
}

#sub_nav .depth_wrap.open .depth_list > li {
  display: block !important;
  z-index: 9 !important;
}

/* 너가 추가해둔 sub_nav position 관련 강제는 유지(원래 쓰던대로라면 OK) */
#sub_nav { position: static !important; top: auto !important; left: auto !important; }
#sub_nav { position: relative !important; z-index: 100 !important; }

/* ------------------------------
   TOP button
------------------------------ */
.sc_top {
  width: 50px;
  height: 50px;
  border: 1px #666666 solid;
  background-color: #404497;
  color: #ffffff;
  position: fixed;
  font-size: 13px;
  z-index: 100;
  right: 10%;
  bottom: 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sc_top > i { color: #ffffff; }


/* ================================
   GNB 드롭다운 글씨가 배경에 깔리는 문제 Fix
   ================================ */

/* 1) gnbBg(회색 배경) 레이어를 확실히 아래로 */
#pcGnb #gnbBg{
  z-index: 0 !important;
}

/* 2) nav-item(메뉴/로고) 레이어를 배경보다 위로 */
#pcGnb .nav-item{
  position: relative;
  z-index: 2;
}

/* 3) 서브메뉴는 nav-item보다도 위로 + 흰 배경을 확실히 */
#pcGnb .nav-menu-sub{
  position: absolute;
  z-index: 3 !important;
}

/* 4) 글씨도 혹시 상속/덮임 있으면 강제로 보이게 */
#pcGnb .nav-menu-sub a{
  color: #666 !important;
  display: block;
}
