/* 갤러리 팝업 스타일 */
.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.popup-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 10001;
}

.popup-nav:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.popup-nav.prev {
    left: 20px;
}

.popup-nav.next {
    right: 20px;
}

.popup-image-container {
    position: relative;
    width: 90%;
    height: 80%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
    -webkit-touch-callout: none;
}

#popup-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.slide-left {
    transform: translateX(-100%);
    opacity: 0;
}

.slide-right {
    transform: translateX(100%);
    opacity: 0;
}

.slide-center {
    transform: translateX(0);
    opacity: 1;
}

.popup-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .popup-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .popup-nav.prev {
        left: 10px;
    }

    .popup-nav.next {
        right: 10px;
    }

    .popup-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }

    .popup-image-container {
        width: 95%;
        height: 75%;
    }

    #popup-image {
        max-width: 100%;
        max-height: 100%;
    }

    .popup-counter {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 14px;
    }
}