.product-catalog {
  --pc-ink: #20354d;
  --pc-muted: #52667d;
  --pc-line: #dce6f0;
  --pc-accent: #1762b8;
  --pc-paper: #fff;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
  color: var(--pc-ink);
}

.product-catalog .pc-heading,
.product-catalog .pc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-catalog .pc-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}

.product-catalog h2,
.product-catalog h3 { margin: 0; line-height: 1.32; }
.product-catalog h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; }
.product-catalog h3 { font-size: 20px; }
.product-catalog .pc-toolbar { margin: 0 0 12px; }
.product-catalog .pc-toolbar input { width: min(280px, 100%); }
.product-catalog .pc-count,
.product-catalog .pc-muted { color: var(--pc-muted); font-size: 13px; }
.product-catalog .pc-muted { margin: 0; }

.product-catalog button,
.product-catalog select,
.product-catalog input:not([type='checkbox']) {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--pc-line);
  border-radius: 8px;
  background: var(--pc-paper);
  color: inherit;
  font: inherit;
}

.product-catalog button { cursor: pointer; font-weight: 600; }
.product-catalog button:hover:not(:disabled) { background: #f0f6fd; }
.product-catalog button:disabled { opacity: .54; cursor: not-allowed; }
.product-catalog :focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.product-catalog input[type='checkbox'] { margin: 0; accent-color: var(--pc-accent); }
.product-catalog .pc-primary { border-color: var(--pc-accent); background: var(--pc-accent); color: white; }
.product-catalog .pc-primary:hover:not(:disabled) { background: #115698; }

.product-catalog .pc-message,
.product-catalog .pc-empty,
.product-catalog .pc-error,
.product-catalog .pc-notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f1f6fc;
  color: var(--pc-muted);
}

.product-catalog .pc-error { background: #fff2ed; color: #962f24; }
.product-catalog .pc-notice { background: #eaf7ef; color: #22543b; }
.product-catalog .pc-error button { margin-left: 6px; }
.product-catalog .pc-empty { margin: 0; border-radius: 0; background: var(--pc-paper); }

.product-catalog .pc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  background: var(--pc-paper);
}

.product-catalog .pc-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.product-catalog .pc-table :is(th, td) { padding: 12px 14px; vertical-align: top; }
.product-catalog .pc-table th { text-align: left; }
.product-catalog .pc-table thead { background: #ebf2fa; }
.product-catalog .pc-table tbody tr { border-top: 1px solid var(--pc-line); }
.product-catalog .pc-table tbody tr:hover { background: #f8fbff; }
.product-catalog .pc-table [scope='row'] { min-width: 112px; overflow-wrap: anywhere; }
.product-catalog .pc-table td:last-child,
.product-catalog .pc-table-edit { white-space: nowrap; }
.product-catalog .pc-table-edit { min-height: 32px; padding: 4px 10px; }
.product-catalog .pc-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: #e7f5ec;
  color: #22563b;
  white-space: nowrap;
}
.product-catalog .pc-inactive { background: #eff2f6; color: #4e5f73; }
.product-catalog .pc-pending { color: #76551b; }
.product-catalog .pc-table .pc-pending { display: block; white-space: nowrap; }

.product-catalog .pc-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(740px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 20px;
  background: #eff6fe;
  color: var(--pc-ink);
  box-shadow: 0 22px 80px #182e4c50;
}

.product-catalog .pc-dialog::backdrop { background: #15294458; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .product-catalog .pc-dialog {
    background: linear-gradient(135deg, #fffffff0, #e8f2fce3);
    -webkit-backdrop-filter: blur(16px) saturate(125%);
    backdrop-filter: blur(16px) saturate(125%);
  }
  .product-catalog .pc-dialog::backdrop {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
}

.product-catalog .pc-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 36px); margin: 0; }
.product-catalog .pc-dialog-head,
.product-catalog .pc-dialog-foot { flex-shrink: 0; padding: 16px 22px; background: #ffffff66; }
.product-catalog .pc-dialog-head { border-bottom: 1px solid var(--pc-line); }
.product-catalog .pc-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--pc-line);
}

.product-catalog .pc-dialog-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 18px 22px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
}

.product-catalog .pc-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
}

.product-catalog .pc-field :is(input, select) { width: 100%; min-width: 0; font-weight: 400; }
.product-catalog .pc-choices {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--pc-line);
  border-radius: 10px;
}

.product-catalog .pc-choices legend { padding: 0 5px; font-size: 14px; font-weight: 600; }
.product-catalog .pc-choice-list { display: flex; gap: 8px 14px; flex-wrap: wrap; }
.product-catalog .pc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; overflow-wrap: anywhere; }
.product-catalog .pc-check small { color: var(--pc-muted); font-size: 12px; }
.product-catalog .pc-listing {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pc-line);
}

.product-catalog .pc-listing-note { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.product-catalog .pc-remove { color: #7f352d; white-space: nowrap; }
.product-catalog .pc-add-listing + .pc-muted { margin-top: 6px; }

@media (max-width: 620px) {
  .product-catalog .pc-listing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-catalog .pc-dialog-head,
  .product-catalog .pc-dialog-body,
  .product-catalog .pc-dialog-foot { padding-inline: 14px; }
  .product-catalog .pc-table :is(th, td) { padding: 10px 12px; }
}
