/* ================= MOBILE VIEW ================= */
@media (max-width: 600px) {

    body {
        overflow: hidden;
    }

    /* 🔹 Hide desktop toolbar */
    .toolbar {
        display: none;
    }

    /* 🔹 Top bar smaller */
    .top-bar {
        height: 50px;
        padding: 0 12px;
    }

    .brand {
        font-size: 16px;
    }

    /* 🔹 Fullscreen viewer */
    .viewer {
        /*height: calc(100vh - 160px);*/
        height: calc(100dvh - 140px);
        padding: 0;
    }

    /* 🔹 Flipbook full width */
    /* #flipbook {
        width: 100% !important;
        height: auto !important;
    } */

    /* 🔹 Bottom toolbar (mobile style) */
    .bottom-bar {
        position: relative;
        bottom: 0;
        left: 0;
        right: 0;
        height: 45px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: #d9f3f6;
        z-index: 999;
    }

    .bottom-bar button i {
        font-size: 18px;
    }

    /* 🔹 Page input smaller */
    .page-box {
        width: 60px;
        font-size: 12px;
    }

    /* 🔹 Modal responsive */
    .modal-box {
        width: 90%;
    }

    .modal-content {
        grid-template-columns: 1fr;
    }

    .modal-right {
        width: 100%;
    }

    .modal-right img {
        width: 140px;
    }

    /* 🔹 Thumbnail overlay full screen */
    .thumb-strip {
        width: 100%;
        padding: 10px;
    }

    .thumb {
        width: 90px;
    }

    /* 🔹 Disable zoom drag cursor issues on mobile */
    .viewer {
        touch-action: pan-x pan-y;
    }
}

@media (max-width: 600px) {
    /* .bottom-bar:not(.mobile-toolbar) {
        display: none;
    } */

    .mobile-toolbar {
        display: flex;
    }
}

@media (max-width: 600px) {
    .viewer {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: none;
    }

    #flipbook {
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        border-radius: 4px;
    }
}


@media (max-width: 600px) {

    .nav-arrow {
        display: flex;
        width: 44px;
        height: 44px;
        font-size: 18px;
        background: rgba(255, 255, 255, 0.25);
    }

    .nav-arrow.left {
        left: 10px;
    }

    .nav-arrow.right {
        right: 10px;
    }

    .nav-arrow {
        z-index: 50;
    }
}
@media (max-width: 600px) {
    #zoomWrapper {
        max-height: 100%;
        max-width: 100%;
    }
    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
        background: rgba(255,255,255,0.6);
        backdrop-filter: blur(4px);
        display: none !important;
    }
    .mobile-toolbar button,
    .mobile-toolbar button i {
        color: #1b2b44 !important;
    }
    .bottom-bar button,
    .bottom-bar button i {
        color: #1b2b44 !important;
    }
}
/*@media (max-width: 600px) {

    .viewer {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}*/
@media (max-width: 600px) {

    /* NAV BAR (page numbers) */
    .mobile-nav-bar {
        position: fixed;
        bottom: 60px;   /* 👈 sits ABOVE icon bar */
        left: 0;
        right: 0;

        height: 50px;
        background: #cfe3e6;

        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;

        z-index: 999;
    }

    /* ICON BAR */
    .mobile-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 45px;
        display: flex;
        justify-content: space-around;
        align-items: center;

        background: #d9f3f6;
        z-index: 1000;
    }

    /* INPUT */
    #pageInputMobile {
        width: 70px;
        text-align: center;
        font-size: 13px;
        padding: 4px;
    }
}

#bookLoader {
    position: absolute;
    inset: 0;

    background: #ffffff;
    z-index: 20;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 6px;
}

/* Spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #ddd;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loader-box {
    text-align: center;
    font-family: Arial;
    justify-items: center !important;
    display: block;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}