/* TradesFolks 18.4.35 — Premium Compact UI Polish
   Additive final layer for public desktop + mobile homepage.
   Goal: tighter density, clearer hierarchy, smaller controls, less visual noise. */

:root{
  --tf-ui-radius:12px;
  --tf-ui-radius-sm:9px;
  --tf-ui-line:#e4e9f0;
  --tf-ui-ink:#0b1739;
  --tf-ui-muted:#667085;
  --tf-ui-gold:#f5bd37;
}

/* ---------- DESKTOP ---------- */
@media(min-width:1024px){
  .site-header.premium-header .utility-bar{min-height:32px!important}
  .site-header.premium-header .utility-inner{min-height:32px!important;font-size:11px!important}
  .site-header.premium-header .header-main.shell{
    min-height:72px!important;
    grid-template-columns:62px minmax(420px,1fr) auto!important;
    gap:14px!important;
    padding-top:8px!important;padding-bottom:8px!important;
  }
  .site-header.premium-header .brand{width:62px!important;min-width:62px!important;height:54px!important}
  .site-header.premium-header .brand img{max-width:58px!important;height:50px!important;max-height:50px!important}
  .site-header.premium-header .global-search{
    height:50px!important;min-height:50px!important;
    grid-template-columns:132px minmax(240px,1fr) 46px 112px!important;
    border-radius:12px!important;
  }
  .site-header.premium-header .global-search>select,
  .site-header.premium-header .global-search>input[name="q"]{height:48px!important;min-height:48px!important;font-size:13px!important}
  .site-header.premium-header .global-search>.tf-header-desktop-voice{width:44px!important;min-width:44px!important;height:48px!important;min-height:48px!important}
  .site-header.premium-header .global-search>.tf-header-search-submit{
    width:112px!important;min-width:112px!important;max-width:112px!important;
    height:50px!important;min-height:50px!important;max-height:50px!important;
    font-size:13px!important;border-radius:0 11px 11px 0!important;
  }
  .site-header.premium-header .header-actions{gap:8px!important;font-size:12px!important}
  .site-header.premium-header .header-actions>a{min-height:42px!important}
  .site-header.premium-header .join-button,
  .site-header.premium-header .compare-header-link,
  .site-header.premium-header .shopping-cart-link{padding:0 13px!important;border-radius:10px!important}

  .site-header.premium-header .nav-row{min-height:44px!important}
  .site-header.premium-header .nav-inner{min-height:44px!important}
  .site-header.premium-header .category-trigger{min-height:36px!important;padding:0 12px!important;font-size:12px!important}
  .site-header.premium-header .tf-market-nav{gap:20px!important}
  .site-header.premium-header .tf-market-nav>*>button,
  .site-header.premium-header .tf-market-nav>a{font-size:11.5px!important}

  .tf-home-v3-hero{
    width:min(1480px,calc(100% - 32px))!important;
    height:458px!important;margin-top:12px!important;border-radius:15px!important;
  }
  .tf-home-v3-copy{max-width:560px!important;padding:38px 0 28px!important}
  .tf-home-v3-copy h1{font-size:clamp(38px,3.4vw,56px)!important;line-height:.98!important;letter-spacing:-.035em!important}
  .tf-home-v3-copy p{max-width:540px!important;font-size:14px!important;line-height:1.55!important}
  .tf-home-v3-eyebrow{font-size:9px!important;padding:6px 10px!important}
  .tf-home-v3-search{height:48px!important;max-width:570px!important}
  .tf-home-v3-search select,.tf-home-v3-search input,.tf-home-v3-search button{height:48px!important;font-size:12px!important}
  .tf-home-v3-popular{margin-top:8px!important;gap:5px!important;font-size:10px!important}
  .tf-home-v3-popular a{padding:5px 8px!important}
  .tf-home-v3-actions{margin-top:12px!important;gap:8px!important}
  .tf-home-v3-actions a{min-height:38px!important;padding:0 14px!important;font-size:11px!important;border-radius:9px!important}
  .tf-home-v3-stats{margin-top:13px!important;max-width:500px!important}
  .tf-home-v3-stats>div{padding:10px 12px!important}
  .tf-home-v3-stats strong{font-size:17px!important}
  .tf-home-v3-stats span{font-size:9px!important}
  .tf-home-v3-trust{min-height:40px!important}
  .tf-home-v3-trust .shell{min-height:40px!important;font-size:9.5px!important}

  .tf-home-v3-industries{padding-top:26px!important;padding-bottom:30px!important}
  .tf-home-v3-section-head{margin-bottom:12px!important;align-items:end!important}
  .tf-home-v3-section-head h2{font-size:32px!important;line-height:1.05!important;letter-spacing:-.025em!important}
  .tf-home-v3-section-head p{font-size:12px!important;margin-top:5px!important}
  .tf-home-v3-section-head>a{min-height:34px!important;padding:0 11px!important;font-size:10px!important;border-radius:9px!important}
  .tf-home-v3-category-grid{gap:9px!important}
  .tf-home-v3-category-card{border-radius:12px!important}
  .tf-home-v3-category-media{min-height:150px!important}
  .tf-home-v3-category-body{padding:8px 10px 10px!important}
  .tf-home-v3-category-body>span{font-size:8px!important}
  .tf-home-v3-category-body>strong{font-size:11px!important;line-height:1.25!important}
  .tf-home-v3-subcategories{margin-top:16px!important}
  .tf-home-v3-subcategories>strong{font-size:11px!important}
  .tf-home-v3-subcategories a{padding:6px 9px!important;font-size:10px!important}
}

