.wcbr-box {
	--wcbr-reader-accent: #14a798;
	max-width: 900px;
	margin: 20px auto;
	font-family: inherit;
	width: 100% !important;
}

.wcbr-box,
.wcbr-box * {
	box-sizing: border-box;
}

/* حماية ضد الحاويات الضيقة (زي Elementor Grid Container). */
.elementor-widget-container:has( .wcbr-box ),
.elementor-element:has( > .elementor-widget-container .wcbr-box ),
[class*="elementor-element-"]:has( .wcbr-box ) {
	width: 100% !important;
	max-width: 100% !important;
	grid-column: 1 / -1 !important;
	flex: 1 1 100% !important;
}

.wcbr-reader-box {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 18px;
	padding: 22px;
	box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.06 );
}

.wcbr-buy-box {
	text-align: center;
	padding: 30px 20px;
	border: 1px dashed #ccc;
	border-radius: 8px;
	background: #fafafa;
}

.wcbr-buy-message {
	margin-bottom: 14px;
	font-size: 15px;
}

.wcbr-buy-btn {
	display: inline-block;
}

.wcbr-resume-banner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #eefaf8;
	color: #0d6b60;
	border: 1px solid #cdf0ea;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 16px;
	direction: rtl;
}

.wcbr-resume-icon {
	font-size: 16px;
}

/* ==== محول العرض (فليب بوك / عادي) ==== */
.wcbr-mode-switch {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-bottom: 16px;
	background: #f4f4f4;
	border-radius: 999px;
	padding: 4px;
	max-width: 320px;
	margin-left: auto;
	margin-right: auto;
}

.wcbr-mode-btn {
	flex: 1;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 999px !important;
	padding: 9px 14px !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	color: #666 !important;
	transition: background 0.2s ease, color 0.2s ease;
}

.wcbr-mode-btn.active {
	background: var( --wcbr-reader-accent, #14a798 ) !important;
	color: #fff !important;
}

/* ==== شريط الأدوات ==== */
.wcbr-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.wcbr-toolbar .button {
	border-radius: 999px !important;
	display: inline-flex !important;
	align-items: center;
	gap: 5px;
	background: #fff !important;
	border: 1.5px solid #e2e2e2 !important;
	color: #333 !important;
	font-weight: 600 !important;
	font-size: 13.5px !important;
	padding: 9px 16px !important;
	box-shadow: none !important;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.wcbr-toolbar .button:hover {
	border-color: var( --wcbr-reader-accent, #14a798 ) !important;
	color: var( --wcbr-reader-accent, #14a798 ) !important;
}

.wcbr-toolbar .wcbr-fullscreen {
	background: var( --wcbr-reader-accent, #14a798 ) !important;
	border-color: var( --wcbr-reader-accent, #14a798 ) !important;
	color: #fff !important;
}

.wcbr-toolbar .wcbr-fullscreen:hover {
	opacity: 0.9;
	color: #fff !important;
}

.wcbr-btn-icon {
	font-size: 15px;
	line-height: 1;
}

.wcbr-page-info {
	min-width: 72px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: #444;
	font-size: 13.5px;
	background: #f7f7f7;
	border-radius: 999px;
	padding: 9px 14px;
}

.wcbr-progress-track {
	height: 5px;
	background: #eee;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 16px;
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}

.wcbr-progress-fill {
	height: 100%;
	width: 0;
	background: var( --wcbr-reader-accent, #14a798 );
	border-radius: 999px;
	transition: width 0.25s ease;
}

.wcbr-viewer-area {
	position: relative;
	min-height: 400px;
	background: linear-gradient( 180deg, #f3f3f3, #e8e8e8 );
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 24px;
}

.wcbr-loading {
	padding: 40px;
	color: #555;
}

.wcbr-plain-canvas {
	max-width: 100%;
	height: auto;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	background: #fff;
}

/* Flipbook */
.wcbr-flipbook-stage {
	position: relative;
	width: 100%;
	max-width: 560px;
	aspect-ratio: 3 / 4;
	perspective: 2200px;
	margin: 0 auto;
}

.wcbr-flip-page {
	position: absolute;
	inset: 0;
	background: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	transform-style: preserve-3d;
	transform-origin: right center;
	transition: transform 0.6s ease;
	backface-visibility: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wcbr-flip-page img {
	max-width: 100%;
	max-height: 100%;
}

.wcbr-flip-page.wcbr-flip-turn-next {
	transform: rotateY(-160deg);
}

.wcbr-flip-page.wcbr-flip-turn-prev {
	transform-origin: left center;
	transform: rotateY(160deg);
}

.wcbr-viewer-area:fullscreen {
	background: #111;
}

.wcbr-viewer-area:fullscreen .wcbr-flipbook-stage {
	max-width: 720px;
}

.wcbr-fs-wrapper:fullscreen {
	background: #111;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wcbr-fs-wrapper:fullscreen .wcbr-toolbar {
	flex-shrink: 0;
	margin-bottom: 16px;
}

.wcbr-fs-wrapper:fullscreen .wcbr-toolbar .button {
	background: #262626 !important;
	color: #fff !important;
	border-color: #3a3a3a !important;
}

.wcbr-fs-wrapper:fullscreen .wcbr-toolbar .button:hover {
	border-color: var( --wcbr-reader-accent, #14a798 ) !important;
	color: var( --wcbr-reader-accent, #14a798 ) !important;
}

.wcbr-fs-wrapper:fullscreen .wcbr-toolbar .wcbr-fullscreen {
	background: var( --wcbr-reader-accent, #14a798 ) !important;
	color: #fff !important;
}

.wcbr-fs-wrapper:fullscreen .wcbr-page-info {
	color: #fff;
	background: #262626;
}

.wcbr-fs-wrapper:fullscreen .wcbr-progress-track {
	background: #333;
}

.wcbr-fs-wrapper:fullscreen .wcbr-viewer-area {
	background: transparent;
	flex: 1;
	width: 100%;
	min-height: 0;
}

.wcbr-fs-wrapper:fullscreen .wcbr-flipbook-stage {
	max-width: 620px;
	height: 100%;
	max-height: 85vh;
}

.wcbr-fs-wrapper:fullscreen .wcbr-plain-canvas {
	max-height: 88vh;
	width: auto;
}
