/* Commerce components. This is the ONLY owner of product-buy / product-action /
   quantity geometry. Do not re-introduce a state-dependent flex-wrap rule. */
:root { --purchase-height:44px; --quantity-target:44px; }
.product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-items:stretch; }
.product-card { display:flex; flex-direction:column; position:relative; min-width:0; height:auto; align-self:stretch; border-radius:18px; overflow:hidden; background:#fff; }
.product-copy { display:flex; flex-direction:column; flex:1; min-width:0; padding:11px; }
.product-size { display:block; height:15px; flex:0 0 15px; font-size:10px; line-height:15px; margin:0 0 6px; color:#68765f; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.product-name { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; width:100%; min-width:0; height:40px; min-height:40px; flex:0 0 40px; font-size:14px; line-height:20px; text-align:left; font-weight:600; padding:0; margin:6px 0 0; }
.product-name:focus-visible { outline-offset:0; }
.product-stock { display:flex; align-items:center; gap:4px; height:17px; flex:0 0 17px; font-size:11px; line-height:17px; margin:7px 0 10px; color:#59734c; white-space:nowrap; }
.product-stock::before { content:''; width:4px; height:4px; flex:none; background:currentColor; border-radius:50%; }
.product-stock.unavailable { color:#9f6551; }
.product-buy { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:24px var(--purchase-height); gap:10px; padding:9px 0 0; margin-top:auto; flex:none; min-width:0; }
.product-price { display:block; align-self:center; min-width:0; font-size:18px; font-weight:650; line-height:24px; letter-spacing:-.5px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.product-price.price-medium { font-size:16px; }
.product-price.price-long { font-size:13px; letter-spacing:-.4px; }
.product-action { display:grid; grid-template-columns:minmax(0,1fr); height:var(--purchase-height); min-width:0; width:100%; border-radius:12px; isolation:isolate; }
.product-action > .button { width:100%; height:var(--purchase-height); min-height:var(--purchase-height); max-height:var(--purchase-height); min-width:0; border-radius:12px; padding:0 6px; gap:6px; white-space:nowrap; font-size:13px; line-height:18px; }
.product-action .icon { width:17px; height:17px; }
.product-card .favorite { position:absolute; z-index:2; right:4px; top:4px; width:44px; height:44px; display:grid; place-items:center; border-radius:50%; background:#ffffffeb; color:#43644c; }
.product-card .favorite .icon { width:20px; height:20px; }
.product-card .favorite.active .icon { fill:#d6e4c9; }
/* The targets themselves do not shrink or move on press. Only icons animate. */
.quantity { --quantity-height:44px; display:grid; grid-template-columns:var(--quantity-target) minmax(22px,1fr) var(--quantity-target); align-items:center; justify-content:normal; gap:0; width:116px; min-width:110px; height:var(--quantity-height); min-height:var(--quantity-height); flex:0 0 auto; padding:0; margin:0; border-radius:12px; background:#e7efdf; color:var(--green); }
.product-action > .quantity { width:100%; min-width:0; }
.quantity > button { display:grid; place-items:center; width:var(--quantity-target); min-width:var(--quantity-target); height:var(--quantity-height); min-height:44px; border-radius:10px; padding:0; margin:0; }
.quantity > button .icon { width:17px; height:17px; }
.quantity > button[aria-disabled=true] { color:#8d9b85; cursor:not-allowed; }
.quantity > button:focus-visible { outline-offset:-3px; }
.quantity-value { display:block; min-width:0; font-size:14px; font-weight:600; line-height:20px; text-align:center; font-variant-numeric:tabular-nums; overflow:hidden; }
.purchase-bar { display:grid; grid-template-columns:116px minmax(0,1fr); gap:12px; height:48px; min-width:0; align-items:stretch; }
.purchase-bar .quantity { --quantity-height:48px; }
.purchase-bar .button { min-width:0; height:48px; min-height:48px; padding:4px 8px; }
.purchase-bar .purchase-full { grid-column:1/-1; }
.purchase-bar .purchase-link { display:flex; flex-direction:column; gap:0; font-size:12px; line-height:18px; }
.purchase-link > strong { font-size:15px; line-height:18px; font-variant-numeric:tabular-nums; }
.cart-row { display:grid; grid-template-columns:72px minmax(0,1fr); position:relative; gap:10px 12px; padding:18px 0; border-bottom:1px solid var(--line); min-width:0; }
.cart-thumb { grid-row:1/3; align-self:start; width:72px; height:92px; border-radius:15px; overflow:hidden; }
.cart-thumb .photo { height:100%; width:100%; }
.cart-description { min-width:0; padding-right:34px; }
.cart-name { display:block; text-align:left; width:100%; min-width:0; }
.cart-description h3 { font-size:14px; line-height:20px; letter-spacing:-.1px; margin:0 0 5px; overflow-wrap:anywhere; }
.cart-description p { font-size:11px; line-height:16px; color:var(--muted); overflow-wrap:anywhere; }
.cart-controls { grid-column:2; display:grid; grid-template-columns:116px minmax(0,1fr); align-items:center; gap:8px; min-width:0; }
.cart-controls .price { min-width:0; font-size:14px; line-height:18px; text-align:right; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.cart-row .remove { position:absolute; top:11px; right:-7px; width:44px; min-width:44px; height:44px; color:#718369; }
.cart-row .remove .icon { width:18px; height:18px; }
/* Protect other competing flex children; let text wrap rather than push siblings. */
.segmented button { min-width:0; min-height:44px; white-space:normal; line-height:18px; }
.sheet-buttons { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:9px; }
.sheet-buttons .button { min-width:0; }
.receipt-line > span,.totals > div > span { min-width:0; }
.receipt-line > b,.totals > div > b { flex:none; }
.app-header > .ic-btn,.support-header > .ic-btn { flex:none; }
.search > .icon { flex:none; }
.search input { min-width:0; }
@media(max-width:370px) {
 .product-grid { gap:10px; }
 .product-action > .button { font-size:12px; gap:4px; }
 .product-action .icon { width:15px; height:15px; }
 .product-copy { padding:10px; }
 .product-name { font-size:13px; }
 .cart-row { grid-template-columns:64px minmax(0,1fr); gap:10px; }
 .cart-thumb { width:64px; height:86px; }
}

.quantity[data-digits="4"] .quantity-value { font-size:12px; }
.quantity[data-digits="5"] .quantity-value { font-size:10px; }