/* ---------- TABLET / MOBILE ---------- */
@media(max-width:1023px){
  body.tf-homepage{background:#f7f9fc!important}

  .site-header.premium-header .header-main.shell{
    grid-template-rows:46px 46px!important;
    padding:6px 10px 8px!important;
    row-gap:6px!important;column-gap:7px!important;
  }
  .site-header.premium-header .brand{height:42px!important}
  .site-header.premium-header .brand img{max-width:58px!important;height:40px!important;max-height:40px!important}
  .site-header.premium-header .mobile-account-button,
  .site-header.premium-header .mobile-menu-toggle{
    width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;border-radius:11px!important;
  }
  .site-header.premium-header .header-actions{width:44px!important;min-width:44px!important;height:44px!important}
  .site-header.premium-header .shopping-cart-link{
    width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;border-radius:11px!important;
  }
  .site-header.premium-header .shopping-cart-link .cart-svg-icon,
  .site-header.premium-header .shopping-cart-link .cart-svg-icon svg{width:23px!important;height:23px!important}
  .site-header.premium-header .shopping-cart-link b[data-cart-count]{
    top:-5px!important;right:-4px!important;min-width:20px!important;height:20px!important;font-size:10px!important;
  }

  .site-header.premium-header .global-search{
    grid-template-columns:34px minmax(0,1fr) 38px 44px!important;
    height:46px!important;min-height:46px!important;border-radius:12px!important;
  }
  .site-header.premium-header .global-search>.mobile-search-icon{width:34px!important;height:44px!important}
  .site-header.premium-header .global-search>.mobile-search-icon svg{width:17px!important;height:17px!important}
  .site-header.premium-header .global-search>input[name="q"]{height:44px!important;line-height:44px!important;font-size:13px!important;padding-right:4px!important}
  .site-header.premium-header .global-search>.mobile-voice-search{
    width:34px!important;min-width:34px!important;max-width:34px!important;height:34px!important;min-height:34px!important;max-height:34px!important;border-radius:9px!important;
  }
  .site-header.premium-header .global-search>.mobile-voice-search svg{width:17px!important;height:17px!important}
  .site-header.premium-header .global-search>.tf-mobile-search-submit{
    width:44px!important;min-width:44px!important;max-width:44px!important;height:46px!important;min-height:46px!important;max-height:46px!important;border-radius:0 11px 11px 0!important;
  }
  .site-header.premium-header .global-search>.tf-mobile-search-submit svg{width:18px!important;height:18px!important}

  .tf-home-v3-hero{
    width:calc(100% - 16px)!important;
    height:330px!important;
    margin:8px auto 0!important;border-radius:13px!important;
  }
  .tf-home-v3-copy{
    padding:22px 18px 18px!important;
    max-width:88%!important;
  }
  .tf-home-v3-copy h1{font-size:28px!important;line-height:1.02!important;letter-spacing:-.035em!important}
  .tf-home-v3-copy p{font-size:11.5px!important;line-height:1.45!important;max-width:310px!important}
  .tf-home-v3-eyebrow{font-size:8px!important;padding:5px 8px!important}
  .tf-home-v3-search{display:none!important}
  .tf-home-v3-popular{margin-top:9px!important;gap:4px!important}
  .tf-home-v3-popular>span{font-size:8px!important}
  .tf-home-v3-popular a{font-size:8px!important;padding:4px 6px!important}
  .tf-home-v3-actions{margin-top:12px!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important}
  .tf-home-v3-actions a{min-height:36px!important;padding:0 10px!important;font-size:9px!important;border-radius:8px!important}
  .tf-home-v3-stats{margin-top:10px!important}
  .tf-home-v3-stats>div{padding:8px 7px!important}
  .tf-home-v3-stats strong{font-size:14px!important}
  .tf-home-v3-stats span{font-size:7px!important}
  .tf-home-v3-slider-ui{bottom:10px!important;right:10px!important}
  .tf-home-v3-trust{min-height:32px!important;overflow:hidden!important}
  .tf-home-v3-trust .shell{min-height:32px!important;white-space:nowrap!important;overflow:hidden!important;font-size:7px!important;gap:8px!important}

  .tf-home-v3-industries{padding:18px 0 88px!important}
  .tf-home-v3-section-head{margin-bottom:10px!important;gap:8px!important}
  .tf-home-v3-section-head>div>span{font-size:8px!important}
  .tf-home-v3-section-head h2{font-size:22px!important;line-height:1.05!important;letter-spacing:-.025em!important}
  .tf-home-v3-section-head p{font-size:10px!important;line-height:1.35!important;margin-top:4px!important}
  .tf-home-v3-section-head>a{min-height:32px!important;padding:0 9px!important;font-size:9px!important;border-radius:8px!important}

  .tf-home-v3-category-grid{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;
  }
  .tf-home-v3-category-card{border-radius:10px!important;min-width:0!important}
  .tf-home-v3-category-media{height:92px!important;min-height:92px!important}
  .tf-home-v3-category-media img{width:100%!important;height:100%!important;object-fit:contain!important}
  .tf-home-v3-category-body{padding:6px 7px 8px!important}
  .tf-home-v3-category-body>span{font-size:7px!important;margin-bottom:2px!important}
  .tf-home-v3-category-body>strong{font-size:9px!important;line-height:1.2!important}
  .tf-home-v3-subcategories{margin-top:12px!important}
  .tf-home-v3-subcategories>strong{font-size:9px!important;margin-bottom:6px!important}
  .tf-home-v3-subcategories>div{gap:5px!important;overflow-x:auto!important;flex-wrap:nowrap!important;padding-bottom:2px!important}
  .tf-home-v3-subcategories a{font-size:8px!important;padding:5px 8px!important;white-space:nowrap!important}

  /* Compact floating AI control */
  .tf-ai-launcher,[data-ai-launcher]{transform:scale(.88)!important;transform-origin:right bottom!important}
}

/* Very small phones */
@media(max-width:390px){
  .site-header.premium-header .header-main.shell{
    grid-template-columns:minmax(44px,1fr) 40px 40px 44px!important;
    grid-template-rows:44px 44px!important;
    padding:5px 8px 7px!important;
  }
  .site-header.premium-header .brand img{max-width:54px!important;height:38px!important}
  .site-header.premium-header .mobile-account-button,
  .site-header.premium-header .mobile-menu-toggle{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
  .site-header.premium-header .header-actions,.site-header.premium-header .shopping-cart-link{width:44px!important;min-width:44px!important;height:42px!important;min-height:42px!important}
  .site-header.premium-header .global-search{grid-template-columns:32px minmax(0,1fr) 36px 42px!important;height:44px!important;min-height:44px!important}
  .site-header.premium-header .global-search>input[name="q"]{font-size:12.5px!important;height:42px!important;line-height:42px!important}
  .site-header.premium-header .global-search>.tf-mobile-search-submit{width:42px!important;min-width:42px!important;max-width:42px!important;height:44px!important;min-height:44px!important;max-height:44px!important}
  .tf-home-v3-hero{height:312px!important}
  .tf-home-v3-copy{padding:19px 15px 16px!important}
  .tf-home-v3-copy h1{font-size:25px!important}
  .tf-home-v3-section-head h2{font-size:20px!important}
}
