/* ========================================================
   1. 메인 컨테이너 & 기본 레이아웃
   ======================================================== */
.main-container {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    height: auto;   
    margin: 0 auto;
    z-index: 9999;
}

.section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 0;
    gap: 10px;
    z-index: 9999;
}

/* ========================================================
   2. 상단 최상단 헤더
   ======================================================== */
.box {
    position: relative; /* absolute의 기준점 */
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    flex-wrap: nowrap;
    flex-shrink: 0;
    width: 100%;
    height: 82px;
    background: linear-gradient(to top, #1E1E1E, #030712FF);
}

.box-2 {
    position: absolute;
    right: 19px;          /* 20px 떨어진 위치 붙임  */
    top: 50%;
    transform: translateY(-50%); /* 💡 세로 중앙 정렬 */
    display: flex;
    align-items: center;
    z-index: 3;
}

.logo-img {
    width: 180px;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.logo-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.lang-link {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    text-decoration: none;
    cursor: pointer;
    z-index: 3;
}

.pic-2 {
    flex-shrink: 0;
    position: relative;
    width: 20px;
    height: 22px;
    background: url(/assets/images/.svg) no-repeat center;
    background-size: cover;
}

/* ========================================================
   3. 메인 네비게이션 (PC - )
   ======================================================== */
.section-2 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    flex-wrap: nowrap;
    flex-shrink: 1;
    position: relative;
    width: 100%;
    height: auto; 
    z-index: 5;
}

.section-3 {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    flex-wrap: nowrap;
    flex-shrink: 1;
    gap: 10px;
    position: relative;
    height: auto;
    min-height: 40px;
    padding: 12px 46px;
    background: #1E1E1E;
    z-index: 6;
}

.group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
    position: relative;
    width: 100%;    
    height: auto !important;
    min-height: 20px; 
    z-index: 7;
    overflow: visible !important;
}

.B_box01, .B_box02 {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 1;
    position: relative;
    height: auto;
    background: rgba(217, 217, 217, 0);
    z-index: 8;
    max-width: 18px;
}

/* PC 대메뉴 글자 스타일 */
.text, .text-2, .text-3, .text-4, .text-5 {
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: auto;
    position: relative;
    min-width: 40px;
    height: auto; /* 하단 바 공간 확보 및 유연성을 위해 auto  */
    padding-bottom: 6px; /* 글자와 하단 로딩 바 사이의 간격 */
    color: #e4e4e4;
    font-family: Inter, var(--default-font-family);
    font-size: 15px;
    font-weight: 600;
    line-height: 20.574px;
    text-align: center;
    white-space: nowrap;
    z-index: 9;
    cursor: pointer;
    display: inline-block; /* transform 및 가상요소 위치 정렬 보장 */
    transition: color 0.4s ease;
}

/* 하단 단색 애니메이션 바 기본 설정 (기본은 안보이는 상태) */
.text::after, .text-2::after, .text-3::after, .text-4::after, .text-5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px; /* 그라데이션이 바 두께 */
    background: linear-gradient(90deg, #d0ff93 0%, #1e4d98 100%);
    
    /* 바의 모서리를 살짝 동글게추가  */
    border-radius: px; 
    
    transform: scaleX(0); /* 첫너비 0 */
    transform-origin: left; /* 왼쪽에서 채워 */
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 2. 대메뉴 호버 시: 글자색 변경 + 애니메이션 바 로딩(100% 채움) */
.text:hover, .text-2:hover, .text-3:hover, .text-4:hover, .text-5:hover {
    color: #d8f8ff;
}

.text:hover::after, .text-2:hover::after, .text-3:hover::after, .text-4:hover::after, .text-5:hover::after {
    transform: scaleX(1); /* 너비 100%로 싹 채워짐 */
}

/* PC */
.sub-menu-popup {
    position: absolute;
    top: 147%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 20px 6px;
    background: rgba(20, 20, 20, 0.85);
    border-radius: 0 0 10px 10px;
    box-shadow: 0px 10px 20px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 100;
}

.sub-menu-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    text-align: center;
}

