@charset "utf-8";

/* ==============================================================
   Top Utility
   ============================================================== */
.top-utility {
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    z-index: 101;
}

.header-wrap {
    position: relative;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
}

.main-page .header-wrap {
    position: absolute;
    background-color: transparent;
    top: 0;
    left: 0;
    transition: background-color 0.1s ease;
}


@media (min-width: 1201px) {

    .main-page .header-wrap:hover,
    .header-wrap:hover {
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}


.main-page .top-utility {
    background: transparent;
    border-bottom: none;
    position: relative;
    width: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}


.top-utility .inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 40px;
}

.top-utility a {
    padding: 0 15px;
    color: #1d1d1d;
}

.main-page .top-utility a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.main-page .header-wrap:hover .top-utility a {
    color: #888;
}

.main-page .top-utility .divider {
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s ease;
}

.main-page .header-wrap:hover .top-utility .divider {
    color: #fff;
}

.top-utility a:hover,
.main-page .header-wrap:hover .top-utility a:hover {
    color: var(--primary-color);
}

.top-utility .divider {
    color: #fff;
    font-size: 14px;
}

/* ==============================================================
   Header & GNB (Desktop)
   ============================================================== */
.header {
    height: 80px;
    background: var(--white);
    position: relative;
    z-index: 100;
    border-bottom: 1px solid #e0e0e0;
}

.main-page .header {
    background: transparent;
    border-bottom: none;
    position: relative;
    width: 100%;
    transition: background-color 0.05s ease;
}

@media (min-width: 1201px) {

    .main-page .header-wrap:hover .header,
    .main-page .header-wrap:hover .top-utility {
        background: #fff;
    }

    .main-page .header-wrap:hover .top-utility {
        border-bottom: 1px solid #f0f0f0;
    }
}

.header .inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    gap: 100px;
}

.header .logo {
    width: 285px;
    /* Logo area fixed width for alignment */
    flex-shrink: 0;
}

.header .logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-symbol {
    height: 30px;
    width: auto;
}

.logo-text {
    height: 22px;
    width: auto;
}

.main-page .header .logo .logo-text {
    filter: brightness(0) invert(1);
    /* 텍스트 로고를 흰색으로 변경 */
    transition: filter 0.3s ease;
}

@media (min-width: 1200px) {
    .main-page .header-wrap:hover .logo .logo-text {
        filter: none;
    }
}

.gnb {
    height: 100%;
}

.gnb-list {
    display: flex;
    height: 100%;
}

.gnb-item {
    height: 100%;
}

.gnb-item>a {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center text for alignment with mega menu */
    height: 100%;
    width: 160px;
    /* Match mega-col width */
    font-size: 18px;
    font-weight: 500;
    color: #555;
    position: relative;
    transition: color 0.3s ease;
}

.main-page .gnb-item>a {
    color: #fff;
    transition: color 0.3s ease;
}

@media (min-width: 1200px) {
    .main-page .header-wrap:hover .gnb-item>a {
        color: #555;
    }
}

.gnb-item.active>a {
    color: var(--primary-color);
}

.gnb-item.active>a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 2;
}

@media (min-width: 1200px) {
    .gnb-item:hover>a {
        color: var(--primary-color);
    }

    .gnb-item:hover>a::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: var(--primary-color);
        z-index: 2;
    }
}

