.book-ad {
    position: fixed;
    bottom: 20px;
    left: 50%;
    width: min(340px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 16px;
    background: white;
    color: #222;
    border-radius: 14px;
    box-shadow: 0 6px 30px rgba(0,0,0,.2);
    z-index: 9999;

    transform: translate(-50%, calc(100% + 40px));
    opacity: 0;
    visibility: hidden;

    transition: transform .5s ease,
                opacity .5s ease,
                visibility .5s ease;
}

.book-ad[hidden] {
    display: none !important;
}

.book-ad.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.book-ad-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.book-ad-image {
    width: 115px;
    height: 145px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.book-ad-info {
    flex: 1;
    min-width: 0;
}

.book-ad-info p {
    font-size: 13px;
    margin: 8px 0;
}

.book-ad-button {
    display: inline-block;
    padding: 8px 12px;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    font-size: 13px;
}

#close-book-ad {
    position: absolute;
    top: 4px;
    right: 8px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .book-ad {
        transition: none;
    }
}