/* ===== 구매 전 확인사항 모달 ===== */
#PayPurposePopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 10000;
}
#PayPurposePopup .popup_inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 600px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    padding: 40px 36px 32px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: payPopupUp .28s ease;
}
@keyframes payPopupUp {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 16px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
#PayPurposePopup h4 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}
#PayPurposePopup .popup_desc {
    font-size: 16px;
    color: #666;
    margin-bottom: 16px;
}

/* 구매 목적: 카드형 2열 그리드 */
#PayPurposePopup .purpose_list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
#PayPurposePopup .purpose_item {
    cursor: pointer;
}
#PayPurposePopup .purpose_item input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
#PayPurposePopup .purpose_item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #444;
    text-align: center;
    line-height: 1.4;
    transition: border-color .15s, background .15s, color .15s;
}
#PayPurposePopup .purpose_item:hover span {
    border-color: #9db8ff;
}
#PayPurposePopup .purpose_item input:checked + span {
    border-color: #2D67FF;
    background: #f0f4ff;
    color: #2D67FF;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #2D67FF;
}
#PayPurposePopup .purpose_item input:focus-visible + span {
    outline: 2px solid #2D67FF;
    outline-offset: 2px;
}

/* 약관 박스 */
#PayPurposePopup .agree_box {
    background: #f8f9fa;
    border: 1px solid #eef0f3;
    padding: 18px 20px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    height: 150px;
    overflow-y: auto;
    margin-bottom: 16px;
}
#PayPurposePopup .agree_box p + p {
    margin-top: 10px;
}

/* 동의 체크박스 강조 영역 */
#PayPurposePopup .final_agree_box {
    background: #f0f4ff;
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 24px;
}
#PayPurposePopup .final_agree_box label {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
}

/* 버튼 */
#PayPurposePopup .popup_btn_box {
    display: flex;
    gap: 12px;
}
#PayPurposePopup .popup_btn_box button {
    flex: 1;
    height: 56px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
#PayPurposePopup .btn_cancel {
    background: #f1f3f5;
    color: #555;
}
#PayPurposePopup .btn_cancel:hover {
    background: #e6e8eb;
}
#PayPurposePopup .btn_confirm {
    flex: 1.6;
    background: #2D67FF;
    color: #fff;
}
#PayPurposePopup .btn_confirm:hover {
    background: #1e55e8;
}

/* 장바구니 테이블 (모달 아님) */
.analysis_info {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    font-weight: normal;
}

/* ===== 모바일 ===== */
@media screen and (max-width: 767px) {
    #PayPurposePopup .popup_inner {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }
    #PayPurposePopup h4 {
        font-size: 20px;
    }
    #PayPurposePopup .popup_desc {
        font-size: 15px;
    }
    #PayPurposePopup .purpose_item span {
        min-height: 48px;
        font-size: 15px;
    }
    #PayPurposePopup .agree_box {
        height: 120px;
        font-size: 14px;
        padding: 14px 16px;
    }
    #PayPurposePopup .final_agree_box label {
        font-size: 15px;
    }
    #PayPurposePopup .popup_btn_box button {
        height: 50px;
        font-size: 16px;
    }
}
