/* 1. 팝업 전체를 감싸는 컨테이너 (배경 어둡게 처리 및 정렬) */
.popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 배경 반투명 검정 */
    z-index: 9999;
    display: none; /* JS로 제어하기 위해 초기엔 숨김 */

    /* PC 기본: 가로 정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* 팝업 사이 간격 */
}

/* 2. 개별 팝업 스타일 */
.popup-item {
    background: #fff;
    width: 400px;
    max-width: 90vw; /* 모바일에서 화면 넘침 방지 */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 3. 이미지 영역 */
.popup-link {
    display: block;
    line-height: 0; /* 이미지 하단 여백 제거 */
}
.popup-img {
    width: 100%;
    height: auto;
    display: block;
}

/* 4. 버튼 영역 (자세히 보러가기) */
.popup-btn-area {
    padding: 10px;
    text-align: center;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}
.view-detail-btn {
    display: inline-block;
    background-color: #333; /* 버튼 색상 */
    color: #fff;
    text-decoration: none;
    padding: 10px 30px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s;
}
.view-detail-btn:hover {
    background-color: #555;
}

/* 5. 하단 옵션 영역 (하루닫기, 닫기) */
.popup-footer {
    padding: 10px 15px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #666;
}
.popup-footer label {
    cursor: pointer;
    display: flex;
    align-items: center;
}
.popup-footer input {
    margin-right: 5px;
}
.close-btn {
    cursor: pointer;
    font-weight: bold;
    color: #333;
    border: 1px solid #ccc;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 6. 모바일 반응형 처리 (화면 폭 768px 이하) */
@media screen and (max-width: 768px) {
    .popup-wrapper {
        /* 모바일에서는 겹쳐야 하므로 정렬 방식 유지하되 겹침 처리 */
    }
    .popup-item {
        /* 모바일에서는 팝업들이 제자리에서 겹침 (절대 위치) */
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85vw; /* 모바일 너비 조정 */
    }
}