/* Minilibros Armonía — Lector, modo biblioteca y ficha de catálogo
   v2.1.1: Agregados estilos para acceso restringido
   
   Paleta real de marca:
   Azul Profundo #1C5368 · Azul Emblema #1C7095 · Verde Armonía #789A5D
   Aqua Claro #ACE1E7 · Dorado Tierra #948C68 · Tinta #22333B */

/* =========================================================================
 *  Bloqueo de botón "Añadir al carrito" en Modo Biblioteca
 * ====================================================================== */
.woocommerce .product .add_to_cart_button,
.woocommerce-page .product .add_to_cart_button,
.woocommerce ul.products li.product .button.add_to_cart_button,
.woocommerce-page ul.products li.product .button.add_to_cart_button,
.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button {
	display: none !important;
	visibility: hidden !important;
}

/* =========================================================================
 *  Botones "Leer en línea" y "Descargar PDF"
 * ====================================================================== */
.mla-acciones {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 16px 0;
	align-items: center;
}

.mla-acciones.mla-acciones-restringido {
	margin: 12px 0;
}

.mla-btn-leer,
.mla-btn-descargar {
	background: #1C7095;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 20px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.15s ease;
	display: inline-block;
	text-align: center;
	line-height: 1.5;
}

.mla-btn-leer:hover,
.mla-btn-descargar:hover {
	background: #1C5368;
	color: #fff;
	transform: translateY(-2px);
}

.mla-btn-leer:active,
.mla-btn-descargar:active {
	transform: translateY(0);
}

.mla-btn-descargar {
	background: #789A5D;
}

.mla-btn-descargar:hover {
	background: #1C5368;
}

/* =========================================================================
 *  Mensaje de acceso restringido (login/registro)
 * ====================================================================== */
.mla-acceso-restringido {
	background: #FFF3CD;
	border: 1px solid #FFE69C;
	border-left: 4px solid #FFC107;
	border-radius: 4px;
	padding: 10px 14px;
	margin: 12px 0;
	color: #856404;
	font-size: 0.95em;
	line-height: 1.5;
}

.mla-acceso-restringido a {
	color: #1C7095;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s ease;
}

.mla-acceso-restringido a:hover {
	color: #1C5368;
	text-decoration: underline;
}

.mla-acceso-restringido a:visited {
	color: #1C7095;
}

/* =========================================================================
 *  Ficha de catálogo (Autor, Nº, Colección, Categoría)
 * ====================================================================== */
.mla-ficha-catalogo {
	background: #ACE1E7;
	border-left: 4px solid #1C5368;
	border-radius: 4px;
	padding: 10px 16px;
	margin: 12px 0 20px;
}

.mla-ficha-item {
	margin: 4px 0;
	color: #22333B;
	font-size: 0.95em;
	line-height: 1.5;
	word-break: break-word;
}

.mla-ficha-item strong {
	color: #1C5368;
	font-weight: 600;
}

/* =========================================================================
 *  Modal del lector PDF
 * ====================================================================== */
.mla-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
}

.mla-modal.show,
.mla-modal[style*="display: block"],
.mla-modal[style*="display:block"] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.mla-modal-fondo {
	position: absolute;
	inset: 0;
	background: rgba(34, 51, 59, 0.85);
	cursor: pointer;
}

.mla-modal-contenido {
	position: relative;
	max-width: 900px;
	width: 95%;
	height: 90vh;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	z-index: 2;
}

.mla-modal-cerrar {
	position: absolute;
	top: 8px;
	right: 12px;
	background: #1C5368;
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 34px;
	height: 34px;
	padding: 0;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 10;
	transition: background 0.2s ease;
}

.mla-modal-cerrar:hover {
	background: #1C7095;
}

.mla-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* =========================================================================
 *  Responsive: tablets y móviles
 * ====================================================================== */
@media (max-width: 782px) {
	.mla-modal-contenido {
		max-width: 100%;
		width: 100%;
		height: 100vh;
		border-radius: 0;
	}

	.mla-acciones {
		flex-direction: column;
		gap: 8px;
	}

	.mla-btn-leer,
	.mla-btn-descargar {
		width: 100%;
		padding: 12px 16px;
	}

	.mla-acceso-restringido {
		font-size: 0.9em;
		padding: 8px 12px;
	}

	.mla-ficha-catalogo {
		padding: 8px 12px;
	}

	.mla-ficha-item {
		font-size: 0.9em;
	}
}

/* =========================================================================
 *  Print: ocultar controles interactivos
 * ====================================================================== */
@media print {
	.mla-acciones,
	.mla-modal,
	.woocommerce .button {
		display: none !important;
	}

	.mla-ficha-catalogo {
		page-break-inside: avoid;
		border: 1px solid #ccc;
	}
}
