/* Mobile header — menu + logo left, auth block pinned right (guest + logged-in) */
@media (max-width: 1023px) {
  .app-header__start {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 0.35rem;
    min-width: 0;
  }

  .app-header__start .app-header__logo {
    grid-column: unset !important;
    grid-row: unset !important;
  }

  .app-header__wrapper:has(.app-header__guest),
  .app-header__wrapper:has(.app-header__user) {
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__menu-toggle,
  .app-header__wrapper:has(.app-header__user) .app-header__menu-toggle {
    flex: 0 0 auto;
    flex-shrink: 0;
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__logo {
    flex: 1 1 auto;
    grid-column: unset !important;
    grid-row: unset !important;
    height: calc(var(--header-height, 70px) - 0.5rem);
    min-width: 0;
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__logo .mk-logo-img,
  .app-header__wrapper:has(.app-header__guest) .app-header__logo img.mk-logo-img {
    max-width: min(155px, 42vw);
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__guest {
    align-items: center;
    display: flex !important;
    flex: 0 0 auto;
    gap: 0.35rem;
    justify-content: flex-end;
    margin-left: auto !important;
    width: auto !important;
    min-width: 0;
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__guest .outlined-link {
    flex: 0 0 auto;
    min-width: 0;
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__guest .outlined-link span {
    font-size: 0.75rem;
    white-space: nowrap;
  }

  /* Logged-in: compact logo on left, user controls on right */
  .app-header__wrapper:has(.app-header__user) .app-header__logo {
    flex: 0 1 auto;
    height: 3rem;
    align-self: center;
    flex-shrink: 0;
    min-width: 0;
  }

  .app-header__wrapper:has(.app-header__user) .app-header__logo .mk-logo-img,
  .app-header__wrapper:has(.app-header__user) .app-header__logo img.mk-logo-img {
    height: 100%;
    max-height: 3rem;
    max-width: min(142px, 36vw);
    width: auto;
    object-fit: contain;
    object-position: left center;
  }

  .app-header__user.app-header__auth {
    align-items: center;
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 0.35rem;
    justify-content: flex-end;
    margin-left: auto !important;
    min-width: 0;
    overflow: visible;
    width: auto !important;
  }
}

@media (max-width: 360px) {
  .app-header__wrapper:has(.app-header__guest) .app-header__logo .mk-logo-img,
  .app-header__wrapper:has(.app-header__guest) .app-header__logo img.mk-logo-img {
    max-width: min(122px, 38vw);
  }

  .app-header__wrapper:has(.app-header__guest) .app-header__guest .outlined-link span {
    font-size: 0.7rem;
  }
}

/* Header animated logo (GIF) — mobile + desktop */
.app-header__logo {
  display: block;
  height: calc(var(--header-height, 70px) - 0.5rem);
  min-width: 0;
  flex-shrink: 0;
}

.app-header__logo .mk-logo-img,
.app-header__logo img.mk-logo-img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 155px;
  object-fit: contain;
  object-position: left center;
}

/* Mobile logged-in header — balance | username | bell (right side) */
@media (max-width: 1023px) {
  /* Balance pill */
  .app-header__auth > a.outlined-link--primary {
    padding: 0 0.25rem 0 0.5rem !important;
    height: 28px;
    min-width: 0;
    flex: 0 0 auto;
    border-color: #3b82f6;
  }

  .app-header__auth > a.outlined-link--primary .outlined-link__icon-l {
    display: none;
  }

  .app-header__auth > a.outlined-link--primary .outlined-link__icon-r.icon-placeholder {
    display: none;
  }

  .app-header__auth > a.outlined-link--primary span {
    position: relative;
    display: block;
    padding: 0 1.45rem 0 0.15rem;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .app-header__auth .deposit-icon {
    color: #00c717 !important;
    right: 0.05rem !important;
    font-size: 1.15rem;
  }

  /* Profile — icon only (no username text) */
  .app-header__auth .app-header__username {
    align-items: center !important;
    display: flex !important;
    flex: 0 0 auto !important;
    height: 28px !important;
    justify-content: center !important;
    max-width: none !important;
    min-width: 28px !important;
    padding: 0 !important;
    width: 28px !important;
    border-radius: 50% !important;
  }

  .app-header__auth .app-header__username span {
    display: none !important;
  }

  .app-header__auth .app-header__username .outlined-link__icon-l {
    position: static !important;
    left: auto !important;
    margin: 0 !important;
    font-size: 0.95rem !important;
  }

  /* Bell — always visible */
  .app-header__auth .bellNoti {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0.35rem;
    margin: 0;
  }
}

@media (max-width: 360px) {
  .app-header__wrapper:has(.app-header__user) .app-header__logo .mk-logo-img,
  .app-header__wrapper:has(.app-header__user) .app-header__logo img.mk-logo-img {
    max-width: 122px;
    max-height: 2.65rem;
  }

  .app-header__user.app-header__auth {
    gap: 0.25rem;
  }
}

@media (min-width: 1024px) {
  .app-header__logo .mk-logo-img,
  .app-header__logo img.mk-logo-img {
    height: 100%;
    max-height: calc(var(--header-height, 90px) - 0.5rem);
    max-width: 200px;
    object-fit: contain;
  }

  .app-header__wrapper:has(.app-header__user) .app-header__logo .mk-logo-img,
  .app-header__wrapper:has(.app-header__user) .app-header__logo img.mk-logo-img {
    max-width: 180px;
  }
}

/* Home slider image */
.app-slide .mk-home-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
