html.ctm-catalog-lock,
body.ctm-catalog-lock {
	overflow: hidden !important;
}

.ctm-catalog-viewer-marker {
	display: none !important;
}

.ctm-catalog-link-trigger,
.ctm-catalog-open-button {
	cursor: pointer;
}

.ctm-catalog-overlay {
	--ctm-catalog-nav-color: #9d2825;
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #fff;
	color: #111;
	display: none;
}

.ctm-catalog-overlay.is-open {
	display: block;
}

.ctm-catalog-shell {
	position: relative;
	width: 100%;
	height: 100%;
	background: #fff;
	overflow: hidden;
}

.ctm-catalog-topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 46px;
	z-index: 20;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 0 18px;
	background: rgba(255, 255, 255, 0.96);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ctm-catalog-brand {
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ctm-catalog-counter {
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	text-align: center;
}

.ctm-catalog-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
}

.ctm-catalog-actions button,
.ctm-catalog-actions a {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: #111;
	cursor: pointer;
	text-decoration: none;
}

.ctm-catalog-actions svg,
.ctm-catalog-nav svg {
	width: 24px;
	height: 24px;
	stroke: currentColor;
	stroke-width: 1.8;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ctm-catalog-stage {
	position: absolute;
	inset: 46px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	overflow: hidden;
	perspective: 2400px;
	perspective-origin: center center;
}

.ctm-catalog-book {
	position: relative;
	z-index: 2;
	width: calc(100vw - 150px);
	height: calc(100vh - 76px);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-in;
	pointer-events: auto;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.ctm-catalog-stage.is-zoomed .ctm-catalog-book {
	cursor: zoom-out;
}

.ctm-catalog-spread {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	max-width: 100%;
	max-height: 100%;
	transform-style: preserve-3d;
	transform-origin: center center;
	transition: transform 160ms ease;
	will-change: transform;
}

.ctm-catalog-stage.is-pinching .ctm-catalog-spread {
	transition: none;
}

.ctm-catalog-spread[data-pages="1"] {
	justify-content: center;
}

.ctm-catalog-page {
	position: relative;
	flex: 0 0 auto;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-position: center;
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
	backface-visibility: hidden;
	transform: translateZ(0);
}

.ctm-catalog-spread[data-pages="2"] .ctm-catalog-page-left {
	box-shadow: -12px 18px 34px rgba(0, 0, 0, 0.13);
}

.ctm-catalog-spread[data-pages="2"] .ctm-catalog-page-right {
	box-shadow: 12px 18px 34px rgba(0, 0, 0, 0.13);
}

.ctm-catalog-spread[data-pages="2"] .ctm-catalog-page-left::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 18px;
	height: 100%;
	background: linear-gradient(to left, rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0));
	pointer-events: none;
}

.ctm-catalog-spread[data-pages="2"] .ctm-catalog-page-right::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 18px;
	height: 100%;
	background: linear-gradient(to right, rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0));
	pointer-events: none;
}

.ctm-catalog-page.is-hidden-for-flip {
	opacity: 0;
	visibility: hidden;
}

.ctm-catalog-flip-sheet {
	position: absolute;
	z-index: 12;
	perspective: 2400px;
	pointer-events: none;
	transform-style: preserve-3d;
}

.ctm-catalog-flip-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 680ms cubic-bezier(0.23, 0.74, 0.26, 1);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
	will-change: transform;
}

.ctm-catalog-flip-sheet.is-next .ctm-catalog-flip-inner {
	transform-origin: left center;
}

.ctm-catalog-flip-sheet.is-prev .ctm-catalog-flip-inner {
	transform-origin: right center;
}

.ctm-catalog-flip-sheet.is-next.is-flipping .ctm-catalog-flip-inner {
	transform: rotateY(-180deg);
}

.ctm-catalog-flip-sheet.is-prev.is-flipping .ctm-catalog-flip-inner {
	transform: rotateY(180deg);
}

.ctm-catalog-flip-face {
	position: absolute;
	inset: 0;
	background-color: #fff;
	background-size: 100% 100%;
	background-position: center;
	background-repeat: no-repeat;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.ctm-catalog-flip-face.is-front::after,
.ctm-catalog-flip-face.is-back::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.ctm-catalog-flip-sheet.is-next .ctm-catalog-flip-face.is-front::after {
	background: linear-gradient(to left, rgba(0, 0, 0, 0.24), rgba(255, 255, 255, 0) 42%);
}

.ctm-catalog-flip-sheet.is-prev .ctm-catalog-flip-face.is-front::after {
	background: linear-gradient(to right, rgba(0, 0, 0, 0.24), rgba(255, 255, 255, 0) 42%);
}

.ctm-catalog-flip-face.is-back {
	transform: rotateY(180deg);
}

.ctm-catalog-nav {
	position: absolute;
	top: 50%;
	z-index: 10;
	width: 56px;
	height: 86px;
	border: 0;
	border-radius: 0;
	background: var(--ctm-catalog-nav-color);
	color: #fff;
	transform: translateY(-50%);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 160ms ease, transform 160ms ease;
}

.ctm-catalog-prev {
	left: 0;
}

.ctm-catalog-next {
	right: 0;
}

.ctm-catalog-nav:hover {
	transform: translateY(-50%) scale(1.04);
}

.ctm-catalog-nav:disabled {
	opacity: 0.18;
	cursor: default;
	transform: translateY(-50%);
}

.ctm-catalog-loader {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 30;
	transform: translate(-50%, -50%);
	padding: 10px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
	font-size: 14px;
}

.ctm-catalog-loader[hidden] {
	display: none !important;
}

.ctm-catalog-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
}

.ctm-catalog-list-card {
	margin: 0;
}

.ctm-catalog-list-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.ctm-catalog-list-link img,
.ctm-catalog-cover {
	display: block;
	width: 100%;
	height: auto;
}

@media (max-width: 767px) {
	.ctm-catalog-topbar {
		height: 44px;
		padding: 0 10px;
		grid-template-columns: 1fr auto auto;
	}

	.ctm-catalog-brand {
		font-size: 12px;
		max-width: 130px;
	}

	.ctm-catalog-counter {
		font-size: 14px;
	}

	.ctm-catalog-actions {
		gap: 10px;
	}

	.ctm-catalog-stage {
		inset: 44px 0 0;
	}

	.ctm-catalog-book {
		width: 100vw;
		height: calc(100vh - 44px);
		padding: 0 12px;
		cursor: default;
	}

	.ctm-catalog-spread {
		transition: none;
	}

	.ctm-catalog-flip-sheet {
		display: none;
	}

	.ctm-catalog-page {
		box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
	}

	.ctm-catalog-nav {
		top: auto;
		bottom: max(10px, env(safe-area-inset-bottom));
		width: 48px;
		height: 48px;
		background: transparent;
		color: var(--ctm-catalog-nav-color);
		transform: none;
	}

	.ctm-catalog-nav:hover {
		transform: scale(1.04);
	}

	.ctm-catalog-nav:disabled {
		transform: none;
	}

	.ctm-catalog-prev {
		left: calc(50% - 52px);
	}

	.ctm-catalog-next {
		right: calc(50% - 52px);
	}
}
