/* =========================================================================
   QR Fichas de Producto – página pública
   Idea: la cédula de una pieza de museo. La imagen en una hornacina,
   la ficha técnica como cédula, detalles finos en pan de oro.
   ========================================================================= */

:root {
	--qrfp-acento: #24407a;                 /* Azul mariano (se cambia en Ajustes) */
	--qrfp-cal: #f0f1ec;                    /* Fondo: blanco cal */
	--qrfp-tinta: #1d2333;
	--qrfp-suave: #5b6272;
	--qrfp-linea: #d8dbd2;
	--qrfp-oro: #a8823a;                    /* Pan de oro */
	--qrfp-nicho: #e3e6e8;
	--qrfp-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
	--qrfp-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--qrfp-ancho: 1180px;
	--qrfp-margen: clamp(18px, 4vw, 40px);
}
@supports (background: color-mix(in srgb, red 10%, white)) {
	:root { --qrfp-nicho: color-mix(in srgb, var(--qrfp-acento) 9%, #e6e8e3); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.qrfp {
	margin: 0;
	background: var(--qrfp-cal);
	color: var(--qrfp-tinta);
	font: 1.0625rem/1.6 var(--qrfp-sans);
	-webkit-font-smoothing: antialiased;
}
.qrfp img { max-width: 100%; height: auto; }
.qrfp a { color: var(--qrfp-acento); }
.qrfp :focus-visible { outline: 2px solid var(--qrfp-acento); outline-offset: 3px; border-radius: 4px; }

.qrfp-saltar { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 50; }
.qrfp-saltar:focus { left: 8px; }

/* ---------- Cabecera ---------- */
.qrfp-top {
	max-width: var(--qrfp-ancho);
	margin: 0 auto;
	padding: 14px var(--qrfp-margen);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
}
.qrfp-logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--qrfp-tinta); }
.qrfp-logo-img { display: block; width: auto; max-height: 38px; max-width: 200px; object-fit: contain; }
.qrfp-logo-txt { font-family: var(--qrfp-serif); font-size: 1.2rem; letter-spacing: .01em; }
.qrfp-top-nav { display: none; gap: 28px; }
.qrfp-top-nav a { color: var(--qrfp-tinta); text-decoration: none; font-size: .95rem; padding: 6px 0; border-bottom: 1px solid transparent; }
.qrfp-top-nav a:hover { border-bottom-color: var(--qrfp-oro); }

/* ---------- Hornacina (marco de imagen) ---------- */
.qrfp-nicho {
	position: relative;
	margin: 0;
	aspect-ratio: 4 / 5;
	background: var(--qrfp-nicho);
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 7% 7% 6%;
}
.qrfp-nicho img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 18px 22px rgba(29, 35, 51, .16));
}
/* Arco de medio punto exacto: en 4:5 el radio horizontal 50% equivale al 40% vertical */
.qrfp-nicho--arco { border-radius: 50% 50% 14px 14px / 40% 40% 14px 14px; padding-top: 16%; }
.qrfp-nicho--arco::after {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px solid var(--qrfp-oro);
	opacity: .55;
	border-radius: 50% 50% 8px 8px / 40% 40% 8px 8px;
	pointer-events: none;
}
/* Rellenar: la foto ocupa todo el marco */
.qrfp-nicho--rellenar, .qrfp-nicho--rellenar.qrfp-nicho--arco { padding: 0; }
.qrfp-nicho--rellenar img { object-fit: cover; filter: none; }
.qrfp-nicho--rellenar::after { opacity: .85; border-color: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px rgba(168, 130, 58, .5); }
.qrfp-nicho--recto::after {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px solid var(--qrfp-oro);
	opacity: .45;
	border-radius: 6px;
	pointer-events: none;
}

/* ---------- Ficha ---------- */
.qrfp-ficha {
	max-width: var(--qrfp-ancho);
	margin: 0 auto;
	padding: 4px var(--qrfp-margen) 40px;
}
.qrfp-media { max-width: 520px; margin: 0 auto; }
.qrfp-info { max-width: 40rem; margin: 0 auto; }

.qrfp-cabecera { padding: 28px 0 4px; }
.qrfp-anio {
	margin: 0 0 10px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--qrfp-serif);
	font-size: 1.05rem;
	color: var(--qrfp-oro);
	font-variant-numeric: oldstyle-nums;
}
.qrfp-anio::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.qrfp-cabecera h1 {
	margin: 0;
	font-family: var(--qrfp-serif);
	font-weight: 500;
	font-size: clamp(2.1rem, 3.2vw + 1.2rem, 3.5rem);
	line-height: 1.06;
	letter-spacing: -.01em;
	text-wrap: balance;
}
.qrfp-corta {
	margin: 16px 0 0;
	font-family: var(--qrfp-serif);
	font-size: 1.2rem;
	line-height: 1.55;
	color: var(--qrfp-suave);
	max-width: 34em;
}

