/*
 * LaTortuga Elementor Blocks · Ediciones (carrusel de portadas + visor flipbook)
 * Variables que Elementor puede sobrescribir (sin valor definido = rige el respaldo de var()):
 *   --ltb-ef-bg  --ltb-ef-bg-op  --ltb-ef-h  --ltb-ef-w  --ltb-ef-viewer-bg  --ltb-ef-viewer-fg
 */

/* ───────────── Contenedor (hero verde) ───────────── */
.ltb-block.ltb-ef {
	position: relative;
	overflow: hidden;
	background-color: var(--ltb-ef-bg, var(--ltb-accent));
	color: var(--ltb-ink);
}

.ltb-block .ltb-ef__bg {
	position: absolute;
	left: 0;
	right: 0;
	top: 20px;
	display: flex;
	justify-content: center;
	pointer-events: none;
}
.ltb-block .ltb-ef__bg img {
	width: 94%;
	max-width: 1500px;
	height: auto;
	margin: 0;
	box-shadow: none;
	border-radius: 0;
	opacity: var(--ltb-ef-bg-op, .17);
}

/* ───────────── Carrusel (coverflow en bucle) ───────────── */
.ltb-block .ltb-ef__flow {
	position: relative;
	z-index: 2;
	height: var(--ltb-ef-h, 400px);
	margin-top: 30px;
	perspective: 1600px;
	touch-action: pan-y;
	cursor: grab;
	-webkit-user-select: none;
	user-select: none;
}
.ltb-block .ltb-ef__flow:active {
	cursor: grabbing;
}

.ltb-block .ltb-ef__card {
	position: absolute;
	left: 50%;
	top: 0;
	width: var(--ltb-ef-w, 206px);
	height: auto;
	aspect-ratio: 206 / 284;
	margin: 0 0 0 calc(var(--ltb-ef-w, 206px) / -2);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	will-change: transform;
	-webkit-tap-highlight-color: transparent;
}

.ltb-block .ltb-ef__inner {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--ltb-cream);
	box-shadow: 0 30px 50px -26px rgba(10, 30, 15, .75);
	transition: transform .55s var(--ltb-ease), box-shadow .55s var(--ltb-ease);
}
.ltb-block .ltb-ef__card img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	transition: transform .8s var(--ltb-ease);
	pointer-events: none;
}
/* lomo y brillo */
.ltb-block .ltb-ef__inner::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 4%, rgba(255, 255, 255, .14) 6%, rgba(255, 255, 255, 0) 12%);
}
.ltb-block .ltb-ef__inner::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .35) 50%, rgba(255, 255, 255, 0) 65%);
	transform: translateX(-120%);
	transition: transform 0s;
}
.ltb-block .ltb-ef__card:hover .ltb-ef__inner,
.ltb-block .ltb-ef__card:focus-visible .ltb-ef__inner {
	transform: translateY(-12px) scale(1.06);
	box-shadow: 0 0 0 4px var(--ltb-cream), 0 46px 60px -28px rgba(10, 30, 15, .85);
}
.ltb-block .ltb-ef__card:hover img {
	transform: scale(1.05);
}
.ltb-block .ltb-ef__card:hover .ltb-ef__inner::after {
	transform: translateX(120%);
	transition: transform 1s var(--ltb-ease);
}
.ltb-block .ltb-ef__card:focus {
	outline: none;
}
.ltb-block .ltb-ef__card:focus-visible {
	outline: 3px solid var(--ltb-ink);
	outline-offset: 4px;
}

/* Portada sin escaneo: solo marca y número */
.ltb-block .ltb-ef__nocv {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 8%;
	background: var(--ltb-cream);
	box-shadow: inset 0 0 0 1px var(--ltb-ink);
	container-type: inline-size;
	color: var(--ltb-ink);
	text-align: left;
}
.ltb-block .ltb-ef__nocv i {
	font-style: normal;
	font-weight: 700;
	font-size: 9.5cqw;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1;
}
.ltb-block .ltb-ef__nocv small {
	margin-top: auto;
	font-size: 13cqw;
	font-weight: 700;
	line-height: 1;
}
.ltb-block .ltb-ef__nocv b {
	font-size: 44cqw;
	font-weight: 700;
	letter-spacing: -.05em;
	line-height: .85;
}

