/* ==========================================================================
   Visor de Catálogos – estilos
   ========================================================================== */

:root { --vcat-accent: #513a2a; } /* botón de la ficha; dentro del visor se usa blanco + #afaea7 */

/* --- Botón en la ficha de producto --------------------------------------- */

.vcat-button-wrap { margin: 18px 0 22px; clear: both; }

.vcat-button.vcat-open {
	display: inline-flex; align-items: center; gap: 10px;
	appearance: none; cursor: pointer;
	margin: 0; padding: 13px 22px;
	border: 1px solid var(--vcat-accent); border-radius: 999px;
	background: transparent; color: var(--vcat-accent);
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
	letter-spacing: .01em; text-transform: none; text-decoration: none;
	box-shadow: none; transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.vcat-button.vcat-open svg { flex: none; width: 20px; height: 20px; }
.vcat-button.vcat-open:hover,
.vcat-button.vcat-open:focus-visible {
	background: var(--vcat-accent); color: #fff;
	box-shadow: 0 8px 22px -10px var(--vcat-accent); transform: translateY(-1px);
}
.vcat-button.vcat-open:focus-visible { outline: 2px solid var(--vcat-accent); outline-offset: 3px; }
.vcat-button.vcat-open::after { display: none !important; } /* evita la flecha de los botones de Divi */

/* Tarjeta de portada (shortcode estilo="portada") */
.vcat-cover-card.vcat-open {
	display: inline-flex; flex-direction: column; align-items: stretch; gap: 12px;
	appearance: none; cursor: pointer; margin: 0; padding: 0; border: 0;
	background: none; color: inherit; font: inherit; text-align: left; max-width: 280px;
}
.vcat-cover-img { display: block; overflow: hidden; border-radius: 4px; box-shadow: 0 14px 30px -18px rgba(0,0,0,.55); transition: transform .3s, box-shadow .3s; }
.vcat-cover-img img { display: block; width: 100%; height: auto; margin: 0; }
.vcat-cover-card:hover .vcat-cover-img { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 22px 40px -20px rgba(0,0,0,.6); }
.vcat-cover-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--vcat-accent); }
.vcat-cover-label svg { width: 18px; height: 18px; }

.vcat-gallery-trigger, .vcat-gallery-trigger a { cursor: zoom-in; }

/* --- Bloqueo de scroll ---------------------------------------------------- */

html.vcat-lock, html.vcat-lock body { overflow: hidden !important; }

/* --- Capa del visor ------------------------------------------------------- */

.vcat-overlay {
	--vcat-bg: #121110;
	--vcat-bg2: #24221f;
	--vcat-fg: #fff;
	--vcat-muted: rgba(255,255,255,.6);  /* textos secundarios: marrón claro sobre el fondo */
	--vcat-hl: #fff;                      /* resalte (activo, progreso, foco) */
	--vcat-track: #afaea7;                /* pista de barras, segundo color de marca */
	--vcat-ui: rgba(255,255,255,.07);
	--vcat-ui-hover: rgba(255,255,255,.14);
	--vcat-line: rgba(255,255,255,.1);
	--vcat-panel: rgba(22,21,20,.92);
	--vcat-ph: #ebe8e3;
	--vcat-ph-fg: #c9c4bc;

	position: fixed; inset: 0; z-index: 2147483000;
	display: flex; flex-direction: column;
	background: radial-gradient(120% 90% at 50% 40%, var(--vcat-bg2) 0%, var(--vcat-bg) 70%);
	color: var(--vcat-fg);
	font-size: 14px; line-height: 1.4;
	-webkit-font-smoothing: antialiased;
	opacity: 0; transition: opacity .25s ease;
	-webkit-tap-highlight-color: transparent;
	user-select: none; -webkit-user-select: none;
}
.vcat-overlay.vcat-in { opacity: 1; }
.vcat-overlay *, .vcat-overlay *::before, .vcat-overlay *::after { box-sizing: border-box; }
.vcat-overlay:focus { outline: none; }
/* Iconos de línea fina: 1 px real a cualquier tamaño */
.vcat-overlay svg * { vector-effect: non-scaling-stroke; }

