/* ============================
   Viewer Global Styles
   ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
body { background: var(--bg); color: var(--texto); }

/* Screen reader only */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================
   Top Bar
   ============================ */
.viewer-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 52px;
    background: var(--bg-barra);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.topbar-left, .topbar-center, .topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-left { min-width: 180px; }
.topbar-right { min-width: 180px; justify-content: flex-end; }

.topbar-title {
    font-size: 0.88rem; font-weight: 600; opacity: 0.85; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 200px; letter-spacing: -0.3px;
}

.topbar-btn {
    background: none; border: none; color: var(--texto-2); cursor: pointer;
    padding: 8px; border-radius: 8px; min-width: 36px; min-height: 36px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; text-decoration: none;
}
.topbar-btn svg { stroke-linecap: round; stroke-linejoin: round; }
.topbar-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.topbar-btn.active { background: var(--verde-sutil); color: var(--verde-claro); }

.topbar-separator {
    width: 1px; height: 20px; background: rgba(255,255,255,0.08); margin: 0 2px;
}

/* Page indicator */
.page-indicator {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; color: var(--texto-3); font-weight: 500;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    padding: 4px 8px; border-radius: 8px;
}

.page-indicator input {
    width: 3.2em; text-align: center;
    background: transparent; border: none;
    color: #fff; padding: 0; font-size: 0.88rem; font-weight: 700;
    font-family: inherit;
    -moz-appearance: textfield; outline: none;
}
.page-indicator input:focus { color: var(--verde-claro); }
.page-indicator input::-webkit-outer-spin-button,
.page-indicator input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================
   Thumbnail Panel
   ============================ */
.thumbs-panel {
    position: fixed; top: 52px; left: 0; bottom: 0; width: 200px; z-index: 90;
    background: var(--bg-panel); backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255,255,255,0.06);
    transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto; overscroll-behavior: contain;
}
.thumbs-panel::-webkit-scrollbar { width: 4px; }
.thumbs-panel::-webkit-scrollbar-track { background: transparent; }
.thumbs-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.thumbs-panel.open { transform: translateX(0); }

.thumbs-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 12px; font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--texto-3);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky; top: 0; background: var(--bg-panel); z-index: 1;
}

.thumbs-grid { padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.thumb-item {
    display: block; width: 100%; padding: 0; background: none; font: inherit; color: inherit; text-align: left;
    cursor: pointer; border-radius: 8px; overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.25s; position: relative;
    opacity: 0.7;
}
.thumb-item:hover { border-color: rgba(255,255,255,0.2); opacity: 1; }
.thumb-item.active { border-color: var(--verde-claro); opacity: 1; box-shadow: 0 0 16px rgb(var(--pri-claro-rgb) / 0.25); }
.thumb-item img { width: 100%; height: auto; display: block; }
.thumb-item .thumb-num {
    position: absolute; bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    color: #fff; font-size: 0.68rem; font-weight: 700;
    padding: 2px 7px; border-radius: 4px;
}

/* ============================
   Main Viewer Area
   ============================ */
.viewer-main {
    position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--bg-radial);
}
.viewer-main.shifted { left: 200px; }

.flipbook-container {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; padding: 24px;
}

/* StPageFlip overrides */
.stf__parent { margin: 0 auto !important; }
.stf__wrapper {
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}
.stf__block { filter: drop-shadow(0 10px 28px rgba(0,0,0,0.5)); }
/* Centrado de tapa/contratapa (translateX desde viewer.js) */
#flipbook { transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.flipbook-container { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

.page-content {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--bg-2); overflow: hidden; position: relative;
}
.page-content img {
    width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none;
}
.page-content.has-link { cursor: pointer; }
.page-link-icon {
    position: absolute; bottom: 10px; right: 10px;
    background: rgb(var(--pri-rgb) / 0.92); backdrop-filter: blur(4px);
    color: #fff; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    pointer-events: none; box-shadow: 0 2px 8px rgb(var(--pri-rgb) / 0.45);
}

/* ============================
   Page Loading Skeleton
   ============================ */
.page-content.page-loading {
    background: #e8e8e8;
}
.page-content.page-loading::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.page-content.page-loading img { opacity: 0; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================
   Page Error State
   ============================ */
.page-content.page-error {
    background: #f0f0f0;
}
.page-error-content {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; color: #888; text-align: center; padding: 20px;
}
.page-error-content svg { color: #bbb; }
.page-error-content span { font-size: 0.78rem; font-weight: 500; }
.retry-btn {
    background: var(--verde); color: #fff; border: none; padding: 6px 16px;
    border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background 0.2s;
}
.retry-btn:hover { background: var(--verde-2); }

/* ============================
   Navigation Arrows (floating)
   ============================ */
.nav-arrow {
    position: fixed; top: 50%; transform: translateY(-50%);
    z-index: 50; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--texto-2); cursor: pointer;
    width: 44px; height: 72px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s; backdrop-filter: blur(8px);
}
.nav-arrow:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.12); }
.nav-arrow svg { stroke-linecap: round; stroke-linejoin: round; }
.nav-arrow-left { left: 12px; }
.nav-arrow-right { right: 12px; }

