.flipbook-container {
    max-width: 100%;
    margin: 20px auto;
    position: relative;
    padding: 0;
}

.flipbook-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: opacity 0.3s ease-in-out;
    width: 100%;
}

.flipbook-book-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    touch-action: none;
}

.flipbook-book-wrapper.dragging {
    cursor: grabbing !important;
}

.flipbook-click-areas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
}

.flipbook-click-area {
    flex: 1;
    pointer-events: auto;
    cursor: pointer;
}

.flipbook-click-prev {
    cursor: w-resize;
}

.flipbook-click-next {
    cursor: e-resize;
}

.flipbook {
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform-origin: center center;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 5;
}

.flipbook .flipbook-page {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flipbook .flipbook-page img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.flipbook-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    margin: 0 10px;
}

.flipbook-control-btn {
    background: #0073aa;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    flex-shrink: 0;
}

.flipbook-control-btn:hover {
    background: #005177;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.flipbook-control-btn:active {
    transform: scale(0.95);
}

.flipbook-control-btn svg {
    display: block;
}

.flipbook-page-info {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    padding: 0 10px;
}

.flipbook-zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flipbook-zoom-level {
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
    min-width: 50px;
    text-align: center;
}

.flipbook-divider {
    width: 1px;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
}

.flipbook-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pantalla completa */
.flipbook-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 5px !important;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    flex-direction: column;
}

.flipbook-fullscreen .flipbook-wrapper {
    flex: 1;
    margin-bottom: 0;
    padding: 5px;
    overflow: hidden;
}

.flipbook-fullscreen .flipbook-controls {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0;
    position: relative;
    z-index: 100;
}

.flipbook-fullscreen .flipbook-page-info {
    color: white;
}

.flipbook-fullscreen .flipbook-zoom-level {
    color: white;
}

.flipbook-fullscreen .flipbook-divider {
    background: rgba(255, 255, 255, 0.2);
}

/* Móvil */
@media (max-width: 767px) {
    .flipbook-controls {
        gap: 8px;
        padding: 12px 8px;
    }
    
    .flipbook-control-btn {
        width: 35px;
        height: 35px;
    }
    
    .flipbook-control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .flipbook-page-info {
        font-size: 14px;
        padding: 0 5px;
    }
    
    .flipbook-zoom-level {
        font-size: 12px;
        min-width: 45px;
    }
    
    .flipbook-zoom-controls {
        gap: 6px;
    }
    
    .flipbook-divider {
        height: 25px;
    }
}

/* Escritorio */
@media (min-width: 768px) {
    .flipbook-controls {
        gap: 20px;
        padding: 15px;
    }
}