/* Topbar V2: canonical HCO layout for <=932
   Fixed anchors: logo (left) + lang (right)
   Middle regions: search flexes, feature actions grow leftward from lang. */

@media (max-width: 932px) {
  html.topbar-v2.topbar-booting #mobile-topbar {
    visibility: hidden !important;
    min-height: 52px !important;
  }

  html.topbar-v2.mobile:not(.portrait) #mobile-topbar,
  html.topbar-v2.mobile.portrait #mobile-topbar,
  html.topbar-v2 #mobile-topbar {
    --hco-edge: 8px;
    --hco-gap: 8px;
    --hco-logo-w: 40px;
    --hco-lang-w: 52px;
    --hco-filters-w: 84px;
    --hco-pin-w: 104px;
    --hco-theme-w: 98px;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-search-row,
  html.topbar-v2 #mobile-topbar .mobile-left,
  html.topbar-v2 #mobile-topbar .mobile-logo--portrait,
  html.topbar-v2 #mobile-topbar .search-wrapper,
  html.topbar-v2 #mobile-topbar .search-wrapper input,
  html.topbar-v2 #mobile-topbar .mobile-actions,
  html.topbar-v2 #mobile-topbar .mobile-actions > *,
  html.topbar-v2 #mobile-topbar .mobile-options,
  html.topbar-v2 #mobile-topbar .mobile-options > * {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    translate: none !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    position: static !important;
    margin: 0 !important;
    align-self: center !important;
  }

  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-search-row,
  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-search-row,
  html.topbar-v2 #mobile-topbar .mobile-search-row {
    display: grid !important;
    grid-template-columns: var(--hco-logo-w) minmax(0, 1fr) auto var(--hco-lang-w) !important;
    align-items: center !important;
    align-content: center !important;
    column-gap: var(--hco-gap) !important;
    width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    line-height: 32px !important;
    padding-inline: var(--hco-edge) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-left {
    grid-column: 1 / 3 !important;
    display: grid !important;
    grid-template-columns: var(--hco-logo-w) minmax(0, 1fr) !important;
    column-gap: var(--hco-gap) !important;
    align-items: center !important;
    min-width: 0 !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-left .mobile-logo--portrait,
  html.topbar-v2 #mobile-topbar .mobile-logo--portrait {
    grid-column: 1 !important;
    width: var(--hco-logo-w) !important;
    min-width: var(--hco-logo-w) !important;
    max-width: var(--hco-logo-w) !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-left .search-wrapper,
  html.topbar-v2 #mobile-topbar .search-wrapper {
    grid-column: 2 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  html.topbar-v2 #mobile-topbar .search-wrapper input {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions,
  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-actions,
  html.topbar-v2 #mobile-topbar .mobile-actions {
    grid-column: 3 !important;
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: var(--hco-gap) !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-options {
    grid-column: 4 !important;
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-btn-filters {
    width: var(--hco-filters-w) !important;
    min-width: var(--hco-filters-w) !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-btn-pin {
    width: var(--hco-pin-w) !important;
    min-width: var(--hco-pin-w) !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-btn-toggle-theme {
    width: var(--hco-theme-w) !important;
    min-width: var(--hco-theme-w) !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-lang-dropdown,
  html.topbar-v2 #mobile-topbar #mobile-lang-dropdown .lang-trigger {
    width: var(--hco-lang-w) !important;
    min-width: var(--hco-lang-w) !important;
    max-width: var(--hco-lang-w) !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-lang-dropdown {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-lang-dropdown .lang-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 8px !important;
  }

  html.topbar-v2 #mobile-topbar #mobile-lang-dropdown .lang-trigger .lang-trigger-icon,
  html.topbar-v2 #mobile-topbar #mobile-lang-dropdown .lang-trigger .lang-trigger-caret {
    flex: 0 0 auto !important;
  }

  /* Hard lock direct child placement to beat legacy map-layout geometry. */
  html.topbar-v2 #mobile-topbar .mobile-search-row > .mobile-actions {
    grid-column: 3 / 4 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    box-sizing: border-box !important;
    justify-content: flex-end !important;
    gap: var(--hco-gap) !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-search-row > .mobile-options {
    grid-column: 4 / 5 !important;
    width: var(--hco-lang-w) !important;
    min-width: var(--hco-lang-w) !important;
    max-width: var(--hco-lang-w) !important;
    justify-self: end !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-search-row > .mobile-options #mobile-lang-dropdown,
  html.topbar-v2 #mobile-topbar .mobile-search-row > .mobile-options #mobile-lang-dropdown .lang-trigger {
    width: var(--hco-lang-w) !important;
    min-width: var(--hco-lang-w) !important;
    max-width: var(--hco-lang-w) !important;
    margin: 0 !important;
  }

  html.topbar-v2 #mobile-topbar .mobile-auth-inline {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Visibility by width only */
@media (max-width: 932px) {
  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    animation: shine-move 20s linear infinite !important;
    background-size: 200% 100% !important;
    animation-timing-function: linear !important;
    animation-delay: 0s !important;
  }

  html.topbar-v2 #mobile-topbar .search-wrapper::after {
    transform: translate(0.5px, -0.5px) !important;
    animation: textShine 6s linear infinite !important;
    background-size: 240% 100% !important;
    animation-timing-function: linear !important;
    animation-delay: 0s !important;
  }
}

@media (min-width: 501px) and (max-width: 748px) {
  html.topbar-v2 #mobile-topbar .search-wrapper::after {
    padding-left: 65.5px !important;
    inset: 1.5px 1px 0.5px 1px !important;
  }

  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    width: 34px !important;
    max-width: 34px !important;
    height: 23px !important;
    max-height: 23px !important;
    top: 12px !important;
    left: 10.5px !important;
    right: auto !important;
    bottom: auto !important;
  }
}