/* ============================
   Progress Bar
   ============================ */
.progress-bar-container {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
    height: 3px; background: rgba(255,255,255,0.04);
}
.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--verde), var(--verde-claro));
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 0 2px 2px 0;
}

/* ============================
   Loader
   ============================ */
.loader {
    text-align: center; color: var(--texto-2);
}
.loader p { font-size: 0.88rem; font-weight: 500; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.06);
    border-top-color: var(--verde-claro);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================
   Zoom en el mismo lugar (stage sobre #viewerMain)
   ============================ */
.zoom-stage {
    position: fixed; z-index: 200; overflow: hidden; display: none;
    cursor: zoom-out; touch-action: none; user-select: none; -webkit-user-select: none;
}
.zoom-stage.active { display: block; }
.zoom-stage.is-dragging { cursor: grabbing; }
.zoom-stage:focus { outline: none; }
.zoom-stage__inner {
    position: absolute; display: flex; transform-origin: 0 0; will-change: transform;
}
.zoom-stage__inner.anim { transition: transform .3s ease; }
.zoom-stage__inner img {
    flex: 1 1 0; min-width: 0; height: 100%; object-fit: contain;
    pointer-events: none; user-select: none; -webkit-user-drag: none;
}
@media (hover: hover) and (pointer: fine) {
    #flipbook .page-content:not([data-link]) { cursor: zoom-in; }
}

.zoom-close {
    position: fixed; top: 16px; right: 16px; z-index: 210;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; width: 40px; height: 40px; border-radius: 10px;
    display: none; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s; backdrop-filter: blur(8px);
}
.zoom-close:hover { background: rgba(255,255,255,0.2); }

/* Zoom controls bar */
.zoom-controls {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 210; display: none; align-items: center; gap: 6px;
    background: var(--bg-flotante); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 10px; border-radius: 14px;
}
.zoom-controls .zoom-ctrl-btn {
    background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer;
    padding: 6px 8px; border-radius: 8px; display: flex; align-items: center;
    justify-content: center; transition: all 0.2s; font-family: inherit;
}
.zoom-controls .zoom-ctrl-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.zoom-controls .zoom-ctrl-btn svg { stroke-linecap: round; stroke-linejoin: round; }
.zoom-controls .zoom-page-num {
    font-size: 0.78rem; font-weight: 600; color: var(--texto-2);
    padding: 0 6px; min-width: 50px; text-align: center;
}
.zoom-controls .zoom-level-text {
    font-size: 0.7rem; font-weight: 600; color: var(--texto-3);
    padding: 0 4px;
}
.zoom-controls .zoom-separator {
    width: 1px; height: 18px; background: rgba(255,255,255,0.1);
}

/* ============================
   Toast
   ============================ */
.toast-msg {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
    background: var(--bg-flotante); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff; padding: 12px 24px; border-radius: 12px;
    font-size: 0.85rem; font-weight: 500;
    opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); z-index: 300;
    display: flex; align-items: center; gap: 8px;
}
.toast-msg svg { width: 16px; height: 16px; color: var(--pri-claro); stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================
   Fullscreen Mode (CSS-only on mobile, API on desktop)
   ============================ */
body.is-fullscreen,
body.is-fullscreen html {
    background: var(--bg) !important;
}
body.is-fullscreen .viewer-topbar {
    display: none !important;
}
body.is-fullscreen .viewer-main {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9998 !important;
    background: var(--bg-radial) !important;
}
body.is-fullscreen .thumbs-panel {
    display: none !important;
}
body.is-fullscreen .progress-bar-container {
    display: none !important;
}
body.is-fullscreen .nav-arrow {
    display: none !important;
}
body.is-fullscreen .flipbook-container {
    padding: 8px !important;
    width: 100% !important;
    height: 100% !important;
}
/* Fullscreen exit button */
.fullscreen-exit {
    position: fixed; top: 12px; right: 12px; z-index: 9999;
    background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; width: 44px; height: 44px; border-radius: 12px;
    display: none; align-items: center; justify-content: center;
    cursor: pointer; backdrop-filter: blur(8px);
}
.fullscreen-exit:hover { background: rgba(0,0,0,0.9); }
body.is-fullscreen .fullscreen-exit {
    display: flex !important;
}

/* ============================
   Swipe Hint Overlay (mobile first visit)
   ============================ */
.swipe-hint {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 150;
    background: rgba(0,0,0,0.6); display: none;
    align-items: center; justify-content: center; flex-direction: column; gap: 16px;
    backdrop-filter: blur(2px);
    opacity: 0; transition: opacity 0.4s;
}
.swipe-hint.show { display: flex; opacity: 1; }
.swipe-hint-hand {
    font-size: 48px; animation: swipeAnim 1.5s ease-in-out infinite;
}
.swipe-hint-text {
    font-size: 0.92rem; font-weight: 500; color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.5); padding: 8px 20px; border-radius: 10px;
}
@keyframes swipeAnim {
    0%, 100% { transform: translateX(20px); opacity: 0.4; }
    50% { transform: translateX(-20px); opacity: 1; }
}

