/* ===== Desktop: menu goes under the logo (no color changes) ===== */
@media (min-width: 981px){
  .btx-header-bar{ display:flex; align-items:center; flex-wrap:wrap; gap:0px; }
  /* Keep logo on the left, icons on the right */
  .btx-header-bar .site-logo{ order:0; }
  .btx-header-bar .header-icons{ order:1; margin-left:auto; }
  /* Force nav to its own full-width row under the logo/icons row */
  .btx-header-bar .site-nav{
    order:2; flex-basis:100%; width:100%; margin-top:0px;
  }
  /* Center the tabs below the header bar (switch to flex-start to left-align) */
  .btx-header-bar .site-nav .menu{ justify-content:center; }
}

/* ===== Mobile: full-screen overlay menu when open ===== */
@media (max-width: 980px){
  /* Put the panel above page content, below the admin bar if present */
  .btx-site-header .site-nav .menu{
    position:fixed !important;
    left:0; right:0; top:0; bottom:0;
    display:none; z-index:10000;
    background: var(--btx-surface, #fff);
    flex-direction:column; align-items:flex-start; gap:0;
    padding:20px; overflow:auto;
  }
  body.admin-bar .btx-site-header .site-nav .menu{ top:46px; }   /* mobile admin bar */
  .site-nav.open .menu{ display:flex; }
  .site-nav .menu > li{ width:calc(100% - 20px); }
  .site-nav .menu > li > a{ width:calc(100% -20px); padding:14px 12px; border-radius:8px; }
  .site-nav .menu .sub-menu{ position:static; box-shadow:none; border-radius:8px; padding:6px 0; display:block; }
  /* Keep the hamburger clickable above the overlay */
  .btx-nav-toggle{ position:relative; z-index:10001; }
}

/* === Mobile polish: float hamburger, more room for contact, keep theme colors === */
@media (max-width: 980px){
  /* Float the toggle in the viewport */
  .btx-nav-toggle{
    position: fixed;
    top: 2px;
    left: 2px;
    padding: 10px;
    margin: 0;
    z-index: 10002;                 /* above the overlay menu (which is 10000) */
    color: var(--btx-accent, currentColor);
  }
  .btx-nav-toggle .btx-nav-bar{
    background: var(--btx-accent, currentColor); /* use Starscream accent */
  }
  /* Admin bar offset on mobile */
  body.admin-bar .btx-nav-toggle{ top: 46px; }

  /* Reserve space so the floating button doesn't overlap the logo */
  .btx-header-bar{ padding-left: 0px; }

  /* Keep contact info on one line */
  .header-icons{ flex-wrap: nowrap; gap: 14px; }
  .header-icons > div{ white-space: nowrap; }
}
