#wrap, #header, #container, #footer{
    width: 100%;
    min-width: 320px;
}

#wrap{
    position: relative;
}

#header{
    position: absolute;
    height: 110px;
    top: 0px;
    left: 0;
    z-index: 999;
    padding: 0 40px;
    transition: background 0.05s ease-out;
}

header:has(.gnb li:hover){
    background-color: #fff;
}

header:has(.gnb li:hover) .gnb{
    color: rgb(0, 0, 0);
}

header:has(.gnb li:hover) .logo{
    background: url('/images/logo.png') no-repeat center / contain;
}

.header_wrap{
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1700px;
    margin: 0 auto;
    height: 100%;
}

.logo{
    display: block;
    width: 240px;
    height: 64px;
    margin-top: 15px;
    background: url('/images/logo_w.png') no-repeat center / contain;
}

.logo a{
    display: block;
    width: 100%;
    height: 100%;
}

.gnb{
    height: 100%;
    color: #ffffff;
}

.gnb > ul{
    display: flex;
    margin-right: 50px;
    align-items: center;
    height: 100%;
}

.gnb > ul > li{
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding-right: 10px;
}

.gnb > ul > li > a{
    padding: 0 15px;
    font-size: 1.1rem;
}

.gnb .sub{
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 110px;
    left: -50px;
    color: black;
    font-size: 0.9rem;
    display: flex;
    padding: 20px 0;
    white-space: nowrap;
    gap: 40px;
    align-items: center;
    z-index: 10;
    transition: visibility 0.12s ease-in;
}

header::after{
    content: "";
    position: absolute;
    top: 110px;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #EEEEEE;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.12s ease-in, visibility 0.12s ease-in, transform 0.12s ease-in;
    z-index: 3;
}

.gnb > ul > li:hover .sub{
    opacity: 1;
    visibility: visible;
}

header:has(.gnb > ul > li:hover)::after{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);

}

.gnb > ul > li:hover > a,
.gnb .sub > li > a:hover{
    color: #EE9373;
}

#authLinkArea .sub {
    left: 50%;
    transform: translateX(-50%);
}

.btn_m_menu {
    display: none;
}

/* footer */
#footer{
    background-color: #121212;
    color: #fff;
    padding: 40px 0;
    font-size: 0.9rem;
}

.footer_wrap{
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.f_info li{
    display: flex;
    align-items: center;
    gap: 8px;
}

.f_info em{
    font-style: normal;
    font-weight: 700;
}

.f_copyright p {
    color: #888888;
    font-size: 0.8rem;
}

/* topbotton */
#topBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    width: 45px;
    height: 45px;
    background-color: #333;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s;
}

#topBtn:hover {
    background-color: #0056b3;
}

@media (max-width: 768px) {
    #header {
        height: 80px;
        padding: 0 24px;
    }

    .logo {
        width: 185px;
        height: 50px;
        margin-top: 0;
    }

    /* PC 전용 서브메뉴 배경 바 숨김 */
    header::after {
        display: none !important;
    }

    /* 모바일 햄버거 버튼 노출 */
    .btn_m_menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        z-index: 1001;
    }

    .btn_m_menu span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #ffffff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* 헤더에 호버되거나 메뉴 열렸을 때 버튼 색 변경 */
    header:has(.gnb li:hover) .btn_m_menu span,
    .btn_m_menu.active span {
        background-color: #222222;
    }

    /* 햄버거 버튼 'X' 변환 애니메이션 */
    .btn_m_menu.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .btn_m_menu.active span:nth-child(2) {
        opacity: 0;
    }
    .btn_m_menu.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* 모바일 슬라이드 서브 메뉴 레이어 */
    .gnb {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: -5px 0 15px rgba(0,0,0,0.15);
        padding: 90px 25px 40px;
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
        color: #222222;
    }

    .gnb.active {
        right: 0;
    }

    .gnb > ul {
        flex-direction: column;
        align-items: flex-start;
        margin-right: 0;
        height: auto;
        gap: 20px;
    }

    .gnb > ul > li {
        width: 100%;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding-right: 0;
    }

    .gnb > ul > li > a,
    .gnb > ul > li > a:hover,
    .gnb > ul > li > a:focus {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 6px 0;
        font-size: 1.15rem;
        font-weight: 700;
        color: #222222;
        transition: color 0.2s ease;
    }

    .gnb > ul > li > a::after {
        content: '···';
        font-size: 1.1rem;
        color: #bbbbbb;
        letter-spacing: 2px;
        margin-left: auto;
        transition: color 0.2s ease;
    }

    .gnb > ul > li.active > a,
    .gnb > ul > li.active > a:hover,
    .gnb > ul > li.active > a::after {
        color: #EE9373;
    }

    .gnb .sub {
        display: flex;
        position: static;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 0 0 0 12px;
        width: 100%;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .gnb > ul > li.active > .sub {
        max-height: 300px;
        opacity: 1;
        visibility: visible;
        padding: 10px 0 5px 12px;
    }

    .gnb .sub > li > a {
        font-size: 0.95rem;
        color: #666;
    }

    #authLinkArea .sub {
        left: auto;
        transform: none;
    }

    #topBtn {
        width: 36px;
        height: 36px;
        bottom: 20px;
        right: 15px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #header {
        height: 70px;
        padding: 0 16px;
    }

    .logo {
        width: 155px;
        height: 42px;
    }
}
