/* ==========================================================================
   Visor iPaper Flipbook (layout ipaper-flipbook)
   ========================================================================== */

/* --------------------------------------------------------------------------
   TEMA DEL LAYOUT FLIPBOOK
   Todo lo que cambie de identidad (color, tipografía) se ajusta AQUÍ.
   Estas variables solo aplican dentro de <body class="body-flipbook">,
   por lo que los demás layouts del sitio no se ven afectados.
   -------------------------------------------------------------------------- */
.body-flipbook {
	/* Color principal: navbar, footer, botones activos, resaltados.
	   Beige claro indicado por el cliente el 2026-09-23
	   (antes azul de prueba #3057E1). */
	--fb-brand: #EEE8E3;
	/* Texto/íconos sobre el color principal (indicado por el cliente el 2026-09-30) */
	--fb-brand-contrast: #282828;
	/* Variante para hover/sombras (se deriva del principal) */
	--fb-brand-soft: rgba(238, 232, 227, .25);
	/* Texto, enlaces e iconos de redes del footer (indicado por el cliente el 2026-09-30) */
	--fb-footer-text: #282828;

	/* Tipografía del visor (barra de herramientas, paginador, miniaturas).
	   Pendiente la definitiva; por ahora la misma del sitio. */
	--fb-font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;

	/* Fondos y neutros del visor */
	--fb-bg: #e9ecf3;
	--fb-border: #d9dde6;
	--fb-text: #1d1d1d;

	/* Medidas */
	--fb-toolbar-h: 56px;
	--fb-nav-h: 76px;      /* alto real del navbar fijo (56px en móvil, ver abajo) */
}

/* Navbar y footer del sitio, recoloreados solo en este layout */
.body-flipbook nav.bg-coppel     { background-color: var(--fb-brand); }
.body-flipbook footer.bg-primary { background: var(--fb-brand) !important; }
/* Texto, enlaces e iconos de redes del footer (pisa el blanco de folleto/style.css
   y la clase .text-white de Bootstrap, que lleva !important) */
.body-flipbook footer p,
.body-flipbook footer ul,
.body-flipbook footer ul li a,
.body-flipbook footer ul li a i,
.body-flipbook footer a.text-white { color: var(--fb-footer-text) !important; }
.body-flipbook a.link-nav-home,
.body-flipbook a.link-nav-home:hover,
.body-flipbook a.link-nav-home:visited { color: var(--fb-brand-contrast); }
/* Logo del navbar (LogoCoppel.svg llena todo su lienzo; el anterior traía aire).
   Se conserva la caja de 60px/40px que da folleto/style.css para no mover el alto
   del navbar, y con padding el dibujo queda del alto visible del logo anterior. */
.body-flipbook nav > a > img { height: 60px; padding: 14px 0; box-sizing: border-box; }
@media only screen and (max-width: 700px) {
	.body-flipbook nav > a > img { height: 40px; padding: 9px 0; }
}

/* Cuando llegue la tipografía definitiva, descomentar para aplicarla
   también a navbar y footer de este layout:
.body-flipbook nav.bg-coppel,
.body-flipbook footer { font-family: var(--fb-font-family); }
*/

.body-flipbook { background: var(--fb-bg); }

/* Google Tag Manager (GTM-TFSD9ZTS) inyecta un <ip-embed-leaflet id="horizon">
   con alias de ejemplo en todas las páginas de revistas; en este layout no
   aplica y mostraba "Error: Leaflet was not found" al pie. Se oculta mientras
   se corrige la etiqueta en GTM. */
.body-flipbook > ip-embed-leaflet#horizon,
.body-flipbook > ip-embed#horizon { display: none !important; }

.fb {
	position: relative;
	padding-top: var(--fb-nav-h);
	background: var(--fb-bg);
	color: var(--fb-text);
	font-family: var(--fb-font-family);
}

/* ---------- Toolbar ---------- */
.fb-toolbar {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 8px;
	height: var(--fb-toolbar-h);
	padding: 0 16px;
	background: #fff;
	border-bottom: 1px solid var(--fb-border);
}
.fb-toolbar__group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fb-toolbar__group--center { justify-content: center; }
.fb-toolbar__group--right  { justify-content: flex-end; }

