/* ------------------------------------------------------------------ */
/* Shared image zoom layer                                            */
/*   Plain mode (default): a product photo or at-a-glance figure opens */
/*   at full size; any click or Esc closes it. No zoom, no drag, no    */
/*   hint line - a reader only wants the picture bigger.               */
/*   Pan mode (.is-pan): the OEM / ODM / private-label process         */
/*   diagrams add wheel zoom, drag-to-pan and double-click reset, and */
/*   carry the hint line that explains those gestures.                */
/*   The layer is built by assets/js/mtc-zoom.js, so no <img> with an  */
/*   empty src sits in the markup.                                     */
/* ------------------------------------------------------------------ */

.mtc-zl {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 20, 34, .94);
  overflow: auto;
  padding: 26px 0 58px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity .18s ease;
}
.mtc-zl[hidden] { display: none; }
.mtc-zl.is-open { opacity: 1; }

/* Plain view centres the single picture in the window; there is no hint
   line taking up room at the bottom. */
.mtc-zl:not(.is-pan) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 8px;
}

.mtc-zl-img {
  display: block;
  /* Plain view: one size that fits the window without cropping, whatever
     the aspect ratio of the shot. */
  width: auto;
  height: auto;
  max-width: min(92vw, 1280px);
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  margin: 0 auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  cursor: zoom-out;
  -webkit-user-select: none;
  user-select: none;
}

/* Pan mode: 1x shows the whole diagram inside the viewport; the wheel
   zoom and the pinch handler grow it from this reference size. */
.mtc-zl.is-pan .mtc-zl-img {
  height: calc(100vh - 170px);
  height: calc(100dvh - 170px);
  width: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-in;
  touch-action: pan-x pan-y;
}

.mtc-zl-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 2001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  /* The diagram is white and can sit right under the button, so a
     translucent white disc would disappear into it. */
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(8, 20, 34, .78);
  color:var(--on-dark);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}
.mtc-zl-close:hover,
.mtc-zl-close:focus-visible {
  background: rgba(8, 20, 34, .95);
  outline: none;
}

.mtc-zl-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  font-size: .78rem;
  line-height: 1.4;
  letter-spacing: .01em;
  color:var(--on-dark-muted);
  pointer-events: none;
}
/* Plain image views must not show the gesture legend: it described a
   behaviour they no longer have. */
.mtc-zl-hint[hidden] { display: none; }
/* Zoomed in, the diagram runs under the hint, so it needs its own ground
   to stay legible on white as well as on the dark surround. */
.mtc-zl-hint span {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(8, 20, 34, .74);
}

@media (max-width: 767.98px) {
  .mtc-zl { padding: 54px 10px 24px; }
  .mtc-zl.is-pan { padding-bottom: 46px; }
  /* Fill the width on a phone: a shot capped to the screen height would
     start out smaller than the thumbnail the reader just tapped. */
  .mtc-zl-img {
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 0;
  }
  /* A 2000px-wide diagram capped to the screen height would start out
     showing a third of itself and need sideways panning. */
  .mtc-zl.is-pan .mtc-zl-img {
    height: auto;
    width: 100%;
    max-width: 100%;
  }
  .mtc-zl-close { top: 8px; right: 8px; width: 40px; height: 40px; font-size: 24px; }
  .mtc-zl-hint { bottom: 10px; font-size: .72rem; }
}

/* ------------------------------------------------------------------ */
/* S589 gallery navigation                                           */
/*   One overlay of controls serves both enlarged-image hosts. The     */
/*   buttons are real <button> elements, never anchors, so no new      */
/*   crawlable URLs are introduced.                                   */
/* ------------------------------------------------------------------ */

.mtc-gal-nav[hidden] { display: none !important; }

/* Host 1: the shared dark layer. Fixed positioning keeps the controls
   out of the layer's scroll and flex layout. */
.mtc-gal-nav--zl {
  position: fixed;
  inset: 0;
  z-index: 2002;
  pointer-events: none;
}

/* Host 2: the per-page white Bootstrap lightbox. */
#mtc-lightbox-1 .mtc-lightbox-body { position: relative; }
.mtc-gal-nav--modal {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.mtc-gal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
  border: 1px solid var(--on-dark-muted);
  border-radius: 50%;
  background: var(--brand-deep);
  color: var(--on-dark);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(8, 20, 34, .45);
  -webkit-user-select: none;
  user-select: none;
}
.mtc-gal-prev { left: 18px; }
.mtc-gal-next { right: 18px; }
.mtc-gal-btn:hover,
.mtc-gal-btn:focus-visible {
  background: var(--brand);
  outline: 2px solid var(--on-dark);
  outline-offset: 2px;
}
.mtc-gal-btn:disabled,
.mtc-gal-btn[aria-disabled="true"] {
  opacity: .34;
  cursor: default;
  box-shadow: none;
}
.mtc-gal-nav--modal .mtc-gal-btn {
  width: 46px;
  height: 46px;
  font-size: 1.75rem;
}

.mtc-gal-count {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--brand-deep);
  color: var(--on-dark);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
}
.mtc-gal-nav--modal .mtc-gal-count {
  bottom: 6px;
  background: var(--brand);
}

/* The hint sits in the empty band above the photo, not across it: several
   product shots carry their own dimension line near the bottom edge, and a
   caption there looked like part of the picture. */
.mtc-gal-hint {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(8, 20, 34, .78);
  color: var(--on-dark);
  font-size: .76rem;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  display: none;
}
.mtc-gal-nav--modal .mtc-gal-hint {
  top: 6px;
  background: var(--brand-deep);
  color: var(--on-dark);
}

@media (max-width: 991.98px) {
  .mtc-gal-hint { display: block; }
}

@media (max-width: 767.98px) {
  .mtc-gal-btn { width: 44px; height: 44px; font-size: 1.6rem; }
  .mtc-gal-prev { left: 8px; }
  .mtc-gal-next { right: 8px; }
  .mtc-gal-nav--modal .mtc-gal-btn { width: 42px; height: 42px; }
  .mtc-gal-count { bottom: 12px; font-size: .78rem; }
  .mtc-gal-hint { top: 8px; font-size: .7rem; }
  .mtc-gal-nav--modal .mtc-gal-hint { top: 6px; }
}
