@media (max-width: 900px) {

  .certification-hero-copy {
    max-width: 620px;
  }

  .certification-hero-cards {
    max-width: 560px;
  }

  .certification-content {
    width: calc(100% - 32px);
  }

  .certification-strength-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .certification-process {
    padding-inline: 24px;
  }

  .certification-process-track {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }

  .certification-process-arrow {
    display: none;
  }

  .certification-contact-panel {
    grid-template-columns: 1fr 1.2fr;
  }

  .certification-contact-document {
    display: none;
  }

  .sub-header-inner {
    width: calc(100% - 32px);
    height: 60px;
  }

  .sub-logo .site-logo-img {
    height: 28px;
    width: 310px;
  }

  .sub-logo.has-logo-img {
    max-width: 310px;
  }

  .sub-nav,
  .company-home {
    display: none;
  }

  .sub-actions {
    margin-left: 18px;
  }

  .sub-quote {
    padding: 10px 14px;
    font-size: 12px;
  }

  .header-inner {
    width: calc(100% - 32px);
  }

  .nav {
    display: none;
  }

  .hero {
    width: calc(100% - 32px);
    min-height: 480px;

    background-position: 65% center;
  }

  .hero-content {
    padding: 0 28px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .services {
    width: calc(100% - 32px);

    grid-template-columns: repeat(2, 1fr);
  }

  .quote-banner {
  width: 100%;
}

.quote-banner-inner {
  gap: 20px;
}

.footer {
  width: 100%;
}

.footer-inner {
  grid-template-columns: repeat(2, 1fr);
  gap: 35px;
}

.manufacturing-hero {
  width: calc(100% - 32px);
  height: 320px;
}

.manufacturing-hero-content {
  padding-left: 30px;
  padding-right: 30px;
}

.manufacturing-hero h1 {
  font-size: 38px;
}

.manufacturing-fields {
  width: calc(100% - 32px);
}

.manufacturing-grid {
  grid-template-columns: repeat(2, 1fr);
}

.process-steps-grid {
  grid-template-columns: repeat(2, 1fr);
  row-gap: 20px;
}

.process-step {
  border-left: none;
  padding: 4px 4px;
}

.process-step:nth-child(2n) {
  border-left: 1px solid #d7e0ef;
  padding-left: 24px;
}

.industry-banner {
  flex-direction: column;
  align-items: flex-start;
  gap: 25px;
}

.industry-banner-text,
.industry-list {
  width: 100%;
}

.industry-list {
  grid-template-columns: repeat(3, 1fr);
}

.industry-item:nth-child(4) {
  border-left: 0;
}

}


/* Portfolio detail — stack the gallery above the details */
@media (max-width: 960px) {

  .port-detail-inner {
    flex-direction: column;
  }

  .port-detail-media,
  .port-detail-info {
    flex: none;
    width: 100%;
    max-width: none;
  }

  .port-gallery-viewport {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .port-detail-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 550px) {

  .certification-hero {
    padding: 38px 22px 24px;
    gap: 28px;
  }

  .certification-hero h1 {
    font-size: 31px;
  }

  .certification-hero-copy > p br {
    display: none;
  }

  .certification-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .certification-primary-btn,
  .certification-secondary-btn {
    width: 100%;
    justify-content: space-between;
  }

  .certification-hero-cards {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .certification-hero-card {
    min-height: 225px;
    padding: 20px 14px 16px;
  }

  .certification-hero-card p br {
    display: none;
  }

  .certification-strengths {
    padding-top: 34px;
  }

  .certification-section-heading h2 {
    font-size: 21px;
  }

  .certification-strength-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .certification-strength-card {
    min-height: 112px;
    padding: 20px 18px;
  }

  .certification-process {
    padding: 32px 18px;
  }

  .certification-process-track {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .certification-process-step {
    display: grid;
    grid-template-columns: 58px 1fr;
    column-gap: 15px;
    text-align: left;
  }

  .certification-process-icon {
    width: 58px;
    height: 58px;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .certification-process-step h3 {
    align-self: end;
  }

  .certification-process-step p {
    max-width: none;
    margin: 0;
  }

  .certification-contact-panel {
    grid-template-columns: 1fr;
  }

  .certification-contact-cta,
  .certification-contact-details {
    padding: 28px 24px;
  }

  .sub-logo {
    font-size: 12px;
  }

  .sub-logo strong {
    font-size: 23px;
  }

  .sub-quote {
    min-height: 40px;
    padding: 9px 13px;
  }

  .hero-content {
    padding: 48px 24px;
  }

  .logo span {
    display: none;
  }

  .quote-button {
    padding: 11px 15px;
  }

  .hero {
    min-height: 430px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    font-size: 14px;
  }

  .services {
    grid-template-columns: 1fr;
  }

  .popup {
    padding: 36px 24px;
  }

  .trust-section {
  padding: 24px 18px;
}

.trust-items {
  grid-template-columns: repeat(2, 1fr);
}

.trust-item img {
  height: 130px;
}

.quote-banner-inner {
  flex-direction: column;
  align-items: flex-start;
}

.quote-banner-button {
  width: 100%;
}

.quote-banner-text h2 {
  font-size: 18px;
}

.footer-inner {
  grid-template-columns: 1fr;
  padding: 30px 24px;
}

.footer-bottom {
  margin: 0 24px;
}


.manufacturing-hero {
  height: 280px;
}

.manufacturing-hero-content {
  padding: 25px;
}

.manufacturing-hero h1 {
  font-size: 32px;
}

.manufacturing-grid {
  grid-template-columns: 1fr;
}

.manufacturing-card {
  min-height: auto;
}

.process-steps-grid {
  grid-template-columns: 1fr;
  row-gap: 18px;
}

.process-step,
.process-step:nth-child(2n) {
  border-left: none;
  border-top: 1px solid #d7e0ef;
  padding: 16px 0 0;
}

.process-step:first-child {
  border-top: none;
  padding-top: 0;
}

.process-steps {
  padding: 24px 20px;
}

.process-steps-inner {
  width: 100%;
}

.industry-banner {
  padding: 25px 20px;
}

.industry-banner-text h2 {
  font-size: 18px;
}

.industry-list {
  grid-template-columns: repeat(2, 1fr);
  row-gap: 18px;
}

.industry-item:nth-child(3),
.industry-item:nth-child(5) {
  border-left: 0;
}

}

@media (max-width: 900px) {

  .why-us {
    width: calc(100% - 32px);
  }

  .why-us-inner {
    grid-template-columns: 1fr;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 550px) {

  .why-grid {
    grid-template-columns: 1fr;
  }

  .why-card-img {
    height: 190px;
  }

  .trust-section {
  width: calc(100% - 32px);
}

.trust-content {
  grid-template-columns: 1fr;
  gap: 35px;
}

}


/* Sub-page hero responsive */
@media (max-width: 900px) {

  .rep-products {
    width: calc(100% - 32px);
  }

  .rep-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 550px) {

  .rep-products-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

}

@media (max-width: 900px) {

  .sub-page-hero {
    width: calc(100% - 32px);
    height: 210px;
  }

  .sub-page-hero-content {
    padding-left: 28px;
    padding-right: 28px;
  }

  .sub-page-hero h1 {
    font-size: 34px;
  }

  /* Equipment */
  .equip-section {
    width: calc(100% - 32px);
  }

  .equip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .equip-modal-box {
    max-height: 85vh;
    max-height: 85dvh;
  }

  .equip-modal-card {
    flex-direction: column;
  }

  .equip-modal-img {
    width: 100%;
    height: 220px;
    flex-shrink: 0;
  }

  .equip-modal-info {
    min-height: 0;
  }

  /* Portfolio */
  .portfolio-section {
    width: calc(100% - 32px);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Certification */
  .cert-section,
  .cert-types-section,
  .cert-process-section {
    width: calc(100% - 32px);
  }

  .cert-intro {
    grid-template-columns: 1fr;
  }

  .cert-types-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cert-process-steps {
    flex-wrap: wrap;
    gap: 12px;
  }

  .cert-step-arrow {
    display: none;
  }

  .cert-step {
    min-width: calc(50% - 6px);
  }

  /* Quote */
  .quote-page-section {
    width: calc(100% - 32px);
  }

  .quote-page-inner {
    grid-template-columns: 1fr;
  }

  .quote-contact-info {
    position: static;
  }

}

@media (max-width: 550px) {

  .sub-page-hero h1 {
    font-size: 28px;
  }

  .equip-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .cert-types-grid {
    grid-template-columns: 1fr;
  }

  .cert-step {
    min-width: 100%;
  }

  .quote-form-row {
    grid-template-columns: 1fr;
  }

  /* Portfolio modal — small phones */
  .port-gallery {
    padding: 14px;
  }

  .port-gallery-viewport {
    aspect-ratio: 4 / 3;
  }

  .port-gallery-nav {
    width: 36px;
    height: 36px;
  }

  .port-gallery-nav.prev { left: 8px; }
  .port-gallery-nav.next { right: 8px; }

  .port-gallery-play {
    width: 52px;
    height: 52px;
  }

  .port-gallery-thumb {
    width: 62px;
    height: 46px;
  }

  .port-detail {
    width: calc(100% - 32px);
    padding-bottom: 50px;
  }

  .port-detail-info {
    padding: 22px 20px 24px;
  }

  .port-detail-title {
    font-size: 21px;
  }

  .port-detail-related-grid {
    grid-template-columns: 1fr;
  }

}

/* Unified hero type scale */
@media (max-width: 900px) {
  :root {
    --hero-title-size: 38px;
    --hero-body-size: 14px;
    --hero-action-size: 13px;
  }

  :is(.hero, .manufacturing-hero, .sub-page-hero, .certification-hero) h1 {
    font-size: var(--hero-title-size);
    line-height: var(--hero-title-line-height);
  }

  :is(.hero, .manufacturing-hero, .sub-page-hero) {
    height: 360px;
    min-height: 360px;
  }

  .certification-hero {
    height: auto;
    width: 100%;
    padding: 48px 20px 36px;
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .hero-content,
  .manufacturing-hero-content,
  .sub-page-hero-content,
  .certification-hero-inner {
    width: calc(100% - 32px);
  }

  .certification-hero-inner {
    padding: 0;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .certification-hero-cards {
    align-self: stretch;
    gap: 12px;
  }

  .certification-hero-card {
    min-height: 200px;
    padding: 20px 16px 16px;
  }

  :is(.hero, .manufacturing-hero, .sub-page-hero) p,
  .certification-hero-copy > p {
    font-size: var(--hero-body-size);
    line-height: var(--hero-body-line-height);
  }

  body .footer-bottom {
    width: calc(100% - 32px);
    margin: 0 auto;
  }


  body .industry-banner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 550px) {
  :root {
    --hero-title-size: 31px;
    --hero-body-size: 14px;
    --hero-action-size: 12px;
  }

  :is(.hero, .manufacturing-hero, .sub-page-hero, .certification-hero) h1 {
    margin-bottom: 16px;
    font-size: var(--hero-title-size);
  }


  :is(.hero, .manufacturing-hero, .sub-page-hero) {
    height: 310px;
    min-height: 310px;
  }

  .certification-hero {
    padding: 36px 16px 28px;
  }

  .manufacturing-hero-content,
  .sub-page-hero-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .certification-hero-inner {
    padding: 0;
    width: 100%;
  }
}

/* ══════════════════════════════════════════════
   MOBILE OVERFLOW FIXES
   ══════════════════════════════════════════════ */

/* ── Global safety ───────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }

/* ── hero-button gap on mobile ───────────────── */
@media (max-width: 550px) {
  .hero-button { gap: 24px; }
}

/* ── sub-page & manufacturing hero padding fix ── */
@media (max-width: 900px) {
  .sub-page-hero-content,
  .manufacturing-hero-content {
    padding-right: 28px;
  }
}

/* ── Factory badge banner — stack on mobile ─── */
@media (max-width: 768px) {
  .factory-badge-banner {
    padding: 20px 16px;
  }
  .factory-badge-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px;
    gap: 16px;
  }
  .factory-badge-sep {
    width: 100%;
    height: 1px;
    margin: 0;
  }
  .factory-badge-right {
    flex-shrink: 1;
    width: 100%;
  }
  .factory-badge-right p { font-size: 13px; }
  .factory-badge-bldg { display: none; }
}

/* ── Cert docs grid — responsive columns ─────── */
@media (max-width: 900px) {
  .cert-docs-inner { padding: 40px 20px; }
  .cert-docs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 550px) {
  .cert-docs-inner { padding: 28px 16px; }
  .cert-docs-grid { grid-template-columns: 1fr; }
  .cert-docs-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ── Logos section ───────────────────────────── */
@media (max-width: 900px) {
  .logos-section-inner { padding: 36px 20px 32px; }
  .logos-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 550px) {
  .logos-section-inner { padding: 28px 16px 24px; }
  .logos-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Quote modal done screen ─────────────────── */
@media (max-width: 620px) {
  .qm-done-body {
    flex-direction: column;
    gap: 16px;
  }
  .qm-done-right {
    width: 100%;
    flex-shrink: 1;
  }
}

/* ── Industry banner padding ─────────────────── */
@media (max-width: 768px) {
  body .industry-banner {
    padding-left: 20px;
    padding-right: 20px;
  }
  .industry-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Certification hero min-width clamp ──────── */
@media (max-width: 1100px) {
  .certification-hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 32px;
  }
}

/* ── Final certification hero mobile layout ─── */
@media (max-width: 900px) {
  body .certification-hero {
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  body .certification-hero-inner {
    width: calc(100% - 32px);
    height: auto;
    margin: 0 auto;
    padding: 44px 0 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .certification-hero-copy {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .certification-hero-cards {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 550px) {
  body .certification-hero-inner {
    width: calc(100% - 32px);
    padding: 36px 0 24px;
    gap: 24px;
  }

  .certification-eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
  }

  body .certification-hero h1 {
    width: 100%;
    margin-bottom: 16px;
    font-size: 30px;
    line-height: 1.2;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .certification-hero-copy > p {
    font-size: 13px;
    line-height: 1.7;
    word-break: keep-all;
  }

  .certification-hero-copy > p br {
    display: none;
  }

  .certification-hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .certification-primary-btn,
  .certification-secondary-btn {
    width: 100%;
    justify-content: space-between;
  }

  .certification-hero-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .certification-hero-card {
    width: 100%;
    min-width: 0;
    min-height: 210px;
    padding: 22px 20px 18px;
  }

  .certification-mark {
    height: 64px;
  }
}

/* ── Mobile footer: full version on the home page only ──────────
   Below 900px the bottom tab bar and the drawer already carry the quick
   links, the quote link and the main-site link, so on every other page the
   footer columns are just a long duplicate stack. Only the copyright line
   stays. */
@media (max-width: 900px) {

  .footer:not(.footer-home) .footer-inner {
    display: none;
  }

  .footer:not(.footer-home) .footer-bottom {
    padding: 18px 0;
    border-top: 0;
  }

}

/* ── Final quote modal mobile layout ────────── */
@media (max-width: 550px) {
  .qm-overlay {
    align-items: flex-start;
    padding: 8px;
    overflow-y: auto;
  }

  .qm-box {
    width: 100%;
    max-width: none;
    min-width: 0;
    max-height: calc(100dvh - 16px);
    margin: auto 0;
    overflow-x: hidden;
    border-radius: 14px;
  }

  .qm-close {
    top: 10px;
    right: 10px;
  }

  .qm-steps {
    width: 100%;
    min-width: 0;
    padding: 18px 46px 0 16px;
    align-items: flex-start;
  }

  .qm-step {
    min-width: 0;
    flex: 0 1 auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
  }

  .qm-step-num {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  .qm-step-label {
    max-width: 72px;
    font-size: 10px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
  }

  .qm-step-line {
    min-width: 10px;
    margin: 13px 5px 0;
  }

  .qm-panel {
    width: 100%;
    min-width: 0;
    padding: 20px 16px 22px;
  }

  .qm-panel-header {
    width: 100%;
    min-width: 0;
    gap: 12px;
    margin-bottom: 20px;
  }

  .qm-panel-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .qm-panel-header > div:last-child {
    min-width: 0;
  }

  .qm-panel-header h2 {
    font-size: 16px;
    line-height: 1.45;
    word-break: keep-all;
  }

  .qm-panel-header p {
    font-size: 11px;
  }

  .qm-form,
  .qm-field,
  .qm-row,
  .qm-actions,
  .qm-agree,
  .qm-privacy-note {
    width: 100%;
    min-width: 0;
  }

  .qm-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .qm-field input,
  .qm-field select,
  .qm-field textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .qm-agree {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 7px;
    font-size: 12px;
    line-height: 1.5;
  }

  .qm-agree input {
    margin-top: 2px;
  }

  .qm-agree-detail {
    margin-left: 0;
    font-size: 11px;
  }

  .qm-privacy-note {
    font-size: 10px;
    line-height: 1.6;
    padding: 10px;
  }

  .qm-actions {
    flex-direction: column-reverse;
  }

  .qm-btn-primary,
  .qm-btn-secondary {
    width: 100%;
  }
}
