/**
 * WordPress containment only — Divi/theme fight + page chrome.
 * Canonical header geometry lives in shared-ui/tokens.css + shared-ui/shell.css.
 * Do not redefine logo width, nav font, gaps, or padding with literal values here.
 * Prefer CSS variables so WP and calc cannot drift.
 */

/* Desktop: pin production rail; reinforce shell contract via tokens (!important for Divi). */
@media (min-width: 1024px) {
  body.mg-unified-production { margin-left: 0 !important; padding-left: 0 !important; }
  html { scrollbar-gutter: stable; }

  body.mg-unified-production #mg-production-rail {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    z-index: 9998 !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--header-gap) !important;
    column-gap: var(--header-gap) !important;
    height: var(--header-height) !important;
    min-height: var(--header-height) !important;
    padding-left: max(var(--header-pad-x), calc((100% - var(--header-band-max, var(--content-max))) / 2)) !important;
    padding-right: max(var(--header-pad-x), calc((100% - var(--header-band-max, var(--content-max))) / 2)) !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid var(--header-border) !important;
    box-shadow: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body.mg-unified-production #mg-production-rail .mg-rail-logo {
    display: block !important;
    width: var(--header-logo-w) !important;
    max-width: var(--header-logo-w) !important;
    flex: 0 0 var(--header-logo-w) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }
  body.mg-unified-production #mg-production-rail .mg-logo {
    display: block !important;
    width: var(--header-logo-w) !important;
    max-width: var(--header-logo-w) !important;
    height: auto !important;
    max-height: 48px !important;
    object-fit: contain !important;
    background: transparent !important;
  }
  body.mg-unified-production #mg-production-rail nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: var(--header-nav-gap) !important;
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: var(--header-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.mg-unified-production #mg-production-rail nav a {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    min-height: var(--header-link-min-h) !important;
    padding: 12px 0 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--header-ink) !important;
    font-family: Inter, Arial, sans-serif !important;
    font-size: var(--header-nav-fs) !important;
    font-weight: var(--header-nav-fw) !important;
    line-height: var(--header-nav-lh) !important;
    white-space: nowrap !important;
    text-decoration: none !important;
  }
  body.mg-unified-production #mg-production-rail nav a:hover,
  body.mg-unified-production #mg-production-rail nav a[aria-current="page"] {
    color: var(--header-ink-active) !important;
    border-bottom-color: var(--header-underline) !important;
    font-weight: var(--header-nav-fw) !important;
    padding: 12px 0 9px !important;
    background: transparent !important;
  }
  body.mg-unified-production #mg-production-rail .mg-rail-footer {
    display: flex !important;
    align-items: center !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    width: auto !important;
    flex: 0 0 auto !important;
  }
  body.mg-unified-production #mg-production-rail .mg-nesli-btn {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: var(--header-nesli-h) !important;
    height: var(--header-nesli-h) !important;
    padding: 4px 12px 4px 4px !important;
    margin: 0 !important;
    background: #fff !important;
    border: 1px solid var(--header-underline) !important;
    border-radius: 30px !important;
    color: var(--header-ink-active) !important;
    white-space: nowrap !important;
  }
  body.mg-unified-production #mg-production-rail .mg-nesli-btn img {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
  }
  body.mg-unified-production #mg-production-rail .mg-legal-links,
  body.mg-unified-production #mg-production-rail .mg-close-drawer { display: none !important; }

  body.mg-unified-production #page-container {
    margin: 0 !important;
    padding: var(--header-height) 0 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
  body.mg-unified-production #main-content {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 1280px !important;
    min-width: 0 !important;
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  body.mg-unified-production #mg-production-rail {
    padding-left: max(var(--header-pad-x-compact), calc((100% - var(--header-band-max, var(--content-max))) / 2)) !important;
    padding-right: max(var(--header-pad-x-compact), calc((100% - var(--header-band-max, var(--content-max))) / 2)) !important;
    gap: var(--header-gap-compact) !important;
    column-gap: var(--header-gap-compact) !important;
  }
  body.mg-unified-production #mg-production-rail .mg-rail-logo,
  body.mg-unified-production #mg-production-rail .mg-logo {
    width: var(--header-logo-w-compact) !important;
    max-width: var(--header-logo-w-compact) !important;
    flex: 0 0 var(--header-logo-w-compact) !important;
  }
  body.mg-unified-production #mg-production-rail nav { gap: var(--header-nav-gap-compact) !important; }
  body.mg-unified-production #mg-production-rail nav a {
    font-size: var(--header-nav-fs-compact) !important;
    line-height: var(--header-nav-lh-compact) !important;
  }
  body.mg-unified-production #mg-production-rail .mg-nesli-label { display: none !important; }
}

