/* 파일: frontend-style.css */

/* 팝업 오버레이 */
.bpm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
}

/* body 스크롤 잠금 */
body.bpm-lock-scroll {
    overflow: hidden;
}

.bpm-popup-overlay.active {
    display: block;
}

/* 팝업 래퍼 - 초기 숨김 */
.bpm-popup-wrapper {
    position: fixed;
    z-index: 999999 !important;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0s 0.3s;
    
    /* 기본값: 너비는 JS로 설정, 높이는 auto */
    height: auto;
    min-width: 250px;
}

/* 초기 로딩 시 완전 숨김 (쿠키 있을 경우) */
.bpm-popup-wrapper.bpm-popup-hidden {
    display: none !important;
}

.bpm-popup-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0s 0s;
}

/* 팝업 내용 */
.bpm-popup-content img {
    display: block;
    background: white;
    width: 100%;
    height: auto;
}

/* 닫기 버튼 */
.bpm-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, color 0.2s;
}

.bpm-close-btn:hover {
    background: #fff;
    color: #333;
}

/* 오늘 하루 보지 않기 */
.bpm-popup-footer {
    padding: 10px;
    background: transparent;
    text-align: right;
    font-size: 14px;
    border-top: 1px solid #eee;
}

.bpm-today-close {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bpm-today-check {
    margin: 0;
}

/* PC 위치 설정 */
.bpm-pos-pc-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
}

.bpm-pos-pc-center.active {
    transform: translate(-50%, -50%) scale(1);
}

.bpm-pos-pc-top-left {
    top: 20px;
    left: 20px;
}

.bpm-pos-pc-top-right {
    top: 20px;
    right: 20px;
}

.bpm-pos-pc-bottom-left {
    bottom: 20px;
    left: 20px;
}

.bpm-pos-pc-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* assets/frontend-style.css 파일 내에 추가 */

.bpm-slide-popup {
    /* 팝업 위치 및 크기 설정은 그대로 유지 */
    
    /* 🚨 중요: JS가 로드되기 전까지 팝업을 완전히 숨김 */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; /* 부드러운 전환을 위해 */
}

/* JS가 'active' 클래스를 추가하면 보이게 됨 */
.bpm-slide-popup.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important; /* jQuery fadeIn/fadeOut을 위해 필요 */
}

/* bpm-popup-wrapper의 기본 상태를 설정 (슬라이드 모드가 아닌 경우) */
.bpm-popup-wrapper:not(.bpm-slide-popup) {
    display: none; /* 표준 팝업은 기본적으로 display: none 상태로 대기 */
}
.bpm-popup-wrapper:not(.bpm-slide-popup).active {
    background: transparent;
    display: block;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .bpm-popup-wrapper {
        /* 너비는 JS에서 data-mobile-width 기반으로 설정 */
        max-height: 80vh;
    }
    
    /* 모바일 위치 */
    .bpm-pos-mobile-center {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(0.9);
    }
    
    .bpm-pos-mobile-center.active {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .bpm-pos-mobile-top {
        top: 20px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) scale(0.9);
    }
    
    .bpm-pos-mobile-top.active {
        transform: translateX(-50%) scale(1);
    }
    
    .bpm-pos-mobile-bottom {
        top: auto !important;
        left: 50% !important;
        right: auto !important;
        bottom: 20px !important;
        transform: translateX(-50%) scale(0.9);
    }
    
    .bpm-pos-mobile-bottom.active {
        transform: translateX(-50%) scale(1);
    }

    /* 닫기 버튼 모바일 크기 조정 */
    .bpm-close-btn {
        width: 25px;
        height: 25px;
        line-height: 23px;
        font-size: 18px;
    }
}