/* 웹접근성을 고려한 헤더 메뉴 스타일 */

/* 스킵 네비게이션 */
.skip-nav {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 9999;
}

.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    background: #007bff;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 4px 0;
    transition: top 0.3s ease;
}

/* .skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
} */

/* 스크린 리더 전용 텍스트 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 헤더 기본 스타일 */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* 스크롤 다운 시 헤더 스타일 */
#header.down {
    background-color: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-100px);
}

/* 스크롤 업 시 헤더 스타일 */
#header.up {
    background-color: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    color: #000;
}

/* 스크롤 업 시 헤더 내부 요소들 색상 변경 */
#header.up .nav-link,
#header.up .mobile-menu-btn {
    color: #333;
}

#header.up .nav-link:hover,
#header.up .mobile-menu-btn:hover {
    color: #333;
}



#header.up .logo{
    background-image: url('../images/common/logo-b.svg');
}

#header .logo{
    width: 200px;
    height: 39px;
    background-image: url('../images/common/logo-w.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

/* 로고 스타일 */
.logo a {
    display: block;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
}

/* 메인 네비게이션 */
.main-nav {
    display: flex;
    align-items: center;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    display: flex !important;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    color: #fff;
    font-family: 'GmarketSansMedium';

}


/* .nav-link:focus {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
} */

/* 하위 메뉴 */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-item:hover .sub-menu,
.nav-item:focus-within .sub-menu,
.sub-menu:focus-within {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-link {
    display: block;
    padding: 12px 20px;
    color: var(--black);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 8px;
}


/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

/* .mobile-menu-btn:hover,
.mobile-menu-btn:focus {
    background: var(--skyblue);
    outline: none;
}

.mobile-menu-btn:focus {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
} */

.hamburger {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

.hamburger .line {
    display: block;
    height: 2px;
    background: var(--black);
    transition: all 0.3s ease;
    border-radius: 1px;
    transform-origin: center;
}

.mobile-menu-btn[aria-expanded="true"] .hamburger .line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px) !important;
    transition: transform 0.3s ease !important;
}

.mobile-menu-btn[aria-expanded="true"] .hamburger .line:nth-child(2) {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.mobile-menu-btn[aria-expanded="true"] .hamburger .line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px) !important;
    transition: transform 0.3s ease !important;
}

/* 기본 상태로 돌아갈 때의 transition */
.mobile-menu-btn[aria-expanded="false"] .hamburger .line:nth-child(1),
.mobile-menu-btn[aria-expanded="false"] .hamburger .line:nth-child(3) {
    transform: rotate(0deg) translate(0px, 0px) !important;
    transition: transform 0.3s ease !important;
}

.mobile-menu-btn[aria-expanded="false"] .hamburger .line:nth-child(2) {
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
}

/* 모바일 아코디언 네비게이션 */
.mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
}

