.klem-pdf-flipbook {
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.klem-flipbook-stage {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    background: transparent !important;
}

/* Pagine DOM: nessun bordo, colore, ombra o dorso aggiunto. */
.klem-flipbook-page,
.klem-pdf-flipbook .stf__item,
.klem-pdf-flipbook .stf__parent,
.klem-pdf-flipbook .stf__block {
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.klem-flipbook-page {
    overflow: hidden;
}

.klem-flipbook-page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #fff;
    image-rendering: auto;
    -webkit-user-drag: none;
    user-select: none;
}

/* PageFlip crea questi nodi anche quando le ombre sono disattivate: li rendiamo
   totalmente invisibili per evitare qualsiasi banda residua. */
.klem-pdf-flipbook .stf__outerShadow,
.klem-pdf-flipbook .stf__innerShadow,
.klem-pdf-flipbook .stf__hardShadow,
.klem-pdf-flipbook .stf__hardInnerShadow {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.klem-pdf-flipbook .klem-flipbook-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 420px;
    color: #555;
    font-size: 15px;
}

.klem-flipbook-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #eee;
    border-top-color: #D7006C;
    animation: klem-flipbook-spin .9s linear infinite;
}

@keyframes klem-flipbook-spin { to { transform: rotate(360deg); } }

.klem-flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}

.klem-flipbook-controls button {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #D7006C;
    border-radius: 50%;
    background: #fff;
    color: #D7006C;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}

.klem-flipbook-controls button:disabled {
    opacity: .28;
    cursor: default;
}

.klem-flip-pagenum {
    min-width: 58px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.klem-flip-download { display: none !important; }

.klem-flipbook-error {
    padding: 30px 15px;
    text-align: center;
}

@media (max-width: 767px) {
    .klem-pdf-flipbook,
    .klem-flipbook-stage {
        width: 100%;
        max-width: 100%;
    }

    .klem-pdf-flipbook {
        overflow: hidden;
    }

    .klem-flip-prev,
    .klem-flip-next {
        display: none !important;
    }

    .klem-flipbook-controls {
        margin-top: 8px;
        gap: 0;
    }

    .klem-flip-pagenum {
        min-width: 0;
    }
}
