/* Site-wide fixes shared by every page (2026-11-10 audit). Loaded from the shared head block.
   Page styles come later in each document, so rules that must win use !important or extra
   specificity on purpose. */

/* Sticky headers. Pages set overflow-x:hidden on both html and body; with both set, body becomes
   its own scroll box and position:sticky headers (.logo-bar, .lp-bar) scroll away with the page.
   clip still hides sideways overflow but does not make a scroll box. Browsers without clip keep
   the old behaviour. */
body { overflow-x: clip !important; }

/* One focus ring for every background: a navy outline with a white halo, visible on white, navy
   and red alike (the old blue ring was 1.6:1 on navy). */
:focus-visible {
  outline: 3px solid #003d79 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #fff !important;
}

/* Form field borders: the light greys used before were 1.2-1.5:1 against white. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(:focus):not([aria-invalid="true"]),
select:not(:focus):not([aria-invalid="true"]),
textarea:not(:focus):not([aria-invalid="true"]) {
  border-color: #6b7280 !important;
}
/* Turnstile and other embedded widgets keep their own styling. */
.cf-turnstile input, [data-nw-turnstile] input { border-color: initial !important; }

/* Phone menu (core pages). The panel opens under the sticky header as a full-width sheet with its
   own scroll, a dimmed backdrop, and Call / Request a Quote at the bottom. */
.nw-nav-backdrop { display: none; }
.nw-nav-extra { display: none; }
@media (max-width: 1024px) {
  html body .logo-bar .logo-bar__nav.open {
    position: fixed;
    top: var(--nw-header-bottom, 94px);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nw-header-bottom, 94px));
    max-height: calc(100dvh - var(--nw-header-bottom, 94px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 20px 20px;
    border-radius: 0;
    z-index: 1001;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  }
  html body .logo-bar .logo-bar__nav.open { align-items: stretch; }
  html body .logo-bar .logo-bar__nav.open > a {
    font-size: 17px;
    padding: 14px 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  html body .logo-bar .logo-bar__nav.open .nw-nav-extra {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
  }
  html body .logo-bar .logo-bar__nav.open .nw-nav-extra a {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-size: 17px;
    white-space: nowrap;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
  }
  html body .logo-bar .logo-bar__nav.open .nw-nav-extra .nw-nav-call { background: #c8102e; color: #fff; }
  html body .logo-bar .logo-bar__nav.open .nw-nav-extra .nw-nav-quote { background: #fff; color: #003d79; box-shadow: inset 0 0 0 2px #003d79; }
  .nw-nav-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(10, 22, 40, .45);
  }
  /* Lock the page, not body: making body overflow:hidden would turn it back into a scroll box and drop the sticky header. */
  html.nw-nav-locked { overflow: hidden !important; }
}

/* Pinned Call / Request a Quote bar on phones (core pages; landing pages have their own). */
.nw-callbar { display: none; }
@media (max-width: 768px) {
  .nw-callbar {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #d5dbe3;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .12);
  }
  .nw-callbar a {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: 8px;
    font: 700 16px/1.2 Inter, Arial, sans-serif;
    text-decoration: none !important;
    white-space: nowrap;
  }
  .nw-callbar__call { background: #c8102e; color: #fff !important; }
  .nw-callbar__quote { background: #fff; color: #003d79 !important; box-shadow: inset 0 0 0 2px #003d79; }
  .nw-callbar svg { width: 18px; height: 18px; flex: none; }
  body:has(> .nw-callbar) { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }
  /* Never cover a field someone is typing in, or the open menu. */
  body:has(input:focus, select:focus, textarea:focus) .nw-callbar,
  html.nw-nav-locked .nw-callbar { display: none; }
  html { scroll-padding-bottom: 88px; }
}
@media (max-width: 360px) {
  .nw-callbar a { font-size: 15px; gap: 6px; }
}
@media print { .nw-callbar, .nw-nav-backdrop { display: none !important; } }
