/* =========================================
   Header Component (Extracted from main.css)
========================================= */
.header-wrap {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: 0.3s;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    height: 40px;
    font-weight: 800;
    font-size: 24px;
    color: #01419a; /* Trust Blue */
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.nav-list {
    display: flex;
    height: 100%;
    gap: 5px;
    align-items: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    border-radius: 30px;
    transition: 0.3s;
    background: transparent;
}

.nav-item:hover {
    color: #01419a;
    background: rgba(1, 65, 154, 0.05); /* Trust Blue Alpha */
}

.header-util {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-consult {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    background: #01419a; /* Trust Blue */
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 2px; /* Sharper edges */
    transition: 0.3s;
    border: 1px solid #01419a;
}

.btn-consult:hover {
    background: #002e70; /* Darker Blue */
    box-shadow: 0 5px 15px rgba(1, 65, 154, 0.2);
}

.btn-hamburger {
    display: none;
    font-size: 32px;
    color: #111111;
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #eeeeee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: none;
    padding: 40px 0;
    z-index: 999;
}

.header-wrap:hover .mega-menu {
    display: block;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
}

.mega-col-title {
    color: #01419a;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
    border-bottom: 2px solid #01419a;
    padding-bottom: 8px;
}

.mega-sub-item {
    display: block;
    margin-bottom: 10px;
    color: #666666;
    font-size: 15px;
}

.mega-sub-item:hover {
    color: #00d2ff;
    transform: translateX(5px);
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.mobile-menu-wrap {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #ffffff;
    z-index: 2001;
    transition: 0.4s cubic-bezier(0.33, 1, 0.68, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-wrap.active {
    right: 0;
}

.m-head {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eeeeee;
}

.m-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.m-menu-item {
    margin-bottom: 20px;
}

.m-menu-tit {
    font-weight: 700;
    margin-bottom: 10px;
    color: #01419a;
    display: block;
}

.m-sub-link {
    display: block;
    padding: 12px 0;
    color: #555555;
    border-bottom: 1px solid #f5f5f5;
    font-size: 15px;
    transition: 0.2s;
}

.m-sub-link:hover {
    color: #01419a;
    padding-left: 10px;
}

@media (max-width: 1200px) {
    .nav-list {
        display: none;
    }
    .mega-menu {
        display: none !important;
    }
    .btn-hamburger {
        display: block;
    }
    .btn-consult {
        display: none;
    }
}

@media (max-width: 768px) {
    .m-menu-item {
        margin-bottom: 15px;
    }
    .m-menu-tit {
        font-size: 16px;
        font-weight: 700;
        margin-bottom: 8px;
    }
    .m-sub-link {
        padding: 10px 0;
        font-size: 14px;
    }
}

/* 2nd Header implementation (scrolled) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 90px;
    background-color: transparent;
    transition: background-color 0.3s, box-shadow 0.3s, height 0.4s ease-out;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.header.scrolled {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #eee;
}
.header.menu-open {
    height: 350px; /* 메가메뉴 높이에 맞게 조절 */
    background-color: #fff;
    border-bottom: 1px solid #eee;
}
.header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}
.header .logo {
    z-index: 2;
    width: 200px;
    height: auto;
    margin-top: 0px;
}
.header .logo img {
    width: 100%;
    transition: opacity 0.3s;
}
.header .logo .logo-dark {
    display: block;
}
.header .logo .logo-white {
    display: none;
}
/* --- Desktop Navigation --- */
.nav-desktop {
    display: flex;
    align-items: center;
    height: 100%;
}
.nav-desktop .gnb {
    display: flex;
}
.nav-desktop .gnb > li > a {
    display: flex;
    align-items: center;
    position: relative;
    height: 90px;
    padding: 0 28px;
    font-size: 20px;
    font-weight: 500;
    color: #343a40; /* 기본 텍스트 색상 (스크롤 전) */
    transition: color 0.3s;
}
/* 스크롤 전 투명 배경일 때 텍스트 색상 (흰색) */
.header:not(.scrolled):not(.menu-open) .nav-desktop .gnb > li > a {
    color: #ffffff;
}
/* 스크롤 전 모바일 트리거 색상 (흰색) */
.header:not(.scrolled):not(.menu-open) #menu-toggle {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
/* 스크롤 전/메뉴 닫혔을 때 (투명 배경) 흰색 로고 표시 */
.header:not(.scrolled):not(.menu-open) .logo .logo-white {
    display: block;
}
.header:not(.scrolled):not(.menu-open) .logo .logo-dark {
    display: none;
}
.nav-desktop .gnb > li > a:hover {
    color: #072646; /* Updated Color */
}
/* 스크롤 안됐을 때 호버 색상 */
.header:not(.scrolled):not(.menu-open) .nav-desktop .gnb > li > a:hover {
    color: #ddd;
}
.nav-desktop .gnb > li > a::after {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #072646; /* Updated Color */
    transition: width 0.3s;
    content: "";
    transform: translateX(-50%);
}
/* 스크롤 안됐을 때 밑줄 색상 */
.header:not(.scrolled):not(.menu-open) .nav-desktop .gnb > li > a::after {
    background-color: #ffffff;
}
.nav-desktop .gnb > li:hover > a::after {
    width: calc(100% - 56px);
}

/* --- Mega Menu --- */
.mega-menu-panel {
    position: absolute;
    top: 90px;
    left: 0;
    z-index: 1;
    width: 100%;
    visibility: hidden;
    padding: 30px 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0.4s;
    opacity: 0;
    transform: translateY(-10px);
    border-top: 1px solid #eee;
}
.header.menu-open .mega-menu-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
.mega-menu-panel .wrap {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
}
.submenu-column.megaf {
    margin-left: 260px;
}
.submenu-column {
    max-width: 190px;
}
.submenu-column h4 {
    font-size: 19px;
    font-weight: 700;
    color: #000; /* Updated Color */
    margin-bottom: 5px;
    padding-bottom: 10px;
}
.submenu-column ul li a {
    display: block;
    padding: 9px 0;
    font-size: 16px;
    color: #495057;
    transition: color 0.3s, transform 0.3s;
}
.submenu-column ul li a:hover {
    color: #072646; /* Updated Color */
    transform: translateX(4px);
}

#menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001; /* 1000인 헤더보다 높게 */
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

@media (max-width: 1024px) {
    #menu-toggle {
        display: block;
    }
}

#menu-toggle i {
    font-size: 28px;
}


.header.scrolled #menu-toggle {
    color: #333;
}


