.ds-pdf-flipbook {
	width: 100%;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}

.ds-pdf-flipbook * {
	box-sizing: border-box;
}

.ds-pdf-flipbook__stage {
	position: relative;
	width: 100%;
	background: #f5f5f5;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	overflow: auto;
	display: flex;
	align-items: center;
	/* Changed from center/left to flex-end so zoomed content anchors correctly */
    justify-content: flex-end;
	min-height: 200px;
direction: rtl; /* Ensures scrollbar and panning align with Hebrew reading order */}
.ds-pdf-flipbook__canvas,
.ds-pdf-flipbook__stage img {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    transition: transform 0.2s ease;
/* Anchor the scaling origin to the top-right instead of center */
    transform-origin: top right !important;
    
    /* Fix blurry shrinking on modern browsers */
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
}
/* .ds-pdf-flipbook__canvas,
.ds-pdf-flipbook__stage img {
	display: block;
	max-width: 100%;
	height: auto;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	background: #fff;
	transition: transform 0.2s ease;
	transform-origin: top center;
} */

.ds-pdf-flipbook__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	color: #555;
	z-index: 2;
}

/* Control Bar Layout - Wrap enabled for mobile safety */
.ds-pdf-flipbook__controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
    flex-wrap: wrap;
    user-select: none;
}

/* Unified Rectangular Gray Styling for ALL Buttons */
.ds-pdf-flipbook__btn,
.ds-pdf-flipbook__download,
.ds-pdf-flipbook__prev,
.ds-pdf-flipbook__next {
    background-color: #f1f1f1 !important;
    border: 1px solid #d1d1d1 !important;
    color: #333 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
}

.ds-pdf-flipbook__btn:hover:not(:disabled),
.ds-pdf-flipbook__download:hover,
.ds-pdf-flipbook__prev:hover:not(:disabled),
.ds-pdf-flipbook__next:hover:not(:disabled) {
    background-color: #e4e4e4 !important;
    border-color: #bcbcbc !important;
    color: #000 !important;
    transform: none !important;
}

.ds-pdf-flipbook__btn:disabled,
.ds-pdf-flipbook__prev:disabled,
.ds-pdf-flipbook__next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Page Counter Text Styling */
.ds-pdf-flipbook__page-info {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 0 4px;
    white-space: nowrap;
    text-align: center;
}

.dpf-notice {
	padding: 10px 14px;
	background: #fff8e5;
	border-left: 4px solid #dba617;
	font-size: 13px;
}

/* Mobile Specific Layout Adjustments */
/* Mobile Specific Layout Adjustments */
@media screen and (max-width: 768px) {
    .ds-pdf-flipbook {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .ds-pdf-flipbook__stage {
        width: 100% !important;
        min-height: 400px;
    }

    .ds-pdf-flipbook__canvas,
    .ds-pdf-flipbook__stage img {
        width: 100% !important;
        height: auto !important;
    }

    /* Main container stacks the two rows vertically */
    .ds-pdf-flipbook__controls {
        display: flex;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100%;
    }

    /* Each row behaves as a horizontal flex container */
    .ds-pdf-flipbook__row-top,
    .ds-pdf-flipbook__row-bottom {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100%;
    }

    /* Make items share space cleanly on mobile */
    .ds-pdf-flipbook__row-top .ds-pdf-flipbook__btn,
    .ds-pdf-flipbook__row-bottom .ds-pdf-flipbook__btn,
    .ds-pdf-flipbook__row-bottom .ds-pdf-flipbook__download {
        flex: 1;
        padding: 6px 4px !important;
        font-size: 12px !important;
        text-align: center;
        justify-content: center;
        white-space: nowrap;
    }

    .ds-pdf-flipbook__page-info {
        flex: 0 0 auto;
        padding: 0 8px;
        font-size: 14px;
        white-space: nowrap;
    }
	.ds-pdf-flipbook__zoom-in,
    .ds-pdf-flipbook__zoom-out {
        display: none !important;
    }
}
}