.catalog-list-view { grid-template-columns: minmax(0, 1fr); }
.catalog-toolbar { min-width: 0; }
.catalog-search-field { min-width: 0; }
.catalog-actions { flex-wrap: wrap; }
/* Product catalog: one display row per exact name, original country groups retained. */
.catalog-list-view > .panel { container-type: inline-size; }
#catalogTable { width: 100%; min-width: 1120px; table-layout: fixed; }
#catalogTable th, #catalogTable td { min-width: 0; max-width: none; text-align: center; white-space: normal; overflow-wrap: anywhere; }
#catalogTable th { height:44px; padding:10px 8px; white-space:nowrap; overflow-wrap:normal; }
#catalogTable th:nth-child(1), #catalogTable td:nth-child(1) { width: 7%; }
#catalogTable th:nth-child(2), #catalogTable td:nth-child(2) { width: 22%; }
#catalogTable th:nth-child(3), #catalogTable td:nth-child(3) { width: 16%; }
#catalogTable th:nth-child(4), #catalogTable td:nth-child(4) { width: 10%; }
#catalogTable th:nth-child(5), #catalogTable td:nth-child(5) { width: 8%; }
#catalogTable th:nth-child(6), #catalogTable td:nth-child(6) { width: 7%; }
#catalogTable th:nth-child(7), #catalogTable td:nth-child(7) { width: 7%; position: static; box-shadow: none; }
#catalogTable th:nth-child(8), #catalogTable td:nth-child(8) { width: 10%; }
#catalogTable th:nth-child(9), #catalogTable td:nth-child(9) { width: 8%; }
#catalogTable th:nth-child(10), #catalogTable td:nth-child(10) { width: 5%; }
#catalogPendingOnly { width:16px; height:16px; min-height:16px; padding:0; }
#catalogTable td small { display: block; margin-top: 4px; }
.catalog-row-actions .link-btn.danger { color: var(--red); }
#catalogTable .catalog-row-actions { flex-wrap: wrap; gap: 12px; }
#catalogTable .catalog-row-actions .link-btn { white-space: nowrap; }
#catalogTable .catalog-image-button { display: inline-block; }
.catalog-image-button { border: 0; background: transparent; padding: 0; cursor: zoom-in; border-radius: 8px; }
.catalog-image-button img { display: block; width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #f7faff; }
#catalogAddView .catalog-product-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 20px; }
#catalogAddView .catalog-basic-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-image-pane { min-width: 0; }
.catalog-image-dropzone { border: 1px dashed #b6c8ef; border-radius: 10px; height: 152px; padding: 8px; cursor: pointer; background: #f8fbff; }
.catalog-image-dropzone:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
#catalogImagePreview { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
#catalogImagePreview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.catalog-image-plus { font-size: 28px; color: #6383bb; }
.catalog-image-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
#catalogCostUsdPreview { display: flex; align-items: center; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #f8fbff; }
.catalog-detail-summary { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.catalog-detail-image { display: flex; width: 140px; height: 110px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff; }
.catalog-detail-image img { width: 100%; height: 100%; border: 0; object-fit: contain; }
.catalog-detail-summary .detail-grid { margin: 0; }
.catalog-detail-summary .detail-card { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.catalog-original-groups { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; }
.catalog-original-groups > div { display: flex; justify-content: space-between; gap: 12px; }
.catalog-country-table { margin-top: 14px; }
.catalog-country-table table { width: 100%; min-width: 0; table-layout: fixed; }
.catalog-country-table th:first-child { width: 90px; }
.catalog-country-table th:nth-child(2) { width: 210px; }
.catalog-country-table th:last-child { width: 140px; }
.catalog-country-table td { white-space: normal; overflow-wrap: anywhere; }
.catalog-country-match { background: #eef5ff; }
@media (max-width: 900px) {
  #catalogAddView .catalog-product-layout { grid-template-columns: 1fr; gap: 16px; }
  .catalog-image-pane { width: 220px; max-width: 100%; }
  .catalog-country-table th:nth-child(2) { width: 170px; }
}
@media (max-width: 600px) {
  #catalogAddView .catalog-basic-fields { grid-template-columns: 1fr; }
  .catalog-image-button img { width: 48px; height: 48px; }
  .catalog-detail-summary { grid-template-columns: 1fr; }
  .catalog-country-table th:first-child { width: 56px; }
  .catalog-country-table th:nth-child(2) { width: 28%; }
  .catalog-country-table th:last-child { width: 80px; }
}

#catalogAddView .panel-body { container-type: inline-size; }
#catalogAddView .country-line { grid-template-columns: 130px minmax(0, .8fr) minmax(0, 1.4fr) 120px; }
@container (max-width: 750px) {
  #catalogAddView .catalog-product-layout { grid-template-columns: 1fr; gap: 16px; }
  #catalogAddView .catalog-image-pane { width: 220px; max-width: 100%; }
  #catalogAddView .country-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 400px) {
  #catalogAddView .catalog-basic-fields, #catalogAddView .country-line { grid-template-columns: 1fr; }
}

@container (max-width: 600px) {
  #catalogTable td { padding: 8px 5px; }
  .catalog-image-button img { width: 48px; height: 48px; }
}