/* Botones dentro de la ficha (tablet y escritorio) */
.qrfp-acciones { display: none; flex-wrap: wrap; gap: 10px; margin: 26px 0 6px; }
.qrfp-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 11px 18px;
	border-radius: 999px;
	border: 1px solid var(--qrfp-linea);
	background: #fff;
	color: var(--qrfp-tinta) !important;
	font: 500 .95rem/1.2 var(--qrfp-sans);
	text-decoration: none;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}
.qrfp-btn:hover { border-color: var(--qrfp-acento); }
.qrfp-btn--principal { background: var(--qrfp-acento); border-color: var(--qrfp-acento); color: #fff !important; }
.qrfp-btn--principal:hover { filter: brightness(1.1); }
.qrfp-ico { flex: none; }

/* Secciones */
.qrfp-seccion { padding: 26px 0 4px; }
.qrfp-seccion + .qrfp-seccion { border-top: 1px solid var(--qrfp-linea); margin-top: 22px; }
.qrfp-acciones + .qrfp-seccion, .qrfp-cabecera + .qrfp-seccion { margin-top: 10px; }
.qrfp-seccion h2 {
	margin: 0 0 14px;
	font-family: var(--qrfp-serif);
	font-weight: 500;
	font-style: italic;
	font-size: 1.3rem;
	color: var(--qrfp-acento);
}
.qrfp-seccion p { margin: 0 0 1em; }
.qrfp-seccion p:last-child { margin-bottom: 0; }

/* Cédula (ficha técnica) */
.qrfp-cedula { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.qrfp-cedula div { padding: 11px 0 12px; border-bottom: 1px solid var(--qrfp-linea); }
.qrfp-cedula dt { font-size: .82rem; color: var(--qrfp-suave); }
.qrfp-cedula dd { margin: 2px 0 0; font-family: var(--qrfp-serif); font-size: 1.12rem; line-height: 1.35; }

.qrfp-texto { font-family: var(--qrfp-serif); font-size: 1.14rem; line-height: 1.72; }
.qrfp-texto img { border-radius: 8px; }

.qrfp-curiosidades { list-style: none; margin: 0; padding: 0; }
.qrfp-curiosidades li { position: relative; padding: 0 0 12px 26px; }
.qrfp-curiosidades li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: .62em;
	width: 7px;
	height: 7px;
	background: var(--qrfp-oro);
	transform: rotate(45deg);
}

.qrfp-nota p { color: var(--qrfp-suave); }
.qrfp-solo-imprimir { display: none; }

/* ---------- Otras piezas y catálogo ---------- */
.qrfp-otras {
	max-width: var(--qrfp-ancho);
	margin: 0 auto;
	padding: 34px var(--qrfp-margen) 30px;
	border-top: 1px solid var(--qrfp-linea);
}
.qrfp-otras h2 { margin: 0 0 20px; font-family: var(--qrfp-serif); font-weight: 500; font-size: 1.6rem; }
.qrfp-otras-mas { margin: 22px 0 0; }

.qrfp-rejilla { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
.qrfp-tarjeta a { display: block; text-decoration: none; color: var(--qrfp-tinta); }
.qrfp-nicho--mini { padding: 9% 9% 7%; border-radius: 10px; }
.qrfp-nicho--mini.qrfp-nicho--arco { border-radius: 50% 50% 10px 10px / 40% 40% 10px 10px; padding-top: 18%; }
.qrfp-nicho--mini::after { inset: 6px; }
.qrfp-nicho--mini.qrfp-nicho--arco::after { border-radius: 50% 50% 6px 6px / 40% 40% 6px 6px; }
.qrfp-nicho--mini.qrfp-nicho--rellenar { padding: 0; }
.qrfp-nicho--mini.qrfp-nicho--rellenar img { filter: none; }
.qrfp-nicho--mini img { filter: drop-shadow(0 8px 10px rgba(29, 35, 51, .14)); transition: transform .3s ease; }
.qrfp-tarjeta a:hover img { transform: translateY(-3px); }
.qrfp-tarjeta-nombre { display: block; margin-top: 12px; font-family: var(--qrfp-serif); font-size: 1.1rem; line-height: 1.3; }
.qrfp-tarjeta-anio { display: block; margin-top: 2px; font-size: .85rem; color: var(--qrfp-oro); font-family: var(--qrfp-serif); }

.qrfp-catalogo { max-width: var(--qrfp-ancho); margin: 0 auto; padding: 12px var(--qrfp-margen) 40px; }
.qrfp-catalogo-cab { padding: 18px 0 26px; }
.qrfp-catalogo-cab h1 { margin: 0; font-family: var(--qrfp-serif); font-weight: 500; font-size: clamp(2.1rem, 3vw + 1.2rem, 3.2rem); line-height: 1.08; }
.qrfp-catalogo-cab p { margin: 6px 0 0; color: var(--qrfp-suave); }
.qrfp-paginas { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 6px; }
.qrfp-paginas .page-numbers { padding: 8px 14px; border: 1px solid var(--qrfp-linea); border-radius: 999px; text-decoration: none; color: var(--qrfp-tinta); background: #fff; }
.qrfp-paginas .current { background: var(--qrfp-acento); border-color: var(--qrfp-acento); color: #fff; }
.qrfp-vacio { color: var(--qrfp-suave); }

/* ---------- Pie ---------- */
.qrfp-pie {
	max-width: var(--qrfp-ancho);
	margin: 0 auto;
	padding: 22px var(--qrfp-margen) 30px;
	text-align: center;
	font-size: .8rem;
	color: var(--qrfp-suave);
	border-top: 1px solid var(--qrfp-linea);
}
.qrfp-pie a { color: inherit; text-decoration: none; }
.qrfp-pie a:hover { text-decoration: underline; }

/* ---------- Barra fija de acciones (móvil) ---------- */
.qrfp-barra {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 20;
	display: flex;
	gap: 8px;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-top: 1px solid var(--qrfp-linea);
}
.qrfp-barra-btn {
	flex: none;
	width: 46px;
	height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 999px;
	border: 1px solid var(--qrfp-linea);
	background: #fff;
	color: var(--qrfp-tinta) !important;
	text-decoration: none;
	font: 600 .95rem/1.1 var(--qrfp-sans);
	cursor: pointer;
	padding: 0;
}
.qrfp-barra-btn .qrfp-btn-txt { display: none; }
.qrfp-barra-principal { flex: 1 1 auto; min-width: 0; width: auto; padding: 0 14px; background: var(--qrfp-acento); border-color: var(--qrfp-acento); color: #fff !important; }
.qrfp-barra-principal .qrfp-btn-txt { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrfp-copiado { border-color: var(--qrfp-oro) !important; }
.qrfp-con-barra .qrfp-pie { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
	.qrfp-top { justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
	.qrfp-logo-img { max-height: 46px; }
	.qrfp-top-nav { display: flex; }
	.qrfp-acciones { display: flex; }
	.qrfp-barra { display: none; }
	.qrfp-con-barra .qrfp-pie { padding-bottom: 30px; }
	.qrfp-rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 24px; }
}

/* ---------- Escritorio: imagen fija a la izquierda, texto a la derecha ---------- */
@media (min-width: 960px) {
	.qrfp-ficha {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		gap: clamp(40px, 5vw, 80px);
		align-items: start;
		padding-top: 18px;
		padding-bottom: 64px;
	}
	.qrfp-sin-imagen .qrfp-ficha { display: block; }
	.qrfp-media { position: sticky; top: 28px; max-width: none; margin: 0; }
	.qrfp-nicho { max-height: calc(100vh - 56px); margin: 0 auto; }
	.qrfp-info { margin: 0; padding-top: 8px; }
	.qrfp-sin-imagen .qrfp-info { margin: 0 auto; }
	.qrfp-rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.qrfp-otras { padding-top: 48px; padding-bottom: 48px; }
}

/* ---------- Impresión: una hoja limpia ---------- */
@media print {
	@page { margin: 16mm; }
	body.qrfp { background: #fff; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.qrfp-top-nav, .qrfp-acciones, .qrfp-barra, .qrfp-otras, .qrfp-saltar { display: none !important; }
	.qrfp-top { justify-content: flex-start; padding: 0 0 8mm; }
	.qrfp-ficha { display: block; padding: 0; max-width: none; }
	.qrfp-media { float: right; width: 62mm; margin: 0 0 6mm 8mm; position: static; }
	.qrfp-nicho { background: #fff; border: 1px solid #ccc; padding: 6%; }
	.qrfp-nicho img { filter: none; }
	.qrfp-info { max-width: none; }
	.qrfp-cabecera h1 { font-size: 24pt; }
	.qrfp-seccion { break-inside: avoid; }
	.qrfp-solo-imprimir { display: block; clear: both; margin-top: 8mm; font-size: 9pt; color: #555; }
	.qrfp-pie { border: 0; padding: 6mm 0 0; text-align: left; }
	.qrfp-con-barra .qrfp-pie { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.qrfp * { transition: none !important; }
}