.sub-menu-col a {
    pointer-events: auto !important; /* 클릭 가능 상태 강제 보장 */
    cursor: pointer !important;
    position: relative;
    z-index: 100;
    color: #bfc1c1;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.5s;
    transition: color 0.5s, transform none;
    font-family: 'Inter', 'LH B', sans-serif; /* 사용할 폰트 */
    font-weight: 400;                         /* 폰트 굵기 */
}

.sub-menu-col a:hover {
    color: #ffffff;    
    transform: scale(1.31);
    font-weight: bold;
}
/*호버세트끝*/

.group:hover .sub-menu-popup {
    opacity: 1;
    visibility: visible;
}

/* PC상황 햄 숨김 */
.hamburger-btn {
    display: none;
}

/* ========================================================
   4. 📱 모바일 환경 (768px 이하) - 유격 및 밀착 완전 수정
   ======================================================== */
@media (max-width: 768px) {
    /* 1. 햄버거 버튼 위치 조정 */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100000;
    }

    .hamburger-btn span {
        width: 100%;
        height: 3px;
        background-color: #ffffff;
        border-radius: 2px;
        transition: all 0.4s ease;
    }

    .logo-img {
    width: 150px;
    height: auto;
    display: block;
    flex-shrink: 0;
}

    /* 모바일 펼침 메뉴 (유격 없이 밀착) */
    .section-3 {
        display: none;
        position: absolute;
        top: 0px;            /* 유격 없이 붙음 */
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.9);
        padding: 15px 20px;   /* 상하 여백 슬림하게 조정 */
        z-index: 99999;
    }

    #mainNav.active, 
    .section-3.active {
        display: block !important;
    }

    /* 3. 모바일 레이아웃 및 데코 박스 제거 */
    .section-3 .group {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100%;
    }

    .B_box01, .B_box02 { 
        display: none !important; 
    }

    /* 4. 대메뉴 스타일 및 순서 지정 */
    /*메뉴 추가하고 싶으면 여기*/ 
    /*메뉴 추가하고 싶으면 여기*/ 
    .section-3 .text, 
    .section-3 .text-2, 
    .section-3 .text-3, 
    .section-3 .text-4 {
        text-align: left;
        padding: 22px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .section-3 .text   { order: 1; display: block; width: 100%; cursor: pointer; }
    .section-3 .text-2 { order: 3; display: block; width: 100%; cursor: pointer; }
    .section-3 .text-3 { order: 5; display: block; width: 100%; cursor: pointer; }
    .section-3 .text-4 { order: 7; display: block; width: 100%; cursor: pointer; }
   /*  .section-3 .text-5 { order: 9; display: block; width: 100%; cursor: pointer; } */

    /* 5. 서브메뉴 팝업 상자 해제 */
    .sub-menu-popup {
        position: static !important;
        display: contents !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    /* 6. 소메뉴 위치 교차 배치 */
    .sub-menu-col:nth-child(1) { order: 2; }
    .sub-menu-col:nth-child(2) { order: 4; }
    .sub-menu-col:nth-child(3) { order: 6; }
    .sub-menu-col:nth-child(4) { order: 8; }
    /* .sub-menu-col:nth-child(5) { order: 10; } */

    /* 7. 소메뉴 아코디언 애니메이션/여백 */
    .sub-menu-col {
        display: none;
        width: 100%;
        padding: 12px 0 12px 15px;
        margin-top: 5px;
        margin-bottom: 5px;
        border-left: 2px solid #6b6b6b;
    }

    .sub-menu-col.active {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px;
    }
    
    .sub-menu-col a {
        text-align: left;
        transform-origin: left center; /* 모바일: 왼쪽 기준 -> 오른쪽으로 확대됨 */
    }
}

