/* Staging header fix after upgrade: keep mobile header usable on narrow widths. */
@media (max-width: 991.98px) {
  #header .header-nav { min-height: 0; }
  #header .header-nav .mobile { display: block !important; padding: 8px 0 6px; }

  #header .header-nav .top-logo,
  #header .header-nav #_mobile_logo {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    text-align: center !important;
    margin: 0 0 8px !important;
    clear: both !important;
  }

  #header .header-nav #_mobile_logo h1 { margin: 0 !important; }

  #header .header-nav #_mobile_logo img.logo {
    display: inline-block !important;
    width: auto !important;
    max-width: 220px !important;
    height: auto !important;
    max-height: 76px !important;
  }

  #header .header-top { padding: 8px 0 10px !important; }

  #header .header-top > .container > .row,
  #header .header-top .header-top-right {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 10px !important;
  }

  #header #search_widget {
    display: block !important;
    width: 100% !important;
    max-width: 520px !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    float: none !important;
    clear: both !important;
  }

  #header #search_widget form {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
  }

  #header #search_widget form input[type=text],
  #header #search_widget form input[name=s] {
    display: block !important;
    width: 100% !important;
    height: 42px !important;
    line-height: 42px !important;
    margin: 0 !important;
    padding: 0 44px 0 14px !important;
    border: 1px solid #b8b8b8 !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
  }

  #header #search_widget form .material-icons.search {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    margin: 0 !important;
    line-height: 1 !important;
  }

  #header #search_widget form .material-icons.clear,
  #header #search_widget form button[type=reset] { display: none !important; }

  #header #_desktop_logo,
  #header #_desktop_top_menu { display: none !important; }
}

/* Staging header fix v2: prevent search from overlapping the mobile logo. */
@media (max-width: 991.98px) {
  #header,
  #header .header-nav,
  #header .header-nav .container,
  #header .header-nav .row,
  #header .header-nav .mobile {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  #header .header-top {
    clear: both !important;
    position: relative !important;
    z-index: 1 !important;
  }

  #header .header-nav {
    position: relative !important;
    z-index: 2 !important;
  }

  #header .header-top .header-top-right {
    transform: none !important;
  }
}

/* Staging header fix v3: theme keeps nav at 50px, so move search under the logo. */
@media (max-width: 991.98px) {
  #header .header-top {
    margin-top: 120px !important;
  }
}