.vcat-overlay.vcat-theme-light {
	--vcat-bg: #e9e6e1;
	--vcat-bg2: #f8f7f5;
	--vcat-fg: #23211e;
	--vcat-muted: rgba(35,33,30,.6);
	--vcat-hl: #513a2a;
	--vcat-track: #afaea7;
	--vcat-ui: rgba(0,0,0,.05);
	--vcat-ui-hover: rgba(0,0,0,.1);
	--vcat-line: rgba(0,0,0,.1);
	--vcat-panel: rgba(250,249,247,.95);
	--vcat-ph: #fff;
	--vcat-ph-fg: #d5d0c8;
}

/* Reinicio de botones frente a estilos del tema (Divi incluido) */
.vcat-overlay .vcat-btn,
.vcat-overlay .vcat-pill,
.vcat-overlay .vcat-thumb {
	appearance: none; -webkit-appearance: none;
	margin: 0; padding: 0; border: 0; border-radius: 0;
	background: none; box-shadow: none; text-shadow: none;
	color: inherit; font: inherit; line-height: 1; letter-spacing: normal; text-transform: none;
	min-width: 0; min-height: 0; width: auto; height: auto;
	cursor: pointer; text-decoration: none;
}
.vcat-overlay .vcat-btn::after, .vcat-overlay .vcat-pill::after { display: none !important; }

.vcat-overlay .vcat-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 50%;
	color: var(--vcat-fg);
	transition: background .15s, color .15s, opacity .15s, transform .15s;
}
.vcat-overlay .vcat-btn svg { width: 20px; height: 20px; display: block; }
.vcat-overlay .vcat-btn:hover { background: var(--vcat-ui-hover); }
.vcat-overlay .vcat-btn:active { transform: scale(.94); }
.vcat-overlay .vcat-btn:focus-visible { outline: 1px solid var(--vcat-hl); outline-offset: 2px; }
.vcat-overlay .vcat-btn:disabled { opacity: .28; cursor: default; background: none; transform: none; }
.vcat-overlay .vcat-btn.is-active { color: var(--vcat-hl); background: var(--vcat-ui); }

/* --- Barra superior ------------------------------------------------------- */

.vcat-top {
	flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 10px 14px 10px 24px;
	padding-top: max(10px, env(safe-area-inset-top));
}
.vcat-titlewrap { min-width: 0; }
.vcat-title {
	font-size: 15px; font-weight: 600; letter-spacing: .01em;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vcat-meta { font-size: 12px; color: var(--vcat-muted); margin-top: 2px; min-height: 1em; }
.vcat-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.vcat-overlay .vcat-close { margin-left: 6px; background: var(--vcat-ui); }

/* --- Escenario ------------------------------------------------------------ */

.vcat-main { position: relative; flex: 1; min-height: 0; display: flex; }
.vcat-stage {
	position: relative; flex: 1; min-width: 0;
	display: flex; align-items: center; justify-content: center;
	margin: 6px 76px 10px;
}
.vcat-book { position: relative; margin: auto; filter: drop-shadow(0 26px 40px rgba(0,0,0,.45)); transition: transform .45s cubic-bezier(.3,.7,.3,1); }
.vcat-theme-light .vcat-book { filter: drop-shadow(0 22px 34px rgba(60,50,40,.22)); }
.vcat-loading .vcat-stage, .vcat-has-error .vcat-stage { visibility: hidden; }

/* Páginas */
.vcat-page {
	overflow: hidden; /* PageFlip la posiciona en absoluto */
	background: var(--vcat-ph);
}
.vcat-page .vcat-canvas {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: contain; display: block; background: #fff;
}
.vcat-page .vcat-ph {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: linear-gradient(100deg, var(--vcat-ph) 30%, rgba(255,255,255,.55) 50%, var(--vcat-ph) 70%) var(--vcat-ph);
	background-size: 250% 100%;
	animation: vcat-shimmer 1.4s linear infinite;
}
.vcat-page .vcat-ph span { font-size: clamp(28px, 5vw, 64px); font-weight: 300; color: var(--vcat-ph-fg); font-variant-numeric: tabular-nums; }
.vcat-page.is-ready .vcat-ph { display: none; }
/* Reverso en blanco de las tapas */
.vcat-page.vcat-blank { background: #fbfaf8; }
.vcat-theme-light .vcat-page.vcat-blank { background: #fff; }
/* Pliegue central sutil */
.vcat-page.--left::after, .vcat-page.--right::after {
	content: ""; position: absolute; top: 0; bottom: 0; width: 6%; pointer-events: none; z-index: 2;
}
.vcat-page.--left::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.16), rgba(0,0,0,0)); }
.vcat-page.--right::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.16), rgba(0,0,0,0)); }
.vcat-portrait .vcat-page::after { display: none; }

