/* Menu organization uses the same quiet controls as the merchant settings. */
.category-manager { display: grid; gap: 1rem; min-width: 0; }
.category-intro { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.category-intro > p { min-width: 0; line-height: 1.5; }
.category-intro > span { flex: none; font-variant-numeric: tabular-nums; }
.category-list { display: grid; gap: .875rem; min-width: 0; }
.category-row { min-width: 0; padding: 1rem; border: 1px solid var(--line-200); border-radius: var(--radius); background: var(--paper-50); }
.category-row-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .625rem; margin-bottom: .75rem; }
.category-index { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--radius-sm); background: var(--paper-200); font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.category-count { min-width: 0; flex: 1 1 auto; color: var(--ink-600); font-size: var(--text-sm); overflow-wrap: anywhere; }
.category-order-actions { display: flex; gap: .375rem; border: 0; padding: 0; margin: 0 0 0 auto; }
.category-order-actions .icon-button { min-width: 44px; min-height: 44px; background: transparent; }
.category-delete { color: var(--danger-600); }
.category-name-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem; padding: 0; margin: 0; border: 0; min-width: 0; }
.category-name-fields input { width: 100%; min-width: 0; min-height: 44px; }
.category-required { color: var(--danger-600); }
.category-delete-hint { margin-top: .75rem; font-size: var(--text-xs); color: var(--ink-600); line-height: 1.5; }
.category-readonly-name { display: grid; gap: .25rem; overflow-wrap: anywhere; }
.category-readonly-name span { color: var(--ink-600); font-size: var(--text-sm); }
.category-add { justify-self: start; max-width: 100%; }
.category-empty { display: grid; gap: .5rem; padding: 1.5rem 1rem; background: var(--paper-100); border-radius: var(--radius); }
.category-empty h3 { font-size: var(--text-base); }
.category-empty p { font-size: var(--text-sm); color: var(--ink-600); line-height: 1.5; }
.category-feedback { display: grid; gap: .5rem; padding: .875rem; border: 1px solid var(--warning-border); border-radius: var(--radius); color: var(--ink-900); background: var(--warning-50); font-size: var(--text-sm); line-height: 1.5; }
.category-feedback button { justify-self: start; }
.category-footer { display: grid; gap: .625rem; }
.category-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; }
.category-actions .button { min-height: 44px; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.category-loading { display: flex; align-items: center; gap: .625rem; padding-block: .75rem; color: var(--ink-600); font-size: var(--text-sm); }
.product-category-field { display: grid; gap: .5rem; min-width: 0; }
.product-category-field .field { min-width: 0; }
.product-category-field select { min-width: 0; width: 100%; }
.product-category-field select[hidden] { display: none; }
.product-category-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  width: 100%; min-width: 0; min-height: var(--control-min); padding: .625rem .875rem;
  border: 1px solid var(--line-300); border-radius: var(--radius);
  background: #fff; color: var(--ink-900); font: inherit; line-height: 1.5; text-align: start;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.product-category-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-category-trigger > .icon { flex: none; width: 1rem; height: 1rem; color: var(--ink-600); transition: transform .15s var(--ease); }
.product-category-trigger.is-placeholder { color: var(--ink-600); }
.product-category-trigger:hover:not(:disabled) { border-color: var(--ink-400); background: var(--paper-50); }
.product-category-trigger:focus-visible, .product-category-trigger[aria-expanded="true"] { outline: none; border-color: var(--brand-600); box-shadow: var(--focus); }
.product-category-trigger[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.product-category-trigger[aria-invalid="true"] { border-color: var(--danger-600); }
.product-category-trigger:disabled { cursor: not-allowed; background: var(--paper-100); color: var(--ink-600); opacity: .7; }
.product-category-popover {
  --picker-surface: #fff;
  position: fixed; inset: auto; margin: 0; padding: .375rem;
  border: 1px solid var(--line-200); border-radius: var(--radius-lg);
  background: var(--picker-surface); color: var(--ink-900); box-shadow: var(--shadow-2);
  overflow: hidden; font-size: var(--text-base); line-height: 1.5;
}
.product-category-popover:popover-open { display: flex; flex-direction: column; }
.product-category-popover::backdrop { background: transparent; }
.product-category-popover-head { display: flex; justify-content: space-between; gap: .75rem; flex: none; padding: .375rem .5rem .625rem; color: var(--ink-600); font-size: var(--text-xs); }
.product-category-popover-head > span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.product-category-options { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-300) transparent; }
.product-category-option { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: var(--control-min); padding: .625rem .75rem; border-radius: var(--radius-sm); cursor: pointer; }
.product-category-option > span { min-width: 0; overflow-wrap: anywhere; }
.product-category-option > .icon { width: 1rem; height: 1rem; flex: none; visibility: hidden; }
.product-category-option[aria-selected="true"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.product-category-option[aria-selected="true"] > .icon { visibility: visible; }
.product-category-option:hover, .product-category-option.is-active { background: var(--paper-100); }
.product-category-option[aria-selected="true"]:is(:hover, .is-active) { background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-100); }
.product-category-empty { margin: 0; padding: .75rem; color: var(--ink-600); font-size: var(--text-sm); }
[data-theme="dark"] .product-category-popover, [data-theme="dark"] .product-category-trigger { --picker-surface: #242424; --ink-900: #f5f5f5; --ink-600: #c1b8b1; --paper-100: #333; --line-200: #4a433e; --line-300: #62564d; --brand-50: #452c29; --brand-100: #77504a; --brand-700: #ffd0c8; background: var(--picker-surface); }
@media (max-width: 767px) { .product-category-trigger, .product-category-popover { font-size: max(1rem, var(--text-base)); } }
@media (prefers-reduced-motion: reduce) { .product-category-trigger, .product-category-trigger > .icon { transition: none; } }
.product-category-field .text-button { justify-self: start; min-height: 44px; max-width: 100%; padding-inline: 0; text-align: start; white-space: normal; overflow-wrap: anywhere; }
.product-category-status { color: var(--ink-600); font-size: var(--text-sm); line-height: 1.5; }
[data-theme="dark"] .category-row, [data-theme="dark"] .category-empty { background: #242424; color: #f5f5f5; }
@media (max-width: 479px) {
  .category-row { padding: .75rem; }
  .category-name-fields { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .category-order-actions { flex-basis: 100%; justify-content: flex-end; }
  .category-actions .button { flex: 1 1 auto; }
}
