/* 叫貨各畫面「品項依分類分組」(public/proc-groups.js)。舊 WebView:不用 gap、不用 grid、不用 :has();觸控區 >= 44px。
 * 層次:找品項列(黏在頂列下面)→ 分類標題列(淺灰底、粗字)→ 品項列(白底);已選的品項淡藍底,標題列的「已選幾項」藍色小標 */
.pg-nav { position: -webkit-sticky; position: sticky; top: 0; z-index: 6; margin: 0 -2px 8px; padding: 8px 2px 6px; background: var(--panel, #fff); border-bottom: 1px solid var(--line); }
.pg-find { display: block; font-size: 14px; font-weight: 700; }
.pg-find input { display: block; width: 100%; max-width: 420px; min-height: 44px; margin-top: 4px; box-sizing: border-box; font-size: 16px; font-weight: 400; }
.pg-chips { display: block; margin-top: 6px; }
.pg-chips > button small { margin-left: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.pg-chips > button.pg-chip-x { color: #92400e; }

.pg-grp { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel, #fff); }
.pg-h { display: block; width: 100%; min-height: 48px; margin: 0; padding: 8px 12px; border: 0; border-radius: 0; background: #f2f4f7; color: var(--ink, #1f2937); text-align: left; font: inherit; box-shadow: none; cursor: pointer; }
.pg-h .pg-name { font-size: 16px; }
.pg-h .pg-n { margin-left: 4px; font-size: 13px; color: var(--muted); }
.pg-h .pg-sel { float: right; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #e0ecff; color: #1d4ed8; font-size: 13px; font-weight: 700; }
.pg-h .pg-sel:empty { display: none; }
/* 收合記號:展開朝下、收起朝右(用邊框畫,不靠字型) */
.pg-caret { display: inline-block; width: 7px; height: 7px; margin: 0 10px 2px 2px; border-right: 2px solid #667085; border-bottom: 2px solid #667085; vertical-align: middle; -webkit-transform: rotate(45deg); transform: rotate(45deg); }
.pg-shut .pg-caret { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); }
.pg-body { padding: 0 12px; }
.pg-item.pg-keep { margin: 0 -12px; padding: 0 12px; background: #f5f9ff; }
.pg-more { display: none; margin: 6px 0 8px; }

/* 收起來:只留已選的;一項都沒選就整個身體不佔位 */
.pg-shut .pg-item { display: none; }
.pg-shut .pg-item.pg-keep { display: block; }
.pg-shut .pg-more { display: block; }
.pg-shut .pg-more:empty { display: none; }
.pg-shut .pg-h { border-bottom: 0; }

/* 找品項:不管收合,只列名稱對得上的;整區沒有對到就藏起來 */
.pg-q .pg-grp .pg-item { display: block; }
.pg-q .pg-grp .pg-item.pg-miss { display: none; }
.pg-q .pg-more, .pg-q .pg-grp.pg-none { display: none; }
.pg-empty { display: none; }
