/* ===========================================
   Applications 이미지 팝업 (갤러리) 공통 스타일
   gallery-popup.js 를 사용하는 제품 페이지에서 공통으로 로드됩니다.
   국/영문별로 다른 .popup-caption 폰트 설정은 각 페이지 CSS에 남아 있습니다.
   =========================================== */

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    display: flex;
    opacity: 1;
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: #f1f5f9;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1005;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: transparent;
    font-size: 0;
    overflow: hidden;
}

.popup-close::before,
.popup-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background-color: #0d4681;
    transition: background-color 0.3s ease;
}

.popup-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.popup-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.popup-close:hover {
    background-color: #0d4681;
    border-color: #0d4681;
    transform: scale(1.08) rotate(90deg);
    box-shadow: 0 6px 16px rgba(13, 70, 129, 0.3);
}

.popup-close:hover::before,
.popup-close:hover::after {
    background-color: #fff;
}

.popup-close:active {
    transform: scale(0.95) rotate(90deg);
}

.popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    z-index: 1002;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.popup-nav:hover {
    background-color: #0d4681;
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.popup-prev {
    left: 10px;
}

.popup-next {
    right: 10px;
}

.popup-image {
    width: 100%;
    height: 70vh;
    object-fit: contain;
    margin-bottom: 15px;
}

/* 모바일 팝업 스타일 조정 */
@media (max-width: 991.98px) {
    .popup-content {
        max-width: 95%;
        padding: 15px;
    }

    .popup-image {
        height: 60vh;
    }

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

    .popup-close::before,
    .popup-close::after {
        width: 14px;
    }
}
