/* 모바일 퍼스트: pc-menu는 기본 숨김 */
.pc-menu {
    display: none;
    transition: opacity 0.3s ease-in-out; /* 부드러운 전환 효과 */
}

/* 햄버거는 모바일/PC 모두 보이게 */
.hamburger {
    width: 40px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1100;
    position: relative;
}

.hamburger span {
    display: block;
    height: 4px;
    background: #fff; /* 흰색으로 설정 */
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    transform-origin: center;
}

/* 햄버거 → X 애니메이션 */
.hamburger.active span:nth-child(1) {
    transform: translateY(13px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-13px) rotate(-45deg);
}

/* 오버레이 기본 스타일 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* 기본적으로 숨김 */
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

/* 오버레이 활성화 */
.overlay.show {
    visibility: visible;
    opacity: 1;
}

.overlay-content {
    text-align: center;
}

.overlay-content a {
    color: #fff;
    font-size: 40px;
    margin: 15px 0;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.overlay-content a:hover {
    color: #ccc;
}

/* 오버레이가 활성화될 때 PC 메뉴 숨기기 */
.overlay.show ~ header .pc-menu,
body.overlay-active .pc-menu {
    opacity: 0;
    visibility: hidden;
}

/* 모바일 (767px 이하) */
@media (max-width: 767px) {
    .overlay {
        /* 모바일에서는 전체 화면 */
        left: 0;
        width: 100%;
        transform: none;
    }

    .overlay-content a {
        font-size: 40px;
        margin: 20px 0;
    }
}

/* 태블릿 (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .overlay {
        /* 태블릿에서도 전체 화면 */
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        border-left: none;
        transform: none;
        opacity: 0;
        visibility: hidden;
    }

    .overlay.show {
        transform: none;
        visibility: visible;
        opacity: 1;
    }

    .overlay-content a {
        font-size: 40px;
        margin: 18px 0;
    }
}

/* PC (992px 이상) */
@media (min-width: 992px) {
    .pc-menu {
        display: flex;
        gap: 20px;
    }

    .overlay {
        left: 75%; /* 오른쪽 1/4 */
        width: 25%;
        background: rgba(0, 0, 0, 0.95);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateX(100%);
        opacity: 1;
        visibility: hidden;
    }

    .overlay.show {
        transform: translateX(0);
        visibility: visible;
    }

    .overlay-content a {
        font-size: 24px;
        margin: 20px 0;
    }

    /* PC에서 오버레이 활성화 시 PC 메뉴 완전히 숨기기 */
    .overlay.show ~ header .pc-menu,
    body.overlay-active .pc-menu {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}