/* =========================================
   Header Component - Optimized
========================================= */

/* --- Base Header --- */
.header {
    position: relative;
    z-index: 1000;
    width: 100%;
    height: 90px;
    background-color: #ffffff;
    transition: box-shadow 0.3s, background-color 0.3s;
    border-bottom: 1px solid #e6edf4;
}

.header.scrolled {
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    background-color: #ffffff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header.menu-open {
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

.header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}


/* --- Logo --- */
.header .logo {
    z-index: 2;
    width: 255px;
    height: auto;
}

.header .logo img {
    width: 100%;
    height: auto;
    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 22px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2f3d;
    transition: color 0.3s;
}

.nav-desktop .gnb > li > a:hover {
    color: #0053a6;
}

.nav-desktop .gnb > li > a::after {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #159bd7;
    transition: width 0.3s;
    content: "";
    transform: translateX(-50%);
}

.nav-desktop .gnb > li:hover > a::after {
    width: calc(100% - 56px);
}


/* --- Mega Menu Panel --- */
.mega-menu-panel {
    position: absolute;
    top: 90px;
    left: 0;
    z-index: 1;
    width: 100%;
    visibility: hidden;
    padding: 34px 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0.4s;
    opacity: 0;
    transform: translateY(-10px);
    border-top: 1px solid #e6edf4;
    background: #fff;
    box-shadow: 0 28px 48px rgba(13, 42, 70, 0.08);
}

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

.mega-menu-panel .wrap {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    height: auto;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.submenu-column.megaf { margin-left: 0; }

.submenu-column {
    flex: 1;
    min-width: 0;
}

.submenu-column h4 {
    font-size: 18px;
    font-weight: 700;
    color: #0c2f55;
    margin-bottom: 5px;
    padding-bottom: 10px;
    word-break: keep-all;
    white-space: nowrap;
}

.submenu-column ul li a {
    display: block;
    padding: 9px 0;
    font-size: 15px;
    color: #566473;
    transition: color 0.3s, transform 0.3s;
    word-break: keep-all;
    white-space: nowrap;
}

.submenu-column ul li a:hover {
    color: #0078c8;
    transform: translateX(4px);
}


/* --- Mobile Menu Toggle --- */
#menu-toggle {
    display: none;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1001;
    color: #333;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

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

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


/* =========================================
   Mobile Sidebar & Dimmed Layer
========================================= */
#layoutDimmed {
    display: none;
    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;
}

#aside {
    position: fixed;
    top: 0;
    right: -320px;
    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;
    overflow-y: auto;
}

#aside.active { right: 0; }

#aside .intro {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 80px;
}

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

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

#lnb ul { width: 100%; }

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

#lnb > ul > li > a {
    display: block;
    padding: 18px 24px;
    font-size: 17px;
    font-weight: 800;
    color: #102235;
    position: relative;
    transition: 0.3s;
}

#lnb > ul > li > a::after {
    content: '';
    position: absolute;
    right: 24px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #aebac9;
    border-bottom: 2px solid #aebac9;
    transform: translateY(-60%) rotate(45deg);
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1), border-color 0.3s;
}

#lnb > ul > li.on > a { color: #0067b8; }
#lnb > ul > li.on > a::after {
    transform: translateY(-40%) rotate(225deg);
    border-color: #0067b8;
}

#lnb > ul > li > ul {
    display: none;
    background: #f8fafb;
    padding: 10px 0;
}

#lnb > ul > li > ul > li > a {
    display: block;
    padding: 12px 24px 12px 34px;
    font-size: 15px;
    color: #566473;
    font-weight: 500;
    transition: 0.2s;
}

#lnb > ul > li > ul > li > a:hover {
    color: #0067b8;
    padding-left: 38px;
    font-weight: 700;
}

#lnb > ul > li > ul > li > a::after { display: none; }

/* Sidebar 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);
}

/* Sidebar Contact Area */
.scustom {
    padding: 30px;
    background: #f4f9fd;
    border-top: 1px solid #e4f0f8;
}

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

.scustom h3 a {
    font-size: 24px;
    font-weight: 800;
    color: #0053a6;
    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: #159bd7;
    color: #159bd7;
}


/* =========================================
   Responsive
========================================= */
@media (max-width: 768px) {
    .header { height: 70px; }
    .header .wrap {
        height: 70px;
        padding: 0 15px;
    }
    .header .logo { width: 190px; }
    .header.menu-open { height: auto; }
    .mega-menu-panel { top: 70px; }
    .mega-menu-panel .wrap {
        flex-wrap: wrap;
        padding: 0 15px;
    }
    .nav-desktop .gnb > li > a {
        height: 70px;
        font-size: 16px;
    }
    body { padding-bottom: 80px; }
}
