/* The purchase list stays mounted while its quantity dialog is open. */
.browse-list-page .product-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; align-items: start; }
.browse-product-card { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; padding: 14px; border: 1px solid #e5e5e5; border-radius: 6px; background: #fff; color: #111; text-align: left; cursor: pointer; }
.browse-product-card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.browse-product-card:disabled { cursor: default; color: #737373; background: #fafafa; }
.browse-product-name, .purchase-dialog h2 { display: block; white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.browse-product-card .price-stack { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.browse-product-card .price { font-size: 19px; }
.browse-product-card .price-stack .muted { font-size: 13px; }
.purchase-stock-status { color: #9b3131; font-size: 14px; }
.bottom-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
.bottom-nav button { white-space: normal; }
.purchase-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; position: sticky; top: 58px; z-index: 20; padding: 10px 0; background: var(--bg, #fff); }
.purchase-toolbar .input { min-width: 0; width: 100%; font-size: 16px; }
.purchase-category-toggle { min-height: 44px; max-width: 150px; overflow-wrap: anywhere; }
[data-category-panel-host] { position: absolute; top: 100%; right: 0; width: min(100%,420px); }
.purchase-category-panel { padding: 8px; max-height: min(60dvh,520px); overflow-y: auto; border: 1px solid #d6d6d6; border-radius: 6px; background: #fff; box-shadow: 0 8px 20px #00000014; overscroll-behavior: contain; }
.purchase-category-scope { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px; border-bottom: 1px solid #dedede; font-size: 16px; }
.purchase-category-scope input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.purchase-category-row { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: start; padding-left: calc(var(--category-depth) * 16px); }
.category-expand, .category-expand-spacer { width: 36px; height: 44px; }
.category-expand { border: 0; background: transparent; color: #444; cursor: pointer; }
.category-name { display: block; min-height: 44px; width: 100%; padding: 10px 8px; border: 0; border-radius: 4px; background: transparent; color: #222; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.category-name:hover, .category-expand:hover, .category-name.selected { background: #f0f2f1; }
.category-name.selected { font-weight: 600; }
[data-product-list-start] { scroll-margin-top: 138px; }
.purchase-modal-open { overflow: hidden; scrollbar-gutter: stable; }
.purchase-dialog { width: min(420px,calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; padding: 24px; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; color: #222; }
.purchase-dialog::backdrop { background: #0000004d; }
.purchase-dialog h2 { margin: 4px 32px 16px 0; font-size: 18px; line-height: 1.5; }
.purchase-dialog-close { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; }
.purchase-price { margin-bottom: 12px; }
.purchase-price .price-stack { display: grid; gap: 4px; }
.purchase-price .price { font-size: 20px; }
.purchase-price .muted { font-size: 13px; }
.purchase-conversions { display: grid; gap: 4px; margin-bottom: 20px; color: #555; font-size: 14px; }
.purchase-dialog label { display: block; margin-bottom: 8px; font-size: 14px; }
.purchase-dialog-actions { display: flex; align-items: center; gap: 16px; }
.purchase-quantity { display: flex; align-items: center; gap: 8px; }
.purchase-quantity-unit { font-size: 16px; }
.quantity-input, .purchase-dialog-actions .quantity-input { font-size: 18px; }
.purchase-dialog-actions .quantity-input { width: 120px; min-width: 0; height: 42px; }
.purchase-add { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #ccc; border-radius: 7px; background: #fff; color: #111; font-size: 28px; cursor: pointer; }
.purchase-add:hover:not(:disabled) { background: #f5f5f5; border-color: #b8b8b8; }
.purchase-add:active:not(:disabled) { background: #ebebeb; border-color: #b8b8b8; }
.purchase-add:disabled { background: #f5f5f5; border-color: #ddd; color: #999; cursor: not-allowed; }
@media(max-width:767px) {
  .browse-list-page .product-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .browse-product-card { padding: 10px; }
  .purchase-toolbar { top: 54px; gap: 8px; }
  .purchase-category-toggle { padding-inline: 12px; }
  .purchase-dialog { padding: 20px; }
  .purchase-dialog-actions .quantity-input { width: 104px; }
}
