/* ===========================
    FLIPBOOK BACKGROUNDS
    =========================== */
    #book .fb-page {
        background-size: cover !important;
        background-position: center !important;  
    }
    #book .fb-page:nth-child(1) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/1.jpg'); }
    #book .fb-page:nth-child(2) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/2.jpg'); }
    #book .fb-page:nth-child(3) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/3.jpg'); }
    #book .fb-page:nth-child(4) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/4.jpg'); }
    #book .fb-page:nth-child(5) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/5.jpg'); }
    #book .fb-page:nth-child(6) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/6.jpg'); }
    #book .fb-page:nth-child(7) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/7.jpg'); }
    #book .fb-page:nth-child(8) { background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/8.jpg'); }

    /* ===========================
    GENERAL
    =========================== */
    body {
        margin: 0;
        background-color: #f5f5f5;
        background-image: url('https://tildeazul.com.ar/flipbooks/mijares/eng/img/pattern.png'); /* tu tile */
        background-repeat: repeat;
        background-size: auto;
        height: 100vh;
        overflow: hidden;
    }

    /* ===========================
    TOOLBAR
    =========================== */
    .fb-toolbar {
        position: absolute;
        top: 20px;
        right: 20px;
        display: flex;
        gap: 8px;
        background: rgba(255,255,255,0.8);
        padding: 6px 8px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .fb-toolbar button {
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 4px;
        color: #434343;
        font-size: 18px;
    }
    .fb-toolbar button:hover {
        opacity: 0.8;
    }

    @media (max-width: 1300px) {
        .fb-toolbar button {
            padding: 10px;
            font-size: 20px;
        }
    }
    @media (max-width: 1300px) {
        .fb-toolbar button {
            padding: 10px;
            font-size: 20px;
        }
    }
    

    /* ===========================
    CONTENEDORES PRINCIPALES
    =========================== */
    .fb-container {
        width: 100%;
        min-width: 100vw;
        height: 100vh;               
        display: flex;
        justify-content: center;
        align-items: center;        
    }

    .fb-wrapper {
        width: auto !important;
        height: auto !important;
        display: inline-block !important;
        position: relative;
        
    }  
    .fb-book-frame {
        position: relative;
        width: fit-content;
        margin: 0 auto;
        
    }
    @media (max-width: 990px) {
        .fb-wrapper  {
            display: flex;
            justify-content: center;
            align-items: center;   
        }
    }

    

    /* ===========================
    EL CONTENEDOR DEL LIBRO
    =========================== */
    #book {
        
        max-height: 100vh !important;
        margin: auto;
        width: 100% !important;
        max-width: none !important;
    }   

    


    /* ===========================
    FIX PARA PAGEFLIP
    =========================== */
    .stf__wrapper {
        width: 100% !important;
        height: 100% !important;
        padding-bottom: 0 !important;
    }
    
    .stf__block {
        width: 100% !important;
        height: 100% !important;
    }

    .fb-wrapper.fb-wrapper--centered {
        justify-content: center !important;
        align-items: center !important;
        padding-left: 0 !important;
    }

    .portaid-centered-right {
        left: 50%;
        transform: translateX(-50%);          
    }

     .portaid-centered-left {
        left: 50%;
        transform: translateX(50%);
    }

    #fbWrapper {
        transition: transform 0.5s ease;
    }   


    /* ===========================
    NAVEGACIÓN (flechas)
    =========================== */
    .fb-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: none;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        z-index: 30;
        color: #434343;
        background: transparent;
    }
    #prevBtn { left: -50px; }
    #nextBtn { right: -50px; }

    .fb-arrow:hover {
        color: black;
    }

    .fb-arrow i {
        font-size: 40px;
    }   


    /* ===========================
    PROGRESS BAR
    =========================== */
    #progressBar {
        width: 30%;
        height: 6px;
        background: #ddd;
        border-radius: 3px;
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        overflow: hidden;
    }

    #progressFill {
        width: 0%;
        height: 100%;
        background: #444;
        transition: width .35s ease;
    }

    .progress-step {
        flex: 1;
        background: #ccc;
        transition: background .3s;
    }
    .progress-step.active {
        background: #444;
    }

    @media (max-width: 990px) {
        #progressBar {
            width: 70%;
            height: 8px;
            bottom: 20px;
        }
    }
    @media (max-width: 760px) {
        #progressBar {
            width: 70%;
            height: 10px;
            
        }        
    }


    /* ===========================
    HIDES
    =========================== */
    .fb-hidden {
        display: none !important;
    }

    /* ===========================
    ZOOM PANEL
    =========================== */
    .zoom-controls {
        position: absolute;
        right: 20px;
        top: 100px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: rgba(255,255,255,0.85);
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .zoom-btn {
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 18px;
        color: #434343;
    }
    .zoom-btn:hover {
        opacity: 0.7;
    }

    .zoom-on {
        cursor: grab;
    }
    .zoom-on:active {
        cursor: grabbing;
    }

    .fb-toolbar {
        z-index: 9999 !important;
    }

    #zoomControls {
        z-index: 9999 !important;
    }

    #book, .stf__wrapper, .stf__block {
        z-index: 1 !important;
    }

    #zoomOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5000; 
    cursor: grab;
    }

    #zoomOverlay.active {
        display: block !important;
    }
    #zoomOverlay.fb-hidden { display: none !important; }

    #zoomOverlay {
        touch-action: none;
    }