/* ── Phone menu, Option A (.om) ───────────────────────────────────────────
   Markup: inc/mobile-menu.php. Behaviour: assets/js/mobile-menu.js.
   Enqueued with media="(max-width: 900px)", the theme's mobile breakpoint,
   so none of this reaches desktop.

   Square everywhere: no border-radius, bevels or shadows. Its own colour
   tokens, set here and not inherited: main.css redefines --line and
   --muted per page and lightens --oxid-blue in dark mode, and this menu
   stays white with #004C8C in both themes. Every text colour passes 4.5:1
   on white; white passes on #004C8C. Sizes are from the 390px design. */

.om {
  --oxid-blue: #004C8C;
  --oxid-blue-dark: #003A6B;
  --ink: #14191F;
  --ink-soft: #3E4852;
  --muted: #5B6670;
  --line: #E3E7EC;
  --field-border: #C9D1DA;
  --bg: #FFFFFF;
  --om-gutter: 24px;
  --om-display: 'Archivo', system-ui, sans-serif;
  --om-text: 'Spline Sans', system-ui, sans-serif;

  position: fixed;
  inset: 0;
  /* Above the WP admin bar (99999), which it covers while open. */
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
  font-family: var(--om-display);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

.om[hidden] {
  display: none;
}

.om,
.om * {
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
}

/* Resets in :where(), so they weigh no more than one class and every
   component rule below wins over them. */
.om :where(a) {
  text-decoration: none;
}

.om :where(button) {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.om :where(svg) {
  display: block;
  flex: none;
}

/* Page scroll is locked while the menu is open (mobile-menu.js). */
html.om-locked,
html.om-locked body {
  overflow: hidden;
}

/* Focus: 2px brand blue, 2px off the element. Never removed. */
.om a:focus-visible,
.om button:focus-visible {
  outline: 2px solid var(--oxid-blue);
  outline-offset: 2px;
}

/* ── Header: logo, close ── */
.om-head {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 64px;
  padding: 0 12px 0 var(--om-gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* Logo centred at the same size as the site's phone header (main.css:
   .site-header .brand img, 48px tall), so it doesn't jump on open. */
.om-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  min-height: 44px;
  transform: translate(-50%, -50%);
}

.om-logo img {
  display: block;
  width: auto;
  height: 48px;
}

.om-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

/* ── Panels: only the area between header and footer changes ──
   Panels take their content's height (no flex-grow), so the footer sits
   right under the last row instead of at the bottom of the screen. */
.om-panel {
  flex: none;
  display: flex;
  flex-direction: column;
}

.om-panel[hidden] {
  display: none;
}

@keyframes om-in-from-right {
  from { transform: translateX(100%); }
  to { transform: none; }
}

@keyframes om-in-from-left {
  from { transform: translateX(-100%); }
  to { transform: none; }
}

.om-panel.om-from-right {
  animation: om-in-from-right 200ms ease-out;
}

.om-panel.om-from-left {
  animation: om-in-from-left 200ms ease-out;
}

/* ── Search ── */
/* The search bar sits right under the header, with no visible label
   (user's call, Nov 16 2026; the label is visually hidden for screen
   readers). Everything below follows it up. 10px above (was 20px, then
   16px, then 12px; user's call Nov 17 2026). */
.om-searchwrap {
  padding: 10px var(--om-gutter) 8px;
}

.om-search {
  margin: 0;
}

.om-search-row {
  display: flex;
  height: 48px;
  border: 1.5px solid var(--field-border);
  background: var(--bg);
}

.om-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 14px;
  border: 0;
  background: transparent;
  /* 16px minimum: iOS Safari zooms in on focus below that. */
  font: 400 16px/1.2 var(--om-text);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.om-search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.om-search-input:focus-visible {
  outline: 2px solid var(--oxid-blue);
  outline-offset: -4px;
}

/* Where :has() works, the focus ring goes round the whole field instead. */
@supports selector(:has(*)) {
  .om-search-input:focus-visible {
    outline: none;
  }

  .om-search-row:has(.om-search-input:focus-visible) {
    outline: 2px solid var(--oxid-blue);
    outline-offset: 2px;
  }
}

.om-search-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--oxid-blue);
  color: #FFFFFF;
  cursor: pointer;
}