/* ───────────── Visor (ventana modal) ───────────── */
.ltb-block .ltb-ef__dialog {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: auto;
	background: var(--ltb-ef-viewer-bg, var(--ltb-deep-2));
	color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
}
.ltb-block .ltb-ef__dialog:not([open]) {
	display: none;
}
.ltb-block .ltb-ef__dialog[open] {
	animation: ltbEfIn .45s ease both;
}
.ltb-block .ltb-ef__dialog::backdrop {
	background: var(--ltb-deep-2);
}
@keyframes ltbEfIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.ltb-block .ltb-ef__v {
	position: relative;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.ltb-block .ltb-ef__v::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 60% 70% at 50% 46%, rgba(153, 204, 153, .2), rgba(153, 204, 153, 0) 70%);
	pointer-events: none;
}
.ltb-block .ltb-ef__vin {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	max-width: 1312px;
	margin: 0 auto;
	padding: 28px 36px 32px;
}

.ltb-block .ltb-ef__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	width: 100%;
}
.ltb-block .ltb-ef__vtitle {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .01em;
	color: inherit;
}
.ltb-block .ltb-ef__note {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12.5px;
	color: rgba(255, 255, 204, .8);
}
.ltb-block .ltb-ef__note[hidden],
.ltb-block .ltb-ef__tool[hidden] {
	display: none;
}
.ltb-block .ltb-ef__note span::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 8px;
	border-radius: 50%;
	background: #d9a441;
}
.ltb-block .ltb-ef__tools {
	display: flex;
	gap: 8px;
}
.ltb-block .ltb-ef__tool {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border: 1px solid rgba(255, 255, 204, .3);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
	font: inherit;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: background .2s, border-color .2s, color .2s;
}
.ltb-block .ltb-ef__tool:hover {
	background: rgba(255, 255, 204, .1);
	border-color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
	color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
}
.ltb-block .ltb-ef__tool--close {
	background: var(--ltb-cream);
	border-color: var(--ltb-cream);
	color: var(--ltb-ink);
}
.ltb-block .ltb-ef__tool--close:hover {
	background: #fff;
	border-color: #fff;
	color: var(--ltb-ink);
}

.ltb-block .ltb-ef__row {
	display: flex;
	align-items: center;
	gap: 20px;
}
.ltb-block .ltb-ef__round {
	flex: none;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ltb-cream);
	box-shadow: none;
	color: var(--ltb-deep);
	cursor: pointer;
	transition: background .25s, transform .25s var(--ltb-ease), opacity .25s;
}
.ltb-block .ltb-ef__round:hover {
	background: #fff;
	transform: scale(1.06);
}
.ltb-block .ltb-ef__round:active {
	transform: scale(.94);
}
.ltb-block .ltb-ef__round[disabled] {
	opacity: .28;
	cursor: default;
	transform: none;
}

/* Escenario: se ajusta al ancho y alto disponibles (proporción 940 × 646) */
.ltb-block .ltb-ef__stage {
	position: relative;
	width: min(940px, calc(100vw - 232px), calc((100vh - 230px) * 1.4551));
	min-width: 320px;
	aspect-ratio: 940 / 646;
	perspective: 2800px;
	outline: none;
}
.ltb-block .ltb-ef__stage:focus-visible {
	outline: 2px solid var(--ltb-cream);
	outline-offset: 8px;
}
.ltb-block .ltb-ef__floor {
	position: absolute;
	left: 8%;
	right: 8%;
	bottom: -30px;
	height: 40px;
	background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 70%);
	filter: blur(4px);
}
.ltb-block .ltb-ef__shift {
	position: absolute;
	inset: 0;
	transition: transform .9s var(--ltb-turn);
}
.ltb-block .ltb-ef__shift.is-front { transform: translateX(-25%); }
.ltb-block .ltb-ef__shift.is-back  { transform: translateX(25%); }

