/* ==========================================================
   SITE HEADER (mfwh-*) — light, sticky, with service-area mega menu
   Loaded after styles.css / mobile.css. Uses its own class names so the
   legacy header rules (header .brand, .header-link, .mfw-header) don't apply.
   ========================================================== */

/* overflow-x: hidden on html/body (styles.css) breaks position: sticky; clip
   hides horizontal overflow the same way without creating a scroll container. */
html,
body {
  overflow-x: clip !important;
}

html {
  scroll-padding-top: 104px;
}

:root {
  --mfwh-ink: #0f172a;
  --mfwh-muted: #475569;
  --mfwh-line: rgba(15, 23, 42, 0.08);
  --mfwh-red: #dc2626;
  --mfwh-red-dark: #b91c1c;
  --mfwh-navy: #070e1c;
}

/* ---------- Trust bar ---------- */
.mfwh-topbar {
  background: var(--mfwh-navy);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 500;
}

.mfwh-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
}

.mfwh-topbar__trust {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}

.mfwh-topbar__trust li::before {
  content: "✓";
  color: var(--mfwh-red);
  font-weight: 800;
  margin-right: 7px;
}

.mfwh-topbar a.mfwh-topbar__mail {
  color: rgba(255, 255, 255, 0.82) !important;
  text-decoration: none;
}

.mfwh-topbar a.mfwh-topbar__mail:hover {
  color: #ffffff !important;
}

/* ---------- Main bar ---------- */
.mfwh {
  position: sticky;
  top: 0;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--mfwh-line);
  transition: box-shadow 0.25s ease;
}

.mfwh.is-scrolled {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.mfwh__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 96px;
}

.mfwh__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.mfwh__brand img {
  display: block;
  height: 72px;
  width: auto;
  transition: height 0.25s ease;
}

.mfwh.is-scrolled .mfwh__brand img {
  height: 60px;
}

/* ---------- Desktop nav ---------- */
.mfwh__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.mfwh__menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.mfwh__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--mfwh-ink) !important;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}

.mfwh__link:hover,
.mfwh__has-mega:hover > .mfwh__link,
.mfwh__has-mega.is-open > .mfwh__link {
  color: var(--mfwh-red) !important;
  background: rgba(239, 68, 68, 0.06);
}

.mfwh__link.is-current {
  color: var(--mfwh-red) !important;
}

.mfwh__link svg {
  transition: transform 0.2s ease;
}

.mfwh__has-mega:hover > .mfwh__link svg,
.mfwh__has-mega.is-open > .mfwh__link svg {
  transform: rotate(180deg);
}

/* Mega menu spans the whole bar */
.mfwh__has-mega {
  position: static;
}

.mfwh__mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 1px;
  padding: 26px 28px 20px;
  background: #ffffff;
  border: 1px solid var(--mfwh-line);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Invisible bridge so the menu stays open while the pointer moves down to it */
.mfwh__mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -30px;
  height: 30px;
}

.mfwh__has-mega:hover > .mfwh__mega,
.mfwh__has-mega.is-open > .mfwh__mega,
.mfwh__has-mega:focus-within > .mfwh__mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mfwh__mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 28px;
}

.mfwh__mega-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
}

.mfwh__mega ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mfwh__mega li a {
  display: block;
  padding: 5px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--mfwh-ink) !important;
  text-decoration: none;
}

.mfwh__mega li a:hover {
  color: var(--mfwh-red) !important;
}

.mfwh__mega-all {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mfwh-red) !important;
  text-decoration: none;
}

/* ---------- Actions ---------- */
.mfwh__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mfwh a.mfwh__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: var(--mfwh-ink) !important;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.mfwh__phone svg {
  color: var(--mfwh-red);
}

.mfwh a.mfwh__phone:hover {
  background: rgba(15, 23, 42, 0.05);
}

.mfwh a.mfwh__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--mfwh-red);
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.mfwh a.mfwh__cta:hover {
  background: var(--mfwh-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.36);
}

.mfwh__burger,
.mfwh__panel-cta {
  display: none;
}

/* Visible breadcrumbs for inner pages */
.mfw-crumbbar {
  background: #f8fafc;
  border-bottom: 1px solid var(--mfwh-line);
  padding: 12px 0;
}

.mfw-crumbbar .mfw-breadcrumbs {
  margin: 0 auto;
}

/* ---------- Medium desktop: tighten ---------- */
@media (max-width: 1240px) {
  .mfwh__phone span {
    display: none;
  }

  .mfwh a.mfwh__phone {
    padding: 10px;
    background: rgba(15, 23, 42, 0.05);
  }

  .mfwh__bar {
    gap: 18px;
  }

  .mfwh__link {
    padding: 10px 11px;
  }
}

/* ---------- Tablet & mobile: hamburger panel ---------- */
@media (max-width: 1140px) {
  html {
    scroll-padding-top: 80px;
  }

  .mfwh-topbar {
    display: none;
  }

  .mfwh__bar {
    min-height: 76px;
    justify-content: space-between;
  }

  .mfwh__brand img,
  .mfwh.is-scrolled .mfwh__brand img {
    height: 58px;
  }

  .mfwh .mfwh__actions a.mfwh__cta {
    display: none;
  }

  .mfwh a.mfwh__phone {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    background: var(--mfwh-red);
  }

  .mfwh__phone svg {
    color: #ffffff;
  }

  .mfwh__burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--mfwh-line);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
  }

  .mfwh__burger span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--mfwh-ink);
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .mfwh.is-menu-open .mfwh__burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mfwh.is-menu-open .mfwh__burger span:nth-child(2) {
    opacity: 0;
  }

  .mfwh.is-menu-open .mfwh__burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Slide-down menu panel */
  .mfwh__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    max-height: calc(100vh - 76px);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    padding: 12px 16px 24px;
    background: #ffffff;
    border-top: 1px solid var(--mfwh-line);
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .mfwh.is-menu-open .mfwh__nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .mfwh__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .mfwh__link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 12px;
    font-size: 17px;
  }

  /* Mega menu becomes an accordion; hover doesn't open it on touch */
  .mfwh__mega,
  .mfwh__has-mega:hover > .mfwh__mega,
  .mfwh__has-mega:focus-within > .mfwh__mega {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 4px 12px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mfwh__has-mega.is-open > .mfwh__mega {
    display: block;
  }

  .mfwh__has-mega:hover > .mfwh__link svg {
    transform: none;
  }

  .mfwh__has-mega.is-open > .mfwh__link svg {
    transform: rotate(180deg);
  }

  .mfwh__mega::before {
    display: none;
  }

  .mfwh__mega-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .mfwh__panel-cta {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--mfwh-line);
  }

  .mfwh__cta--block {
    padding: 15px 22px;
    font-size: 16px;
  }

  .mfwh a.mfwh__call-block {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 999px;
    border: 1px solid var(--mfwh-line);
    font-weight: 700;
    color: var(--mfwh-ink) !important;
    text-decoration: none;
  }

  body.mfwh-lock {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .mfwh__brand img,
  .mfwh.is-scrolled .mfwh__brand img {
    height: 52px;
  }
}

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

/* With a sticky header the legacy 100px hero top padding leaves a blank gap on phones */
@media (max-width: 768px) {
  .hero.mfw-serving {
    padding-top: 28px !important;
  }
}