/* The site's type-ahead (main.js "Search suggestions"), kept light and
   square inside the menu, dark mode or not. */
.om .lm-suggest {
  --sg-bg: #FFFFFF;
  --sg-ink: #14191F;
  --sg-dim: #5B6670;
  --sg-line: #E3E7EC;
  --sg-hover: #F3F5F8;
  --sg-mark: #004C8C;
}

/* ── Groups: Products, Company ── */
.om-nav {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 8px var(--om-gutter) 0;
}

.om-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 60px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font: 700 22px/1.1 var(--om-display);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.om-group[aria-expanded="true"] {
  color: var(--oxid-blue);
}

.om-chev {
  color: var(--muted);
  transition: transform 200ms ease;
}

.om-group[aria-expanded="true"] .om-chev {
  color: var(--oxid-blue);
}

.om-group[aria-expanded="true"] .om-chev,
.om-sub[aria-expanded="true"] .om-chev {
  transform: rotate(180deg);
}

/* Expand / collapse: the row animates between 0 and the content's height.
   Collapsed content is visibility:hidden, so Tab and screen readers skip
   it; the visibility flip waits for the collapse to finish. The inner
   box's padding + matching negative margin keeps focus rings at its edges
   from being clipped without moving anything. */
.om-collapse {
  /* Never squeezed to fit the screen: the overlay scrolls instead. */
  flex-shrink: 0;
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 200ms ease, visibility 0s;
}

.om-collapse.is-collapsed {
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 200ms ease, visibility 0s linear 200ms;
}

.om-collapse-inner {
  min-height: 0;
  overflow: hidden;
  margin: -4px -6px;
  padding: 4px 6px;
}

.om-group-body {
  display: flex;
  flex-direction: column;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--om-text);
}

/* Sub-items: a series (toggles in place), Standalone Products (drills). */
.om-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  font: 600 17px/1.25 var(--om-text);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.om-models {
  list-style: none;
  margin: 0;
  padding: 0 0 6px 16px;
}

.om-models li {
  margin: 0;
  padding: 0;
}

.om-model,
.om-company {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--om-text);
}

.om-model {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-soft);
}

.om-company {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

/* Accent links: View the series, Product Directory. */
.om-accent {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font: 600 15px/1.3 var(--om-text);
  color: var(--oxid-blue);
}

.om-dir {
  margin-top: 6px;
}

/* ── Standalone Products panel ── */
.om-subhead {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 0 64px;
  border-bottom: 1px solid var(--line);
}

.om-back {
  position: absolute;
  top: 10px;
  left: 12px;
}

.om-subhead-title {
  margin: 0;
  font: 700 20px/1.2 var(--om-display);
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  text-align: center;
}

/* Closes with the same divider as the main panel's last group, so the
   quote button sits under a line on both panels. */
.om-rows {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  margin: 0 var(--om-gutter);
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
}

.om-row {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font: 700 20px/1.2 var(--om-display);
  color: var(--ink);
}

.om-rows .om-dir {
  min-height: 52px;
}

/* ── Footer: Request a Quote ──
   No divider of its own (user's call): it follows the menu's last line,
   the one under Product Directory. */
.om-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px var(--om-gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

.om-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 16px;
  background: var(--oxid-blue);
  font: 800 16px/1 var(--om-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.om .om-quote:hover,
.om .om-quote:focus-visible {
  background: var(--oxid-blue-dark);
  color: #FFFFFF;
}

/* ── Hover, for devices that have it ── */
@media (hover: hover) {
  .om-model:hover,
  .om-company:hover,
  .om-row:hover,
  .om-sub:hover {
    color: var(--oxid-blue);
  }

  .om-accent:hover {
    color: var(--oxid-blue-dark);
  }

  .om-search-btn:hover {
    background: var(--oxid-blue-dark);
  }
}

@media (prefers-reduced-motion: reduce) {
  .om,
  .om * {
    transition: none !important;
    animation: none !important;
  }
}
