.catalogview-viewer {
    text-align: center;
    margin: 30px auto;
    max-width: 1100px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fb-controls {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.fb-prev,
.fb-next,
.fb-zoom-group button,
.fb-fullscreen-toggle {
    margin: 0 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
}

.fb-page {
    font-weight: 600;
    margin: 0 8px;
}

.fb-zoom-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Outer wrapper for zoom scroll */
.fb-book-outer {
    margin: 0 auto;
    max-width: 1100px;
    overflow: hidden;
}

/* Book container */
.fb-book {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1100px;
    background: radial-gradient(circle at center, #f5f5f5 0%, #d3d3d3 60%, #b0b0b0 100%);
    padding: 20px 10px;
    box-shadow: 0 14px 35px rgba(0,0,0,0.35);
    perspective: 1600px;
    border-radius: 8px;
    transform-origin: center top;
}

/* Spine between pages */
.fb-spine {
    width: 8px;
    background: linear-gradient(to right, #b9b9b9, #f0f0f0, #b9b9b9);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.35);
}

/* Left and right page wrappers */
.fb-page-wrap {
    position: relative;
    width: 50%;
    max-width: 540px;
    background: #fafafa;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
    transform-style: preserve-3d;
    z-index: 1;
}

/* Curl overlay */
.fb-page-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: radial-gradient(circle at 50% 50%,
        rgba(255,255,255,0.3) 0%,
        rgba(255,255,255,0.05) 35%,
        rgba(0,0,0,0.45) 100%);
    mix-blend-mode: multiply;
}

/* Curl when flipping forward (right page) */
.fb-page-wrap.fb-curl-next::before {
    opacity: 1;
    background: radial-gradient(circle at 0% 50%,
        rgba(255,255,255,0.5) 0%,
        rgba(255,255,255,0.12) 35%,
        rgba(0,0,0,0.5) 100%);
}

/* Curl when flipping backward (left page) */
.fb-page-wrap.fb-curl-prev::before {
    opacity: 1;
    background: radial-gradient(circle at 100% 50%,
        rgba(255,255,255,0.5) 0%,
        rgba(255,255,255,0.12) 35%,
        rgba(0,0,0,0.5) 100%);
}

.fb-page-left {
    border-right: 1px solid #ccc;
}

.fb-page-right {
    border-left: 1px solid #ccc;
    cursor: pointer;
}

/* Page images */
.fb-image {
    width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    backface-visibility: hidden;
    border-radius: 4px;
}

/* Thumbnails */
.fb-thumbs {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.fb-thumb {
    width: 60px;
    height: auto;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    box-sizing: border-box;
    transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    border-radius: 3px;
}

.fb-thumb:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.fb-thumb-active {
    border-color: #0073aa;
    opacity: 1;
}

/* Mobile: single-page mode */
@media (max-width: 768px) {
    .catalogview-viewer {
        max-width: 100%;
    }

    .fb-book-outer {
        max-width: 100%;
    }

    .fb-book {
        max-width: 100%;
        padding: 10px 5px;
    }

    .fb-page-left,
    .fb-spine {
        display: none;
    }

    .fb-page-right {
        width: 100%;
        max-width: 100%;
        border-left: none;
        cursor: default;
    }

    .fb-page-wrap {
        padding: 8px;
    }

    .fb-thumb {
        width: 48px;
    }
}
