/**
 * MrFix legacy header navigation — modular replacement for the removed
 * critical.css / main.css menu rules.
 * Scope deliberately limited to #masthead; does not affect Store Bar or Hero.
 */
#masthead,
#masthead *,
#masthead *::before,
#masthead *::after { box-sizing: border-box; }

#masthead { position: relative; z-index: 1000; background: #fff; }
#masthead .mrfix-header-nav { position: relative; z-index: 2; background: #fff; border-bottom: 1px solid #edf0f3; }
#masthead .mrfix-header-inner { display: flex; align-items: center; gap: clamp(14px,2vw,28px); width: 100%; min-height: 74px; }
#masthead .mrfix-logo { flex: 0 0 140px; width: 140px; min-width: 0; margin: 0; }
#masthead .mrfix-main-nav { display: block; flex: 1 1 auto; min-width: 0; }
#masthead .mrfix-main-menu { display: flex; align-items: center; justify-content: center; gap: clamp(12px,2vw,30px); margin: 0; padding: 0; list-style: none; }
#masthead .mrfix-main-menu > li { position: static; display: block; margin: 0; padding: 0; list-style: none; }
#masthead .mrfix-main-menu > li > .mrfix-nav-link { display: inline-flex; align-items: center; gap: 9px; min-height: 74px; margin: 0; padding: 0; color: #192736; text-decoration: none; text-transform: uppercase; font-size: clamp(12px,1vw,14px); font-weight: 750; line-height: 1.25; white-space: nowrap; }
#masthead .mrfix-main-menu > li:hover > .mrfix-nav-link,
#masthead .mrfix-main-menu > li:focus-within > .mrfix-nav-link,
#masthead .mrfix-main-menu > li.current-menu-item > .mrfix-nav-link { color: #f56600; }
#masthead .mrfix-main-menu > li.mrfix-has-mega > .mrfix-nav-link::after { content: ''; width: 7px; height: 7px; flex: none; margin-top: -4px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
#masthead .mrfix-main-menu > li > .mrfix-submenu-toggle { display: none; }
#masthead .mrfix-mobile-toggle { display: none; }
#masthead .mrfix-mobile-menu[hidden] { display: none !important; }
#masthead a:focus-visible,
#masthead button:focus-visible { outline: 2px solid #f56600; outline-offset: 3px; }

/* Desktop: large dropdowns attach to the entire header, not the menu item. */
#masthead .mrfix-main-menu > li.mrfix-has-mega { position: static; }
#masthead .mrfix-main-menu > li > .mrfix-mega { position: absolute; top: 100%; left: 0; right: 0; width: auto; z-index: 10; padding: 0; background: #fff; border-top: 1px solid #e9edf1; box-shadow: 0 16px 35px #101c2d1e; visibility: hidden; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .16s ease, transform .16s ease, visibility .16s ease; }
#masthead .mrfix-main-menu > li:hover > .mrfix-mega,
#masthead .mrfix-main-menu > li:focus-within > .mrfix-mega,
#masthead .mrfix-main-menu > li.is-open > .mrfix-mega { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
#masthead .mrfix-mega-inner { max-width: 1280px; max-height: min(70vh,620px); margin: 0 auto; padding: 22px 28px 26px; overflow-y: auto; overscroll-behavior: contain; }

/* Repairs: compact, real links, column layout without nested list markers. */
#masthead .mrfix-repairs-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
#masthead .mrfix-repair-group { display: flex; flex-direction: column; min-width: 0; padding: 13px; border: 1px solid #ebeff3; border-radius: 13px; background: #fff; }
#masthead .mrfix-repair-head { display: flex; align-items: center; gap: 10px; color: #172738; text-decoration: none; min-height: 54px; }
#masthead .mrfix-repair-head img { flex: 0 0 50px; display: block; width: 50px; height: 50px; object-fit: contain; border-radius: 9px; background: #f8f9fb; }
#masthead .mrfix-repair-head strong { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
#masthead .mrfix-repair-group > ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 8px; margin: 11px 0 0; padding: 0; list-style: none; }
#masthead .mrfix-repair-group > ul > li { margin: 0; padding: 0; list-style: none; }
#masthead .mrfix-repair-group > ul a { display: block; padding: 5px 1px; text-decoration: none; color: #526171; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
#masthead .mrfix-repair-group a:hover { color: #f56600; }

