/* Michael Markowski — shared site header (include via site-header.php)
   Fixed (not sticky): many lab pages use body { overflow: hidden; height: 100vh },
   which breaks position:sticky. Fixed keeps the bar pinned to the viewport. */

.mm-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10000;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  background-color: #ffffff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/*
 * Lab pages: vertical + horizontal center in the viewport below the fixed header.
 * - min-height + height:auto overrides per-app body { height: 100vh }.
 * - Scripts at the end of <body> are hidden from flex layout (they still execute).
 */
body:has(> .mm-site-header) {
  padding-top: calc(69px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
}

body:has(> .mm-site-header) > script,
body:has(> .mm-site-header) > noscript {
  display: none;
}

.mm-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mm-header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.mm-header-logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(240px, 55vw);
  object-fit: contain;
}

.mm-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #111;
  cursor: pointer;
  border-radius: 6px;
}

.mm-nav-toggle:hover {
  background: #f5f5f5;
}

.mm-nav-toggle:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.mm-main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 28px;
}

/* High specificity + !important so lab / host stylesheets don’t flatten nav links */
header.mm-site-header .mm-main-nav a:link,
header.mm-site-header .mm-main-nav a:visited {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  color: #111111 !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: none !important;
  transition: color 0.15s ease;
  -webkit-font-smoothing: antialiased;
}

header.mm-site-header .mm-main-nav a:hover,
header.mm-site-header .mm-main-nav a:focus-visible {
  color: #ee764b !important;
}

header.mm-site-header .mm-main-nav a.mm-nav-active:link,
header.mm-site-header .mm-main-nav a.mm-nav-active:visited {
  color: #ee764b !important;
}

.mm-cart-link {
  padding: 6px 4px !important;
}

.mm-cart-link svg {
  display: block;
}

@media (max-width: 768px) {
  .mm-header-inner {
    padding: 12px 18px;
    flex-wrap: wrap;
  }

  .mm-nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .mm-main-nav {
    width: 100%;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .mm-site-header.mm-nav-open .mm-main-nav {
    max-height: 320px;
  }

  .mm-main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
    border-top: 1px solid #eee;
    margin-top: 8px;
  }

  .mm-main-nav li {
    border-bottom: 1px solid #f0f0f0;
  }

  header.mm-site-header .mm-main-nav a:link,
  header.mm-site-header .mm-main-nav a:visited {
    display: flex;
    padding: 14px 0;
    width: 100%;
  }

  .mm-cart-link {
    justify-content: flex-start;
  }
}