/* Mega Menu Dropdown */
.mega-menu {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

@media (min-width: 1200px) {
    .header-wrap:hover .mega-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.mega-grid {
    display: flex;
    justify-content: flex-start;
    padding-left: 385px;
    /* Logo 285px + gap 100px */
}

.mega-col {
    padding: 30px 0;
    text-align: center;
    width: 160px;
    border-left: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.mega-col:first-child {
    border-left: none;
}

@media (min-width: 1200px) {

    /* Highlight mega column when corresponding GNB item is hovered, or when column itself is hovered */
    .header-wrap:has(.gnb-item:nth-child(1):hover) .mega-col:nth-child(1),
    .header-wrap:has(.gnb-item:nth-child(2):hover) .mega-col:nth-child(2),
    .header-wrap:has(.gnb-item:nth-child(3):hover) .mega-col:nth-child(3),
    .header-wrap:has(.gnb-item:nth-child(4):hover) .mega-col:nth-child(4),
    .header-wrap:has(.gnb-item:nth-child(5):hover) .mega-col:nth-child(5),
    .mega-col:hover {
        background-color: color-mix(in srgb, var(--primary-color), transparent 95%);
    }

    /* Maintain GNB item color when its corresponding column is hovered */
    .header-wrap:has(.mega-col:nth-child(1):hover) .gnb-item:nth-child(1)>a,
    .header-wrap:has(.mega-col:nth-child(2):hover) .gnb-item:nth-child(2)>a,
    .header-wrap:has(.mega-col:nth-child(3):hover) .gnb-item:nth-child(3)>a,
    .header-wrap:has(.mega-col:nth-child(4):hover) .gnb-item:nth-child(4)>a,
    .header-wrap:has(.mega-col:nth-child(5):hover) .gnb-item:nth-child(5)>a {
        color: var(--primary-color);
    }
}

.mega-col li a {
    display: block;
    padding: 12px 10px;
    /* 좌우 패딩을 조금 줄여 공간 확보 */
    font-size: 15px;
    color: #666;
    text-align: center;
    transition: all 0.3s ease;
    margin: 0 5px;
    white-space: nowrap;
}

.mega-col li a:hover {
    color: var(--primary-color);
    font-weight: 600;
}

/* 개별 마진 제거 */

.mega-col.active-bg {
    background-color: #f8f9fa;
    /* Light gray for active column */
}

.mega-col ul li {
    margin-bottom: 15px;
}

.mega-col ul li:last-child {
    margin-bottom: 0;
}

.mega-col ul li a {
    font-size: 15px;
    color: #666;
}

.mega-col ul li a:hover {
    color: var(--primary-color);
    font-weight: 500;
}

/* Long text adjustment */
.mega-col:nth-child(4) ul li:nth-child(3) a {
    font-size: 14px;
}

.icon-link {
    font-size: 12px;
    margin-left: 2px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    width: 25px;
    height: 25px;
    position: relative;
}

/* Mobile Menu Button Animation to X */
.header-wrap.mobile-active .mobile-menu-btn span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
}

.header-wrap.mobile-active .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
}

.header-wrap.mobile-active .mobile-menu-btn span:nth-child(3) {
    transform: rotate(-45deg);
    top: 8px;
}

.mobile-menu-btn span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--black);
    left: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
    /* Added for smooth transition */
}

.main-page .mobile-menu-btn span {
    background: var(--white);
    transition: background-color 0.3s ease;
}

@media (min-width: 1201px) {
    .main-page .header-wrap:hover .mobile-menu-btn span {
        background: var(--black);
    }
}

.mobile-menu-btn span:nth-child(1) {
    top: 0;
}

.mobile-menu-btn span:nth-child(2) {
    top: 8px;
}

.mobile-menu-btn span:nth-child(3) {
    top: 16px;
}

/* ==============================================================
   Mobile Menu Overlay
   ============================================================== */
.mobile-menu-overlay {
    position: fixed;
    top: 60px;
    /* Start below the mobile header */
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--white);
    z-index: 2000;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    display: flex;
}

/* Deleted redundant header styles */

.mobile-menu-body {
    flex: 1;
    padding: 20px;
}

.m-gnb-item {
    margin-bottom: 5px;
}

.m-gnb-title {
    width: 100%;
    text-align: left;
    font-size: 22px;
    font-weight: var(--fw-bold);
    color: var(--primary-color);
    /* Brand blue for menu titles */
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
}

.m-gnb-title .arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #a0aec0;
    border-right: 2px solid #a0aec0;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.m-gnb-item.active .m-gnb-title .arrow {
    transform: rotate(-135deg);
}

