/* Mobile navigation (hamburger menu) — screens narrower than 840px */

.nav-toggle{
  display:none;
  width:44px; height:44px;
  padding:0; margin:0 -10px 0 0;
  background:transparent; border:0; border-radius:2px;
  cursor:pointer;
  flex-direction:column; align-items:center; justify-content:center; gap:5px;
  -webkit-tap-highlight-color:transparent;
}
.nav-toggle span{
  display:block; width:24px; height:2px;
  background:var(--ink, #111);
  transition:transform 200ms ease, opacity 150ms ease;
}
.nav-toggle:focus-visible{outline:2px solid var(--accent, #183090); outline-offset:2px;}
.nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg);}
.nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
.nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

/* Extra items that only exist in the mobile menu */
nav.links a.nav-cta-mobile{display:none;}
.nav-sub-toggle{display:none;}

@media (max-width:839px){
  .nav-toggle{display:flex;}
  .nav-inner{gap:12px;}
  .nav-inner > a.btn-primary{margin-left:auto; padding:10px 16px; font-size:14px;}

  /* Menu panel, drops down under the header */
  header.site nav.links{
    display:none;
    position:absolute; top:100%; left:0; right:0;
    flex-direction:column; align-items:stretch; flex-wrap:nowrap;
    gap:0; row-gap:0;
    max-height:calc(100vh - 80px); max-height:calc(100dvh - 80px);
    overflow-y:auto; -webkit-overflow-scrolling:touch;
    padding:8px var(--gutter, 24px) 24px;
    background:#fff;
    border-bottom:1px solid var(--hair, #e5e5e5);
    box-shadow:0 18px 32px rgba(0,0,0,0.10);
  }
  header.site.nav-open nav.links{display:flex;}

  header.site nav.links a{
    display:block; padding:14px 0; font-size:16px;
    border-bottom:1px solid var(--hair, #e5e5e5);
    white-space:normal;
  }
  header.site nav.links a::after{display:none;}

  /* Products: tap the arrow to open / close the product list */
  header.site nav.links .nav-item{display:flex; flex-wrap:wrap; align-items:stretch;}
  header.site nav.links .nav-item::after{display:none;}
  header.site nav.links .nav-item > a{flex:1 1 auto; min-width:0;}
  header.site nav.links .dropdown-caret{display:none;}

  header.site nav.links .nav-sub-toggle{
    display:flex; align-items:center; justify-content:center;
    flex:0 0 52px; padding:0; margin:0;
    background:transparent; border:0;
    border-bottom:1px solid var(--hair, #e5e5e5);
    color:var(--ink, #111); cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  header.site nav.links .nav-sub-toggle svg{
    width:20px; height:20px; transition:transform 200ms ease;
  }
  header.site nav.links .nav-item.open .nav-sub-toggle svg{transform:rotate(180deg);}
  header.site nav.links .nav-sub-toggle:focus-visible{outline:2px solid var(--accent, #183090); outline-offset:-2px;}

  header.site nav.links .dropdown-menu{
    display:none;
    flex:0 0 100%;
    position:static; min-width:0; margin:0; list-style:none;
    padding:0 0 0 16px;
    background:transparent; border:0; box-shadow:none;
    opacity:1 !important; visibility:visible !important; transform:none !important;
  }
  header.site nav.links .nav-item.open .dropdown-menu{display:block;}
  header.site nav.links .dropdown-menu a{padding:12px 0; font-size:15px; color:var(--muted, #555);}

  header.site nav.links a.nav-cta-mobile{
    display:none; margin-top:20px; padding:14px 22px;
    text-align:center; color:#fff; border-bottom:0;
  }
}

/* On very small phones, the enquiry button moves into the menu to leave room for the logo */
@media (max-width:599px){
  .nav-inner > a.btn-primary{display:none;}
  .nav-inner{justify-content:space-between;}
  header.site nav.links a.nav-cta-mobile{display:block;}
}

/* ---- Responsive fixes ---- */

/* Page banner headings: wider line length */
.page-hero h1{max-width:30ch;}

/* Product-family tabs: even height, vertically centred text, 2 columns on tablets */
.family-nav a{display:flex; align-items:center; min-height:60px; line-height:1.3;}
@media (min-width:700px) and (max-width:959px){
  .family-nav{grid-template-columns:repeat(2,1fr);}
}

/* ---- Mobile fit: nothing may be wider than the screen ---- */

/* Grid columns can shrink below their content width. Without this, a wide table
   forces the column (and the whole page) wider than the phone screen. */
.split, .scope-grid, .text-media{grid-template-columns:minmax(0,1fr);}
.split > *, .scope-grid > *, .text-media > *{min-width:0;}
@media (min-width:700px){
  .scope-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (min-width:900px){
  .split{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);}
  .text-media{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);}
}

/* Wide tables scroll inside their own box instead of widening the page */
.table-scroll{max-width:100%;}

/* Long words / lines wrap instead of overflowing */
.spec-list .val, .scope-col li, .notes-list li, table.plain td, table.plain th{overflow-wrap:break-word;}

@media (max-width:639px){
  /* Standards table: smaller, tighter, status text may wrap */
  table.standards{min-width:520px; font-size:14px;}
  table.standards th{padding:12px 14px;}
  table.standards td{padding:14px;}
  .status-pill{white-space:normal;}

  /* Config table */
  table.plain{font-size:14.5px;}
  table.plain th, table.plain td{padding-right:12px;}

  /* Breadcrumb pill inside the banner: line 1 = Home / Products, line 2 = current page */
  .crumb-pill{
    flex-wrap:wrap; column-gap:8px; row-gap:6px;
    max-width:100%; padding:12px 18px; border-radius:20px;
    font-size:11.5px; letter-spacing:0.08em; line-height:1.3;
  }
  .crumb-pill .sep{margin:0;}
  .crumb-pill .current{flex:0 0 100%;}
  .crumb-pill .sep:has(+ .current){display:none;}

  /* Buttons may wrap onto two lines instead of running off the screen */
  .btn{white-space:normal; max-width:100%; text-align:center; line-height:1.35;}

  /* Banner text sizes */
  .page-hero .lede{font-size:16px;}
}

/* Safety net: anything that still manages to be wider than the screen is clipped,
   so the page can never be dragged sideways on a phone or tablet */
@media (max-width:899px){
  main, footer{overflow-x:clip; max-width:100%;}
}
