/* Catalog preview viewer (shared).
   One page at a time, fitted to the panel height so the whole page is visible
   without scrolling. The zoom control goes from 100% (fit) to 300%, and the
   page images are rendered at 2400 px so hairlines and small spec tables stay
   readable when enlarged. */

.mtcv[hidden]{display:none}
.mtcv{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;
  padding:24px}
.mtcv-backdrop{position:absolute;inset:0;background:rgba(9,24,40,.62);backdrop-filter:blur(2px)}
.mtcv-panel{position:relative;display:flex;flex-direction:column;width:100%;max-width:780px;
  height:calc(100vh - 48px);background:#fff;border-radius:12px;overflow:hidden;
  box-shadow:0 28px 64px rgba(6,24,44,.34)}
.mtcv-bar{flex:0 0 auto;display:flex;align-items:center;gap:10px;
  padding:12px 16px;border-bottom:1px solid #e3ecf5;background:#fff}
.mtcv-title{flex:1 1 auto;min-width:0;font-size:.95rem;font-weight:700;color:var(--ink);line-height:1.25;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* page pager */
.mtcv-pager{flex:0 0 auto;display:flex;align-items:center;gap:3px;
  font-size:.82rem;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.mtcv-pager b{color:var(--brand)}
.mtcv-pager button{width:26px;height:26px;padding:0;border:1px solid #dbe6f1;border-radius:5px;
  background:#fff;color:var(--brand);font-size:1.05rem;line-height:1;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;transition:border-color .16s ease,background .16s ease}
.mtcv-pager button:hover:not(:disabled){border-color:#0054a5;background:#f2f8fe}
.mtcv-pager button:disabled{opacity:.32;cursor:default}

/* zoom control */
.mtcv-zoombar{flex:0 0 auto;display:flex;align-items:center;gap:1px;
  border:1px solid #dbe6f1;border-radius:6px;padding:2px}
.mtcv-zoombar button{min-width:26px;height:24px;padding:0 5px;border:0;border-radius:4px;
  background:transparent;color:var(--brand);font-size:.95rem;font-weight:700;line-height:1;
  cursor:pointer;transition:background .16s ease}
.mtcv-zoombar button:hover:not(:disabled){background:#eef6fb}
.mtcv-zoombar button:disabled{opacity:.32;cursor:default}
.mtcv-zval{min-width:42px;text-align:center;font-size:.74rem;font-weight:700;color:var(--muted);
  font-variant-numeric:tabular-nums}

.mtcv-btn{display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border:0;border-radius:6px;
  background:#0054a5;color:var(--on-dark);font-size:.86rem;font-weight:700;line-height:1;cursor:pointer;
  text-decoration:none;transition:background .16s ease}
.mtcv-btn:hover{background:#0a4378;color:var(--on-dark);text-decoration:none}
.mtcv-btn-ghost{background:#fff;color:var(--brand);border:1px solid #9ebad7}
.mtcv-btn-ghost:hover{background:#eef6fb;color:var(--brand)}
.mtcv-short{display:none}
.mtcv-x{flex:0 0 36px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;
  border:1px solid #dbe6f1;border-radius:6px;background:#fff;color:var(--muted);font-size:1.3rem;
  line-height:1;cursor:pointer;transition:border-color .16s ease,color .16s ease}
.mtcv-x:hover{border-color:#0054a5;color:var(--brand)}

/* page stage: fit by height, scroll only when zoomed in.
   touch-action:none keeps the browser from stealing our swipe gestures; the
   viewer pans with JS when zoomed in and changes pages when fitted. */
.mtcv-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;
  background:#eef2f7;padding:16px;touch-action:none}
.mtcv-body.is-zoomed{cursor:grab}
.mtcv-body.is-dragging{cursor:grabbing}
.mtcv-stage{min-height:100%;display:flex;justify-content:center;align-items:flex-start;margin:0 auto;
  transition:transform .18s ease}
.mtcv-body.is-swiping .mtcv-stage{transition:none}
.mtcv-img{display:block;flex:0 0 auto;background:#fff;border-radius:3px;
  box-shadow:0 2px 12px rgba(0,84,165,.14);user-select:none;-webkit-user-drag:none}

@media (max-width:767.98px){
  .mtcv{padding:0}
  .mtcv-panel{max-width:none;height:100%;max-height:none;border-radius:0}
  .mtcv-bar{flex-wrap:wrap;padding:10px 12px;gap:8px}
  .mtcv-title{flex:1 1 100%;order:1;font-size:.9rem}
  .mtcv-pager{order:2;flex:0 0 auto}
  .mtcv-zoombar{order:3}
  .mtcv-bar>.mtcv-btn{order:4;margin-left:auto;padding:8px 12px;font-size:.8rem}
  .mtcv-x{order:5}
  .mtcv-full{display:none}
  .mtcv-short{display:inline}
  .mtcv-body{padding:10px}
}