.mobile-nav[aria-hidden="false"] {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.mobile-nav[aria-hidden="true"] {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* 강제로 모바일 메뉴 표시 */
.mobile-nav[style*="display: block"] {
    display: block !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 20px;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    color: var(--black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

/* 
.mobile-nav-toggle:focus {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
} */

/* 토글 버튼이 active 상태일 때 */
.mobile-nav-toggle.active {
    background: var(--skyblue);
    color: var(--blue);
    font-weight: 600;
}

/* 모바일 토글 버튼 포커스 외곽선 제거 */
.mobile-nav-toggle:focus,
.mobile-nav-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.menu-text {
    flex: 1;
}

.menu-arrow {
    display: inline-block;
    width: 12px;
    height: 12px;
    position: relative;
    margin-left: 8px;
    color: #fff;
    font-size: 0; /* 내부 텍스트(예: ▼) 숨김 */
}

/* 가로/세로 스트로크로 + 모양을 만들고,
   펼침 시 세로 스트로크를 스케일 아웃하여 - 로 전환 */
.menu-arrow::before,
.menu-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background-color: currentColor;
    transform-origin: center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* 가로 막대 */
.menu-arrow::before {
    width: 10px;
    height: 2px;
    transform: translate(-50%, -50%);
}

/* 세로 막대 */
.menu-arrow::after {
    width: 2px;
    height: 10px;
    transform: translate(-50%, -50%) scaleY(1);
}

/* 열림 상태: 세로 막대 축소/페이드 → '-' */
.mobile-nav-toggle[aria-expanded="true"] .menu-arrow::after,
.mobile-nav-toggle.active .menu-arrow::after {
    transform: translate(-50%, -50%) scaleY(0);
    opacity: 0;
}

.mobile-sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-5px);
    transition: max-height 0.5s ease-out, 
                opacity 0.5s ease-out, 
                transform 0.5s ease-out;
    background: rgba(255 255 255 / 0.1);
    margin: 0 20px;
    border-radius: 20px;

}

/* 토글 버튼에 active 클래스가 붙으면 하위 메뉴 표시 */
.mobile-nav-toggle.active + .mobile-sub-menu {
    max-height: 300px !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: max-height 0.5s ease-out, 
                opacity 0.5s ease-out, 
                transform 0.5s ease-out !important;
}

.mobile-sub-menu.active {
    max-height: 300px !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: max-height 0.5s ease-out, 
                opacity 0.5s ease-out, 
                transform 0.5s ease-out !important;
}

/* 강제로 하위 메뉴 표시 */
.mobile-sub-menu[style*="display: block"] {
    display: block !important;
    max-height: 300px !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}


.mobile-sub-link {
    display: block !important;
    padding: 15px 40px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

#mobile-menu .menu-text{
    color: #fff;
    font-family: 'GmarketSansMedium';
}


.mobile-nav-link {
    display: block;
    padding: 20px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}


.fx-mn{
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
}

.fx-mn .sns{
    gap: 10px;
}

/* SNS 아이콘 초기 상태 - 깜빡임 방지 */
.fx-mn .sns li {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    visibility: hidden;
    transition: all 0.3s ease;
}

/* SNS 아이콘 hover 효과 */
.fx-mn .sns li:hover {
    transform: translateY(-5px) scale(1.1);
    filter: brightness(1.2);
}

.fx-mn .sns li:hover img {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.fx-mn .sns li a {
    display: block;
    transition: all 0.3s ease;
}

.fx-mn .sns li a:hover {
    transform: scale(1.05);
}

.fx-mn .sns li a img {
    max-width: 51px;
    border-radius: 50%;
}

/* TOP 버튼 스타일 */
.btn-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 70px;
    height: 70px;
    background: #fff;
    border: 1px solid #111;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.btn-top::before {
    content: "";
    width: 16px;
    height: 11px;
    background: url("../images/common/btn-top.png") no-repeat center center / contain;
    margin-bottom: 2px;
}

.btn-top::after {
    content: 'TOP';
    font-weight: 600;
}

.btn-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-top:active {
    transform: translateY(0);
}

.btn-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#footer{
    background-color: #151515;
    padding: 20px 0 60px 0;
}

#footer .top {
    margin-bottom: 20px;
}

#footer .top ul{
    gap: 0 30px;
}

#footer .top ul li a{
    color: #fff;
}

#footer .line{
    width: 100%;
    height: 1px;
    background-color: #444;
    margin: 0 0 20px 0;
}

#footer .bottom{
    justify-content: space-between;
}

#footer .bottom .lbox h2,
#footer .bottom .lbox p{
    color: #999;
}

#footer .bottom .rbox{
    margin-left: auto;
    color: #999;
}

#footer .bottom .rbox .info{
    gap: 20px;
}

#footer .bottom .rbox dl{
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

#footer .bottom .rbox .copy{
    margin-top: 30px;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    .hamburger .line{
        background-color: #fff;
    }

    #header.up .hamburger .line{
        background-color: var(--black);
    }

    #footer .bottom{
        flex-direction: column;
    }

    #footer{
        padding-bottom: 100px;
    }


    #footer .bottom .rbox {
        margin-left: 0;
        margin-top: 30px;
    }

    #footer .bottom .rbox .info {
        flex-direction: column;
        gap: 10px;
    }

    .fx-mn .sns .icon img {
        width: 40px;
    }

    .btn-top {
        bottom: 45px;
        width: 40px;
        height: 40px;
    }


}/*E:1024*/

/* 데스크톱에서 메인 네비게이션 표시 */
@media (min-width: 1025px) {
    .main-nav {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
    
    .mobile-nav {
        display: none !important;
    }
}

@media (max-width: 768px) {

    #header{
        background-color: #fff;
    }

    #header .logo{
        background-image: url('../images/common/logo-b.svg');
    }

    .hamburger .line{
        background-color: var(--black);
    }

    .mobile-nav-list{
        background-color: var(--black);
    }

    .header-inner {
        padding: 0 20px;
        height: 60px;
    }
    
    .logo img {
        height: 40px;
    }
    
    header.m-on{
        background-color: #fff;
    }

    .mobile-nav {
        top: 60px;
        height: 100vh;
        background-color: var(--black);
        color: #fff;
    }


    .btn-top::before {
        font-size: 16px;
    }

    .btn-top::after {
        font-size: 12px;
    }
}

/* 포커스 표시 개선 */
/* *:focus {
    outline: 1px solid var(--blue);
    outline-offset: 2px;
} */

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .nav-link,
    .sub-link,
    .mobile-nav-toggle,
    .mobile-nav-link,
    .mobile-sub-link {
        border: 1px solid #000;
    }
}

/* 애니메이션 감소 설정 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}