/* Keep action labels in sync and anchor desktop counters to the whole action.
 * The search field absorbs the remaining row space. */
#header .psvc-header-garage__label,
#header .ma-header-account-label,
#header .tvcart-icon-text-wrapper .tvcart-lable,
#header .ma-header-language-selector .tv-language-btn .tv-language-span,
#header .ma-header-language-selector .tv-language-btn .ma-header-language-code {
  font-weight: 400 !important;
}

#header .tv-cart-icon-main > .cart-products-count,
#header .tv-myaccount-btn .mcom-header-account-icon > .mcom-header-badge {
  border: 0 !important;
  font-weight: 400 !important;
}

@media (min-width: 992px) {
  #header .tv-myaccount-btn span.mcom-header-account-icon {
    margin: 0 !important;
  }

  #header .ma-header-account-link,
  #header .tvcart-icon-text-wrapper {
    position: relative !important;
    min-height: 70px;
  }

  #header .tv-myaccount-btn span.mcom-header-account-icon,
  #header .tv-cart-icon-main {
    position: static !important;
  }

  #header .tv-cart-icon-main > .cart-products-count,
  #header .tv-myaccount-btn .mcom-header-account-icon > .mcom-header-badge {
    top: 5px !important;
    left: auto !important;
    right: -8px !important;
    margin: 0 !important;
    transform: none !important;
  }

  #header .tv-contact-account-cart-wrapper > *,
  #header .tvcart-icon-text-wrapper > * {
    flex-shrink: 0;
  }

  #header .tvcart-icon-text-wrapper,
  #header .tvcart-icon-text-wrapper .tv-cart-cart-inner {
    width: auto;
    min-width: 0;
  }

  #header .tv-contact-account-cart-wrapper .psvc-header-garage__label,
  #header .tv-contact-account-cart-wrapper .ma-header-account-label,
  #header .tv-contact-account-cart-wrapper .tvcart-lable {
    display: block !important;
    max-width: none;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* A session name must fit the compact account action rather than grow the header. */
#header .ma-header-account-link--logged-in .ma-header-account-label {
  min-width: 0;
  max-width: 8ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

/* The legacy logo/locale expand above 1280px: keep the compact actions until
 * 1400px so that the search field still has usable space at that transition. */
@media (max-width: 1399.98px) {
  #header .tv-contact-account-cart-wrapper .psvc-header-garage__label,
  #header .tv-contact-account-cart-wrapper .ma-header-account-label,
  #header .tv-contact-account-cart-wrapper .tvcart-lable,
  #header #tvcms-mobile-view-header .psvc-header-garage__label,
  #header #tvcms-mobile-view-header .ma-header-account-label,
  #header #tvcms-mobile-view-header .tvcart-lable {
    display: none !important;
  }
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  #header .tv-contact-account-cart-wrapper .psvc-header-garage__btn,
  #header .tv-contact-account-cart-wrapper .tv-myaccount-btn,
  #header .tv-contact-account-cart-wrapper .tvcart-icon-text-wrapper {
    gap: 0 !important;
  }
}
