
:root{
  /* Adjust if your header is taller than 56px */
  --menuh-h: 56px;
  --menu-gap: 0px;
  --shadow: 0 6px 14px rgba(0,0,0,.08);
}
/* Header (from menu-h.php) stays on top */
#site-menu-h{ position: sticky; top: 0; z-index: 1040; }
/* Ensure visible height */
#site-menu-h .navbar, #site-menu-h header{ min-height: var(--menuh-h); }

/* Main menu (from menu.php) sits directly below header */
#site-menu{ margin-top: calc(var(--menuh-h) + var(--menu-gap)); }
/* If menu nav is fixed-top, normalize to sticky to avoid overlap */
#site-menu .navbar.fixed-top{ position: sticky; top: 0; }
#site-menu .navbar.sticky-top{ top: 0; }

/* Keep in-page anchor jumps clear of both bars */
html, body{ scroll-padding-top: calc(var(--menuh-h) + 12px); }

/* Optional shadow only after scrolling a bit */
.scrolled #site-menu-h,
.scrolled #site-menu .navbar{ box-shadow: var(--shadow); }

/* iOS safe-area insets in Telegram webview */
@supports (top: env(safe-area-inset-top)) {
  #site-menu-h{ top: env(safe-area-inset-top); }
  #site-menu{ margin-top: calc(var(--menuh-h) + var(--menu-gap) + env(safe-area-inset-top)); }
}
