.categories-page { max-width: 1240px; margin-inline: auto; }
.categories-page .products-heading { margin-bottom: 20px; }
.categories-page .products-panel { padding: 20px 22px 24px; }
.category-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 210px) auto; align-items: center; gap: 12px; }
.category-toolbar .product-search { width: 100%; min-width: 0; min-height: 44px; }
.category-toolbar select,.category-add input,.category-picker-tools input { min-width: 0; min-height: 44px; padding: 10px 13px; border: 1px solid #e6e1ec; border-radius: 10px; background: #fff; color: #30283c; font: inherit; font-size: 12px; }
.category-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; white-space: nowrap; }
.category-refresh img { width: 17px; height: 17px; }
.category-refresh[aria-busy="true"] img { animation: category-refresh-spin .8s linear infinite; }
.category-refresh:disabled { cursor: wait; opacity: .7; }
@keyframes category-refresh-spin { to { transform: rotate(360deg); } }
.category-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; min-height: 48px; gap: 3px; margin: 10px 0 14px; padding: 0 2px; color: #8a8092; font-size: 12px; line-height: 1.9; }
.category-breadcrumb button,.category-picker-crumb button { border: 0; padding: 3px 5px; border-radius: 6px; background: transparent; color: #7552a4; font: inherit; cursor: pointer; }
.category-breadcrumb button:hover,.category-picker-crumb button:hover { background: #f3eef8; }
.category-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 8px; padding: 16px; border: 1px solid #ece6f1; border-radius: 13px; background: #faf8fc; }
.category-add input { width: 100%; }
.category-add input::placeholder { color: #a197a9; }
.category-add .button-primary { min-height: 42px; white-space: nowrap; }
.category-message { min-height: 18px; margin: 8px 3px 12px; color: #7055a0; font-size: 12px; }
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; margin: 10px 0; padding: 15px 17px; border: 1px solid #ece8f0; border-radius: 13px; background: #fff; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.category-row:hover { border-color: #ddd2e9; background: #fdfcff; box-shadow: 0 3px 12px #30204408; }
.category-row-info { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.5fr); align-items: center; gap: 4px 14px; min-width: 0; }
.category-row-info strong { overflow-wrap: anywhere; color: #30283c; font-size: 14px; }
.category-row-info small { grid-column: 1 / -1; overflow-wrap: anywhere; color: #83788d; font-size: 11px; }
.category-row-info span { color: #92889a; font-size: 11px; }
.category-row-actions { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.category-row-actions .button-secondary { white-space: nowrap; }
.category-delete { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 1px solid #f1dfe2; border-radius: 10px; background: #fff8f8; color: #b65365; font-size: 20px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.category-delete:hover { border-color: #e8c4ca; background: #fff0f1; }
.category-delete img { display: block; width: 19px; height: 19px; filter: brightness(0) saturate(100%) invert(35%) sepia(25%) saturate(1894%) hue-rotate(302deg) brightness(87%) contrast(86%); }
.category-empty { margin: 10px 0; padding: 32px 16px; border: 1px dashed #e4dce9; border-radius: 12px; background: #fcfbfd; color: #8d8495; text-align: center; }
.categories-page > .products-panel > .category-more { display: block; margin: 18px auto 0; }
.categories-page > .products-panel > .category-more[hidden],.category-picker .category-more[hidden] { display: none; }

/* Product editor category picker */
.category-picker { display: block !important; }
.category-selected { margin: 7px 0 11px; padding: 11px 13px; border: 1px solid #ece5f3; border-radius: 10px; background: #f8f5fb; color: #6345a0; overflow-wrap: anywhere; }
.category-picker-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.category-picker-tools input { flex: 1; }
.category-picker-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 7px 0; color: #8a8092; font-size: 11px; line-height: 1.8; }
.category-picker-list { max-height: 260px; overflow: auto; border: 1px solid #ece8f0; border-radius: 11px; background: #fff; }
.category-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: 7px 11px; border-bottom: 1px solid #f0edf3; }
.category-picker-row:last-child { border-bottom: 0; }
.category-pick-name,.category-open { border: 0; background: none; font: inherit; text-align: right; cursor: pointer; }
.category-pick-name { flex: 1; min-width: 0; color: #393246; overflow-wrap: anywhere; }
.category-pick-name:hover,.category-open:hover { color: #7353b0; }
.category-open { flex: none; color: #7353b0; font-size: 11px; white-space: nowrap; }
.category-leaf { flex: none; color: #8f8696; font-size: 11px; }
.category-picker .category-more { margin-top: 10px; }

@media (max-width: 800px) {
  .categories-page .products-panel { padding: 16px; }
  .category-row { grid-template-columns: 1fr; gap: 12px; }
  .category-row-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .categories-page .products-panel { padding: 12px; }
  .category-toolbar { grid-template-columns: 1fr; }
  .category-toolbar select { width: 100%; }
  .category-refresh { width: 100%; }
  .category-add { grid-template-columns: 1fr; padding: 13px; }
  .category-add .button-primary { width: 100%; }
  .category-row { margin: 9px 0; padding: 13px; }
  .category-row-info { grid-template-columns: 1fr; gap: 4px; }
  .category-row-info small { grid-column: auto; }
  .category-row-actions { justify-content: space-between; }
  .category-row-actions .button-secondary { flex: 1; }
  .category-picker-tools input { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .category-row,.category-delete { transition: none; } }

.categories-page .category-page-heading { margin-bottom: 8px; padding: 12px 14px; }
.categories-page .category-page-heading h1 { margin: 3px 0; font-size: 17px; }
.categories-page .products-panel { padding: 14px; }
.categories-page .category-toolbar { grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) auto; gap: 8px; }
.categories-page .category-toolbar .product-search,.categories-page .category-toolbar select,.categories-page .category-refresh { min-height: 38px; }
.categories-page .category-breadcrumb { min-height: 34px; margin: 8px 0; padding: 2px 8px; border-radius: 8px; background: #faf8fc; }
.categories-page .category-add { grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto; gap: 10px; padding: 12px; margin-bottom: 0; }
.category-add-heading { display: grid; gap: 3px; }
.category-add-heading strong { color: #51435c; font-size: 12px; }
.category-add-heading small { color: #918397; font-size: 10px; }
.categories-page .category-add input,.categories-page .category-add .button-primary { min-height: 38px; }
.categories-page .category-message:empty { min-height: 0; margin: 0; }
.categories-page .category-list { margin-top: 12px; border: 1px solid #eeeaf2; border-radius: 11px; overflow: hidden; }
.categories-page .category-row { grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) auto; gap: 14px; margin: 0; padding: 11px 12px; border: 0; border-radius: 0; box-shadow: none; }
.categories-page .category-row + .category-row { border-top: 1px solid #f0ecf3; }
.category-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.category-row-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: #f4edf9; color: #9974b7; }
.category-row-icon svg { width: 21px; height: 21px; }
.categories-page .category-row-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.categories-page .category-row-info strong { font-size: 12px; }
.categories-page .category-row-info small { grid-column: auto; font-size: 10px; }
.category-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #83788d; font-size: 11px; }
.category-kind { padding: 4px 7px; border-radius: 7px; background: #f4f1f6; color: #83788d; white-space: nowrap; }
.category-kind.is-branch { background: #f0e9fb; color: #7653a0; }
.categories-page .category-row-actions .button-secondary { padding: 6px 10px; font-size: 11px; }
.categories-page .category-row-actions .category-delete { width: 34px; height: 34px; }
.categories-page .category-empty { margin: 0; border: 0; }
@media (max-width: 800px) {
  .categories-page .category-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .category-row-meta { grid-column: 1; }
  .categories-page .category-row-actions { grid-column: 2; grid-row: 1 / 3; }
  .categories-page .category-add { grid-template-columns: minmax(0, 1fr) auto; }
  .category-add-heading { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .categories-page .category-toolbar { grid-template-columns: 1fr 1fr; }
  .categories-page .category-toolbar .product-search { grid-column: 1 / -1; }
  .categories-page .category-add { grid-template-columns: 1fr; }
  .category-add-heading { grid-column: auto; }
  .categories-page .category-row { grid-template-columns: 1fr; }
  .categories-page .category-row-actions { grid-column: 1; grid-row: auto; }
}
