/* TradesFolks 18.4.40 — Balanced Responsive Desktop Header
   Reduces search dominance, reserves account identity space,
   and upgrades Compare/Cart into compact premium controls. */

@media(min-width:1024px){
  .site-header.premium-header .header-main.shell{
    grid-template-columns:54px minmax(420px,1120px) minmax(430px,auto)!important;
    justify-content:space-between!important;
    gap:10px!important;
  }

  .site-header.premium-header .global-search{
    width:100%!important;
    max-width:1120px!important;
    justify-self:start!important;
    grid-template-columns:108px minmax(220px,1fr) 40px 88px!important;
    height:46px!important;
    min-height:46px!important;
  }

  .site-header.premium-header .global-search>select,
  .site-header.premium-header .global-search>input[name="q"]{
    height:44px!important;
    min-height:44px!important;
    font-size:12px!important;
  }

  .site-header.premium-header .global-search>.tf-header-search-submit{
    width:88px!important;
    min-width:88px!important;
    max-width:88px!important;
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
  }

  .site-header.premium-header .header-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:6px!important;
    width:auto!important;
    min-width:430px!important;
    height:44px!important;
    white-space:nowrap!important;
  }

  /* Keep logged-in user identity visible. */
  .site-header.premium-header .header-actions>.tf-header-user{
    display:inline-flex!important;
    min-width:72px!important;
    max-width:112px!important;
    height:38px!important;
    padding:0 8px!important;
    color:#172238!important;
    background:#f8fafc!important;
    border:1px solid #e3e8ef!important;
    border-radius:9px!important;
    overflow:hidden!important;
    flex:0 1 auto!important;
  }
  .site-header.premium-header .tf-header-user-prefix{
    display:inline!important;
    margin-right:3px!important;
    color:#667085!important;
  }
  .site-header.premium-header .tf-header-user-name{
    display:block!important;
    max-width:72px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-weight:800!important;
    color:#102b4f!important;
  }

  .site-header.premium-header .header-actions>.tf-header-dashboard,
  .site-header.premium-header .header-actions>.join-button{
    min-width:78px!important;
    width:auto!important;
    height:38px!important;
    padding:0 10px!important;
    font-size:10.5px!important;
    border-radius:9px!important;
  }

  /* Premium Compare pill */
  .site-header.premium-header .header-actions>.compare-header-link{
    min-width:92px!important;
    height:38px!important;
    padding:0 9px 0 11px!important;
    gap:7px!important;
    border:1px solid #0b2a63!important;
    border-radius:10px!important;
    background:#071b46!important;
    color:#fff!important;
    box-shadow:0 3px 10px rgba(7,27,70,.10)!important;
    font-size:10.5px!important;
    font-weight:800!important;
  }
  .site-header.premium-header .header-actions>.compare-header-link:hover{
    background:#0b2a63!important;
    transform:translateY(-1px)!important;
  }
  .site-header.premium-header .header-actions>.compare-header-link span{
    display:grid!important;
    place-items:center!important;
    min-width:20px!important;
    height:20px!important;
    margin:0!important;
    padding:0 4px!important;
    border-radius:999px!important;
    background:#f5bd37!important;
    color:#071b46!important;
    font-size:9px!important;
    font-weight:900!important;
  }

  /* Premium Cart pill */
  .site-header.premium-header .header-actions>.shopping-cart-link{
    min-width:104px!important;
    width:auto!important;
    height:38px!important;
    padding:0 9px!important;
    gap:6px!important;
    border:1px solid #0b2a63!important;
    border-radius:10px!important;
    background:#071b46!important;
    color:#fff!important;
    box-shadow:0 3px 10px rgba(7,27,70,.10)!important;
  }
  .site-header.premium-header .header-actions>.shopping-cart-link:hover{
    background:#0b2a63!important;
    transform:translateY(-1px)!important;
  }
  .site-header.premium-header .shopping-cart-link .cart-svg-icon{
    display:grid!important;
    place-items:center!important;
    width:22px!important;
    height:22px!important;
    min-width:22px!important;
    margin:0!important;
    border-radius:7px!important;
    background:#f5bd37!important;
    color:#075bc5!important;
  }
  .site-header.premium-header .shopping-cart-link .cart-svg-icon svg{
    width:14px!important;
    height:14px!important;
  }
  .site-header.premium-header .shopping-cart-link>span:not(.cart-svg-icon){
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
    padding:3px 7px!important;
    border-radius:999px!important;
    background:#f5bd37!important;
    color:#071b46!important;
    font-size:10px!important;
    font-weight:900!important;
    line-height:1!important;
  }
  .site-header.premium-header .shopping-cart-link b[data-cart-count]{
    position:static!important;
    display:grid!important;
    place-items:center!important;
    min-width:20px!important;
    height:20px!important;
    margin:0!important;
    padding:0 4px!important;
    border:0!important;
    border-radius:999px!important;
    background:#f5bd37!important;
    color:#071b46!important;
    font-size:9px!important;
    font-weight:900!important;
    transform:none!important;
  }
}

