
/* V164 - Product category/list page
   1600px public canvas, compact sidebar, responsive product grid.
   Applies only to product listing/category pages; Admin is untouched. */

:root{
  --v164-list-shell:1600px;
  --v164-list-gap:22px;
  --v164-sidebar:240px;
}

/* Main category page uses the same wide public canvas as homepage */
@media(min-width:1200px){
  body:not(.admin-layout) .product-list-page.v137-product-list-page,
  body:not(.admin-layout) .product-list-page.v136-product-list-page{
    width:min(var(--v164-list-shell),calc(100% - 48px))!important;
    max-width:var(--v164-list-shell)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:0!important;
    padding-right:0!important;
    box-sizing:border-box!important;
  }

  body:not(.admin-layout) .product-list-page .v136-list-layout{
    display:grid!important;
    grid-template-columns:var(--v164-sidebar) minmax(0,1fr)!important;
    gap:var(--v164-list-gap)!important;
    width:100%!important;
    max-width:none!important;
    align-items:start!important;
  }

  body:not(.admin-layout) .product-list-page .v136-list-main{
    min-width:0!important;
    width:100%!important;
    max-width:none!important;
  }

  /* Sidebar remains compact and easy to scan */
  body:not(.admin-layout) .product-list-page .v136-sidebar,
  body:not(.admin-layout) .product-list-page .product-sidebar{
    width:100%!important;
    max-width:var(--v164-sidebar)!important;
  }

  /* Toolbar stretches across the product content column */
  body:not(.admin-layout) .product-list-page .v137-toolbar,
  body:not(.admin-layout) .product-list-page .v136-toolbar,
  body:not(.admin-layout) .product-list-page .v135-product-toolbar{
    width:100%!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }

  /* Do not let the short category intro look artificially narrow */
  body:not(.admin-layout) .product-list-page .v137-list-heading .category-description{
    max-width:980px!important;
  }

  /* Long category copy remains comfortably readable after pagination */
  body:not(.admin-layout) .product-list-page .v137-category-copy{
    width:100%!important;
    max-width:1050px!important;
    margin:34px auto 0!important;
    padding:26px 30px!important;
    box-sizing:border-box!important;
    border:1px solid #e1ebe6!important;
    border-radius:14px!important;
    background:#fff!important;
  }
}

/* Large desktop: 5 product cards */
@media(min-width:1500px){
  body:not(.admin-layout) .product-list-page.v137-product-list-page .product-grid.v137-product-grid,
  body:not(.admin-layout) .product-list-page.v136-product-list-page .product-grid.v136-product-grid,
  body:not(.admin-layout) .product-list-page .product-grid.v135-product-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:16px!important;
    width:100%!important;
    max-width:none!important;
    align-items:stretch!important;
  }
}

/* Standard desktop: 4 product cards */
@media(min-width:1200px) and (max-width:1499px){
  body:not(.admin-layout) .product-list-page.v137-product-list-page .product-grid.v137-product-grid,
  body:not(.admin-layout) .product-list-page.v136-product-list-page .product-grid.v136-product-grid,
  body:not(.admin-layout) .product-list-page .product-grid.v135-product-grid{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:15px!important;
  }
}

/* Tablet: sidebar becomes full-width block, then 3 products/row */
@media(min-width:768px) and (max-width:1199px){
  body:not(.admin-layout) .product-list-page.v137-product-list-page,
  body:not(.admin-layout) .product-list-page.v136-product-list-page{
    width:calc(100% - 32px)!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  body:not(.admin-layout) .product-list-page .v136-list-layout{
    display:block!important;
  }

  body:not(.admin-layout) .product-list-page .v136-sidebar,
  body:not(.admin-layout) .product-list-page .product-sidebar{
    width:100%!important;
    max-width:none!important;
    margin-bottom:16px!important;
  }

  body:not(.admin-layout) .product-list-page .product-grid.v137-product-grid,
  body:not(.admin-layout) .product-list-page .product-grid.v136-product-grid,
  body:not(.admin-layout) .product-list-page .product-grid.v135-product-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:13px!important;
  }
}

/* Mobile: 2 product cards/row */
@media(max-width:767px){
  body:not(.admin-layout) .product-list-page.v137-product-list-page,
  body:not(.admin-layout) .product-list-page.v136-product-list-page{
    width:100%!important;
    max-width:none!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }

  body:not(.admin-layout) .product-list-page .v136-list-layout{
    display:block!important;
  }

  body:not(.admin-layout) .product-list-page .product-grid.v137-product-grid,
  body:not(.admin-layout) .product-list-page .product-grid.v136-product-grid,
  body:not(.admin-layout) .product-list-page .product-grid.v135-product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }

  body:not(.admin-layout) .product-list-page .v137-category-copy{
    padding:18px 14px!important;
    margin-top:24px!important;
  }
}
