/* ========== FLIPBOOK (PDF) ========== */
.flipbook {
    position: relative;
    background: rgba(15, 15, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 24px;
    outline: none;
}
.flipbook.is-fullscreen {
    border-radius: 0;
    border: none;
    padding: 16px;
    background: var(--dark, #09090B);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flipbook-stage {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flipbook-book-wrap {
    width: 100%;
    margin: 0 auto;
}
.flipbook:not(.is-ready) .flipbook-book-wrap { visibility: hidden; }

.flipbook-page {
    background: #fff;
    overflow: hidden;
}
.flipbook-page canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.flipbook-page:not(.is-rendered) {
    background: #f3f3f3 linear-gradient(90deg, #f3f3f3 0%, #e9e9e9 50%, #f3f3f3 100%);
}
.flipbook.is-single .flipbook-page {
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.flipbook-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--gray, #8B949E);
    font-size: 0.95rem;
    text-align: center;
    padding: 0 16px;
}
.flipbook.is-ready .flipbook-status { display: none; }
.flipbook.is-error .flipbook-status i { display: none; }

.flipbook-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.flipbook-toolbar .flipbook-spacer { flex: 1; }
.flipbook-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--light, #F0F6FC);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.flipbook-btn:hover:not(:disabled) {
    border-color: var(--fire-red, #DC2626);
    color: var(--white, #fff);
    background: rgba(220, 38, 38, 0.12);
}
.flipbook-btn:disabled { opacity: 0.35; cursor: default; }
.flipbook-counter {
    min-width: 90px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--gray, #8B949E);
    font-size: 0.9rem;
}
.flipbook.is-error .flipbook-toolbar [data-flip],
.flipbook.is-error .flipbook-counter { display: none; }

/* Setas laterais sobre o livro (desktop) */
.flipbook-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(9, 9, 11, 0.7);
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
}
.flipbook-nav:hover:not(:disabled) { background: var(--fire-red, #DC2626); }
.flipbook-nav:disabled { opacity: 0; pointer-events: none; }
.flipbook-nav.flipbook-prev { left: 0; }
.flipbook-nav.flipbook-next { right: 0; }
.flipbook.is-ready:not(.is-single) .flipbook-nav { display: flex; }

@media (max-width: 768px) {
    .flipbook { padding: 12px; border-radius: 14px; }
    .flipbook-nav { display: none !important; }
    .flipbook-btn .flipbook-btn-label { display: none; }
}

/* Estilos base da biblioteca StPageFlip */
.stf__parent { position: relative; display: block; box-sizing: border-box; transform: translateZ(0); touch-action: pan-y; }
.stf__wrapper { position: relative; width: 100%; box-sizing: border-box; }
.stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2000px; }
.stf__item { display: none; position: absolute; transform-style: preserve-3d; }
.stf__outerShadow, .stf__innerShadow, .stf__hardShadow, .stf__hardInnerShadow { position: absolute; left: 0; top: 0; }

/* Lista de catálogos */
.flipbook-card-cover {
    height: 260px;
}
.flipbook-card-cover img {
    object-fit: contain !important;
    padding: 16px;
}