/* Common laptop width: reduce search first, preserve account name and actions. */
@media(min-width:1024px) and (max-width:1439px){
  .site-header.premium-header .header-main.shell{
    grid-template-columns:50px minmax(340px,1fr) auto!important;
    gap:8px!important;
  }

  .site-header.premium-header .global-search{
    max-width:860px!important;
    grid-template-columns:92px minmax(160px,1fr) 38px 76px!important;
  }

  .site-header.premium-header .global-search>.tf-header-search-submit{
    width:76px!important;
    min-width:76px!important;
    max-width:76px!important;
  }

  .site-header.premium-header .header-actions{
    min-width:390px!important;
    gap:5px!important;
  }

  .site-header.premium-header .header-actions>.tf-header-user{
    min-width:64px!important;
    max-width:92px!important;
    padding-inline:6px!important;
  }

  .site-header.premium-header .tf-header-user-name{
    max-width:62px!important;
  }

  .site-header.premium-header .header-actions>.tf-header-dashboard,
  .site-header.premium-header .header-actions>.join-button{
    min-width:70px!important;
    padding-inline:8px!important;
  }

  .site-header.premium-header .header-actions>.compare-header-link{
    min-width:86px!important;
  }

  .site-header.premium-header .header-actions>.shopping-cart-link{
    min-width:98px!important;
  }
}

/* Narrow desktop: collapse labels gradually, but never hide the user name. */
@media(min-width:1024px) and (max-width:1180px){
  .site-header.premium-header .header-main.shell{
    grid-template-columns:46px minmax(280px,1fr) auto!important;
  }

  .site-header.premium-header .global-search{
    max-width:690px!important;
    grid-template-columns:82px minmax(120px,1fr) 36px 68px!important;
  }

  .site-header.premium-header .global-search>.tf-header-search-submit{
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
  }

  .site-header.premium-header .header-actions{
    min-width:350px!important;
  }

  .site-header.premium-header .tf-header-user-prefix{
    display:none!important;
  }

  .site-header.premium-header .header-actions>.tf-header-dashboard{
    width:38px!important;
    min-width:38px!important;
    padding:0!important;
    font-size:0!important;
  }
  .site-header.premium-header .header-actions>.tf-header-dashboard::after{
    content:"⌂"!important;
    display:block!important;
    font-size:16px!important;
    line-height:1!important;
    color:#0b4ca5!important;
  }

  .site-header.premium-header .header-actions>.compare-header-link{
    min-width:76px!important;
    padding-inline:8px!important;
  }

  .site-header.premium-header .header-actions>.shopping-cart-link{
    min-width:82px!important;
  }

  .site-header.premium-header .shopping-cart-link>span:not(.cart-svg-icon){
    display:none!important;
  }
}