@keyframes vcat-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* Enlaces dentro del PDF */
.vcat-links { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.vcat-link { position: absolute; pointer-events: auto; border-radius: 2px; transition: background .15s, box-shadow .15s; }
.vcat-link:hover { background: color-mix(in srgb, #afaea7 22%, transparent); box-shadow: 0 0 0 1px #afaea7; }
.vcat-flipping .vcat-links { display: none; }

/* Flechas laterales */
.vcat-overlay .vcat-side {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
	width: 52px; height: 52px; background: var(--vcat-ui);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.vcat-overlay .vcat-side svg { width: 24px; height: 24px; }
.vcat-overlay .vcat-side:active { transform: translateY(-50%) scale(.94); }
.vcat-overlay .vcat-side:disabled { opacity: 0; pointer-events: none; }
.vcat-side-prev { left: 14px; }
.vcat-side-next { right: 14px; }
.vcat-zoomed .vcat-side, .vcat-loading .vcat-side, .vcat-has-error .vcat-side { display: none; }

/* --- Carga --------------------------------------------------------------- */

.vcat-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 8; }
.vcat-loader[hidden] { display: none; }
.vcat-loader-cover {
	position: absolute; max-height: 78%; max-width: 70%; width: auto; height: auto;
	opacity: .14; filter: blur(2px); border-radius: 4px;
}
.vcat-loader-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 20px; }
.vcat-loader-text { font-size: 14px; color: var(--vcat-muted); max-width: 320px; }
.vcat-spinner {
	width: 34px; height: 34px; border-radius: 50%;
	border: 1px solid var(--vcat-track); border-top-color: var(--vcat-hl);
	animation: vcat-spin .8s linear infinite;
}
.vcat-progress { width: 160px; height: 2px; background: var(--vcat-track); border-radius: 2px; overflow: hidden; }
.vcat-progress span { display: block; height: 100%; width: 5%; background: var(--vcat-hl); transition: width .3s; }
@keyframes vcat-spin { to { transform: rotate(360deg); } }

.vcat-error-actions { display: flex; gap: 10px; }
.vcat-overlay .vcat-pill {
	display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px;
	background: var(--vcat-hl); color: var(--vcat-bg); font-size: 14px; font-weight: 600;
}
.vcat-overlay .vcat-pill-ghost { background: var(--vcat-ui); color: var(--vcat-fg); }

/* --- Barra inferior ------------------------------------------------------ */

.vcat-bottom {
	flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px;
	padding: 0 16px 14px;
	padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.vcat-loading .vcat-bottom, .vcat-has-error .vcat-bottom { visibility: hidden; }

.vcat-scrub { position: relative; width: min(560px, 100%); height: 18px; display: flex; align-items: center; }
.vcat-single .vcat-scrub { display: none; }
.vcat-scrub input[type=range] {
	-webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; padding: 0;
	background: transparent; cursor: pointer; border: 0; box-shadow: none;
}
.vcat-scrub input[type=range]:focus { outline: none; }
.vcat-scrub input[type=range]::-webkit-slider-runnable-track {
	height: 3px; border-radius: 3px;
	background: linear-gradient(to right, var(--vcat-hl) var(--vcat-fill, 0%), var(--vcat-track) var(--vcat-fill, 0%));
}
.vcat-scrub input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--vcat-track); }
.vcat-scrub input[type=range]::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--vcat-hl); }
.vcat-scrub input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%;
	background: var(--vcat-fg); border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.4); transition: transform .15s;
}
.vcat-scrub input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--vcat-fg); border: 0; }
.vcat-scrub input[type=range]:hover::-webkit-slider-thumb, .vcat-scrub input[type=range]:focus-visible::-webkit-slider-thumb { transform: scale(1.25); }
.vcat-scrub-bubble {
	position: absolute; bottom: 24px; transform: translateX(-50%) translateY(4px);
	padding: 4px 9px; border-radius: 6px; background: var(--vcat-fg); color: var(--vcat-bg);
	font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
	opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; white-space: nowrap;
}
.vcat-scrub-bubble.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.vcat-controls {
	display: flex; align-items: center; gap: 2px;
	padding: 4px 6px; border-radius: 999px;
	background: var(--vcat-ui); border: 1px solid var(--vcat-line);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.vcat-pager { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 10px; margin: 0; font-variant-numeric: tabular-nums; cursor: text; }
.vcat-overlay .vcat-pager input {
	appearance: none; width: 3ch; min-width: 2.5ch; margin: 0; padding: 4px 2px; border: 0; border-bottom: 1px solid transparent; border-radius: 0;
	background: transparent; box-shadow: none; color: var(--vcat-fg);
	font: inherit; font-size: 14px; font-weight: 600; text-align: center; line-height: 1.2;
	transition: border-color .15s;
}
.vcat-overlay .vcat-pager input:hover, .vcat-overlay .vcat-pager input:focus { border-bottom-color: var(--vcat-hl); outline: none; }
.vcat-total { color: var(--vcat-muted); font-size: 14px; white-space: nowrap; }
.vcat-sep { width: 1px; height: 20px; background: var(--vcat-line); margin: 0 6px; }

/* --- Miniaturas ---------------------------------------------------------- */

.vcat-thumbs {
	position: absolute; top: 0; bottom: 0; left: 0; z-index: 9;
	width: min(360px, 88vw); overflow-y: auto; overscroll-behavior: contain;
	background: var(--vcat-panel); border-right: 1px solid var(--vcat-line);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	padding: 16px; animation: vcat-slide .22s ease;
	scrollbar-width: thin; scrollbar-color: var(--vcat-line) transparent;
}
.vcat-thumbs[hidden] { display: none; }
@keyframes vcat-slide { from { transform: translateX(-24px); opacity: 0; } }
.vcat-thumbs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 16px 12px; }
.vcat-overlay .vcat-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vcat-thumb-img {
	position: relative; display: block; width: 100%; overflow: hidden; border-radius: 2px;
	background: var(--vcat-ph); outline: 1px solid transparent; outline-offset: 3px;
	transition: outline-color .15s, transform .15s;
}
.vcat-thumb-img canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.vcat-thumb:hover .vcat-thumb-img { transform: translateY(-2px); }
.vcat-thumb.is-current .vcat-thumb-img { outline-color: var(--vcat-hl); }
.vcat-thumb:focus-visible .vcat-thumb-img { outline-color: var(--vcat-fg); }
.vcat-thumb-num { font-size: 11px; color: var(--vcat-muted); font-variant-numeric: tabular-nums; }
.vcat-thumb.is-current .vcat-thumb-num { color: var(--vcat-hl); font-weight: 600; }