/* ============================
   Reading Time Indicator
   ============================ */
.reading-time {
    position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
    z-index: 95; background: var(--bg-flotante); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--texto-2); padding: 6px 16px; border-radius: 8px;
    font-size: 0.75rem; font-weight: 500;
    opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.reading-time.show { opacity: 1; }

/* ============================
   Embed Mode Page Indicator
   ============================ */
.embed-page-indicator {
    position: fixed; bottom: 12px; right: 12px; z-index: 80;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.7); padding: 4px 10px; border-radius: 6px;
    font-size: 0.72rem; font-weight: 600;
    pointer-events: none;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 767px) {
    .viewer-topbar { height: 44px; padding: 0 8px; }
    .viewer-main { top: 44px; }
    .topbar-title { max-width: 80px; font-size: 0.78rem; }
    .topbar-left { min-width: auto; gap: 4px; }
    .topbar-right { min-width: auto; gap: 2px; }
    .topbar-btn { padding: 6px; }
    .topbar-btn svg { width: 18px; height: 18px; }
    .thumbs-panel { top: 44px; }
    .flipbook-container { padding: 4px; }
    .topbar-center { gap: 2px; }
    .nav-arrow { display: none; }
    .topbar-separator { display: none; }
    .page-indicator { padding: 3px 6px; font-size: 0.78rem; }
    .page-indicator input { width: 28px; font-size: 0.82rem; }
    .progress-bar-container { height: 2px; }
    .reading-time { top: 54px; }
    .stf__wrapper { touch-action: pan-y pinch-zoom; }
}

@media (max-width: 480px) {
    .topbar-title { display: none; }
    .topbar-right #btnShare { padding: 4px; }
    .topbar-right #btnZoom { padding: 4px; }
    .viewer-topbar { height: 40px; }
    .viewer-main { top: 40px; }
    .flipbook-container { padding: 2px; }
    .thumbs-panel { top: 40px; }
    .reading-time { top: 50px; }
}



/* ============================
   Logo en la barra superior
   ============================ */
.topbar-logo { display: block; height: 22px; width: auto; max-width: 110px; object-fit: contain; }
.topbar-logo-pill { padding: 4px 8px; border-radius: 10px; margin-right: 4px; }
.topbar-logo-link { display: flex; align-items: center; text-decoration: none; border-radius: 10px; }

/* ============================
   Flechas laterales deshabilitadas (primera/ultima pagina)
   ============================ */
.nav-arrow[disabled] { opacity: 0; pointer-events: none; }
.topbar-btn[disabled], .mobile-bar button[disabled] { opacity: 0.3; pointer-events: none; }

/* ============================
   Miniaturas: fondo para cerrar (mobile)
   ============================ */
.thumbs-backdrop {
    position: fixed; inset: 0; z-index: 89; background: rgba(0,0,0,0.55);
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}

/* ============================
   Barra inferior mobile
   ============================ */
.mobile-bar { display: none; }

