/* CFS Storefront v0.2.17 — phone-only shopping ergonomics.
   At >640px the pre-existing desktop/tablet layouts remain authoritative.
   No pricing, stock, supplier, checkout or quote behavior changes here. */
@media (max-width:640px) {
  /* A compact, complete phone header: logo, quote-cart and hamburger remain visible. */
  header.site .nav-primary { height:56px; min-height:56px; gap:8px; padding-inline:12px; }
  header.site .nav-primary .logo img { height:28px; width:auto; max-width:min(56vw,208px); object-fit:contain; }
  header.site .nav-primary .cartbtn { width:40px; height:40px; }
  header.site .nav-primary .burger { width:40px; height:40px; flex:none; }
  header.site .nav-primary .header-quote { display:none!important; }
  header.site .mobnav { top:56px; }
  .cfs-shop-parity .tight:first-child { padding-top:22px; }
  .cfs-shop-parity h1 { font-size:clamp(1.68rem,7.5vw,2.15rem); line-height:1.13; margin-bottom:10px; }
  .cfs-shop-parity .cfs-shop-intro { font-size:.85rem; line-height:1.45; margin-bottom:18px; }
  .cfs-shop-parity .eyebrow { font-size:.58rem; margin-bottom:7px; }
  .cfs-shop-parity .crumbs { margin-bottom:12px; }

  /* Single-column results, with compact image-left product cards. */
  .prodgrid,
  ul.cfs-seeded-product-grid,
  .cfs-shop-grid.products,
  .woocommerce ul.products { grid-template-columns:minmax(0,1fr)!important; gap:11px!important; }
  .prodgrid > li.prod,
  ul.cfs-seeded-product-grid > li.prod,
  ul.products > li.prod,
  .cfs-shop-grid.products > li.prod {
    display:grid!important;
    grid-template-columns:minmax(104px,36%) minmax(0,1fr);
    column-gap:12px;
    align-items:start;
    padding:10px;
    min-width:0;
    box-shadow:none;
    border-radius:7px;
    transition:none;
  }
  .prodgrid > li.prod:hover,
  ul.cfs-seeded-product-grid > li.prod:hover,
  ul.products > li.prod:hover { transform:none; box-shadow:none; }
  .prodgrid > li.prod > .img,
  ul.cfs-seeded-product-grid > li.prod > .img,
  ul.products > li.prod > .img {
    grid-column:1;
    grid-row:1;
    width:100%;
    aspect-ratio:1/1!important;
    min-height:0!important;
    max-height:none!important;
    border-radius:5px;
    align-self:start;
  }
  .prodgrid > li.prod > .img > img,
  ul.cfs-seeded-product-grid > li.prod > .img > img,
  ul.products > li.prod > .img > img { width:100%; height:100%; aspect-ratio:1; object-fit:cover; }
  .prod .img .badge { font-size:.48rem; line-height:1.15; letter-spacing:.035em; padding:5px 6px; top:6px; left:6px; right:auto; max-width:calc(100% - 12px); }
  .prodgrid > li.prod > .body,
  ul.cfs-seeded-product-grid > li.prod > .body,
  ul.products > li.prod > .body { grid-column:2; grid-row:1; padding:0!important; display:flex; flex-direction:column; min-width:0; }
  .prod .coll { font-size:.56rem; line-height:1.35; letter-spacing:.055em; }
  .prod b.nm { font-size:.87rem; line-height:1.27; margin:3px 0 5px; -webkit-line-clamp:3; }
  .prod .specs { font-size:.7rem; line-height:1.38; margin:0 0 6px; -webkit-line-clamp:2; }
  .prod .prod-commerce { margin-top:4px; gap:7px; }
  .prod .prod-priceblock { border:0; padding:0; gap:2px; }
  .prod .prod-priceblock .price { font-size:1.32rem; letter-spacing:-.025em; }
  .prod .prod-priceblock .price span { font-size:.66rem; }
  .prod .prod-priceblock small { font-size:.67rem; line-height:1.38; white-space:normal; }
  .prod .prod-quoted { font-size:.9rem; }
  .prod .prod-actions { gap:5px; }
  .prod .prod-buy { min-height:42px; padding:9px 8px; font-size:.77rem; line-height:1.15; }
  .prod .prod-sample { border:0!important; background:transparent!important; min-height:34px; padding:6px 2px; font-size:.74rem; text-decoration:underline; text-underline-offset:3px; color:var(--steel)!important; }
  .prod .prod-sample.is-added { color:#286a3c!important; background:transparent!important; }
  .prod .cfs-card-sample-feedback { font-size:.72rem; padding:7px; line-height:1.35; overflow-wrap:anywhere; }
  /* Promotion cards remain full-width and clearly distinct from products. */
  .cfs-shop-grid .shop-promo, .prodgrid .shop-promo { width:100%; min-height:0; }
  .shop-promo-content { padding:22px 18px!important; }
  .shop-promo h3 { font-size:1.35rem; }
  .shop-promo p { font-size:.8rem; }

  /* Progressive enhancement: filters stay visible if JS is unavailable. */
  .cfs-mobile-shop-tools { display:flex; align-items:center; gap:9px; margin:0 0 14px; }
  .cfs-mobile-shop-tools button, .cfs-mobile-shop-tools select {
    min-height:43px; border:1px solid #CFCBC3; background:#fff; border-radius:5px;
    color:var(--ink); font:600 .82rem/1.2 Inter,system-ui,sans-serif;
  }
  .cfs-mobile-shop-tools .cfs-mobile-filter-toggle { flex:0 0 auto; padding:9px 14px; cursor:pointer; }
  .cfs-mobile-shop-tools .cfs-mobile-filter-toggle[aria-expanded="true"] { border-color:var(--steel); background:#EAF1F6; color:#174664; }
  .cfs-mobile-shop-tools .cfs-mobile-sort-wrap { display:flex; align-items:center; min-width:0; flex:1; }
  .cfs-mobile-shop-tools .cfs-mobile-sort { width:100%; padding:8px 26px 8px 10px; appearance:auto; }
  .cfs-mobile-shop-tools .cfs-mobile-sort-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .shopwrap.cfs-mobile-enhanced > .refine:not(.is-open) { display:none!important; }
  .shopwrap.cfs-mobile-enhanced > .refine.is-open { display:block!important; margin-bottom:14px; max-height:none; }

  /* Quote shortcut: appears only when there are quote-cart lines. */
  .cfs-mobile-quote-shortcut:not([hidden]) {
    position:fixed; display:flex; align-items:center; justify-content:center; gap:10px;
    left:12px; right:12px; bottom:max(12px,env(safe-area-inset-bottom)); z-index:57;
    min-height:50px; padding:10px 16px; background:var(--ink); border:1px solid #3d3933;
    border-radius:9px; box-shadow:0 8px 28px rgba(18,17,15,.25);
    color:#fff; font:750 .89rem/1.2 Inter,system-ui,sans-serif;
    text-align:center;
  }
  .cfs-mobile-quote-shortcut .cfs-shortcut-arrow { margin-left:auto; font-size:1.2rem; }
  body.cfs-quote-modal-open .cfs-mobile-quote-shortcut { display:none!important; }
  body.cfs-mobile-quote-present { padding-bottom:76px; }
}
@media (max-width:355px) {
  .prodgrid > li.prod,ul.cfs-seeded-product-grid > li.prod,ul.products > li.prod { grid-template-columns:minmax(94px,34%) minmax(0,1fr); column-gap:9px; padding:8px; }
  .prod b.nm { font-size:.81rem; }
  .prod .prod-priceblock .price { font-size:1.17rem; }
  .prod .prod-buy { font-size:.72rem; }
  header.site .nav-primary .logo img { height:25px; }
}
@media (min-width:641px) {
  .cfs-mobile-shop-tools,.cfs-mobile-quote-shortcut { display:none!important; }
}
