/* Ibom-Oil V56 navigation: one 1100px fixed-header contract for every page family.
   A sticky header remains in normal document flow and reserves a second 64px row.
   The fixed overlay below stays visible without pushing the page downward. */
:root { --ibom-nav-height: 64px; }

html {
  scroll-padding-top: calc(var(--ibom-nav-height) + 12px);
}

body:is(.ibom-site, .admin-page, .product-manager-page) {
  padding-top: 0 !important;
}

body.ibom-site > header,
body.admin-page > .header,
body.product-manager-page > .topbar {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: var(--ibom-nav-height) !important;
  min-height: var(--ibom-nav-height) !important;
  margin: 0 !important;
  z-index: 3000 !important;
  transform: none !important;
  box-sizing: border-box !important;
}

body.ibom-site > header .navbar,
body.admin-page > .header .nav {
  height: 100% !important;
  min-height: 0 !important;
}

/* Give the first visible page root one deliberate safe area. This replaces the
   header's former in-flow row instead of stacking page padding underneath it. */
body.ibom-site > :where(main, section, .dashboard-shell, .ibom-auth-stage, .role-wrap, .chat-shell, .terms-page, .faq-hero, .container):first-of-type {
  margin-top: 0 !important;
  padding-top: calc(var(--ibom-nav-height) + 18px) !important;
}

body.ibom-home-page > .hero {
  padding-top: calc(var(--ibom-nav-height) + 14px) !important;
}

/* Keep every content shell and desktop sidebar on the measured 64px header
   contract. Shells receive the header height once; their own main-panel padding
   remains the small intentional gap below the bar. */
body.ibom-customer-page > .dashboard-shell,
body.admin-page > .layout {
  min-height: 100svh !important;
  margin-top: 0 !important;
  padding-top: var(--ibom-nav-height) !important;
}

body.ibom-customer-page > .dashboard-shell > .dashboard-sidebar,
body.admin-page > .layout > .sidebar {
  top: var(--ibom-nav-height) !important;
  height: calc(100svh - var(--ibom-nav-height)) !important;
}

body.product-manager-page > .sidebar {
  top: var(--ibom-nav-height) !important;
  height: calc(100svh - var(--ibom-nav-height)) !important;
}

body.product-manager-page > .main {
  padding-top: calc(var(--ibom-nav-height) + 18px) !important;
}

body:is(.ibom-site, .admin-page, .product-manager-page) > header + :is(main, section, .layout, .dashboard-shell, .ibom-auth-stage, aside) {
  margin-top: 0 !important;
}

body.ibom-site :where(main, section, article, div)[id],
body.admin-page :where(main, section, article, div)[id],
body.product-manager-page :where(main, section, article, div)[id] {
  scroll-margin-top: calc(var(--ibom-nav-height) + 12px);
}

.ibom-hamburger-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.2em;
  height: 1.2em;
  color: currentColor;
  font: 900 1.35rem/1 system-ui, sans-serif;
}

/* Every navigation trigger keeps a reliable finger-sized hit area. The
   header-based triggers inherit the fixed header, while customer workspace
   triggers become a floating sticky control on compact screens below. */
