/* Cross-template field and responsive fixes. Loaded after template themes. */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe { max-width: 100%; height: auto; }
.brand-block, .nav-phone { margin: 0; min-width: 0; }
.brand-logo-frame { display: inline-flex; align-items: center; min-width: 0; overflow: hidden; flex: 0 0 auto; }
.brand-logo-frame.is-wide-crop-left {
  width: clamp(315px, 26vw, 370px);
  height: 58px;
  background: #fff;
  border-radius: 5px;
}
.brand-logo-frame.is-wide-crop-left .brand-logo {
  width: auto !important;
  max-width: none !important;
  height: 58px !important;
  object-fit: contain;
  object-position: left center;
  border-radius: 0 !important;
  filter: none !important;
}
.brand-texts.is-logo-caption-hidden { display: none !important; }
.brand-name, .brand-city, .nav-phone-number, .mfr-header-top-inner span,
.custom-record h2, .custom-record h3, .custom-detail-field dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.site-main { min-width: 0; }
.svc-hero-inner, .svc-hero-text, .svc-hero-side { min-width: 0; }
.svc-hero-text h1 { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.svc-hero-intro { max-width: 100%; overflow-wrap: anywhere; }
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 48px;
  align-items: start;
}
.pd-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.pd-gallery > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bg-2, #f5f7fa);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 6px;
}
.pd-gallery > img:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; max-height: 560px; }
.pd-info { min-width: 0; }
.pd-info h1 { overflow-wrap: anywhere; }
.pd-no-img { display: grid; place-items: center; min-height: 360px; padding: 32px; background: var(--bg-2, #f5f7fa); color: var(--text-3, #667085); }
.custom-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.custom-section-heading .section-title,
.custom-section-heading .section-sub { margin-bottom: 0; text-align: left; }
.custom-records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.custom-record {
  min-width: 0;
  overflow: hidden;
  background: var(--bg-1, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
}
.custom-record-image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2, #f5f7fa); }
.custom-record-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.custom-record:hover .custom-record-image img { transform: scale(1.025); }
.custom-record-body { padding: 20px; }
.custom-record-body h2, .custom-record-body h3 { margin: 0 0 10px; font-size: 20px; line-height: 1.35; }
.custom-record-body h2 a, .custom-record-body h3 a { color: inherit; text-decoration: none; }
.custom-record-body > p { margin: 0 0 14px; color: var(--text-3, #667085); line-height: 1.75; }
.custom-record-fields { margin: 0; }
.custom-record-fields > div { display: grid; grid-template-columns: minmax(72px, .35fr) 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft, #eef0f3); }
.custom-record-fields dt { color: var(--text-3, #667085); }
.custom-record-fields dd { margin: 0; color: var(--text-2, #344054); }
.custom-records-list, .custom-records-timeline { grid-template-columns: 1fr; }
.custom-records-list .custom-record, .custom-records-timeline .custom-record { display: grid; grid-template-columns: minmax(180px, 28%) 1fr; }
.custom-records-timeline { position: relative; padding-left: 24px; }
.custom-records-timeline::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line, #e5e7eb); }
.custom-records-timeline .custom-record { position: relative; }
.custom-records-timeline .custom-record::before { content: ""; position: absolute; left: -24px; top: 26px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary, #2563eb); box-shadow: 0 0 0 4px var(--bg-1, #fff); }
.custom-detail-layout { max-width: 1040px; }
.custom-detail-cover { margin: 0 0 28px; }
.custom-detail-cover img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: var(--bg-2, #f5f7fa); border-radius: 8px; }
.custom-detail-fields { margin: 0; border-top: 1px solid var(--line, #e5e7eb); }
.custom-detail-field { display: grid; grid-template-columns: minmax(130px, 22%) 1fr; gap: 28px; padding: 20px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.custom-detail-field dt { font-weight: 600; color: var(--text-2, #344054); }
.custom-detail-field dd { min-width: 0; margin: 0; line-height: 1.8; color: var(--text-3, #667085); }
.custom-detail-field.field-type-textarea dd { white-space: pre-line; }
.custom-detail-field dd ul { margin: 0; padding-left: 20px; }
.custom-detail-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.custom-detail-images img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.rich-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.rich-content pre { max-width: 100%; overflow-x: auto; }
.empty-state { padding: 56px 24px; text-align: center; color: var(--text-3, #667085); background: var(--bg-2, #f5f7fa); }
.price { color: #a44f05; }
.card-time { color: #667085; }
.site-footer, .site-footer p, .site-footer span { color: #94a3b8; }
.site-footer h3 { margin: 0 0 14px; color: #fff; font-size: 17px; }

/* Model-driven case pages: labels and order follow the CMS field schema. */
.page-eyebrow { display: block; margin-bottom: 10px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: 0; }
.case-card { overflow: hidden; border: 1px solid var(--line, #e2e8f0); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.case-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 14px 34px rgba(15, 23, 42, .09); }
.case-card .card-img { aspect-ratio: 16 / 9; min-height: 0; }
.case-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.case-card .card-body { padding: 22px; }
.case-card .card-body h2, .case-card .card-body h3 { margin: 10px 0 8px; font-size: 21px; line-height: 1.35; }
.case-card .card-desc { min-height: 3.2em; color: var(--text-3, #64748b); }
.case-card .card-arrow { display: inline-flex; gap: 8px; margin-top: 14px; color: var(--primary); font-weight: 700; }
.card-img-placeholder { display: grid; place-content: center; gap: 8px; background: #f1f5f9; color: #475569; }
.placeholder-mark { font-size: 12px; font-weight: 800; color: var(--primary); }
.case-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 0; margin: 18px 0 0; list-style: none; }
.case-meta li { color: var(--text-3, #64748b); }
.case-meta strong { color: var(--text-1, #0f172a); }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 34px; }
.case-gallery figure { margin: 0; }
.case-gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.case-gallery figcaption { margin-top: 7px; color: var(--text-3, #64748b); font-size: 12px; }
.record-content-flow { display: grid; gap: 34px; }
.record-content-block { padding-bottom: 30px; border-bottom: 1px solid var(--line-soft, #e2e8f0); }
.record-content-block:last-child { padding-bottom: 0; border-bottom: 0; }
.record-content-block .section-title { margin-bottom: 14px; font-size: 25px; }
.credential-source { display: inline-flex; margin-top: 10px; color: var(--primary); font-size: 13px; font-weight: 700; }
.site-search { display: flex; width: min(520px, 100%); margin-top: 22px; }
.site-search input { min-width: 0; flex: 1; height: 44px; border: 1px solid var(--line, #cbd5e1); border-right: 0; border-radius: 5px 0 0 5px; padding: 0 13px; background: var(--bg-1, #fff); color: var(--text-1, #0f172a); }
.site-search button { height: 44px; border: 1px solid var(--primary); border-radius: 0 5px 5px 0; padding: 0 20px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Desktop shell: company identity and phone occupy their own row.  A second
   navigation row prevents long company names and 8-12 real columns from
   colliding at common laptop widths. Manufacture already has this structure. */
@media (min-width: 901px) {
  .site-header:not(.mfr-toolways-header) .nav-inner {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    grid-template-areas:
      "brand phone"
      "navigation navigation";
    gap: 10px 28px;
    height: auto;
    min-height: 112px;
    padding-top: 12px;
  }
  .site-header:not(.mfr-toolways-header) .brand-block {
    grid-area: brand;
    align-self: center;
    max-width: min(680px, 70vw);
  }
  .site-header:not(.mfr-toolways-header) .brand {
    min-width: 0;
    max-width: 100%;
  }
  .site-header:not(.mfr-toolways-header) .brand-logo-frame:not(.is-wide-crop-left) {
    max-width: min(280px, 32vw);
  }
  .site-header:not(.mfr-toolways-header) .brand-logo-frame:not(.is-wide-crop-left) .brand-logo {
    max-width: 100%;
    object-fit: contain;
  }
  .site-header:not(.mfr-toolways-header) .brand-texts { max-width: 300px; }
  .site-header:not(.mfr-toolways-header) .nav-phone {
    grid-area: phone;
    align-self: center;
  }
  .site-header:not(.mfr-toolways-header) .main-nav {
    grid-area: navigation;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 3px;
    padding: 7px 0 8px;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .site-header:not(.mfr-toolways-header) .main-nav a,
  .site-header:not(.mfr-toolways-header) .main-nav .nav-link {
    padding: 8px 12px;
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  body.nav-open { overflow: hidden; }
  .site-header .nav-inner { position: relative; }
  .site-header .main-nav,
  .mfr-main-navigation .main-nav {
    display: none !important;
    flex-basis: 100%;
    width: 100%;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .site-header .main-nav.is-open,
  .mfr-main-navigation .main-nav.is-open { display: flex !important; }
  .site-header .brand-block {
    width: calc(100% - 52px);
    max-width: calc(100% - 52px);
    flex: 1 1 auto;
  }
  .site-header .nav-toggle {
    display: block !important;
    position: absolute;
    top: 8px;
    right: var(--container-pad, 24px);
    width: 40px;
    z-index: 2;
  }
  .product-detail { grid-template-columns: 1fr; gap: 30px; }
  .custom-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-records-list, .custom-records-timeline { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header .nav-inner { row-gap: 8px; }
  .site-header .brand-block { max-width: calc(100% - 56px); }
  .site-header .brand { min-width: 0; }
  .site-header .brand-logo-frame:not(.is-wide-crop-left) {
    width: min(180px, calc(100vw - 120px));
    max-width: 100%;
  }
  .site-header .brand-logo-frame:not(.is-wide-crop-left) .brand-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    object-fit: contain;
  }
  .brand-logo-frame.is-wide-crop-left { width: min(300px, calc(100vw - 92px)); height: 46px; }
  .brand-logo-frame.is-wide-crop-left .brand-logo { height: 46px !important; }
  .site-header .brand-texts { min-width: 0; }
  .site-header .brand-name { display: block; max-width: 100%; font-size: 14px; line-height: 1.25; }
  .site-header .nav-phone { display: none; }
  body.tpl-service .svc-hero { padding: 64px 0 72px; }
  body.tpl-service .svc-hero h1 { font-size: 26px; line-height: 1.28; }
  body.tpl-service .svc-hero-intro { font-size: 14px; line-height: 1.75; }
  body.tpl-service .svc-hero-stats { gap: 16px; }
  body.tpl-service .svc-hero-stats .stat { min-width: 82px; }
  body.tpl-service .svc-hero-side { padding: 22px; }
  .pd-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pd-gallery > img:first-child { max-height: 420px; }
  .custom-section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .custom-records { grid-template-columns: 1fr; }
  .custom-records-list .custom-record, .custom-records-timeline .custom-record { display: block; }
  .custom-record-body { padding: 16px; }
  .custom-record-body h2, .custom-record-body h3 { font-size: 18px; }
  .custom-detail-field { grid-template-columns: 1fr; gap: 8px; padding: 16px 0; }
  .custom-detail-images { grid-template-columns: 1fr 1fr; }
  .page-hero h1, .compact-hero h1 { font-size: 28px; line-height: 1.3; }
  .breadcrumb { display: flex; flex-wrap: wrap; }
  .floating-cta { max-width: calc(100vw - 24px); }
  .case-gallery { grid-template-columns: 1fr; }
  .case-card .card-body { padding: 18px; }
  .case-card .card-body h2, .case-card .card-body h3 { font-size: 19px; }
  .record-content-block .section-title { font-size: 22px; }
}
