/* Seaborne v1.6.6 product catalogue fixes: modal, descriptions, links and accessible image viewer */
:root { --sbi-catalogue-text: #173B55; }
/* Product descriptions: keep body copy readable on all product catalogue cards. */
.me-card-body p,
article.me-card p,
article.equipment-card p,
article.product-card p,
article.pt-product-card p,
article.nav-card p,
article.system-card p,
article.hvac-card p {
  color: #173B55 !important;
  -webkit-text-fill-color: #173B55;
  opacity: 1 !important;
}
/* Existing product-image modals used slightly lower stacking values than the fixed site navigation. */
.modal,
.pt-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  box-sizing: border-box !important;
  z-index: 2147483000 !important;
  padding: clamp(12px, 2.5vh, 26px) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}
.modal.open,
.pt-modal.open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal-card,
.pt-modal-card {
  position: relative !important;
  width: auto !important;
  max-width: min(99vw, 2200px) !important;
  max-height: 98dvh !important;
  height: auto !important;
  margin: auto !important;
  overflow: auto !important;
  box-sizing: border-box !important;
  flex: 0 0 auto;
}
.modal-card > img,
.modal-card .modal-img,
.modal-card #modalImage,
.modal-card #modalImg,
.pt-modal-card > img,
.pt-modal-card #modalImage {
  display: block !important;
  width: auto !important;
  max-width: var(--sbi-catalogue-viewer-max-width, 99vw) !important;
  height: auto !important;
  max-height: var(--sbi-catalogue-viewer-max-height, 96dvh) !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 auto !important;
}
.modal-head { flex: 0 0 auto; }
.modal-title,
.pt-modal-title { text-align: center !important; color: #fff !important; padding: 8px 12px 2px; }
.modal-close,
.close,
.pt-modal-close {
  z-index: 5 !important;
  cursor: pointer;
}
/* Marine Engine Spares receives a dedicated viewer because its original page had no modal markup. */
.sbi-catalogue-viewer {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2147483001;
  padding: clamp(12px, 2.5vh, 26px);
  box-sizing: border-box;
  background: rgba(2, 12, 23, .94);
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.sbi-catalogue-viewer.is-open { display: flex; }
.sbi-catalogue-viewer__panel {
  position: relative;
  max-width: 99vw;
  max-height: 98dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
}
.sbi-catalogue-viewer__image {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--sbi-catalogue-viewer-max-width, 99vw);
  max-height: var(--sbi-catalogue-viewer-max-height, 96dvh);
  object-fit: contain;
  object-position: center;
  background: #fff;
  border-radius: 14px;
}
.sbi-catalogue-viewer__title { max-width: 94vw; color: #fff; font-weight: 700; text-align: center; margin: 10px 48px 0; }
.sbi-catalogue-viewer__close {
  position: absolute;
  right: 0;
  top: 0;
  transform: translate(35%, -35%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #08263f;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}
.me-card-media img { cursor: zoom-in; }
/* Generated footer links must sit above decorative footer layers and remain clickable. */
.sb-footer { position: relative; z-index: 30; pointer-events: auto; }
.sb-footer a,
.sb-footer .sb-footer-links a { position: relative; z-index: 1; pointer-events: auto !important; cursor: pointer; }
@media (max-width: 640px) {
  .modal, .pt-modal { padding: 10px !important; }
  .modal-card, .pt-modal-card { max-width: 99vw !important; max-height: 96dvh !important; }
  .modal-card > img, .modal-card .modal-img, .modal-card #modalImage, .modal-card #modalImg,
  .pt-modal-card > img, .pt-modal-card #modalImage { max-width: 98vw !important; max-height: 90dvh !important; }
  .sbi-catalogue-viewer { padding: 10px; }
  .sbi-catalogue-viewer__image { max-width: 99vw; max-height: 94dvh; }
}

/* v1.6.8: near-full-viewport catalogue artwork for readable technical labels. */
.modal-card, .pt-modal-card, .sbi-catalogue-viewer__panel {
  max-width: 99vw !important;
  max-height: 98dvh !important;
}
.modal-card > img, .modal-card .modal-img, .modal-card #modalImage,
.modal-card #modalImg, .pt-modal-card > img, .pt-modal-card #modalImage,
.sbi-catalogue-viewer__image {
  max-width: 99vw !important;
  max-height: 96dvh !important;
  width: auto !important; height: auto !important;
  object-fit: contain !important;
}
@media (max-width: 640px) {
  .modal-card > img, .modal-card .modal-img, .modal-card #modalImage,
  .modal-card #modalImg, .pt-modal-card > img, .pt-modal-card #modalImage,
  .sbi-catalogue-viewer__image { max-width: 98vw !important; max-height: 92dvh !important; }
}