:where(.mobile-btn, .admin-menu-btn, .dashboard-menu-btn, .menu-btn)[aria-controls],
:where(.mobile-btn, .admin-menu-btn, .dashboard-menu-btn, .menu-btn)[data-sidebar-target] {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

:where(.mobile-btn, .admin-menu-btn, .dashboard-menu-btn, .menu-btn):focus-visible {
  outline: 3px solid var(--gold, #d4af37);
  outline-offset: 3px;
}

/* Staff workspace tabs are also navigation. Keep them reachable while a long
   role page scrolls, and let them scroll horizontally instead of shrinking. */
body.ibom-staff-page .role-tabs {
  position: sticky;
  top: calc(var(--ibom-nav-height) + 8px);
  z-index: 1200;
  display: flex;
  max-width: 100%;
  padding: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid rgba(212, 175, 55, .24);
  border-radius: 14px;
  background: rgba(5, 5, 5, .96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
  scrollbar-width: thin;
}

body.ibom-staff-page .role-tab {
  flex: 0 0 auto;
  min-height: 44px;
}

.ibom-nav-overlay,
body.ibom-site > .overlay {
  display: block;
  position: fixed;
  inset: var(--ibom-nav-height) 0 0;
  z-index: 2400;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, .72);
  transition: opacity .2s ease;
}

.ibom-nav-overlay.show,
body.ibom-site > .overlay.show {
  pointer-events: auto;
  opacity: 1;
}

body.ibom-menu-open { overflow: hidden; }

@media (min-width: 1101px) {
  body.ibom-site > header .mobile-btn,
  body.admin-page .admin-menu-btn,
  body.product-manager-page .dashboard-menu-btn { display: none !important; }

  body.ibom-site > header .mobile-menu { display: none !important; }
}

@media (max-width: 1100px) {
  body.ibom-site > header .nav-links,
  body.ibom-site > header .nav-btns,
  body.ibom-home-page > header .nav-actions,
  body.admin-page > .header .menu { display: none !important; }

  body.ibom-site > header .mobile-btn,
  body.admin-page .admin-menu-btn,
  body.product-manager-page .dashboard-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Customer workspace menu remains available during the full page scroll.
     A floating bottom-left position avoids covering the page title and adds no
     layout height, so the earlier downward-pushing header issue cannot return. */
  body.ibom-customer-page .dashboard-menu-btn[data-sidebar-target] {
    display: inline-flex !important;
    position: fixed !important;
    left: 12px !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    bottom: 18px !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    z-index: 2550 !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: 999px !important;
    color: #111 !important;
    background: linear-gradient(135deg, #f0d778, var(--gold, #d4af37)) !important;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .58) !important;
  }

  body.ibom-site > header .mobile-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 3100 !important;
    width: 100% !important;
    max-height: calc(100svh - var(--ibom-nav-height)) !important;
    margin: 0 !important;
    padding: 12px 16px 18px !important;
    overflow-y: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    border-top: 1px solid var(--border) !important;
    background: #050505 !important;
    box-shadow: 0 20px 42px rgba(0, 0, 0, .56) !important;
  }

  body.ibom-site > header .mobile-menu:is(.show, .open, .is-open) { display: grid !important; }

  body.ibom-site > header .mobile-menu a,
  body.ibom-site > header .mobile-menu-section-label {
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center;
    border-radius: 9px;
  }

  body.ibom-site > header .mobile-menu-section-label {
    grid-column: 1 / -1;
    min-height: auto;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  body.ibom-customer-page .dashboard-sidebar,
  body.admin-page .layout > .sidebar,
  body.product-manager-page > .sidebar {
    display: block !important;
    position: fixed !important;
    top: var(--ibom-nav-height) !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 2600 !important;
    width: min(300px, 88vw) !important;
    height: calc(100svh - var(--ibom-nav-height)) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px 12px 24px !important;
    padding-bottom: 24px !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    transform: translateX(-108%) !important;
    transition: transform .22s ease !important;
    border-right: 1px solid var(--border) !important;
    background: #050505 !important;
    box-shadow: 20px 0 60px rgba(0, 0, 0, .58) !important;
  }

  body.ibom-customer-page .dashboard-sidebar:is(.open, .is-open, .sidebar-open),
  body.admin-page .layout > .sidebar:is(.open, .is-open, .sidebar-open),
  body.product-manager-page > .sidebar:is(.open, .is-open, .sidebar-open) {
    transform: translateX(0) !important;
  }
}

@media (max-height: 520px) and (max-width: 1100px) {
  body.ibom-customer-page .dashboard-menu-btn[data-sidebar-target] {
    bottom: 8px !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 620px) {
  body.ibom-site > header .mobile-menu { grid-template-columns: 1fr; padding-inline: 10px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ibom-nav-overlay,
  body.ibom-site > .overlay,
  body.ibom-customer-page .dashboard-sidebar,
  body.admin-page .layout > .sidebar,
  body.product-manager-page > .sidebar { transition: none !important; }
}