/* Locations: never shrink to a single narrow column on desktop. */
#masthead .mrfix-locations-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
#masthead .mrfix-location-card { display: flex; align-items: center; min-width: 0; gap: 12px; padding: 12px; border: 1px solid #ecf0f3; border-radius: 12px; text-decoration: none; color: #172738; background: #fff; }
#masthead .mrfix-location-card:hover { border-color: #ffba8d; color: #f56600; background: #fff9f5; }
#masthead .mrfix-location-card img { flex: 0 0 52px; display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 9px; background: #f7f9fb; }
#masthead .mrfix-location-card span { font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }

/* Company / Blog: only these narrow dropdowns attach to their own menu item. */
#masthead .mrfix-main-menu > li.mrfix-has-simple { position: relative; }
#masthead .mrfix-main-menu > li > .mrfix-simple-dropdown { left: 0; right: auto; width: max-content; min-width: 220px; max-width: 320px; border: 1px solid #edf0f3; border-radius: 0 0 13px 13px; }
#masthead .mrfix-simple-dropdown-inner { display: flex; flex-direction: column; gap: 2px; padding: 10px; }
#masthead .mrfix-simple-dropdown-inner a { display: block; padding: 10px 12px; border-radius: 8px; color: #263544; text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.35; white-space: normal; }
#masthead .mrfix-simple-dropdown-inner a:hover,
#masthead .mrfix-simple-dropdown-inner a:focus-visible { background: #fff3ea; color: #e55c00; }

