/**
 * Mobile header shell for pages that defer style.css (async/idle).
 * Hides the desktop mega-menu before theme CSS loads (prevents FOUC bullet list).
 * min-height: 0 — pair with page hero padding-top; do NOT add a spacer.
 */

#component-header {
  position: relative;
  z-index: 1000;
  min-height: 0;
}

#component-side-toggle {
  position: absolute;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

#component-side-toggle .side-info {
  pointer-events: auto;
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  z-index: 99999;
  transform: translateX(100%);
  background: #fff;
}

#component-side-toggle .side-info.info-open {
  transform: translateX(0);
}

#component-header .header-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: #fff;
}

#component-header .header-area__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  height: 100px;
}

@media (max-width: 1199px) {
  #component-header {
    min-height: 0;
  }

  #component-header .header-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  #component-header .header-area .container.large {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: max(1rem, env(safe-area-inset-left, 0px))
      max(1rem, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }

  #component-header .header-area__inner {
    height: 70px;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    padding: 0 8px;
  }

  /* Critical: hide unstyled mega-menu until style.css arrives */
  #component-header .main-menu {
    display: none !important;
  }

  #component-header .header__end-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0 !important;
  }

  #component-header .header__navicon {
    display: block;
  }

  #component-header .mobile-menu-toggle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff6a3a, #ff8a65);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 106, 58, 0.3);
    padding: 0;
  }

  #component-header .hamburger {
    width: 20px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  #component-header .hamburger .line {
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }

  #component-header .header__logo {
    display: none;
  }

  #component-header .header__mobile-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: auto;
  }

  #component-header .header__mobile-logo a {
    font-family:
      system-ui,
      -apple-system,
      "Segoe UI",
      Roboto,
      sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #111;
    text-decoration: none;
  }

  #component-header .header__nav-shell {
    flex: 0 0 auto;
    margin: 0;
  }

  #component-header .mobile-menu-overlay:not(.active),
  .mobile-menu-overlay:not(.active),
  #component-header .site-search-overlay:not(.site-search-overlay--open),
  .site-search-overlay:not(.site-search-overlay--open) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