.fb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--fb-border);
	border-radius: 50%;
	background: #fff;
	color: var(--fb-text);
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}
.fb-btn svg { width: 22px; height: 22px; }
.fb-btn:hover, .fb-btn:focus-visible { background: var(--fb-brand); border-color: var(--fb-brand); color: var(--fb-brand-contrast); outline: none; }
.fb-btn:disabled { opacity: .35; cursor: not-allowed; }
a.fb-btn { text-decoration: none; }
.fb-btn:disabled:hover { background: #fff; color: var(--fb-text); border-color: var(--fb-border); }

/* Toggle Página única / Vista general */
.fb-toggle {
	position: relative;
	display: inline-flex;
	align-items: stretch;
	height: 40px;
	padding: 3px;
	border: 1px solid var(--fb-border);
	border-radius: 999px;
	background: #f2f4f8;
	cursor: pointer;
}
.fb-toggle__indicator {
	position: absolute;
	top: 3px; bottom: 3px; left: 3px;
	width: calc(50% - 3px);
	border-radius: 999px;
	background: var(--fb-brand);
	transition: transform .2s ease;
}
.fb-toggle[aria-pressed="true"] .fb-toggle__indicator { transform: translateX(100%); }
.fb-toggle__opt {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: #555;
	white-space: nowrap;
	transition: color .2s;
}
.fb-toggle__opt svg { width: 20px; height: 20px; fill: currentColor; }
.fb-toggle__opt.is-active { color: var(--fb-brand-contrast); }

/* Paginador */
.fb-pager { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 15px; }
.fb-pager__input {
	width: 56px;
	height: 36px;
	padding: 0 6px;
	border: 1px solid var(--fb-border);
	border-radius: 8px;
	text-align: center;
	font: inherit;
	-moz-appearance: textfield;
}
.fb-pager__input::-webkit-outer-spin-button,
.fb-pager__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fb-pager__input:focus { outline: 2px solid var(--fb-brand); outline-offset: 1px; }
.fb-pager__sep { color: #999; }

/* Fullscreen icons */
.fb-icon-exit { display: none; }
.fb.is-fullscreen .fb-icon-enter { display: none; }
.fb.is-fullscreen .fb-icon-exit  { display: block; }

/* ---------- Stage ---------- */
.fb-stage {
	position: relative;
	height: calc(100vh - var(--fb-nav-h) - var(--fb-toolbar-h));
	min-height: 480px;
	background: var(--fb-bg);
}
.fb-frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: var(--fb-bg);
}
.fb.is-overview .fb-frame { visibility: hidden; position: absolute; inset: 0; }

/* Vista general */
.fb-overview {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	padding: 20px 16px 40px;
	background: var(--fb-bg);
}
.fb-overview__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 20px 16px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0;
	list-style: none;
}
.fb-overview__item { margin: 0; }
.fb-overview__btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	text-align: center;
	font: inherit;
	color: var(--fb-text);
}
.fb-overview__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 210 / 297;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--fb-border);
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0,0,0,.08);
	transition: transform .15s, box-shadow .15s, border-color .15s;
}
.fb-overview__btn:hover .fb-overview__thumb,
.fb-overview__btn:focus-visible .fb-overview__thumb {
	transform: translateY(-2px);
	border-color: var(--fb-brand);
	box-shadow: 0 6px 16px var(--fb-brand-soft);
}
.fb-overview__btn:focus-visible { outline: none; }
.fb-overview__item.is-current .fb-overview__thumb { border: 2px solid var(--fb-brand); }
.fb-overview__num { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; }

.fb-error {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 24px;
	text-align: center;
	color: #b00020;
}

/* ---------- Pantalla completa ---------- */
.fb:fullscreen,
.fb:-webkit-full-screen,
.fb.is-fs-fallback {
	padding-top: 0;
	background: var(--fb-bg);
}
.fb.is-fs-fallback {
	position: fixed;
	inset: 0;
	z-index: 10000;
}
.fb:fullscreen .fb-stage,
.fb:-webkit-full-screen .fb-stage,
.fb.is-fs-fallback .fb-stage {
	height: calc(100vh - var(--fb-toolbar-h));
	height: calc(100dvh - var(--fb-toolbar-h));
	min-height: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	.body-flipbook { --fb-nav-h: 56px; }
	.fb-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0 8px; gap: 4px; }
	.fb-toolbar__group { gap: 4px; }
	.fb-toggle { height: 36px; }
	.fb-toggle__opt { padding: 0 10px; }
	.fb-btn { width: 36px; height: 36px; }
	.fb-btn svg { width: 20px; height: 20px; }
	.fb-pager { font-size: 14px; gap: 4px; }
	.fb-pager__input { width: 44px; height: 32px; }
	.fb-stage { min-height: 420px; }
	.fb-overview__grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px 10px; }
}