/* Mobile drawer. The closed drawer is always hidden, including on desktop. */
#masthead .mrfix-mobile-menu { display: none; }
#masthead .mrfix-mobile-close { display: none; }
@media (min-width: 992px) {
  #masthead .mrfix-mobile-menu { display: none !important; }
}
@media (max-width: 1199px) and (min-width: 992px) {
  #masthead .mrfix-main-menu { gap: 12px; }
  #masthead .mrfix-main-menu > li > .mrfix-nav-link { font-size: 12px; }
}
@media (max-width: 991px) {
  #masthead .mrfix-main-nav { display: none !important; }
  #masthead .mrfix-header-inner { min-height: 66px; justify-content: space-between; }
  #masthead .mrfix-logo { flex-basis: 112px; width: 112px; }
  #masthead .mrfix-mobile-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 44px; height: 44px; margin: 0; padding: 8px; border: 1px solid #e7ebef; border-radius: 10px; background: #fff; cursor: pointer; }
  #masthead .mrfix-mobile-toggle > span:not(.screen-reader-text) { display: block; width: 23px; height: 2px; border-radius: 2px; background: #162738; }
  body.mrfix-menu-opened { overflow: hidden; }
  #masthead .mrfix-mobile-menu:not([hidden]) { position: fixed; display: block; top: 0; right: 0; bottom: 0; left: auto; z-index: 2000; width: min(440px,100vw); height: 100dvh; padding: 76px 16px 28px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: -22px 0 55px #0c1d3350; }
  #masthead .mrfix-mobile-close { position: absolute; top: 17px; right: 18px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: #f5f7f9; color: #162738; font-size: 28px; line-height: 1; cursor: pointer; }
  #masthead .mrfix-mobile-list,
  #masthead .mrfix-mobile-list > li { margin: 0; padding: 0; list-style: none; }
  #masthead .mrfix-mobile-list > li { display: grid; grid-template-columns: minmax(0,1fr) 48px; align-items: center; border-bottom: 1px solid #edf0f3; }
  #masthead .mrfix-mobile-list > li > .mrfix-nav-link { display: flex; align-items: center; min-width: 0; min-height: 58px; padding: 10px 8px; color: #182837; font-size: 15px; font-weight: 800; text-decoration: none; text-transform: uppercase; white-space: normal; }
  #masthead .mrfix-mobile-list > li > .mrfix-nav-link::after { display: none; content: none; }
  #masthead .mrfix-mobile-list > li > .mrfix-submenu-toggle { grid-column: 2; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 2px; padding: 0; border: 0; border-radius: 9px; background: #fff3ea; color: #f56600; cursor: pointer; }
  #masthead .mrfix-mobile-list > li > .mrfix-submenu-toggle::after { content: ''; display: block; width: 9px; height: 9px; margin-top: -4px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .18s ease; }
  #masthead .mrfix-mobile-list > li.is-open > .mrfix-submenu-toggle::after { transform: translateY(4px) rotate(-135deg); }
  #masthead .mrfix-mobile-list > li:not(.mrfix-has-mega) > .mrfix-nav-link { grid-column: 1 / -1; }
  #masthead .mrfix-mobile-list > li > .mrfix-mega { grid-column: 1 / -1; position: static; display: none; width: 100%; min-width: 0; max-width: none; padding: 0 0 16px; border: 0; border-radius: 0; box-shadow: none; background: transparent; opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  #masthead .mrfix-mobile-list > li.is-open > .mrfix-mega { display: block; }
  #masthead .mrfix-mobile-menu .mrfix-mega-inner { max-height: none; padding: 6px 0; overflow: visible; }
  #masthead .mrfix-mobile-menu .mrfix-repairs-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
  #masthead .mrfix-mobile-menu .mrfix-repair-group { padding: 10px; }
  #masthead .mrfix-mobile-menu .mrfix-repair-head img { width: 46px; height: 46px; flex-basis: 46px; }
  #masthead .mrfix-mobile-menu .mrfix-repair-group > ul { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 10px; }
  #masthead .mrfix-mobile-menu .mrfix-locations-grid { grid-template-columns: 1fr; gap: 8px; }
  #masthead .mrfix-mobile-menu .mrfix-location-card { padding: 10px; }
  #masthead .mrfix-mobile-menu .mrfix-location-card img { width: 45px; height: 45px; flex-basis: 45px; }
  #masthead .mrfix-mobile-menu .mrfix-simple-dropdown-inner { gap: 2px; padding: 3px 8px 12px; }
  #masthead .mrfix-mobile-menu .mrfix-simple-dropdown-inner a { padding: 13px 12px; border-bottom: 1px solid #f0f2f4; font-size: 14px; }
}
@media (max-width: 420px) {
  #masthead .mrfix-mobile-menu:not([hidden]) { padding-inline: 12px; }
  #masthead .mrfix-mobile-menu .mrfix-repair-group > ul { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  #masthead .mrfix-mega,
  #masthead .mrfix-mobile-list > li > .mrfix-submenu-toggle::after { transition: none; }
}


/* MrFix theme: independent desktop mega-menu overlay, no plugin.
   Existing Store Bar, hero, store modal and mobile drawer are preserved. */