@media (min-width: 501px) and (max-width: 746px) {
  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    top: 11.5px !important;
  }
}

@media (width: 747px) {
  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    top: 11.5px !important;
  }
}

@media (min-width: 749px) and (max-width: 932px) {
  html.topbar-v2 #mobile-topbar .search-wrapper::after {
    padding-left: 65.5px !important;
    inset: 1.5px 1px 0.5px 1px !important;
  }

  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    width: 34px !important;
    max-width: 34px !important;
    height: 23.5px !important;
    max-height: 23.5px !important;
    top: 4px !important;
    left: 10.5px !important;
    right: auto !important;
    bottom: auto !important;
  }
}

/* Boundary lock: keep 748px aligned with the adjacent wide-row geometry. */
@media (width: 748px) {
  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    width: 34px !important;
    max-width: 34px !important;
    height: 23.5px !important;
    max-height: 23.5px !important;
    top: 4px !important;
    left: 10.5px !important;
    right: auto !important;
    bottom: auto !important;
  }
}

@media (max-width: 500px) {
  html.topbar-v2 #mobile-topbar .logo-container.sl-logo .logo-shine-sl {
    width: 34px !important;
    max-width: 34px !important;
    height: 23px !important;
    max-height: 23px !important;
    top: 11.5px !important;
    left: 10.5px !important;
    right: auto !important;
    bottom: auto !important;
  }

  html.topbar-v2 #mobile-topbar .search-wrapper::after {
    padding-left: 65.5px !important;
    inset: 1.5px 1px 0.5px 1px !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-search-row,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-search-row,
  html.topbar-v2 #mobile-topbar .mobile-search-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding-inline: var(--hco-edge) !important;
    box-sizing: border-box !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-search-row > .mobile-actions,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-search-row > .mobile-actions,
  html.topbar-v2 #mobile-topbar .mobile-search-row > .mobile-actions {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-left,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-left,
  html.topbar-v2 #mobile-topbar .mobile-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-logo--portrait,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-logo--portrait,
  html.topbar-v2 #mobile-topbar .mobile-logo--portrait {
    flex: 0 0 var(--hco-logo-w) !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .search-wrapper,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .search-wrapper,
  html.topbar-v2 #mobile-topbar .search-wrapper {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-search-row > .mobile-options,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-search-row > .mobile-options,
  html.topbar-v2 #mobile-topbar .mobile-search-row > .mobile-options {
    position: relative !important;
    flex: 0 0 var(--hco-lang-w) !important;
    width: var(--hco-lang-w) !important;
    min-width: var(--hco-lang-w) !important;
    max-width: var(--hco-lang-w) !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: end !important;
    align-self: center !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-search-row > *,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-search-row > *,
  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-left > *,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-left > *,
  html.topbar-v2 #mobile-topbar .mobile-search-row > *,
  html.topbar-v2 #mobile-topbar .mobile-left > * {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    translate: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center !important;
  }

  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-filters { display: none !important; }
  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-actions #mobile-btn-pin,
  html.topbar-v2.mobile.portrait #mobile-topbar .mobile-actions #mobile-btn-toggle-theme,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-pin,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-toggle-theme,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-pin,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: none !important; }
}

@media (min-width: 501px) and (max-width: 648px) {
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-pin { display: inline-flex !important; }
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: none !important; }
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-pin { display: inline-flex !important; }
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: none !important; }
}

@media (min-width: 649px) and (max-width: 748px) {
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-pin { display: inline-flex !important; }
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: none !important; }
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-pin { display: inline-flex !important; }
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: none !important; }

  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-pin,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-pin {
    transform: none !important;
    translate: none !important;
  }
}

@media (min-width: 749px) and (max-width: 932px) {
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-pin,
  html.topbar-v2.mobile:not(.portrait) #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: inline-flex !important; }
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-filters,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-pin,
  html.topbar-v2 #mobile-topbar .mobile-actions #mobile-btn-toggle-theme { display: inline-flex !important; }
}