.m-sub {
    max-height: 0;
    overflow: hidden;
    padding: 0 0 0 20px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.m-gnb-item.active .m-sub {
    max-height: 1000px;
    /* High enough value to accommodate all items */
    padding: 10px 0 20px 20px;
}

.m-sub li {
    position: relative;
    margin-bottom: 15px;
}

.m-sub li a {
    font-size: 16px;
    color: #555;
}

.m-sub li a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.m-utility {
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.m-utility a {
    font-size: 16px;
    color: #666;
}

/* ==============================================================
   Responsive Queries
   ============================================================== */
/* @media screen and (max-width: 1200px) {
    .header .inner {
        padding: 0 20px;
        gap: 80px;
    }

    .header .logo {
        width: auto;
    }

    .logo-symbol {
        height: 25px;
    }

    .logo-text {
        height: 20px;
    }

    .gnb-list {
        gap: 10px;
    }

    .gnb-item>a {
        width: auto;
        padding: 0 15px;
    }

    .mega-grid {
        justify-content: center;
        padding-left: 0;
    }

    .mega-col {
        width: 120px;
    }
} */


@media screen and (max-width: 1400px) {

    /* 모바일 고정 헤더 기본값 (서브페이지 포함) */
    .header-wrap {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border-bottom: 1px solid #e0e0e0;
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

    /* 서브 페이지의 바디 영역에 헤더 높이만큼 패딩 추가 */
    body:not(.main-page) {
        padding-top: 60px;
    }

    /* 메인 페이지 헤더: 상단에서 투명 처리 */
    .main-page .header-wrap {
        position: fixed;
        background-color: transparent;
        border-bottom: none;
        box-shadow: none;
    }

    /* 메인 페이지 헤더 스크롤 다운 혹은 모바일 메뉴 활성화 시 흰색 배경 채우기 */
    .main-page .header-wrap.scrolled,
    .main-page .header-wrap.mobile-active {
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border-bottom: 1px solid #e0e0e0;
    }

    /* 메인 페이지 헤더 스크롤 다운 시 로고 텍스트 및 햄버거 메뉴 어둡게 */
    .main-page .header-wrap.scrolled .logo .logo-text {
        filter: none;
    }

    .main-page .header-wrap.scrolled .mobile-menu-btn span {
        background: var(--black);
    }

    .header .inner {
        padding: 0 20px;
    }

    .top-utility {
        display: none;
    }

    .header {
        height: 60px;
    }

    .gnb {
        display: none;
    }

    .mega-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
        margin-left: auto;
    }
}

/* ==============================================================
   Mobile Active State Overrides
   ============================================================== */
.main-page .header-wrap.mobile-active .header,
.header-wrap.mobile-active .header {
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
}

.main-page .header-wrap.mobile-active .header .logo .logo-text {
    filter: none;
}

.main-page .header-wrap.mobile-active .mobile-menu-btn span {
    background: var(--black);
}

.header-wrap.mobile-active .top-utility {
    display: none;
    /* Hide utility when mobile menu is open */
}

/* ==============================================================
   Mobile Specific (480px and below)
   ============================================================== */
@media screen and (max-width: 480px) {
    .logo-symbol {
        height: 20px;
    }

    .logo-text {
        height: 16px;
    }

    .header .logo a {
        gap: 8px;
    }

    .header .inner {
        padding: 0 15px;
    }

    .mobile-menu-btn {
        width: 20px;
        height: 16px;
    }

    .mobile-menu-btn span {
        height: 2px;
    }

    .mobile-menu-btn span:nth-child(1) {
        top: 0;
    }

    .mobile-menu-btn span:nth-child(2) {
        top: 7px;
    }

    .mobile-menu-btn span:nth-child(3) {
        top: 14px;
    }

    .header-wrap.mobile-active .mobile-menu-btn span:nth-child(1) {
        transform: rotate(45deg);
        top: 7px;
    }

    .header-wrap.mobile-active .mobile-menu-btn span:nth-child(2) {
        opacity: 0;
    }

    .header-wrap.mobile-active .mobile-menu-btn span:nth-child(3) {
        transform: rotate(-45deg);
        top: 7px;
    }

    .header .logo {
        width: auto;
    }

    .header .inner {
        gap: 0px;
    }


}