@media (min-width: 992px) {
  html.mrfix-nav-panel-ready #masthead .mrfix-main-nav .mrfix-main-menu > li > .mrfix-mega {
    display: none !important;
  }
  #mrfix-nav-panel {
    --mrfix-menu-orange: #f56600;
    box-sizing: border-box;
    position: fixed !important;
    inset-inline: 0;
    top: 0;
    z-index: 2147483000;
    width: 100vw;
    max-width: 100vw;
    max-height: min(72vh, 660px);
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-top: 1px solid #edf0f3;
    box-shadow: 0 20px 45px rgb(12 27 43 / 16%);
    font: 14px/1.45 system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
    color: #162536;
  }
  #mrfix-nav-panel *,
  #mrfix-nav-panel *::before,
  #mrfix-nav-panel *::after { box-sizing: border-box; }
  #mrfix-nav-panel[hidden] { display: none !important; }
  #mrfix-nav-panel a { text-decoration: none; }
  #mrfix-nav-panel a:focus-visible { outline: 2px solid var(--mrfix-menu-orange); outline-offset: 2px; }
  #mrfix-nav-panel .mrfix-mega { display: block !important; position: static !important; inset: auto !important; width: auto !important; min-width: 0 !important; max-width: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; opacity: 1 !important; visibility: visible !important; transform: none !important; pointer-events: auto !important; background: #fff !important; border: 0 !important; box-shadow: none !important; }
  #mrfix-nav-panel .mrfix-mega-inner { display: grid; width: 100%; max-width: 1280px; max-height: none; margin-inline: auto; padding: 22px 28px 28px; overflow: visible; }
  #mrfix-nav-panel .mrfix-locations-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
  #mrfix-nav-panel .mrfix-location-card { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 74px; padding: 12px; border: 1px solid #edf0f3; border-radius: 12px; background: #fff; box-shadow: none; color: #172536; }
  #mrfix-nav-panel .mrfix-location-card:hover { border-color: #ffb788; background: #fff8f3; color: #dd5900; }
  #mrfix-nav-panel .mrfix-location-card img { display: block; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #f2f5f7; }
  #mrfix-nav-panel .mrfix-location-card span { min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 750; }
  #mrfix-nav-panel .mrfix-repairs-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
  #mrfix-nav-panel .mrfix-repair-group { display: flex; flex-direction: column; min-width: 0; padding: 13px; border: 1px solid #e8eef3; border-radius: 12px; background: #fff; box-shadow: none; }
  #mrfix-nav-panel .mrfix-repair-head { display: flex; align-items: center; gap: 10px; color: #172536; }
  #mrfix-nav-panel .mrfix-repair-head img { flex: 0 0 46px; width: 46px; height: 46px; object-fit: contain; border-radius: 8px; }
  #mrfix-nav-panel .mrfix-repair-head strong { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
  #mrfix-nav-panel .mrfix-repair-group ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px 9px; margin: 12px 0 0; padding: 0; list-style: none; }
  #mrfix-nav-panel .mrfix-repair-group li { display: block; margin: 0; padding: 0; list-style: none; }
  #mrfix-nav-panel .mrfix-repair-group li a { display: block; padding: 5px 1px; color: #526271; font-size: 13px; line-height: 1.4; }
  #mrfix-nav-panel .mrfix-repair-group li a:hover { color: var(--mrfix-menu-orange); }
  #mrfix-nav-panel.mrfix-panel-simple { inset-inline: auto; width: min(320px,calc(100vw - 24px)); max-width: none; border: 1px solid #edf0f3; border-radius: 0 0 12px 12px; }
  #mrfix-nav-panel.mrfix-panel-simple .mrfix-simple-dropdown-inner { display: flex; flex-direction: column; gap: 3px; padding: 10px; }
  #mrfix-nav-panel.mrfix-panel-simple .mrfix-simple-dropdown-inner a { padding: 10px 12px; color: #172536; font-size: 14px; font-weight: 650; border-radius: 7px; }
  #mrfix-nav-panel.mrfix-panel-simple .mrfix-simple-dropdown-inner a:hover { background: #fff3ea; color: #d95100; }
  #mrfix-nav-panel.mrfix-panel-simple .mrfix-mega-inner { display: block; padding: 0; }
}
@media (min-width: 992px) and (max-width: 1100px) {
  #mrfix-nav-panel .mrfix-locations-grid,
  #mrfix-nav-panel .mrfix-repairs-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 991px) { #mrfix-nav-panel { display: none !important; } }

