/*
 * AREXMODS HEADER ALIGNMENT FIX v1.6.3-r1
 * Scope: desktop top header only.
 * Keeps the current 72px header geometry and fixes optical/vertical alignment.
 */

@media (min-width: 1181px) {
  .topbar {
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .topbar > .topbar-inner,
  .topbar .topbar-inner {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: grid !important;
    grid-template-columns: 190px minmax(0, 1fr) auto !important;
    align-items: center !important;
    align-content: center !important;
    gap: 22px !important;
    overflow: visible !important;
  }

  /* Brand: remove image baseline and inherited vertical offsets. */
  .topbar .brand.arexmods-brand,
  .topbar-inner > .brand {
    box-sizing: border-box !important;
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
    height: 72px !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-start !important;
    align-self: center !important;
    line-height: 1 !important;
    transform: none !important;
  }

  .topbar .brand.arexmods-brand img,
  .topbar-inner > .brand img {
    display: block !important;
    width: auto !important;
    max-width: 178px !important;
    height: auto !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
    vertical-align: middle !important;
    transform: none !important;
  }

  /* Main menu: every label gets exactly the same vertical box. */
  .topbar .nav,
  .topbar-inner > .nav {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: center !important;
    align-self: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  .topbar .nav > a,
  .topbar-inner > .nav > a {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: 72px !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: center !important;
    align-self: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    transform: none !important;
  }

  .topbar .nav > a::before {
    vertical-align: middle !important;
  }

  /* Right cluster: search/auth/wallet/profile all share one optical axis. */
  .topbar .top-actions,
  .topbar-inner > .top-actions {
    box-sizing: border-box !important;
    height: 72px !important;
    min-height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-end !important;
    align-self: center !important;
    gap: 9px !important;
    line-height: 1 !important;
    overflow: visible !important;
  }

  .topbar .top-actions > * {
    box-sizing: border-box !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center !important;
    vertical-align: middle !important;
  }

  .topbar .top-actions > .icon-btn,
  .topbar .top-actions > .btn {
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    transform: none !important;
  }

  .topbar .top-actions > .icon-btn {
    width: 44px !important;
    min-width: 44px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .topbar .top-actions > .btn {
    padding-left: 17px !important;
    padding-right: 17px !important;
  }

  .topbar .top-actions > .btn.btn-primary {
    min-width: 112px !important;
  }

  /* Logged-in controls use the same 44px centerline. */
  .topbar .notification-menu-v086,
  .topbar .profile-menu-v084 {
    height: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
  }

  .topbar .notification-menu-v086 > summary,
  .topbar .profile-menu-v084 > summary,
  .topbar .wallet-pill-v083 {
    box-sizing: border-box !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: center !important;
    align-self: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
  }

  .topbar .profile-menu-v084 > summary,
  .topbar .wallet-pill-v083 {
    justify-content: flex-start !important;
  }

  .topbar .notification-menu-v086 > summary::marker,
  .topbar .profile-menu-v084 > summary::marker {
    font-size: 0 !important;
  }

  /* Text descendants should not carry legacy top/bottom line-height drift. */
  .topbar .nav > a,
  .topbar .top-actions > .btn,
  .topbar .wallet-pill-v083 :is(span,small,b),
  .topbar .profile-menu-v084 :is(span,small,b) {
    line-height: 1.08 !important;
  }

  /* Keep dropdowns above content. */
  .topbar,
  .topbar-inner,
  .topbar .top-actions,
  .topbar .notification-menu-v086,
  .topbar .profile-menu-v084 {
    overflow: visible !important;
  }

  .topbar .notification-dropdown-v086,
  .topbar .profile-dropdown-v084 {
    z-index: 10000 !important;
  }
}

@media (min-width: 1181px) and (max-width: 1700px) {
  .topbar > .topbar-inner,
  .topbar .topbar-inner {
    grid-template-columns: 170px minmax(0, 1fr) auto !important;
    gap: 15px !important;
  }

  .topbar .brand.arexmods-brand,
  .topbar-inner > .brand {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
  }

  .topbar .brand.arexmods-brand img,
  .topbar-inner > .brand img {
    max-width: 160px !important;
  }
}

/* Mobile/tablet existing header behavior is intentionally untouched. */
