.popup-wrapper {
    position: fixed;
    top: 50%; /* 中央縦位置 */
    right: 30px; /* 右端から30px */
    transform: translateY(-50%); /* 縦方向だけ中央揃え */
    background: transparent;
    z-index: 9999;
}

.popup-border {
    background: rgba(0, 0, 0, 0.5);
    padding: 13px;
    box-sizing: border-box;
    box-shadow: 5px 5px 10px 10px rgba(0, 0, 0, 0.5);
}

.popup {
    background: #fff;
    padding: 18px;
    width: 100%;
    max-width: 550px; 
    box-sizing: border-box;
    border-radius: 0;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.popup-content {
    display: flex;
    align-items: center;
}

.popup-left {
    display: flex;
    justify-content: center;
    flex: 4;
}

.book-cover {
    width: 100%;
    max-width: 160px; 
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
}

.popup-right {
    text-align: center;
    flex: 6;
}

.popup-wrapper h2, .popup-wrapper h3 {
    margin: 15px 0 !important;
    font-weight: bold !important;
}

.popup-wrapper p {
    margin: 10px 0 20px 0;
}

.popup-wrapper h2 {
    font-size: 20px !important;
    color: #C63929; /* 赤字 */
}

.button-container {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 6px 20px;
    background-color: #8E9FAC;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 180px;
    text-align: center;
}

.btn:hover {
    background-color: #476074;
}


@media screen and (max-width: 767px) {
    .popup-wrapper {
        left: 10px;
        right: 10px;
    }
    
    .popup-content {
        margin: 0 auto;
        flex-direction: column; /* 縦並び */
    }
    .popup-left, .popup-right {
        width: 100%;
        min-width: unset;
    }
    
    .popup-right h3, .popup-right p {
        font-size: 14px;
    }
    
    .book-cover {
        width: 80%;
    }
}