.atw-compact-brand { display: none; }

/* Reuse the header's sticky state and the same search form, preserving focus,
   predictive results and the normal full-size header at the top of the page. */
@media (max-width: 749px) {
  .header-section:has(> #header-component[sticky] .header-search-bar--show-mobile) {
    min-height: var(--atw-expanded-header-height, auto);
  }

  #header-component[data-sticky-state='active']:has(.header-search-bar--show-mobile) {
    & .header__row--top .header__columns {
      grid-template-columns: 44px 44px minmax(0, 1fr) auto;
      grid-template-areas: 'leftA center search rightB';
      column-gap: 4px;
      padding-block: 4px;
      padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
    }

    & .header-logo {
      width: 44px;
      min-width: 0;
      min-height: 44px;
      padding: 0;
    }
    & .header-logo > :not(.atw-compact-brand) { display: none; }
    & .header-logo .atw-compact-brand { display: flex; }
    & .atw-compact-brand img { width: 32px; height: 32px; object-fit: contain; }

    & .header-search-bar--compact.header-search-bar--show-mobile {
      grid-area: search;
      width: 100%;
      max-width: none;
      height: 44px;
      margin: 0;
    }
    & .header-search-bar__input { padding-inline: 8px; }
    & header-actions { margin-inline-start: 0; }
  }
}
