/* =========================================
   Header Component & Navigation (Unified)
========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 82px;
    background: rgba(5, 9, 20, 0.24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    transition: background 0.3s, box-shadow 0.3s, height 0.4s ease-out, border 0.3s;
}

.header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    height: 82px;
    padding: 0 24px;
    transition: height 0.3s;
}

/* 로고 영역 */
.header .logo {
    display: flex;
    align-items: center;
    width: 188px;
    min-width: 188px;
    height: 82px;
}

.header .logo a {
    display: none;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 100%;
    width: 100%;
    height: 82px;
}

.header .site-logo-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 58px;
    height: auto;
    object-fit: contain;
}

/* --- 메인 페이지 (스크롤 전 기본 상태: 투명 배경, 화이트 로고) --- */
.header:not(.scrolled):not(.menu-open):not(:hover) .logo .logo-white {
    display: flex;
}

/* --- 메인 페이지 스크롤/메뉴오픈/호버 시 다크 로고 --- */
.header.scrolled .logo .logo-dark,
.header.menu-open .logo .logo-dark,
.header:hover .logo .logo-dark {
    display: flex;
}

/* --- 서브 페이지 (항상 다크 로고 및 화이트 배경) --- */
body:not(.main-draft) .header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--cd-line, #e2e8f0);
    box-shadow: 0 18px 50px rgba(15, 28, 45, 0.08);
}
body:not(.main-draft) .header .logo .logo-white {
    display: none !important;
}
body:not(.main-draft) .header .logo .logo-dark {
    display: flex !important;
}

/* 헤더 스크롤 상태 */
.header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--cd-line, #e2e8f0);
    box-shadow: 0 18px 50px rgba(15, 28, 45, 0.08);
}

.header.menu-open {
    height: 312px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--cd-line, #e2e8f0);
}

/* --- Desktop Navigation --- */
.nav-desktop {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-desktop .gnb {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-desktop .gnb > li > a {
    display: flex;
    align-items: center;
    position: relative;
    height: 82px;
    padding: 0 28px;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    transition: color 0.3s;
    text-decoration: none;
}

/* 스크롤/메뉴오픈/호버 또는 서브페이지일 때 GNB 텍스트 색상 다크 */
.header.scrolled .nav-desktop .gnb > li > a,
.header.menu-open .nav-desktop .gnb > li > a,
.header:hover .nav-desktop .gnb > li > a,
body:not(.main-draft) .header .nav-desktop .gnb > li > a {
    color: #343a40;
}

.nav-desktop .gnb > li > a:hover {
    color: var(--cd-blue, #01419a) !important;
}

/* 헤더 우측 전화번호 버튼 */
.header-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 24px;
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    transition: all 0.3s;
    text-decoration: none;
}

.header.scrolled .header-call,
.header.menu-open .header-call,
.header:hover .header-call,
body:not(.main-draft) .header .header-call {
    background: var(--cd-blue, #01419a);
    border-color: var(--cd-blue, #01419a);
    color: #ffffff;
}

.header-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 65, 154, 0.3);
}

/* --- Mega Menu --- */
.mega-menu-panel {
    position: absolute;
    top: 82px;
    left: 0;
    z-index: 1;
    width: 100%;
    visibility: hidden;
    padding: 34px 0 46px;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s;
    opacity: 0;
    transform: translateY(-10px);
    border-top: 1px solid #eee;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1025px) {
    .header:hover {
        height: 312px;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--cd-line, #e2e8f0);
    }
    .header:hover .mega-menu-panel {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }
}

.header.menu-open .mega-menu-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.mega-menu-panel .wrap {
    display: flex;
    gap: 54px;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

.submenu-column.megaf {
    margin-left: 212px;
}

.submenu-column h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 800;
}

.submenu-column h4 a {
    color: var(--cd-ink, #0f1c2d);
    text-decoration: none;
}

.submenu-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.submenu-column ul li a {
    display: block;
    padding: 6px 0;
    font-size: 15px;
    color: #64748b;
    transition: color 0.2s, transform 0.2s;
    text-decoration: none;
}

.submenu-column ul li a:hover {
    color: var(--cd-blue, #01419a);
    transform: translateX(4px);
}

/* 모바일 햄버거 토글 */
#menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 1001;
    color: #ffffff;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 28px;
    padding: 4px;
}

@media (max-width: 1024px) {
    .nav-desktop,
    .header-call {
        display: none !important;
    }
    #menu-toggle {
        display: block;
    }
    .header,
    .header.menu-open,
    .header .wrap {
        height: 72px;
    }
    .header .logo {
        width: 164px;
        min-width: 164px;
        height: 72px;
    }
    .header .logo a {
        height: 72px;
    }
}

.header.scrolled #menu-toggle,
.header.menu-open #menu-toggle,
.header:hover #menu-toggle,
body:not(.main-draft) .header #menu-toggle {
    color: #0f1c2d;
}

/* =========================================
   Mobile Sidebar (Full-Screen Overlay UI)
========================================= */
#layoutDimmed {
    display: none !important;
}

#aside {
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 17, 31, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 992001;
    transition: opacity 0.4s ease, visibility 0.4s;
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    padding: 30px 24px;
}

#aside.active {
    opacity: 1;
    visibility: visible;
}

#aside .intro {
    margin-bottom: 24px;
}

#aside .log img {
    width: 158px;
    height: auto;
    filter: brightness(0) invert(1);
}

#lnb {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 20px 0;
}

#lnb ul {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    text-align: left;
}

#lnb > ul > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#lnb > ul > li > a {
    display: block;
    padding: 18px 10px;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    position: relative;
    transition: color 0.3s;
    text-decoration: none;
}

#lnb > ul > li > a::after {
    content: "\e93d";
    font-family: "xeicon";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transition: transform 0.3s ease;
    font-size: 20px;
    color: #556070;
}

#lnb > ul > li.on > a {
    color: #38bdf8;
}

#lnb > ul > li.on > a::after {
    transform: translateY(-50%) rotate(0deg);
    color: #38bdf8;
}

#lnb > ul > li > ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0;
}

#lnb > ul > li.on > ul {
    max-height: 500px;
}

#lnb > ul > li > ul > li > a {
    display: block;
    padding: 12px 10px 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.2s;
    text-decoration: none;
}

#lnb > ul > li > ul > li > a:hover {
    color: #38bdf8;
    padding-left: 28px;
}

.btnClose {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    font-size: 26px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2002;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btnClose:hover {
    background: #01419a;
    color: #fff;
    transform: rotate(90deg);
}

.scustom {
    padding-top: 24px;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scustom h2 {
    display: none;
}

.scustom h3 a {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.scustom h3 a:hover {
    color: #38bdf8;
}