/* Exact-page / Divi containment (not header geometry). */
body.mg-unified-production,
body.mg-unified-production.page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #f4f7f9 !important;
  color: #13283a !important;
}
body.mg-unified-production #et-main-area {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.mg-unified-production #main-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #f4f7f9 !important;
}
body.mg-unified-production #et-main-area > footer.et-l--footer { display: none !important; }
body.mg-unified-production .mg-exact-page {
  max-width: 1240px !important;
  margin: 0 auto !important;
  padding: 32px 28px 72px !important;
}
body.mg-unified-production .mg-exact-page h1 {
  max-width: none !important;
  color: #073a66 !important;
  font: 800 clamp(30px, 3vw, 48px) / 1.12 Inter, Arial, sans-serif !important;
}
body.mg-unified-production .mg-exact-page h2 {
  color: #073a66 !important;
  font: 800 clamp(25px, 2.4vw, 36px) / 1.12 Inter, Arial, sans-serif !important;
}
body.mg-unified-production .mg-exact-page h3 {
  color: #073a66 !important;
  font: 800 20px / 1.12 Inter, Arial, sans-serif !important;
}
body.mg-unified-production .mg-exact-legacy-hidden { display: none !important; }
body.mg-unified-production .mg-exact-page .eyebrow { color: #073a66 !important; }
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy h1,
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy h2 { color: #ffffff !important; }
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy .eyebrow { color: rgba(255, 255, 255, 0.88) !important; }
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy .lead,
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy p { color: rgba(255, 255, 255, 0.92) !important; }
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy a {
  color: #fff !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.mg-unified-production #main-content .mg-exact-page .hero .hero-copy a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
body.mg-unified-production .mg-exact-page .hero { background: #073a66 !important; }
body.mg-unified-production .mg-exact-page .mg-home-lead {
  max-width: none !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  color: #607386 !important;
}
body.mg-unified-production .mg-exact-page .mg-address-line { white-space: nowrap !important; }
body.mg-unified-production .mg-exact-page .image-card .copy { text-align: left !important; }
body.mg-unified-production #main-content .mg-exact-page .carousel-copy h2,
body.mg-unified-production #main-content .mg-exact-page .carousel-copy p { color: #fff !important; }
body.mg-unified-production .mg-chat-launcher,
body.mg-unified-production .mg-nesli-fab,
body.mg-unified-production a.mg-chat-open,
body.mg-unified-production [data-mihai-chat-open="1"]:not(.mg-nesli-btn) { display: none !important; }

@media (max-width: 1023px) {
  body.mg-unified-production #page-container { padding-top: 66px !important; }
  body.mg-unified-production .mg-topbar {
    position: fixed !important;
    inset: 0 0 auto !important;
    min-height: 66px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--header-border) !important;
    z-index: 50 !important;
  }
  body.mg-unified-production .mg-topbar .mg-logo {
    width: 145px !important;
    height: auto !important;
    max-width: 145px !important;
  }
  body.mg-unified-production #mg-production-rail {
    background: #fff !important;
    color: var(--header-ink-active) !important;
    z-index: 60 !important;
  }
  body.mg-unified-production #mg-production-rail nav a { color: var(--header-ink) !important; }
  body.mg-unified-production #mg-production-rail nav a[aria-current="page"] {
    background: #eaf7fa !important;
    color: var(--header-ink-active) !important;
  }
  body.mg-unified-production .mg-exact-page { padding: 22px 20px 68px !important; }

  /* Kill legacy Divi mobile menus — only the unified Menu button may show. */
  body.mg-unified-production #et_mobile_nav_menu,
  body.mg-unified-production .et_mobile_nav_menu,
  body.mg-unified-production .mobile_menu_bar,
  body.mg-unified-production .mobile_nav,
  body.mg-unified-production #et-secondary-nav,
  body.mg-unified-production .et_pb_menu .mobile_nav,
  body.mg-unified-production .et_pb_fullwidth_menu .mobile_nav,
  body.mg-unified-production .et_pb_menu__icon.et_pb_menu__icon--menu,
  body.mg-unified-production header#main-header .mobile_menu_bar,
  body.mg-unified-production #main-header .mobile_menu_bar,
  body.mg-unified-production .et_toggle_slide_menu {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.mg-unified-production .mg-topbar .mg-menu-toggle { display: inline-flex !important; }
}

@media (max-width: 900px) {
  body.mg-unified-production .mg-exact-page {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  body.mg-unified-production .mg-exact-page .carousel,
  body.mg-unified-production .mg-exact-page .no-mobile { display: none !important; }
  body.mg-unified-production .mg-exact-page .mobile-service-media { display: block !important; }
  body.mg-unified-production .mg-exact-page .mg-home-lead {
    white-space: normal !important;
    font-size: 15px !important;
  }
  body.mg-unified-production .mg-exact-page .mg-address-line { white-space: normal !important; }
}
