/* BankMovie v147 — restore the stable v139 mobile header flow.
   - no background on the mobile header in either color mode
   - no absolute full-width actions layer
   - search + notifications on the left
   - theme switch + menu on the right
   - centered logo and no horizontal overflow */

@media (max-width: 991px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  html body #siteHeader,
  html body #siteHeader.header,
  html body #siteHeader.header-admin,
  html body #siteHeader.header-solid,
  html body #siteHeader.header-glass,
  html body #siteHeader.bm-smart-header,
  html[data-bm-color-mode="light"] body #siteHeader,
  html[data-bm-color-mode="dark"] body #siteHeader,
  html[data-bm-color-mode="light"] body #siteHeader.header-scrolled,
  html[data-bm-color-mode="dark"] body #siteHeader.header-scrolled {
    position: absolute !important;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 64px !important;
    height: 64px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  html body #siteHeader .header-inner,
  html body #siteHeader.header-admin .header-inner {
    position: relative !important;
    width: calc(100% - 12px) !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 64px !important;
    height: 64px !important;
    margin: 0 auto !important;
    padding: 0 6px !important;
    display: block !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body #siteHeader .desktop-nav {
    display: none !important;
  }

  html body #siteHeader .logo {
    position: absolute !important;
    z-index: 6 !important;
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    width: 82px !important;
    max-width: 82px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html body #siteHeader .bm-header-logo-img {
    width: 82px !important;
    max-width: 82px !important;
    height: auto !important;
    max-height: 46px !important;
    object-fit: contain !important;
  }

  html body #siteHeader .header-actions {
    position: relative !important;
    inset: auto !important;
    z-index: 7 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 64px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    direction: ltr !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }

  html body #siteHeader .header-actions > * {
    pointer-events: auto !important;
  }

  html body #siteHeader .bm-header-collection,
  html body #siteHeader .admin-panel-trigger,
  html body #siteHeader .auth-dropdown,
  html body #siteHeader .user-trigger,
  html body #siteHeader .auth-trigger {
    display: none !important;
  }

  html body #siteHeader .bm-header-search {
    order: 1 !important;
  }

  html body #siteHeader .notif-bell {
    order: 2 !important;
  }

  html body #siteHeader .theme-switch {
    --toggle-size: 11.5px;
    order: 10 !important;
    position: relative !important;
    inset: auto !important;
    z-index: 8 !important;
    width: var(--container-width) !important;
    min-width: var(--container-width) !important;
    max-width: var(--container-width) !important;
    height: var(--container-height) !important;
    margin: 0 0 0 auto !important;
    transform: none !important;
    flex: 0 0 var(--container-width) !important;
  }

  html body #siteHeader .menu-btn {
    order: 11 !important;
  }

  html body #siteHeader .menu-btn,
  html body #siteHeader .notif-bell,
  html body #siteHeader .bm-header-search {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    color: #f7fbff !important;
    background: rgba(5, 10, 18, .48) !important;
    border: 1px solid rgba(255, 255, 255, .11) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16), inset 0 1px rgba(255,255,255,.04) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
  }

  html body #siteHeader .bm-header-search-glow,
  html body #siteHeader .bm-header-search-white,
  html body #siteHeader .bm-header-search-border,
  html body #siteHeader .bm-header-search-dark {
    display: none !important;
  }

  html body #siteHeader .bm-header-search-content {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body #siteHeader .bm-header-search-label {
    display: none !important;
  }

  html body #siteHeader .menu-btn svg,
  html body #siteHeader .notif-bell svg,
  html body #siteHeader .bm-header-search-content svg {
    width: 21px !important;
    height: 21px !important;
  }

  /* Prevent any decorative switch element from affecting document width. */
  html body #siteHeader .theme-switch,
  html body #siteHeader .theme-switch__container {
    overflow: hidden !important;
    contain: layout paint !important;
  }

  html body #siteHeader .theme-switch__shooting-star,
  html body #siteHeader .theme-switch__shooting-star-2,
  html body #siteHeader .theme-switch__meteor,
  html body #siteHeader .theme-switch__aurora,
  html body #siteHeader .theme-switch__comets {
    display: none !important;
  }
}

@media (max-width: 360px) {
  html body #siteHeader,
  html body #siteHeader.header,
  html body #siteHeader.header-admin,
  html body #siteHeader .header-inner,
  html body #siteHeader.header-admin .header-inner,
  html body #siteHeader .header-actions {
    min-height: 60px !important;
    height: 60px !important;
  }

  html body #siteHeader .logo,
  html body #siteHeader .bm-header-logo-img {
    width: 70px !important;
    max-width: 70px !important;
  }

  html body #siteHeader .header-actions {
    gap: 5px !important;
  }

  html body #siteHeader .menu-btn,
  html body #siteHeader .notif-bell,
  html body #siteHeader .bm-header-search {
    width: 37px !important;
    min-width: 37px !important;
    max-width: 37px !important;
    height: 37px !important;
    min-height: 37px !important;
    flex-basis: 37px !important;
    border-radius: 11px !important;
  }

  html body #siteHeader .theme-switch {
    --toggle-size: 10.6px;
  }
}
