.rfb-wrapper {
	width: 100%;
}

.rfb-container {
	position: relative;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	user-select: none;
	-webkit-user-select: none;
}

.rfb-stage {
	position: relative;
	width: 100%;
	background-color: #e9e9ec;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 30px 10px;
	box-sizing: border-box;
	min-height: 260px;
}

.rfb-zoomlayer {
	transition: transform .25s ease;
	transform-origin: center center;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.rfb-book {
	position: relative;
	perspective: 2200px;
	perspective-origin: 50% 50%;
	display: flex;
	background: #fff;
	box-shadow: 0 20px 50px rgba(0,0,0,.35);
	width: 100%;
}

.rfb-book.rfb-single-mode {
	perspective: 1800px;
}

.rfb-half {
	position: relative;
	overflow: hidden;
	flex: 1 1 50%;
	min-width: 0;
	aspect-ratio: 0.72 / 1;
}

.rfb-page {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #fff;
	background-size: cover;
	background-position: center;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.rfb-static-left,
.rfb-static-right {
	position: relative;
}

.rfb-flipping {
	position: absolute;
	transform-style: preserve-3d;
	will-change: transform, filter;
	top: 0;
	height: 100%;
	width: 100%;
	transform-style: preserve-3d;
	z-index: 50;
	pointer-events: none;
}

.rfb-flipping .rfb-face {
	position: absolute;
	box-shadow: inset 0 0 18px rgba(0,0,0,.08);
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-color: #fff;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.rfb-flipping .rfb-face.rfb-back {
	transform: rotateY(180deg);
}

.rfb-shade {
	position: absolute;
	mix-blend-mode: multiply;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* Right-turning page: hinge on left edge of that half */
.rfb-hinge-left {
	left: 0;
	transform-origin: left center;
}

/* Left-turning page: hinge on right edge of that half */
.rfb-hinge-right {
	right: 0;
	transform-origin: right center;
}

.rfb-page-shadow-left {
	background: linear-gradient(to right, rgba(0,0,0,.35), rgba(0,0,0,0) 50%);
}

.rfb-page-shadow-right {
	background: linear-gradient(to left, rgba(0,0,0,.35), rgba(0,0,0,0) 50%);
}

.rfb-spine-shadow {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 40px;
	margin-left: -20px;
	background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,.18) 50%, rgba(0,0,0,0) 100%);
	pointer-events: none;
	z-index: 40;
}

.rfb-nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(0,0,0,.35);
	color: #fff;
	font-size: 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 60;
	transition: background .2s ease;
}

.rfb-nav-btn .rfb-glyph {
	font-size: 22px !important;
	line-height: 1 !important;
	color: #ffffff !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-weight: 700 !important;
}

.rfb-nav-btn:hover {
	background: rgba(0,0,0,.6);
}

.rfb-nav-btn:disabled {
	opacity: .25;
	cursor: default;
}

.rfb-nav-prev { left: 8px; }
.rfb-nav-next { right: 8px; }

/* Reader toolbar removed intentionally. */

.rfb-counter {
	font-size: 13px;
	min-width: 56px;
	text-align: center;
	color: #fff;
	opacity: .9;
	letter-spacing: .3px;
}

.rfb-menu-wrap {
	position: relative;
}

.rfb-menu {
	position: absolute;
	bottom: 42px;
	right: 0;
	background: #fff;
	color: #222;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.25);
	min-width: 190px;
	overflow: hidden;
	display: none;
	z-index: 100;
}

.rfb-menu.rfb-open {
	display: block;
}

.rfb-menu button {
	width: 100%;
	background: none;
	border: none;
	text-align: left;
	padding: 10px 14px;
	font-size: 13px;
	color: #222;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	border-radius: 0;
	height: auto;
}

.rfb-menu button:hover {
	background: #f2f2f2;
}

.rfb-menu button .rfb-glyph {
	font-size: 15px !important;
	line-height: 1 !important;
	color: #444444 !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-weight: 700 !important;
	width: 16px;
	text-align: center;
	display: inline-block;
}

