/* TradesFolks 18.4.51 — Mobile Category Showcase Swipe Fix
   Fixes oversized stacked mobile subcategory cards.
   Hero remains compact; subcategories become a horizontal swipe rail. */

@media(max-width:699px){
  .tf-homepage .home-category-showcases{
    padding:10px 0 14px!important;
  }
  .tf-homepage .home-category-showcases>.shell{
    width:100%!important;
    max-width:none!important;
    padding-inline:8px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  .tf-homepage .home-category-showcase{
    padding:8px!important;
    border-radius:12px!important;
    overflow:hidden!important;
  }

  .tf-homepage .home-category-showcase-head{
    gap:6px!important;
    margin-bottom:7px!important;
  }
  .tf-homepage .home-category-browse-pill{
    width:max-content!important;
    padding:4px 7px!important;
    font-size:7px!important;
  }
  .tf-homepage .home-category-showcase-head h3{
    margin:5px 0 2px!important;
    font-size:19px!important;
  }
  .tf-homepage .home-category-showcase-head p{
    font-size:8.5px!important;
    line-height:1.3!important;
  }
  .tf-homepage .home-category-showcase-head>a{
    min-height:29px!important;
    height:29px!important;
    font-size:7.5px!important;
    border-radius:8px!important;
  }

  .tf-homepage .home-category-showcase-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    width:100%!important;
    min-width:0!important;
  }

  /* Compact category hero */
  .tf-homepage .home-category-source-card{
    min-height:154px!important;
    height:154px!important;
    padding:10px!important;
    border-radius:10px!important;
    background-size:cover!important;
    background-position:center center!important;
  }
  .tf-homepage .home-category-source-card strong{
    margin:34px 0 4px!important;
    max-width:76%!important;
    font-size:16px!important;
    line-height:1.03!important;
  }
  .tf-homepage .home-category-source-card p{
    max-width:80%!important;
    font-size:7px!important;
    line-height:1.3!important;
  }
  .tf-homepage .home-category-source-card ul{
    margin-top:5px!important;
    gap:2px!important;
  }
  .tf-homepage .home-category-source-card li{
    font-size:6.2px!important;
  }

  /* Horizontal swipe rail for all subcategories */
  .tf-homepage .home-category-subgrid{
    display:flex!important;
    flex-wrap:nowrap!important;
    grid-template-columns:none!important;
    grid-template-rows:none!important;
    grid-auto-flow:initial!important;
    gap:7px!important;
    width:auto!important;
    max-width:none!important;
    margin:0 -8px!important;
    padding:0 8px 4px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    scroll-padding-left:8px!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-inline:contain!important;
    scrollbar-width:none!important;
  }
  .tf-homepage .home-category-subgrid::-webkit-scrollbar{
    display:none!important;
  }

  .tf-homepage .home-category-subcard{
    flex:0 0 154px!important;
    width:154px!important;
    min-width:154px!important;
    max-width:154px!important;
    height:164px!important;
    min-height:164px!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:78px 58px 28px!important;
    scroll-snap-align:start!important;
    border-radius:9px!important;
    overflow:hidden!important;
    background:#fff!important;
  }
  .tf-homepage .home-category-subcard-image{
    width:100%!important;
    height:78px!important;
    min-height:78px!important;
    background:#fff!important;
  }
  .tf-homepage .home-category-subcard-image img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    object-position:center center!important;
    padding:4px!important;
    box-sizing:border-box!important;
    background:#fff!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:58px!important;
    min-height:58px!important;
    padding:5px 6px 4px!important;
    overflow:hidden!important;
    background:#fff!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 2px!important;
    font-size:8px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  /* Show only two child lines in compact rail cards. */
  .tf-homepage .home-category-subcard-body ul{
    display:block!important;
    margin:0!important;
    padding:0 0 0 10px!important;
    overflow:hidden!important;
  }
  .tf-homepage .home-category-subcard-body li{
    font-size:6px!important;
    line-height:1.18!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .tf-homepage .home-category-subcard-body li:nth-child(n+3){
    display:none!important;
  }

  .tf-homepage .home-category-subcard-action{
    height:28px!important;
    min-height:28px!important;
    padding:0 6px!important;
    font-size:6.8px!important;
    background:#fff!important;
  }
}

@media(max-width:390px){
  .tf-homepage .home-category-showcase{
    padding:7px!important;
  }
  .tf-homepage .home-category-source-card{
    min-height:144px!important;
    height:144px!important;
  }
  .tf-homepage .home-category-source-card strong{
    margin-top:30px!important;
    font-size:15px!important;
  }
  .tf-homepage .home-category-subgrid{
    margin-inline:-7px!important;
    padding-inline:7px!important;
    scroll-padding-left:7px!important;
    gap:6px!important;
  }
  .tf-homepage .home-category-subcard{
    flex-basis:142px!important;
    width:142px!important;
    min-width:142px!important;
    max-width:142px!important;
    height:156px!important;
    min-height:156px!important;
    grid-template-rows:72px 57px 27px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:72px!important;
    min-height:72px!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:57px!important;
    min-height:57px!important;
    padding:4px 5px!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:27px!important;
    min-height:27px!important;
  }
}