/* --- Zoom ---------------------------------------------------------------- */

.vcat-zoom {
	position: absolute; inset: 0; z-index: 7; overflow: auto;
	background: inherit; cursor: grab; overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: var(--vcat-line) transparent;
	touch-action: pan-x pan-y;
}
.vcat-zoom[hidden] { display: none; }
.vcat-zoom.is-dragging { cursor: grabbing; }
.vcat-zoom-inner { display: flex; margin: auto; min-width: 100%; min-height: 100%; align-items: center; justify-content: center; }
.vcat-zoom-page { flex: none; position: relative; background: #fff; }
.vcat-zoom-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }

/* --- Aviso --------------------------------------------------------------- */

.vcat-toast {
	position: absolute; left: 50%; bottom: 18px; z-index: 10; transform: translate(-50%, 10px);
	padding: 9px 16px; border-radius: 999px; background: var(--vcat-fg); color: var(--vcat-bg);
	font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.vcat-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --- Móvil --------------------------------------------------------------- */

@media (max-width: 760px) {
	.vcat-top { padding-left: 16px; padding-right: 8px; }
	.vcat-title { font-size: 14px; }
	.vcat-stage { margin: 4px 8px 8px; }
	.vcat-overlay .vcat-side { display: none; }
	.vcat-overlay .vcat-hide-sm { display: none; }
	.vcat-overlay .vcat-btn { width: 38px; height: 38px; }
	.vcat-bottom { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 380px) {
	.vcat-actions .vcat-btn:not(.vcat-close) { width: 34px; }
	.vcat-sep { margin: 0 2px; }
}
@media (max-height: 520px) and (orientation: landscape) {
	.vcat-top { padding-top: 4px; padding-bottom: 4px; }
	.vcat-meta { display: none; }
	.vcat-bottom { flex-direction: row; justify-content: center; padding-bottom: 6px; }
	.vcat-scrub { width: 40%; }
}

@media (prefers-reduced-motion: reduce) {
	.vcat-overlay, .vcat-page .vcat-ph, .vcat-thumbs { transition: none; animation: none; }
}
