.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 12px;
}

.product-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.product-card .price {
  font-weight: 600;
  margin-bottom: 10px;
}

/* --- Patch 019: Storefront polish --- */

.store-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 14px;
}
.store-toolbar h2{ margin:0; flex: 0 0 auto; }
.store-controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end; /* align controls with content */
  flex: 1 1 520px;
}
.store-controls input[type="search"],
.store-controls select{
  width: auto; /* override global form control 100% width */
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  min-width: 180px;
}
.store-controls input[type="search"]{ min-width: 220px; }
.store-controls select{ min-width: 260px; }
.store-controls .btn{ padding: 10px 14px; }

@media (max-width: 740px){
  .store-toolbar{ align-items:flex-start; }
  .store-controls{ justify-content:flex-start; flex-basis: 100%; }
  .store-controls input[type="search"],
  .store-controls select{ width: 100%; flex-basis: 100%; min-width: 0; }
}

.products-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.product-card{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  background:#fff;
  overflow:hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.03);
  display:flex;
  flex-direction:column;
}
.product-card .img{
  background:#f3f3f3;
  aspect-ratio: 4/5;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.product-card .img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.product-card .body{
  padding: 12px 12px 14px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.product-card .name-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}
.product-card .name-row .name{
  font-weight: 800;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
}
/* override default tag spacing when used in a flex row */
.product-card .name-row .admin-product-tag{ margin-left:0; white-space:nowrap; }

.pagination{
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:center;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}
.pagination a, .pagination span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 40px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  text-decoration:none;
  color: inherit;
  background:#fff;
}
.pagination .active{
  background: var(--accent);
  color:#fff;
  border-color: transparent;
}
.pagination .disabled{
  opacity:.5;
  pointer-events:none;
}


/* Home ordering rules + updates boxes */
.home-info-grid .content-box{
  min-height: 180px;
}
.expandable{
  position: relative;
}
.expandable-content{
  max-height: 160px;
  overflow: hidden;
  transition: max-height .25s ease;
}
.expandable.expanded .expandable-content{
  max-height: 2000px;
}
.expand-toggle{
  margin-top: 10px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
}


/* --- Patch: consistent price/button alignment in product cards --- */
.product-card .body{
  flex: 1;
}
.product-card .name{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
}
.product-card .price{
  margin-top: 0;
}
.product-card .btn{
  margin-top: auto;
  width: 100%;
  display: block;
  text-align: center;
}

