
/*
 * MG HOST — mobile navigation final
 * Dedicated override loaded after the legacy theme to prevent
 * Metronic/mobile CSS from flattening the drawer into page text.
 */

.mg-mobile-drawer {
  display: none;
}

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

  body.hh-customer-body {
    min-width: 0 !important;
  }

  /* The legacy desktop navigation must never participate in the
     mobile layout. The standalone drawer below replaces it. */
  body.hh-customer-body #kt_header_menu_wrapper {
    display: none !important;
  }

  body.hh-customer-body #kt_header.header.header-fixed {
    display: block !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.hh-customer-body #kt_header.header.header-fixed > .container {
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.hh-customer-body #kt_header .topbar {
    display: none !important;
  }

  /* Mobile top bar */
  #kt_header_mobile.hh-mobile-bar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    box-sizing: border-box !important;
    z-index: 6000 !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    background: rgba(8, 7, 13, .97) !important;
    border-bottom: 1px solid rgba(139, 92, 246, .18) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .28) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .hh-mobile-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    color: #f8f5ff !important;
    text-decoration: none !important;
  }

  .hh-mobile-brand .hh-mobile-logo {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    object-fit: contain !important;
    border-radius: 11px !important;
    flex: 0 0 42px !important;
  }

  .hh-mobile-brand span {
    color: #f5f1ff !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: .07em !important;
    white-space: nowrap !important;
  }

  .hh-mobile-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 0 !important;
  }

  .hh-mobile-balance {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    max-width: 154px !important;
    box-sizing: border-box !important;
    padding: 0 11px !important;
    border: 1px solid rgba(139, 92, 246, .36) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(139, 92, 246, .05)) !important;
    color: #d5c5ff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    font-variant-numeric: tabular-nums !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .hh-mobile-balance small {
    margin-left: 4px !important;
    color: #8f879e !important;
    font-size: 8px !important;
    font-weight: 700 !important;
  }

  .hh-mobile-balance:active {
    transform: scale(.98) !important;
    background: rgba(139, 92, 246, .22) !important;
  }

  .hh-mobile-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    border-radius: 12px !important;
    background: #14111d !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
  }

  .hh-mobile-menu-btn span {
    display: block !important;
    width: 19px !important;
    height: 2px !important;
    border-radius: 4px !important;
    background: #cbbaff !important;
    transition: transform .18s ease, opacity .18s ease !important;
  }

  .hh-mobile-menu-btn.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }

  .hh-mobile-menu-btn.is-open span:nth-child(2) {
    opacity: 0 !important;
  }

  .hh-mobile-menu-btn.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* Backdrop */
  body.hh-customer-body .hh-mobile-overlay {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 5900 !important;
    background: rgba(3, 2, 7, .70) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity .20s ease, visibility .20s ease !important;
    -webkit-backdrop-filter: blur(2px) !important;
    backdrop-filter: blur(2px) !important;
  }

  body.hh-customer-body .hh-mobile-overlay.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Real mobile drawer — opens from the RIGHT like the desktop profile panel. */
  body.hh-customer-body .mg-mobile-drawer {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(88vw, 370px) !important;
    max-width: 370px !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    box-sizing: border-box !important;
    z-index: 5950 !important;
    padding: calc(12px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    background:
      radial-gradient(circle at 15% 0%, rgba(139,92,246,.18), transparent 38%),
      linear-gradient(180deg, #12101c 0%, #090810 100%) !important;
    border-left: 1px solid rgba(139,92,246,.22) !important;
    border-right: 0 !important;
    box-shadow: -26px 0 80px rgba(0,0,0,.58) !important;
    transform: translate3d(105%,0,0) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform .22s ease, opacity .18s ease, visibility .22s ease !important;
    will-change: transform !important;
  }

  body.hh-customer-body .mg-mobile-drawer.is-open {
    transform: translate3d(0,0,0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .mg-mobile-drawer-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    padding: 2px 2px 16px !important;
  }

  .mg-mobile-drawer-brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  .mg-mobile-drawer-brand img {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    object-fit: contain !important;
    border-radius: 11px !important;
  }

  .mg-mobile-drawer-brand strong {
    display: block !important;
    color: #fff !important;
    font-size: 15px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    letter-spacing: .07em !important;
  }

  .mg-mobile-drawer-brand span {
    display: block !important;
    margin-top: 4px !important;
    color: #81798d !important;
    font-size: 10px !important;
  }

  .mg-mobile-close {
    display: grid !important;
    place-items: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    background: #17131f !important;
    color: #cbbaff !important;
    font-size: 27px !important;
    line-height: 1 !important;
    font-weight: 300 !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mg-mobile-profile {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    flex: 0 0 auto !important;
    padding: 13px !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 15px !important;
    background: rgba(255,255,255,.035) !important;
  }

  .mg-mobile-avatar {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 13px !important;
    background: #1b1625 center/cover no-repeat !important;
    border: 1px solid rgba(139,92,246,.24) !important;
    position: relative !important;
  }

  .mg-mobile-avatar span {
    position: absolute !important;
    right: -2px !important;
    bottom: -2px !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: #4ade80 !important;
    border: 2px solid #12101c !important;
  }

  .mg-mobile-profile-info {
    min-width: 0 !important;
  }

  .mg-mobile-profile-info strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #f5f2fa !important;
    font-size: 13px !important;
    font-weight: 800 !important;
  }

  .mg-mobile-profile-info span {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-top: 4px !important;
    color: #81798d !important;
    font-size: 10px !important;
  }

  .mg-mobile-balance-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    margin: 10px 0 12px !important;
    padding: 13px 14px !important;
    border-radius: 15px !important;
    border: 1px solid rgba(139,92,246,.26) !important;
    background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(124,58,237,.05)) !important;
    color: #fff !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mg-mobile-balance-card span {
    display: block !important;
    color: #8d839a !important;
    font-size: 9px !important;
    text-transform: uppercase !important;
    letter-spacing: .12em !important;
  }

  .mg-mobile-balance-card strong {
    display: block !important;
    margin-top: 4px !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
  }

  .mg-mobile-balance-card small {
    color: #a99bc1 !important;
    font-size: 9px !important;
  }

  .mg-mobile-balance-card > b {
    color: #c4aaff !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  .mg-mobile-section-title {
    margin: 7px 4px 4px !important;
    padding-top: 7px !important;
    color: #736a80 !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
  }

  .mg-mobile-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
  }

  .mg-mobile-nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    width: 100% !important;
    min-height: 54px !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    color: #ddd7e5 !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mg-mobile-nav-item i {
    display: grid !important;
    place-items: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 11px !important;
    font-style: normal !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #c7b4ff !important;
    background: rgba(124,58,237,.10) !important;
    border: 1px solid rgba(139,92,246,.14) !important;
  }

  .mg-mobile-nav-item > span {
    display: block !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    color: #eeeaf4 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 750 !important;
  }

  .mg-mobile-nav-item > span small {
    display: block !important;
    margin-top: 3px !important;
    color: #777080 !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
  }

  .mg-mobile-nav-item > b {
    flex: 0 0 auto !important;
    color: #635b6d !important;
    font-size: 21px !important;
    font-weight: 400 !important;
  }

  .mg-mobile-nav-item.is-active,
  .mg-mobile-nav-item:active {
    background: rgba(124,58,237,.12) !important;
    border-color: rgba(139,92,246,.20) !important;
  }

  .mg-mobile-nav-item.is-active i {
    background: rgba(139,92,246,.20) !important;
    color: #e1d6ff !important;
  }

  .mg-mobile-logout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 46px !important;
    margin-top: 10px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(244,114,182,.14) !important;
    background: rgba(244,114,182,.045) !important;
    color: #f0dfff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }

  .mg-mobile-logout:active {
    background: rgba(244,114,182,.11) !important;
  }

  body.mg-mobile-nav-open {
    overflow: hidden !important;
  }

  /* Keep the mobile page below the fixed top bar. */
  body.hh-customer-body .page {
    padding-top: 64px !important;
  }

  body.hh-customer-body .content {
    padding-top: 14px !important;
  }
}

@media (max-width: 430px) {
  #kt_header_mobile.hh-mobile-bar {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .hh-mobile-brand span {
    font-size: 12px !important;
  }

  .hh-mobile-balance {
    max-width: 126px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 10px !important;
  }

  .hh-mobile-menu-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
  }

  body.hh-customer-body .mg-mobile-drawer {
    width: calc(100vw - 20px) !important;
    max-width: none !important;
  }
}


/* Final compact logo sizing */
@media (max-width: 991.98px) {
  #kt_header_mobile.hh-mobile-bar .hh-mobile-logo {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    border-radius: 10px !important;
  }
  #kt_header_mobile.hh-mobile-bar .hh-mobile-brand {
    gap: 9px !important;
  }
  #kt_header_mobile.hh-mobile-bar .hh-mobile-brand span {
    font-size: 13px !important;
    letter-spacing: .08em !important;
  }
}
