/* Mobile layout: fit the content, rather than masking horizontal overflow. */
@media(max-width:850px){
  body,header,main,footer{min-width:0;max-width:100%}
  header>*{min-width:0}
  header nav{max-width:100%;white-space:normal}
  #searchForm,.search{min-width:0;max-width:100%}
  input,select,textarea{min-width:0;max-width:100%;font-size:16px}
  .productmega,.megacategories,.megacontent,.megafeature{min-width:0;max-width:100%}
  .megacategories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}
  .megacategories>a{min-width:0;white-space:normal;overflow-wrap:anywhere}
  .megasublinks a{min-width:0;overflow-wrap:anywhere}
  .megaheading,.megafeature{overflow-wrap:anywhere}
  .megafeature img{flex-shrink:0}
  .productgrid>*{min-width:0}
  .productcard .cardbody,.productcard .producttitle{min-width:0;max-width:100%;overflow-wrap:anywhere}
  .productcard .cardquantity>div{width:100%;max-width:180px;min-width:0}
  .productcard .cardquantity input{width:0;min-width:0;flex:1}
  .productcard .cardquantity button{flex-shrink:0}
  .catalogShell{grid-template-columns:minmax(0,1fr)}
  .catalogfilters,.catalogresults,#liveResults,#subFilters{min-width:0;max-width:100%}
  .catalogcategorylist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}
  .catalogcategorylist button{width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}
  .catalogfilters .catalogsubs{display:flex;flex-wrap:wrap;max-height:270px;overflow-y:auto;overflow-x:hidden}
  .catalogsubs a{flex:1 1 110px;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .catalogtoolbar{flex-wrap:wrap;min-width:0}
  .catalogsortcontrol{max-width:100%;min-width:0;flex:1 1 150px}
  .catalogsortcontrol select{max-width:100%;width:100%;font-size:16px}
  .activefilters,.crumb{min-width:0;max-width:100%;flex-wrap:wrap;overflow-wrap:anywhere}
  .filterchip{max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .infogrid{grid-template-columns:minmax(0,1fr)}
  .infogrid>*,.contactcards>*,.pricefields>*,.aboutwarehousecontent{min-width:0;max-width:100%}
  .infogrid img{max-width:100%}
  .legalcontent,.contactcardtext,footer,.registeredaddress,#readContent{overflow-wrap:anywhere}
  .pricelistpage,.pricelistform,.priceaccess,.pricefields{min-width:0;max-width:100%}
  dialog{max-width:calc(100% - 24px);min-width:0}
  #drawer{max-width:100%;min-width:0}
  .directcartitem{grid-template-columns:43px minmax(0,1fr)}
  .directcartitem>strong{grid-column:2;white-space:normal;overflow-wrap:anywhere}
  .directitembody,.directitemcontrols,.directreviewheading{min-width:0;overflow-wrap:anywhere}
  .directtotals>div{flex-wrap:wrap}
  .checkoutsteps{flex-wrap:wrap}
  .drawerhead{gap:12px}.drawerhead h2{min-width:0;overflow-wrap:anywhere}
}
@media(max-width:600px){
  .contactcards{grid-template-columns:minmax(0,1fr)}
  .categories{grid-template-columns:repeat(2,minmax(0,1fr))}
  .categories .category:nth-child(4),.categories .category:nth-child(5){grid-column:auto;margin-left:0}
  .category{min-width:0}
  .category img{max-width:100%}
  .cardbody .price{font-size:clamp(16px,4.5vw,21px);overflow-wrap:anywhere}
  .joinbanner .btn{white-space:normal;max-width:100%}
  .pricelistactions .btn{white-space:normal;overflow-wrap:anywhere}
  #searchForm input,.filtersearch input,.subfiltersearch,.field input,.field select,.field textarea{font-size:16px}
  #main input,#main select,#accountModal input,#drawer input,#drawer select,#drawer textarea,#productModal input{font-size:16px}
}
