/* ══════════════════════════════════════
   Flipbook — flipbook.css v2.0
   ══════════════════════════════════════ */

.fb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 10, 0.96);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(8px);
}
.fb-overlay.active { display: flex; }

/* ── Barra superior ── */
.fb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 96vw;
    max-width: 1300px;
    padding: 0 4px;
    flex-shrink: 0;
}
.fb-topbar-title {
    color: rgba(255,255,255,.9);
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 600;
}
.fb-close {
    background: none;
    border: 1.5px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.85);
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.fb-close:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }

/* ── Stage ── */
.fb-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 96vw;
    max-width: 1300px;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

/* ── Flechas ── */
.fb-nav {
    background: none;
    border: 1.5px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.8);
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    transition: background .15s, border-color .15s, transform .15s;
}
.fb-nav:hover  { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); transform: scale(1.08); }
.fb-nav:active { transform: scale(.95); }
.fb-nav:disabled { opacity: .18; cursor: default; transform: none !important; }
.fb-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Libro ── */
.fb-book {
    display: flex;
    align-items: stretch;
    position: relative;
    filter: drop-shadow(0 32px 80px rgba(0,0,0,.85));
    flex: 0 0 auto;
    max-width: 1100px;
    overflow: visible;
    z-index: 1;
}

.fb-page-wrap {
    position: relative;
    overflow: visible;
    flex: 0 0 auto;
}
.fb-page-wrap.fb-left  { border-radius: 5px 0 0 5px; }
.fb-page-wrap.fb-right { border-radius: 0 5px 5px 0; }
.fb-page-wrap.fb-left  > canvas { border-radius: 5px 0 0 5px; overflow: hidden; }
.fb-page-wrap.fb-right > canvas { border-radius: 0 5px 5px 0; overflow: hidden; }

.fb-canvas {
    display: block;
    background: #faf7f2;
}

/* Sombra lomo */
.fb-page-wrap.fb-left::after {
    content: '';
    position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
    background: linear-gradient(to left, rgba(0,0,0,.22), transparent);
    pointer-events: none; z-index: 3;
}
.fb-page-wrap.fb-right::before {
    content: '';
    position: absolute; top: 0; left: 0; bottom: 0; width: 40px;
    background: linear-gradient(to right, rgba(0,0,0,.22), transparent);
    pointer-events: none; z-index: 3;
}

/* Lomo */
.fb-spine {
    width: 14px;
    flex-shrink: 0;
    background: linear-gradient(to right, #6a5540, #b89060, #dcc090, #b89060, #6a5540);
    box-shadow: 0 0 18px rgba(0,0,0,.6);
    z-index: 5;
}

/* Canvas de volteo */
.fb-flip-canvas {
    position: absolute;
    top: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: 4px;
}

/* ── Barra inferior ── */
.fb-bottombar {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 96vw;
    max-width: 1300px;
    padding: 0 4px;
    justify-content: center;
    flex-shrink: 0;
}
.fb-page-info {
    color: rgba(255,255,255,.55);
    font-size: 12px;
    font-family: sans-serif;
    min-width: 100px;
    text-align: center;
}

/* Miniaturas */
.fb-thumbs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    max-width: 700px;
    padding: 4px 0 6px;
    scrollbar-width: none;
}
.fb-thumbs::-webkit-scrollbar { display: none; }
.fb-thumb {
    flex-shrink: 0;
    width: 40px; height: 56px;
    border-radius: 3px;
    overflow: visible;
    cursor: pointer;
    opacity: .45;
    transition: opacity .2s, transform .2s;
    border: 2px solid transparent;
    background: #1a1a20;
}
.fb-thumb:hover  { opacity: .8; transform: scale(1.08); }
.fb-thumb.active { opacity: 1; border-color: #c8a96e; transform: scale(1.12); }
.fb-thumb canvas { width: 100%; height: 100%; display: block; }

/* ── Loader ── */
.fb-loader {
    position: absolute;
    inset: 0;
    background: #12121a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-radius: 4px;
    z-index: 20;
}
.fb-loader-ring {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: #c8a96e;
    border-radius: 50%;
    animation: fb-spin .8s linear infinite;
}
@keyframes fb-spin { to { transform: rotate(360deg); } }
.fb-loader p { color: rgba(255,255,255,.45); font-size: 13px; font-family: sans-serif; }

/* ── Botón abrir ── */
.fb-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 28px;
    background: #1a2a3a;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    font-family: Georgia, serif;
    cursor: pointer;
    transition: background .2s, transform .15s;
    text-decoration: none;
}
.fb-open-btn:hover  { background: #243850; transform: translateY(-2px); }
.fb-open-btn:active { transform: translateY(0); }
.fb-open-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Responsive: una sola página en móvil ── */
@media (max-width: 750px) {
    .fb-page-wrap.fb-left { display: none; }
    .fb-spine              { display: none; }
    .fb-page-wrap.fb-right { border-radius: 5px; }
}
