/* V150 — restore compact finder layout + fix overflowing action text */

@media (min-width:721px){
  /* Restore the older compact quick-filter layout instead of full-width rows */
  body.order-redesign #shopFinder.finder-top-dock .quick-shop-buttons{
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:center!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    margin:0 auto!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .quick-filter-btn{
    width:auto!important;
    min-width:118px!important;
    max-width:none!important;
    min-height:44px!important;
    height:44px!important;
    flex:0 0 auto!important;
    padding:0 16px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    font-size:10px!important;
    line-height:1.15!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .quick-shop-buttons > .quick-filter-btn:last-child{
    grid-column:auto!important;
  }

  /* Search row back to the clean 1 field + 1 button layout */
  body.order-redesign #shopFinder.finder-top-dock .search-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 156px!important;
    align-items:stretch!important;
    gap:12px!important;
    margin-top:14px!important;
    margin-bottom:12px!important;
  }

  body.order-redesign #shopFinder.finder-top-dock #keyword,
  body.order-redesign #shopFinder.finder-top-dock #searchBtn{
    min-height:50px!important;
    height:50px!important;
    margin:0!important;
  }

  body.order-redesign #shopFinder.finder-top-dock #searchBtn{
    width:156px!important;
    min-width:156px!important;
  }

  /* Three normal filters + a wider action area so labels never overflow */
  body.order-redesign #shopFinder.finder-top-dock .search-toolbar{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr)) 300px!important;
    align-items:stretch!important;
    gap:12px!important;
    margin:0 auto!important;
    overflow:visible!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .quick-filters{
    display:contents!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .quick-filters > .field{
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    height:46px!important;
    margin:0!important;
    font-size:11px!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .filter-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
    width:300px!important;
    min-width:300px!important;
    margin:0!important;
    overflow:visible!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .filter-actions button{
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    height:46px!important;
    padding:0 12px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:10px!important;
    line-height:1.1!important;
  }

  body.order-redesign #shopFinder.finder-top-dock #advancedToggle{
    font-size:10px!important;
    letter-spacing:-.1px!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .advanced-filters.open{
    margin-top:12px!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:12px!important;
  }
}

/* Laptop / resized desktop: give filter buttons their own full-width row */
@media (min-width:721px) and (max-width:1180px){
  body.order-redesign #shopFinder.finder-top-dock .quick-filter-btn{
    min-width:108px!important;
    padding:0 13px!important;
    font-size:9.5px!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .search-toolbar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .quick-filters{
    display:contents!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .quick-filters #sortFilter{
    grid-column:1 / -1!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .filter-actions{
    grid-column:1 / -1!important;
    width:100%!important;
    min-width:0!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .filter-actions button{
    font-size:11px!important;
  }
}

/* Narrow desktop/tablet: keep controls stacked cleanly */
@media (min-width:721px) and (max-width:900px){
  body.order-redesign #shopFinder.finder-top-dock .search-row{
    grid-template-columns:1fr!important;
  }

  body.order-redesign #shopFinder.finder-top-dock #searchBtn{
    width:100%!important;
    min-width:0!important;
  }

  body.order-redesign #shopFinder.finder-top-dock .advanced-filters.open{
    grid-template-columns:1fr!important;
  }
}
