/* VISQA2: isolated mobile overrides, loaded last by apply_mobile_css.py.
 * Keep wide data inside its scroll region. Do not hide page overflow to
 * compensate for a screenshot taken with a wider browser layout viewport.
 */
@media screen and (max-width: 767px) {
  .row > *, .jz-diff-grid > *, .jz-cta-strip > * { min-width: 0; }
  .jz-diff-grid { grid-template-columns: minmax(0, 1fr); }
  .jz-hub-card { height: auto; }

  /* Header height is already measured in script.js. Remove the extra spacer. */
  header + section.mt-5 { margin-top: 0 !important; }
  .top-bar small { flex-wrap: wrap; gap: 0.35rem; }
  .top-bar small > a { margin-right: 0.4rem !important; }
  .top-bar .btn { padding: 0.5rem; }
  .navbar-toggler { min-width: 44px; min-height: 44px; }

  .jz-breadcrumb, .jz-cluster-nav, .jz-contact-line, footer p {
    overflow-wrap: anywhere;
  }
  .jz-breadcrumb { line-height: 1.55; }
  .jz-page-hero { padding: 2.25rem 0 2rem; }
  .jz-page-hero h1 { font-size: 1.9rem; line-height: 1.15; }
  .jz-page-body h2 { font-size: 1.5rem; line-height: 1.25; }
  .jz-tldr { padding: 1rem; }
  .jz-tldr h2 { font-size: 0.8rem; }
  .jz-faq details { padding: 0.85rem 1rem; }
  .jz-faq summary { min-height: 44px; }
  .jz-sources h2 { font-size: 1rem; }
  .jz-cta-strip { padding: 1.5rem 1.1rem; }

  .btn { max-width: 100%; white-space: normal; overflow-wrap: break-word; }
  .jz-page-hero .btn, .jz-cta-strip .btn, .jz-page-body .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .jz-page-body .btn-primary, .jz-page-body .btn-dark { color: #fff; }
  .help-button {
    max-width: calc(100% - 24px);
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    white-space: normal;
    animation: none;
  }

  /* All existing tables already have a scroll wrapper. Preserve table semantics. */
  .table-responsive, .jz-spec-wrap, .jz-compare-wrap {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .table-responsive > table:has(tr > :nth-child(3)),
  .jz-spec-wrap > table:has(tr > :nth-child(3)),
  .jz-compare-wrap > table:has(tr > :nth-child(3)) { min-width: 36rem; }
  .table-responsive > table:has(tr > :nth-child(5)),
  .jz-spec-wrap > table:has(tr > :nth-child(5)),
  .jz-compare-wrap > table:has(tr > :nth-child(5)) { min-width: 48rem; }
  .table-responsive th, .table-responsive td,
  .jz-spec-wrap th, .jz-spec-wrap td,
  .jz-compare-wrap th, .jz-compare-wrap td {
    word-break: normal;
    overflow-wrap: normal;
  }
  table.jz-spec td.jz-source { white-space: normal; }
  .table-responsive td a, .jz-spec-wrap td a, .jz-compare-wrap td a {
    overflow-wrap: anywhere;
  }

  /* These retained cards contain whitespace-only photo columns after MEDIA.
   * An actual image or other element keeps its original column visible.
   */
  .portfolio-item .row > .col-5:not(:has(*)) { display: none; }
  .portfolio-item .row > .col-5:not(:has(*)) + .col-6 { width: 100%; padding-inline: 1.5rem; }
  .portfolio-item .row > .col-3:not(:has(*)) { display: none; }
  .portfolio-item .row > .col-3:not(:has(*)) + .col-8 { width: 100%; padding-inline: 1.5rem; }
  .portfolio-item .justify-content-between { flex-wrap: wrap; gap: 0.5rem; }

  .jzf { padding: 1.5rem 1rem; max-width: 100%; }
  .jzf .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jzf .tile { min-width: 0; padding-inline: 0.5rem; }
  .jzf .step-title { font-size: 1.25rem; }
  .jzf input, .jzf select, .jzf textarea { font-size: 16px; max-width: 100%; }

  iframe[src*="youtube.com/embed/"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  /* Bound the video height even when a screenshot uses a very tall viewport. */
  #video { height: 65svh; min-height: 360px; max-height: 600px; }
}

/* R3 2026-10-26: keep portrait utensil photos from stretching the card grid */
.portfolio-item .card-img-top{max-height:170px;width:auto;max-width:100%;object-fit:contain;display:block;margin:0 auto}
/* R3 2026-10-26: on phones, say that wide tables scroll sideways */
@media (max-width:575.98px){
  .jz-spec-wrap::before,.table-responsive::before,.jz-compare-wrap::before,.tblwrap::before{content:"Swipe sideways to see every column";display:block;font-size:.8rem;color:#5a6470;margin:0 0 .35rem}
  .jz-spec-wrap td,.jz-spec-wrap th,.table-responsive td,.table-responsive th,.jz-compare-wrap td,.jz-compare-wrap th,.tblwrap td,.tblwrap th{padding:.4rem .5rem;font-size:.9rem}
}

/* VISQA3 2026-10-27: fixes from the Codex visual audit of every page at 390 and 1280. */
/* "anywhere" let table columns, buttons and footer lines shrink until words split ("Compartm/ent", "(PD/F)").
 * break-word only splits a word that cannot fit on a line by itself. */
.jz-page-body, .jz-tldr, .jz-faq, .jz-cluster-nav, .jz-breadcrumb, .jz-contact-line, footer p,
.table-responsive td a, .jz-spec-wrap td a, .jz-compare-wrap td a { overflow-wrap: break-word; }
.jz-sources a { word-break: normal; overflow-wrap: anywhere; }
a[href^="tel:"] { white-space: nowrap; }
/* Dark buttons and footer links kept a dark link color on a dark background. */
a.btn-dark, a.btn-dark:visited, a.btn-dark:hover, a.btn-dark:focus { color: #fff !important; }
footer a.lblue { color: #dbe7f5 !important; }
/* Retherm model list sits on the blue band: white cards, as on the live site (headings and opened text were
 * blue or grey on blue). */
.bg-lblue .accordion-item, .bg-lblue .accordion-button, .bg-lblue .accordion-collapse { background-color: #fff; }
.bg-lblue .accordion-body, .bg-lblue .accordion-body p, .bg-lblue .accordion-body h5 { color: #1c1c1c; }
/* A gutter row's negative top margin pulled blue panels over the heading above them. */
h2 + .row[class*="g-"] { margin-top: 0.75rem; }
/* Card footers: case count and spec link ran together when they wrapped. */
.portfolio-item .justify-content-between { flex-wrap: wrap; column-gap: 0.75rem; }
/* Closing call-to-action buttons: even spacing, no indent when they wrap. */
.jz-cta-strip > div:last-child { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.jz-cta-strip .btn.ms-2 { margin-left: 0 !important; }
/* script.js marks wide-table wrappers that already fit; they need no "swipe" hint. */
.jz-fits::before { display: none !important; }
@media screen and (max-width: 767px) {
  /* Keep the floating contact button off the footer's last line. */
  footer { padding-bottom: 72px; }
  /* Legacy heroes stacked five pt-5 spacers above the headline (about 240px of blank space on phones). */
  header + section:not(#video).pt-5, header + section:not(#video) .pt-5 { padding-top: 0.75rem !important; }
  header + section:not(#video).pb-5, header + section:not(#video) > .container.pb-5 { padding-bottom: 1rem !important; }
}
/* Review links land on these; keep them clear of the fixed header. */
#new-photo, #at-a-glance { scroll-margin-top: calc(var(--jz-header-height, 154px) + 16px); }
/* VISQA3 round 2 (Codex re-audit). */
footer .fa-phone + span { white-space: nowrap; }
/* Side-by-side legacy buttons touched once they wrapped. */
a.btn:has(+ a.btn), a.btn + a.btn { margin-bottom: 0.5rem; }
/* White translucent lids vanished against the white page. */
img[src*="-translucent"] { border: 1px solid #cfd8e3; border-radius: 6px; }
/* Two related-link blocks stacked their padding into one large gap. */
section[aria-labelledby="related-guides-0l"] { padding-top: 1rem !important; }
@media screen and (max-width: 767px) {
  /* Table captions are as wide as the scrolling table; keep them in view so they wrap on screen. */
  .table-responsive caption, .jz-spec-wrap caption, .jz-compare-wrap caption {
    position: sticky; left: 0; max-width: calc(100vw - 2rem); white-space: normal;
  }
  /* Bootstrap's 3rem section spacers stacked into 150-200px blank bands on phones. */
  .py-5 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
  .pt-5 { padding-top: 1.75rem !important; }
  .pb-5 { padding-bottom: 1.75rem !important; }
  .my-5 { margin-top: 1.75rem !important; margin-bottom: 1.75rem !important; }
  .mt-5 { margin-top: 1.75rem !important; }
  .mb-5 { margin-bottom: 1.75rem !important; }
}
/* VISQA3 round 3: product cards in one grid row end at the same height. */
.portfolio-item { display: flex; flex-direction: column; }
.portfolio-item > .d-flex { flex: 1 1 auto; }
.portfolio-item > .d-flex > .card { width: 100%; }
/* VISQA3 round 4 (tablet and small-laptop audit). */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Four cards across left ~170px each, so "Accessories" and "Drinkware" split mid-word: two across instead. */
  .row > .col-md-3:has(> .card) { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 1199.98px) {
  /* The photo cards' display-size headings and 3rem padding split "Tradeshows" and the button label. */
  .card-cover .display-6 { font-size: 1.6rem; }
  .card-cover .p-5 { padding: 2rem !important; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* Quote-section headings beside the form ran past their column ("Replacement" clipped). */
  #quote .display-2 { font-size: 2.75rem; }
}
/* Round 5: from 992 to 1199px the eight-item menu ran past the window ("Contact" cut off). Use the full width,
 * a slightly smaller logo and tighter link spacing; measured to fit at 992, 1024, 1100 and 1199. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar > .container, .navbar > .container-fluid { max-width: 100%; padding-left: 16px; padding-right: 16px; }
  .navbar .navbar-nav .nav-link { padding-left: 0.35rem !important; padding-right: 0.35rem !important; font-size: 0.8rem; }
  .navbar .navbar-brand img { max-width: 120px; height: auto; }
  .navbar .navbar-brand { margin-right: 0.5rem; }
}