.ltb-block .ltb-ef__leaf {
	position: absolute;
	top: 0;
	left: 50%;
	width: 50%;
	height: 100%;
	transform-origin: 0 50%;
	transform-style: preserve-3d;
	transition: transform .9s var(--ltb-turn);
}
.ltb-block .ltb-ef__leaf.is-flipped {
	transform: rotateY(-180deg);
}
.ltb-block .ltb-ef__face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #efebdd;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}
.ltb-block .ltb-ef__face img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
}
/* Página del PDF dibujada por PDF.js (proporción del PDF respetada; el resto queda color papel) */
.ltb-block .ltb-ef__face canvas,
.ltb-block .ltb-ef__th canvas {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
	opacity: 0;
	transition: opacity .3s ease;
}
.ltb-block .ltb-ef__face canvas.is-ready,
.ltb-block .ltb-ef__th canvas.is-ready {
	opacity: 1;
}
.ltb-block .ltb-ef__back {
	transform: rotateY(180deg);
}
.ltb-block .ltb-ef__front::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(0, 0, 0, .24), rgba(0, 0, 0, 0) 7%, rgba(255, 255, 255, .06) 9%, rgba(255, 255, 255, 0) 14%);
}
.ltb-block .ltb-ef__back::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(270deg, rgba(0, 0, 0, .24), rgba(0, 0, 0, 0) 7%, rgba(255, 255, 255, .06) 9%, rgba(255, 255, 255, 0) 14%);
}
.ltb-block .ltb-ef__face.is-cover::after {
	background: linear-gradient(90deg, rgba(0, 0, 0, .32), rgba(0, 0, 0, 0) 4%, rgba(255, 255, 255, .12) 6%, rgba(255, 255, 255, 0) 12%);
}
.ltb-block .ltb-ef__leaf.is-turning .ltb-ef__face::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .22));
	animation: ltbEfShade .9s var(--ltb-turn) both;
}
@keyframes ltbEfShade {
	0%   { opacity: 0; }
	50%  { opacity: 1; }
	100% { opacity: 0; }
}

/* Página sin escaneo */
.ltb-block .ltb-ef__pend {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	height: 100%;
	padding: 12% 11%;
	color: var(--ltb-ink);
	background: linear-gradient(#f2eedf, #eae5d2);
}
.ltb-block .ltb-ef__pend .pn {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ltb-muted);
}
.ltb-block .ltb-ef__pend .lines {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.ltb-block .ltb-ef__pend .lines i {
	display: block;
	height: 7px;
	border-radius: 2px;
	background: rgba(20, 20, 20, .08);
}
.ltb-block .ltb-ef__pend--cover {
	justify-content: space-between;
	background: var(--ltb-mist);
}
.ltb-block .ltb-ef__pend--cover em {
	font-style: normal;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.ltb-block .ltb-ef__pend--cover b {
	font-size: clamp(40px, 9vw, 88px);
	letter-spacing: -.05em;
	line-height: .8;
}

/* Estado de carga del PDF */
.ltb-block .ltb-ef__status {
	position: absolute;
	inset: 0;
	z-index: 950;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-size: 13px;
	letter-spacing: .04em;
	color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
	pointer-events: none;
}
.ltb-block .ltb-ef__status[hidden] {
	display: none;
}
.ltb-block .ltb-ef__spin {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 204, .25);
	border-top-color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
	border-radius: 50%;
	animation: ltbEfSpin .9s linear infinite;
}
@keyframes ltbEfSpin {
	to { transform: rotate(360deg); }
}

/* Zonas de clic (mitad izquierda/derecha del libro) */
.ltb-block .ltb-ef__hit {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50%;
	z-index: 900;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}
.ltb-block .ltb-ef__hit--l { left: 0;  cursor: w-resize; }
.ltb-block .ltb-ef__hit--r { right: 0; cursor: e-resize; }
.ltb-block .ltb-ef__hit:focus-visible {
	outline: 2px solid var(--ltb-cream);
	outline-offset: -4px;
}

/* Barra inferior: contadores y miniaturas */
.ltb-block .ltb-ef__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 22px;
	width: 100%;
}
.ltb-block .ltb-ef__count {
	flex: none;
	min-width: 150px;
	white-space: nowrap;
	font-size: 13px;
	letter-spacing: .06em;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 204, .82);
}
.ltb-block .ltb-ef__count b {
	font-size: 15px;
	color: var(--ltb-ef-viewer-fg, var(--ltb-cream));
}
.ltb-block .ltb-ef__count--r {
	text-align: right;
}
.ltb-block .ltb-ef__thumbs {
	display: flex;
	flex: 1 1 auto;
	align-items: flex-end;
	gap: 10px;
	min-width: 0;
	padding: 4px 0;
	overflow-x: auto;
	scrollbar-width: none;
}
.ltb-block .ltb-ef__thumbs::-webkit-scrollbar {
	display: none;
}
.ltb-block .ltb-ef__th {
	flex: none;
	display: flex;
	gap: 1px;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .2s, background .2s, transform .25s var(--ltb-ease);
}
.ltb-block .ltb-ef__th i {
	display: block;
	width: 26px;
	height: 36px;
	background: rgba(255, 255, 204, .18);
}
.ltb-block .ltb-ef__th img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
}
.ltb-block .ltb-ef__th:hover {
	transform: translateY(-3px);
	border-color: rgba(255, 255, 204, .4);
}
.ltb-block .ltb-ef__th.is-on {
	border-color: var(--ltb-cream);
	background: rgba(255, 255, 204, .08);
}
.ltb-block .ltb-ef__th:focus-visible {
	outline: 2px solid var(--ltb-cream);
	outline-offset: 2px;
}