/* =========================================
   Mobile Sidebar & Dimmed Layer
========================================= */

/* 1. Dimmed Background */
#layoutDimmed {
    display: none; /* Default hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#layoutDimmed.active {
    display: block;
    opacity: 1;
}

/* 2. Sidebar (#aside) */
#aside {
    position: fixed;
    top: 0;
    right: -320px; /* Hidden by default */
    width: 320px;
    height: 100%;
    background: #ffffff;
    z-index: 2001;
    transition: right 0.4s cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

#aside.active {
    right: 0; /* Show */
}

/* 3. Sidebar Header (Intro) */
#aside .intro {
    padding: 20px;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 80px;
}

#aside .log img {
    height: 40px;
    width: auto;
}

/* 4. Sidebar Navigation (#lnb) */
#lnb {
    flex: 1;
    padding: 20px 0;
}

#lnb ul {
    width: 100%;
}

#lnb > ul > li {
    width: 100%;
    border-bottom: 1px solid #f9f9f9;
}

#lnb > ul > li > a {
    display: block;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    position: relative;
    transition: 0.3s;
}

/* Accordion Arrow */
#lnb > ul > li > a::after {
    content: '\e93d'; /* xeicon arrow down */
    font-family: 'xeicon';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: 0.3s;
    font-size: 18px;
    color: #ccc;
    font-weight: 400;
}

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

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

/* 5. Submenu */
#lnb > ul > li > ul {
    display: none; /* Hidden by default */
    background: #f8f9fa;
    padding: 10px 0;
}

#lnb > ul > li > ul > li > a {
    display: block;
    padding: 10px 30px 10px 40px;
    font-size: 15px;
    color: #666;
    transition: 0.2s;
}

#lnb > ul > li > ul > li > a:hover {
    color: #01419a;
    padding-left: 45px;
}

#lnb > ul > li > ul > li > a::after {
    display: none; /* No arrow for submenus */
}

/* 6. Close Button */
.btnClose {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2002;
    background: #f5f5f5;
    border-radius: 50%;
    transition: 0.3s;
}

.btnClose:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* 7. Bottom Custom Area (Contact) */
.scustom {
    padding: 30px;
    background: #f5faff;
    border-top: 1px solid #eef6fc;
}

.scustom h2 {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.scustom h3 a {
    font-size: 24px;
    font-weight: 800;
    color: #01419a;
    display: flex;
    align-items: center;
    gap: 5px;
}

.scustom .social-links {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.scustom .social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    color: #555;
    font-size: 20px;
    transition: 0.3s;
}

.scustom .social-links a:hover {
    border-color: #01419a;
    color: #01419a;
}