.rfb-menu .rfb-menu-check {
	margin-left: auto;
	opacity: 0;
	font-size: 12px;
}

.rfb-menu .rfb-menu-check.rfb-active {
	opacity: 1;
}

.rfb-fullscreen-mode {
	background: #000;
	display: flex;
	flex-direction: column;
	justify-content: center;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	max-width: none !important;
}

.rfb-fullscreen-mode .rfb-stage {
	flex: 1;
	border-radius: 0;
	background-color: #000;
}


.rfb-toast {
	position: absolute;
	bottom: 54px;
	left: 50%;
	transform: translateX(-50%) translateY(6px);
	background: rgba(0,0,0,.8);
	color: #fff;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	z-index: 120;
	white-space: nowrap;
}

.rfb-toast.rfb-show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
	.rfb-nav-btn { width: 34px; height: 34px; font-size: 16px; }
}

/* ---------------- Thumbnails panel ---------------- */
.rfb-thumbs-panel {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 220px;
	background: #fff;
	box-shadow: 4px 0 20px rgba(0,0,0,.25);
	z-index: 80;
	transform: translateX(-100%);
	transition: transform .25s ease;
	display: flex;
	flex-direction: column;
}

.rfb-thumbs-panel.rfb-open {
	transform: translateX(0);
}

.rfb-thumbs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-bottom: 1px solid #eee;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .5px;
	color: #333;
}

.rfb-thumbs-close {
	background: none;
	border: none;
	cursor: pointer;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
}

.rfb-thumbs-close .rfb-glyph {
	font-size: 16px !important;
	line-height: 1 !important;
	color: #666666 !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-weight: 700 !important;
}

.rfb-thumbs-list {
	overflow-y: auto;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rfb-thumb-item {
	border: 2px solid transparent;
	background: #f5f5f5;
	border-radius: 4px;
	cursor: pointer;
	padding: 0;
	overflow: hidden;
	text-align: left;
	transition: border-color .15s ease;
}

.rfb-thumb-item:hover {
	border-color: #999;
}

.rfb-thumb-img {
	width: 100%;
	padding-top: 130%;
	background-size: cover;
	background-position: center;
	position: relative;
}

.rfb-thumb-label {
	font-size: 11px;
	text-align: center;
	padding: 4px 0;
	color: #555;
	background: #fff;
}

/* ---------------- Share popover ---------------- */
.rfb-share-popover {
	position: absolute;
	bottom: 42px;
	right: 0;
	background: #fff;
	color: #222;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.25);
	width: 260px;
	padding: 14px;
	display: none;
	z-index: 100;
}

.rfb-share-popover.rfb-open {
	display: block;
}

.rfb-share-title {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 8px;
	color: #222;
}

.rfb-share-input {
	width: 100%;
	box-sizing: border-box;
	resize: none;
	height: 44px;
	font-size: 12px;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 6px;
	color: #444;
	margin-bottom: 10px;
	font-family: inherit;
}

.rfb-share-icons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.rfb-share-popover .rfb-share-icon-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex: none;
}

.rfb-share-popover .rfb-share-icon-btn .rfb-glyph {
	font-size: 14px !important;
	line-height: 1 !important;
	color: #ffffff !important;
	font-family: Arial, Helvetica, sans-serif !important;
	font-weight: 700 !important;
}

.rfb-share-popover .rfb-share-facebook { background: #1877f2; }
.rfb-share-popover .rfb-share-twitter { background: #000; }
.rfb-share-popover .rfb-share-whatsapp { background: #25d366; }
.rfb-share-popover .rfb-share-linkedin { background: #0a66c2; }
.rfb-share-popover .rfb-share-pinterest { background: #e60023; }
.rfb-share-popover .rfb-share-email { background: #666; }

.rfb-share-popover .rfb-share-icon-btn:hover {
	filter: brightness(1.15);
	transform: scale(1.06);
}

@media (max-width: 640px) {
	.rfb-thumbs-panel { width: 160px; }
}

