/* Popup de ordenação de categorias e pratos */
.reorder-dialog{width:min(640px,96vw);max-height:94dvh;display:flex;flex-direction:column}
.reorder-dialog[open]{display:flex}
.reorder-form{display:flex;flex-direction:column;min-height:0;max-height:calc(94dvh - 56px)}
.reorder-instructions{margin:-6px 0 14px;font-size:11px;line-height:1.55;color:var(--muted)}
.reorder-category{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;font-size:12px}
.reorder-category select{padding:10px 12px;border:1px solid #d8dfd6;border-radius:8px;background:#fff;font:13px var(--font-body),sans-serif;color:#263830}
.reorder-scroll{flex:1;min-height:180px;max-height:58dvh;overflow:auto;overscroll-behavior:contain;margin:0 -6px;padding:2px 6px 8px;scrollbar-width:thin}
.reorder-group+.reorder-group{margin-top:18px}
.reorder-group h3{position:sticky;top:0;z-index:2;display:flex;align-items:baseline;justify-content:space-between;margin:0 0 8px;padding:8px 2px;background:#f7f8f4;font:700 13px var(--font-display),sans-serif;color:var(--brand-primary)}
.reorder-group h3 span{font:400 11px var(--font-body),sans-serif;color:var(--muted)}
.reorder-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}
.reorder-item{display:grid;grid-template-columns:36px 22px 44px minmax(0,1fr) 34px;align-items:center;gap:10px;min-height:56px;padding:6px 8px 6px 4px;border:1px solid var(--line);border-radius:12px;background:#fff;box-sizing:border-box}
.reorder-item.is-hidden-item .reorder-text b{color:#7b857e}
.reorder-handle{display:grid;place-items:center;align-self:stretch;width:36px;border:0;border-radius:8px;background:none;color:#8b968e;cursor:grab;touch-action:none}
.reorder-handle svg{width:12px;height:20px;fill:currentColor}
.reorder-handle:hover{background:#f1f4ef;color:var(--brand-primary)}
.reorder-handle:focus-visible{outline:2px solid var(--brand-primary);outline-offset:1px}
.reorder-position{font:700 12px var(--font-display),sans-serif;color:var(--muted);text-align:center}
.reorder-thumb{width:44px;height:44px;border-radius:9px;object-fit:cover;background:var(--brand-surface)}
.reorder-thumb.is-empty{display:grid;place-items:center;font:700 16px var(--font-display),sans-serif;color:var(--brand-primary);background:var(--brand-surface)}
.reorder-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.reorder-text b{overflow:hidden;font-size:13px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap;color:#1f2a24}
.reorder-text small{font-size:11px;color:var(--muted)}
.reorder-badge{color:#a14b45}
.reorder-menu-wrap{position:relative}
.reorder-more{width:34px;height:34px;border:0;border-radius:8px;background:none;color:#6a776e;font-size:18px;line-height:1;cursor:pointer}
.reorder-more:hover,.reorder-more[aria-expanded=true]{background:#f1f4ef}
.reorder-more:focus-visible{outline:2px solid var(--brand-primary)}
.reorder-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:30;display:flex;flex-direction:column;min-width:190px;padding:6px;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 10px 30px #1f2a2426}
.reorder-menu[hidden]{display:none}
.reorder-menu button{padding:9px 10px;border:0;border-radius:6px;background:none;font:13px var(--font-body),sans-serif;color:#263830;text-align:left;cursor:pointer}
.reorder-menu button:hover:not(:disabled),.reorder-menu button:focus-visible{background:#f1f4ef;outline:none}
.reorder-menu button:disabled{color:#b6beb7;cursor:default}
/* Estados do arraste */
.reorder-item.is-lifted{position:fixed;z-index:1000;margin:0;pointer-events:none;border-color:var(--brand-primary);box-shadow:0 14px 34px #1f2a2433,0 2px 6px #1f2a241f;transform:rotate(.6deg) scale(1.01)}
.reorder-item.is-lifted .reorder-handle{cursor:grabbing}
.reorder-placeholder{border:2px dashed color-mix(in srgb,var(--brand-primary) 45%,#fff);border-radius:12px;background:color-mix(in srgb,var(--brand-primary) 6%,#fff);list-style:none;box-sizing:border-box}
.reorder-item.is-grabbed{border-color:var(--brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-primary) 22%,transparent)}
.reorder-item.is-grabbed .reorder-handle{color:var(--brand-primary);background:#f1f4ef}
.reorder-item.is-flash{animation:reorder-flash .9s ease}
@keyframes reorder-flash{0%{background:color-mix(in srgb,var(--brand-primary) 16%,#fff)}100%{background:#fff}}
.reorder-dialog.is-reordering,.reorder-dialog.is-reordering *{cursor:grabbing!important;user-select:none}
.reorder-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:22px;margin-top:10px}
.reorder-status{font-size:12px;color:var(--brand-primary)}
@media(prefers-reduced-motion:reduce){.reorder-item.is-lifted{transform:none}.reorder-item.is-flash{animation:none}}
@media(max-width:650px){.reorder-item{grid-template-columns:34px 18px 40px minmax(0,1fr) 32px;gap:8px}.reorder-thumb{width:40px;height:40px}.reorder-scroll{max-height:52dvh}}

/* Janela Categorias com abas */
#dialog.category-hub{width:min(760px,96vw);min-height:min(620px,90dvh);max-height:94dvh;box-sizing:border-box;padding:24px;background:#f7f8f4;overflow:auto}
#dialog.category-hub.reorder-dialog{display:flex;flex-direction:column;overflow:hidden}
.category-hub-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.category-hub-head h2{margin:6px 0 0;font:700 22px/1.2 var(--font-display),sans-serif;color:var(--brand-primary)}
.category-hub-head h2 span{font:500 13px var(--font-body),sans-serif;color:var(--muted)}
.category-hub-tabs{display:flex;gap:4px;margin:16px 0 14px;padding:4px;border-radius:12px;background:#eaeee7}
.category-hub-tabs [role=tab]{flex:1;padding:10px 12px;border:0;border-radius:9px;background:none;font:600 13px var(--font-body),sans-serif;color:#56665b;cursor:pointer}
.category-hub-tabs [role=tab][aria-selected=true]{background:#fff;color:var(--brand-primary);box-shadow:0 1px 3px #1f2a241f}
.category-hub-tabs [role=tab]:focus-visible{outline:2px solid var(--brand-primary);outline-offset:1px}
.category-hub .category-index-grid{margin-top:8px}
.category-hub-ordenar .reorder-form{flex:1;min-height:0;max-height:none}
@media(max-width:650px){#dialog.category-hub{padding:16px}.category-hub-head h2{font-size:19px}.category-hub .category-index-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