@media (max-width: 767px) {
    .topbar-center, #btnThumbs, #btnZoom, #btnAutoPlay, #btnFullscreen { display: none !important; }
    .topbar-logo { height: 20px; max-width: 90px; }
    .topbar-title { max-width: none; flex: 1; min-width: 0; }
    .topbar-left { flex: 1; min-width: 0; }

    .mobile-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 85;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding: 0 8px env(safe-area-inset-bottom, 0px);
        display: flex; align-items: center; justify-content: space-between; gap: 4px;
        background: var(--bg-barra); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--borde);
    }
    .mobile-bar .mb-btn {
        min-width: 48px; min-height: 48px; border-radius: 12px;
        background: none; border: none; color: var(--texto-2); cursor: pointer;
        display: flex; align-items: center; justify-content: center;
    }
    .mobile-bar .mb-btn svg { width: 22px; height: 22px; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-bar .mb-btn.active { background: var(--verde-sutil); color: var(--verde-claro); }
    .mobile-bar .mb-nav { display: flex; align-items: center; gap: 2px; }
    .mobile-bar .page-indicator { font-size: 0.9rem; padding: 6px 10px; }
    .mobile-bar .page-indicator input { font-size: 0.95rem; width: 2.4em; }

    .viewer-main { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
    .progress-bar-container { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
    .thumbs-panel { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); width: 160px; }
    .viewer-main.shifted { left: 0; }
    .thumbs-panel.open ~ .thumbs-backdrop { opacity: 1; pointer-events: auto; }
    .toast-msg { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    .zoom-controls { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

    /* Zonas de toque grandes en los bordes para pasar de pagina */
    .tap-zone {
        position: absolute; top: 0; bottom: 0; width: 18%; z-index: 5;
        background: none; border: none; padding: 0; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .tap-zone.tap-prev { left: 0; }
    .tap-zone.tap-next { right: 0; }
}
@media (min-width: 768px) { .tap-zone { display: none; } }

body.is-fullscreen .mobile-bar, body.is-fullscreen .tap-zone { display: none !important; }

/* ============================
   Boton fijo "Hace tu pedido" (WhatsApp)
   ============================ */
.wa-fab {
    position: fixed; right: 20px; bottom: 24px; z-index: 95;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 18px; border-radius: 999px;
    background: var(--verde-grad); color: #fff; text-decoration: none;
    font-size: 0.88rem; font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35), 0 0 0 1px rgb(var(--pri-claro-rgb) / 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.45), 0 0 0 1px rgb(var(--pri-claro-rgb) / 0.6); }
.wa-fab svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================
   Menu de compartir
   ============================ */
.share-menu {
    position: fixed; z-index: 150; min-width: 200px; padding: 6px;
    background: var(--bg-panel); border: 1px solid var(--borde); border-radius: var(--radio);
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.share-menu[hidden] { display: none; }
.share-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border: none; border-radius: 8px; background: none;
    color: var(--texto); font: inherit; font-size: 0.88rem; text-align: left; text-decoration: none; cursor: pointer;
}
.share-item:hover, .share-item:focus-visible { background: var(--verde-sutil); }
.share-item svg { width: 18px; height: 18px; color: var(--verde-claro); stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ============================
   Aviso "Continuar desde la pagina X"
   ============================ */
.resume-card {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 96;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
    max-width: calc(100vw - 32px); padding: 12px 14px 12px 18px;
    background: var(--bg-flotante); backdrop-filter: blur(10px);
    border: 1px solid var(--verde-borde); border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    font-size: 0.88rem; color: var(--texto);
}
.resume-card[hidden] { display: none; }
.resume-card strong { color: var(--verde-claro); }
.resume-actions { display: flex; gap: 8px; }
.resume-btn {
    white-space: nowrap;
    padding: 8px 14px; border-radius: 10px; border: 1px solid var(--borde);
    background: rgba(255,255,255,0.05); color: var(--texto); font: inherit; font-weight: 600; font-size: 0.82rem; cursor: pointer;
}
.resume-btn:hover { background: rgba(255,255,255,0.1); }
.resume-primary { background: var(--verde-grad); border-color: transparent; }
.resume-primary:hover { background: var(--verde-grad); filter: brightness(1.1); }

@media (max-width: 767px) {
    .wa-fab {
        right: 12px; bottom: calc(56px + 14px + env(safe-area-inset-bottom, 0px));
        width: 52px; height: 52px; padding: 0; justify-content: center;
    }
    .wa-fab svg { width: 26px; height: 26px; }
    /* En mobile solo el icono; el texto queda para lectores de pantalla */
    .wa-fab .wa-fab-text {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
    }
    .resume-card {
        bottom: calc(56px + 14px + env(safe-area-inset-bottom, 0px));
        left: 12px; right: 76px; transform: none; max-width: none;   /* deja lugar al boton de WhatsApp */
        justify-content: flex-start; gap: 10px; padding: 12px;
    }
}
body.is-fullscreen .wa-fab, body.is-fullscreen .resume-card { display: none !important; }

/* ============================
   Capa sobre la imagen de cada página (la usan módulos como los íconos de productos).
   viewer.js la ubica en % sobre el rectángulo real de la imagen (object-fit: contain).
   ============================ */
.page-capa { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.page-capa > * { pointer-events: auto; }
.zoom-pag { flex: 1 1 0; min-width: 0; height: 100%; position: relative; }
.zoom-pag img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.zoom-pag .page-capa { pointer-events: none; }