.ltb-block .ltb-ef__tool:focus-visible,
.ltb-block .ltb-ef__round:focus-visible {
	outline: 2px solid var(--ltb-cream);
	outline-offset: 3px;
}
.ltb-block .ltb-ef__tool--close:focus-visible {
	outline-color: #fff;
}

/* ───────────── Modo una página (móvil) ───────────── */
.ltb-block .ltb-ef__v.is-single .ltb-ef__stage {
	width: min(300px, calc(100vw - 72px), calc((100vh - 340px) * .728));
	min-width: 180px;
	aspect-ratio: 300 / 412;
	perspective: 1600px;
}
.ltb-block .ltb-ef__v.is-single .ltb-ef__leaf {
	left: 0;
	width: 100%;
}
.ltb-block .ltb-ef__v.is-single .ltb-ef__leaf.is-flipped {
	transform: rotateY(-160deg);
	opacity: 0;
	transition: transform .8s var(--ltb-turn), opacity .5s ease .3s;
}
.ltb-block .ltb-ef__v.is-single .ltb-ef__row {
	position: relative;
	gap: 0;
	margin-bottom: 72px;           /* espacio para las flechas, que van bajo la página */
}
.ltb-block .ltb-ef__v.is-single .ltb-ef__round {
	position: absolute;
	bottom: -66px;
	z-index: 950;
}
.ltb-block .ltb-ef__v.is-single .ltb-ef__round--prev { left: 0; }
.ltb-block .ltb-ef__v.is-single .ltb-ef__round--next { right: 0; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1024px) {
	.ltb-block .ltb-ef__vin { padding-left: 24px; padding-right: 24px; }
	.ltb-block .ltb-ef__count { min-width: 120px; }
}

@media (max-width: 767px) {
	.ltb-block .ltb-ef__bg { top: 12px; }
	.ltb-block .ltb-ef__flow { height: var(--ltb-ef-h, 250px); margin-top: 20px; }
	.ltb-block .ltb-ef__card {
		width: var(--ltb-ef-w, 124px);
		margin-left: calc(var(--ltb-ef-w, 124px) / -2);
	}
	.ltb-block .ltb-ef__vin { padding: 20px 20px 32px; gap: 20px; }
	.ltb-block .ltb-ef__top { flex-direction: column; align-items: flex-start; }
	.ltb-block .ltb-ef__tool span { display: none; }
	.ltb-block .ltb-ef__tool { padding: 0 12px; }
	.ltb-block .ltb-ef__bar { flex-direction: column; gap: 14px; }
	.ltb-block .ltb-ef__thumbs { max-width: 100%; width: 100%; }
	.ltb-block .ltb-ef__count { min-width: 0; }
	.ltb-block .ltb-ef__count--r { text-align: left; }
}

/* ───────────── Movimiento reducido ───────────── */
@media (prefers-reduced-motion: reduce) {
	.ltb-block .ltb-ef__dialog[open],
	.ltb-block .ltb-ef__leaf.is-turning .ltb-ef__face::before {
		animation: none;
	}
	.ltb-block .ltb-ef__spin {
		animation-duration: 2.4s;
	}
	.ltb-block .ltb-ef__shift,
	.ltb-block .ltb-ef__leaf,
	.ltb-block .ltb-ef__inner,
	.ltb-block .ltb-ef__card img,
	.ltb-block .ltb-ef__v.is-single .ltb-ef__leaf.is-flipped {
		transition-duration: .01ms;
	}
}
