/* HojeaSuite — tienda
 *
 * Los colores salen del tema cuando el tema los publica; si no, caen en los
 * de aquí.
 */

.hoja-boton-caja,
.hoja-visor {
	--hoja-acento: var(--rjk-primary, var(--wp--preset--color--primary, #1d3a22));
	--hoja-acento-texto: var(--rjk-on-primary, #fff);
	--hoja-borde: var(--rjk-border, #e1dbd0);
	--hoja-texto: var(--rjk-text, #333);
	--hoja-apagado: var(--rjk-text-muted, #6b6b6b);
	--hoja-radio: var(--rjk-radius, 10px);
}

/* ------------------------------------------------ El botón de la ficha */

.hoja-boton-caja {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin: 14px 0 0;
}

.hoja-boton {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 11px 18px;
	border: 1px solid var(--hoja-acento);
	border-radius: max(6px, calc(var(--hoja-radio) - 2px));
	background: transparent;
	color: var(--hoja-acento);
	font-family: inherit;
	font-size: .95em;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.hoja-boton:hover,
.hoja-boton:focus {
	background: var(--hoja-acento);
	color: var(--hoja-acento-texto);
}

.hoja-icono {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10.3 5 7.8 4.3 4 4.3v13.4c3.8 0 6.3.7 8 2.2 1.7-1.5 4.2-2.2 8-2.2V4.3c-3.8 0-6.3.7-8 2.2z'/%3E%3Cpath d='M12 6.5V20'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10.3 5 7.8 4.3 4 4.3v13.4c3.8 0 6.3.7 8 2.2 1.7-1.5 4.2-2.2 8-2.2V4.3c-3.8 0-6.3.7-8 2.2z'/%3E%3Cpath d='M12 6.5V20'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
}

.hoja-cuantas {
	font-size: .86em;
	color: var(--hoja-apagado);
}

.hoja-enlace-listado {
	display: inline-block;
	margin-top: 4px;
	font-size: .82em;
	color: var(--hoja-apagado);
	text-decoration: underline;
}

/* ------------------------------------------------------------ El visor */

body.hoja-abierto { overflow: hidden; }

.hoja-visor {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}

.hoja-visor[hidden] { display: none; }

.hoja-fondo {
	position: absolute;
	inset: 0;
	background: rgba(12, 12, 14, .88);
}

.hoja-caja {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1100px;
	height: 100%;
	max-height: 94vh;
	color: #f2f2f2;
}

.hoja-barra {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 4px 12px;
}

.hoja-titulo {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	font-size: 1rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hoja-contador {
	font-size: .88rem;
	color: #c7c7c7;
	font-variant-numeric: tabular-nums;
}

.hoja-cerrar {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.hoja-cerrar:hover,
.hoja-cerrar:focus { background: rgba(255, 255, 255, .22); }

/* Las páginas, una al lado de otra, con parada en cada una */

.hoja-paginas {
	flex: 1 1 auto;
	display: flex;
	gap: 16px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: 6px;
}

.hoja-pagina {
	flex: 0 0 100%;
	margin: 0;
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hoja-pagina img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	background: #fff;
	box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

.hoja-final {
	flex: 0 0 100%;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	text-align: center;
	padding: 20px;
}

.hoja-final-texto {
	margin: 0;
	max-width: 36ch;
	font-size: 1.05rem;
	line-height: 1.5;
	color: #e8e8e8;
}

.hoja-boton-comprar {
	border-color: #fff;
	background: #fff;
	color: #16161a;
	text-decoration: none;
}

.hoja-boton-comprar:hover,
.hoja-boton-comprar:focus {
	background: transparent;
	color: #fff;
}

.hoja-pdf {
	flex: 1 1 auto;
	min-height: 0;
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
}

.hoja-pdf iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.hoja-final-pdf {
	flex: 0 0 auto;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 12px 20px;
	padding: 14px 4px 0;
	text-align: left;
}

.hoja-final-pdf .hoja-final-texto {
	flex: 1 1 240px;
	max-width: none;
	font-size: .95rem;
}

/* Flechas */

.hoja-flecha {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}

.hoja-flecha:hover,
.hoja-flecha:focus { background: rgba(255, 255, 255, .26); }

.hoja-flecha-antes { left: -8px; }
.hoja-flecha-despues { right: -8px; }

.hoja-aviso {
	margin: 10px 0 0;
	font-size: .78rem;
	line-height: 1.4;
	color: #9a9a9a;
	text-align: center;
}

@media (max-width: 782px) {
	.hoja-visor { padding: 12px 8px; }
	.hoja-flecha { display: none; }
	.hoja-caja { max-height: 96vh; }
	.hoja-paginas { gap: 10px; }
}
