.catalog-view-all { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px; }
.catalog-sort-control { display: grid; grid-template-columns: auto minmax(0, 230px); align-items: center; gap: 8px 12px; }
.catalog-sort-control label { font-size: 15px; }
.catalog-sort-control select { min-width: 0; max-width: 100%; min-height: 44px; padding: 10px; background: #faf7ed; border: 1px solid #a59b7b; color: #243e31; font: 16px Arial,sans-serif; }
#catalog-sort-note { grid-column: 1/-1; margin: 0; font-size: 13px; line-height: 1.5; }
@media(max-width:600px) { .catalog-sort-control { width: 100%; grid-template-columns: auto minmax(0, 1fr); } }

#category-picker {
  margin: 18px 0 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
#category-picker label { font-size: 15px; }
#category-picker #categories {
  display: block;
  width: min(100%, 360px);
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #a59b7b;
  background: #faf7ed;
  color: #243e31;
  font: 16px Arial,sans-serif;
  margin: 0;
}
#category-picker #categories:focus-visible { outline: 3px solid #bc853e; outline-offset: 3px; }
#products > #vendors { padding-left: 0; padding-right: 0; margin-top: 35px; border-top: 1px solid #b6aa8b; }
@media(max-width:600px) {
  #category-picker { display: grid; grid-template-columns: 1fr; gap: 8px; }
  #category-picker #categories { width: 100%; }
}

/* Keep the same browsing sequence on phones and desktop. */
#main > #products > .section-head { order: 0; }
#main > #products > .catalog-view-all { order: 1; }
#main > #products > .catalog-tools { order: 2; }
#main > #products > #category-picker { order: 3; }
#main > #products > #category-detail { order: 4; }
#main > #products > #vendors { order: 5; }
#main > #products > .catalog-note { order: 6; }

/* Compact phone spacing while keeping controls easy to tap. */
@media (max-width: 600px) {
  #main > #products > .section-head { margin-bottom: 16px; gap: 10px; }
  #products .section-head .eyebrow { margin-bottom: 8px; }
  #products .shop-title { margin-top: 0; margin-bottom: 10px; }
  #products .section-head p { margin-top: 8px; line-height: 1.45; }
  #main > #products > .catalog-view-all { margin-top: 0; gap: 12px; }
  #products .catalog-sort-control { gap: 6px 10px; }
  #catalog-sort-note { line-height: 1.35; }
  #main > #products > .catalog-tools { margin-top: 14px; margin-bottom: 0; }
  #products .catalog-search label { margin-bottom: 6px; }
  #products .catalog-search input { padding: 10px 12px; }
  #main > #products > #category-picker { margin: 14px 0 0; gap: 6px; }
  #main > #products > #category-detail { margin-top: 18px; }
  #category-detail > h2 { margin-top: 0; margin-bottom: 8px; }
  #category-detail > p { margin-top: 8px; margin-bottom: 12px; line-height: 1.45; }
  #main > #products > #vendors { margin-top: 24px; padding-top: 24px; padding-bottom: 24px; }
}

/* Desktop products use the compact photo-and-details category layout. */
@media (min-width: 601px) {
  #category-detail .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  #category-detail .catalog-product { padding: 10px; border: 1px solid #b6aa8b; }
  #category-detail .catalog-product .product-card { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 4px 12px; padding: 0; flex: initial; align-content: start; }
  #category-detail .product-card img { grid-column: 1; grid-row: 1 / span 8; width: 80px; height: 90px; aspect-ratio: auto; object-fit: contain; }
  #category-detail .product-card > :not(img) { grid-column: 2; margin: 0; }
  #category-detail .product-card h4 { font: normal 20px/1.2 Georgia, serif; overflow-wrap: anywhere; }
  #category-detail .product-card .catalog-price { font-size: 16px; line-height: 1.4; }
  #category-detail .product-card span { font-size: 13px; line-height: 1.4; }
  #category-detail .catalog-card-order { padding: 8px 0 0 92px; }
  #category-detail .catalog-card-order select { margin-bottom: 8px; }
  #category-detail .catalog-card-order label { margin-bottom: 6px; }
  #category-detail .catalog-card-order .catalog-card-quantity { margin-bottom: 0; }
  #category-detail .catalog-add-status { margin: 8px 0 0; }
  #category-detail .catalog-add-status:empty { margin: 0; }
}

/* Three compact product cards per row on desktop. */
@media (min-width: 1000px) {
  #category-detail .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #category-detail .catalog-card-order { padding-left: 0; }
}

/* Farm Store polish following desktop/mobile screenshot comparison. */
.shop-page { --green: #243e31; }
.shop-page > header { padding-top: 16px; padding-bottom: 16px; row-gap: 12px; }
.shop-page .eyebrow::before { content: none; }
.shop-page .shop-heading { padding: 22px 6% 0; }
.shop-page #main > #products { padding-top: 28px; }
.shop-page #main > #products > .section-head { margin-bottom: 20px; }
.shop-page #main > #products > .catalog-tools { margin-top: 18px; margin-bottom: 0; }
.shop-page #category-picker { margin-top: 14px; margin-bottom: 16px; }
.shop-page #vendors > .back-to-top { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; }
.shop-page .catalog-product .button,
.shop-page .load-products,
.shop-page .catalog-filters button[aria-pressed="true"] { background: #243e31; border-color: #243e31; color: #fff; }
@media (max-width: 600px) {
  .shop-page > header { padding-top: 12px; padding-bottom: 12px; row-gap: 10px; }
  .shop-page .shop-heading { padding-top: 16px; }
  .shop-page #main > #products { padding-top: 22px; }
  .shop-page #main > #products > .catalog-tools { margin-top: 12px; }
  .shop-page #main > #products > #category-picker { margin-top: 12px; margin-bottom: 0; }
}

/* Keep browsing simple: search beside Cart, one category selector. */
.shop-page .store-header-tools { display: flex; align-items: end; gap: 12px; margin-left: auto; min-width: 0; }
.shop-page .store-header-search { display: grid; gap: 5px; width: 220px; max-width: 100%; min-width: 0; }
.shop-page .store-header-search label { font: 14px/1.3 Arial, sans-serif; }
.shop-page #product-search { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #a59b7b; background: #faf7ed; color: #243e31; font: 16px Arial, sans-serif; }
.shop-page .store-mobile-cart { display: none; }
@media (max-width: 600px) {
  .shop-page > header { gap: 12px; }
  .shop-page header .mobile-page-menu { width: 120px; margin: 0; flex: 0 0 120px; }
  .shop-page .store-header-tools { flex: 1 1 160px; gap: 8px; align-items: center; }
  .shop-page .store-header-search { flex: 1; width: auto; }
  .shop-page .store-header-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .shop-page .store-mobile-cart { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; font: 14px Arial, sans-serif; }
}
#category-detail .product-grid{align-items:stretch}
#category-detail .catalog-product{display:flex;flex-direction:column;box-sizing:border-box;min-width:0}
#category-detail .catalog-product>.product-card{flex:none}
#category-detail .catalog-card-order{margin-top:auto}
