/* V3R catalog layer: existing catalog data, controls and member actions. */
body.catalog-page,
dialog.catalog-detail-dialog {
  --catalog-paper: #f7f3ee;
  --catalog-card: #fffdfa;
  --catalog-surface: #efe8df;
  --catalog-line: #e2d9cd;
  --catalog-divider: #d3c8ba;
  --catalog-navy: #1f2b40;
  --catalog-muted: #5f564d;
}

body.catalog-page { background: var(--catalog-paper); }
body.catalog-page main { max-width: 1328px; }
body.catalog-page .catalog-intro { padding: 12px 0 8px; gap: 20px; }
body.catalog-page .catalog-intro .eyebrow,
body.catalog-page .catalog-intro h1 br,
body.catalog-page .catalog-intro p:not(.eyebrow) { display: none; }
body.catalog-page .catalog-intro h1 { font-size: 28px; line-height: 1.4; letter-spacing: 0; color: var(--catalog-navy); }
body.catalog-page .catalog-intro h1 em { display: block; font-size: 15px; line-height: 1.6; color: var(--catalog-muted); }
body.catalog-page .catalog-intro-stat { gap: 3px; color: var(--catalog-navy); }
body.catalog-page .catalog-intro-stat strong { font-size: 34px; font-weight: 600; }
body.catalog-page .catalog-intro-stat span { font-size: 12px; }
body.catalog-page .catalog-intro-stat small { max-width: 180px; font-size: 11px; line-height: 1.6; }
body.catalog-page .catalog-section,
body.catalog-page.member-view .catalog-section { margin-top: 12px; }
body.catalog-page .catalog-section > .section-heading { gap: 16px; margin-bottom: 14px; }
body.catalog-page .catalog-section > .section-heading h2 { font-size: 20px; color: var(--catalog-navy); }
body.catalog-page .catalog-section > .section-heading .subtle { margin: 0; color: var(--catalog-muted); line-height: 1.6; }

/* Search and view remain immediately available; disclosure keeps every filter. */
body.catalog-page .catalog-toolbar {
  display: block;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--catalog-line);
  border-radius: 14px;
  background: var(--catalog-card);
  box-shadow: none;
}
body.catalog-page .catalog-toolbar-top { gap: 12px; margin-bottom: 8px; }
body.catalog-page .catalog-toolbar-top .filter-tabs { gap: 5px; }
body.catalog-page .catalog-toolbar-top .filter-tab {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--catalog-line);
  border-radius: 999px;
  background: var(--catalog-card);
  color: var(--catalog-navy);
  font-size: 14px;
}
body.catalog-page .catalog-toolbar-top .filter-tab.active {
  border-color: var(--catalog-navy);
  background: var(--catalog-navy);
  color: var(--catalog-card);
}
body.catalog-page .catalog-toolbar-top .search-field { max-width: 560px; min-width: 0; }
body.catalog-page .catalog-toolbar-top .search-field input {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--catalog-divider);
  border-radius: 8px;
  background: var(--catalog-card);
  color: var(--catalog-navy);
  font-size: 16px;
}
body.catalog-page .catalog-filter-panel { min-width: 0; border-top: 1px solid var(--catalog-line); }
body.catalog-page .catalog-filter-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 9px 1px 0;
  list-style: none;
  cursor: pointer;
  color: var(--catalog-navy);
  font-size: 14px;
  font-weight: 600;
}
body.catalog-page .catalog-filter-panel > summary::-webkit-details-marker { display: none; }
body.catalog-page .catalog-filter-panel > summary::after { content: '+'; font-size: 20px; font-weight: 400; }
body.catalog-page .catalog-filter-panel[open] > summary { padding-bottom: 12px; }
body.catalog-page .catalog-filter-panel[open] > summary::after { content: '−'; }
body.catalog-page .catalog-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
body.catalog-page .catalog-filters > .catalog-select,
body.catalog-page .catalog-filters > .brand-filter {
  min-width: 0;
  min-height: 60px;
  padding: 5px 10px;
  gap: 3px;
  border: 1px solid var(--catalog-line);
  border-radius: 8px;
  background: var(--catalog-card);
}
body.catalog-page .catalog-select label { font-size: 12px; color: var(--catalog-muted); letter-spacing: 0; }
body.catalog-page .catalog-select select { min-width: 0; min-height: 40px; font-size: 14px; font-weight: 500; color: var(--catalog-navy); }
body.catalog-page .catalog-select small { font-size: 11px; overflow-wrap: anywhere; }
body.catalog-page .brand-filter > summary { min-height: 54px; padding: 12px 0; font-size: 14px; color: var(--catalog-navy); overflow-wrap: anywhere; }
body.catalog-page .brand-filter > label { font-size: 12px; }
body.catalog-page .brand-filter input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
body.catalog-page .brand-options { max-height: 280px; overscroll-behavior: contain; }
body.catalog-page .brand-options button { min-height: 44px; font-size: 13px; overflow-wrap: anywhere; }
body.catalog-page .brand-options button[aria-pressed='true'] { background: var(--catalog-navy); color: var(--catalog-card); border-color: var(--catalog-navy); }
body.catalog-page .catalog-sort-row { gap: 16px; margin-top: 12px; }
body.catalog-page .catalog-sort-row .catalog-select { min-width: 0; }
body.catalog-page .catalog-sort-row select { width: auto; max-width: 230px; font-size: 14px; }
body.catalog-page .catalog-sort-row .clear-filters { min-height: 44px; font-size: 13px; color: var(--catalog-muted); }
body.catalog-page .date-anchor { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--catalog-muted); }
body.catalog-page .catalog-common-filters { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; margin-bottom: 6px; align-items: center; }
body.catalog-page .catalog-common-filters .catalog-sort-row { margin: 0; min-width: 0; justify-content: space-between; gap: 10px; }
body.catalog-page .catalog-common-filters .catalog-sort-row select { max-width: 145px; }
body.catalog-page .catalog-data-note { margin: 8px 0 0; }
body.catalog-page .catalog-controls-panel > summary { display: none; }
body.catalog-page .catalog-sort-select { display: grid; }
body.catalog-page .catalog-common-filters .clear-filters { min-height: 44px; margin: 0; white-space: nowrap; }
body.catalog-page .brand-filter > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
body.catalog-page .brand-filter > summary::-webkit-details-marker { display: none; }
body.catalog-page .brand-filter > summary::after { content: '+'; }
body.catalog-page .brand-filter[open] > summary::after { content: '−'; }

@media (max-width: 600px) {
  body.catalog-page .catalog-controls-panel > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-top: 1px solid var(--catalog-line); cursor: pointer; list-style: none; font-size: 14px; color: var(--catalog-navy); }
  body.catalog-page .catalog-controls-panel > summary::-webkit-details-marker { display: none; }
  body.catalog-page .catalog-controls-panel > summary::after { content: '+'; font-size: 20px; }
  body.catalog-page .catalog-controls-panel[open] > summary::after { content: '−'; }
  body.catalog-page .catalog-common-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.catalog-page .catalog-common-filters .clear-filters { justify-self: end; }
}

body.catalog-page .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
body.catalog-page .product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--catalog-line);
  border-radius: 14px;
  background: var(--catalog-card);
  box-shadow: 0 1px 2px #3c2d1e08;
}
body.catalog-page .product-card:hover { transform: none; box-shadow: 0 6px 18px #3c2d1e12; }
body.catalog-page .product-card > .product-image { flex: none; aspect-ratio: 4 / 5; background: var(--catalog-surface); }
body.catalog-page .product-card > .product-image img { object-fit: contain; object-position: center; transform: none; }
body.catalog-page .product-card > .product-meta,
body.catalog-page .product-card > .product-brand-title,
body.catalog-page .product-card > .product-name,
body.catalog-page .product-card > .product-tags,
body.catalog-page .product-card > .optional-preview { margin-left: 14px; margin-right: 14px; }
body.catalog-page .product-meta { gap: 6px; margin-top: 12px; margin-bottom: 4px; color: var(--catalog-muted); font-size: 11px; flex-wrap: wrap; }
body.catalog-page .product-brand-title { margin-top: 2px; margin-bottom: 4px; font-size: 12px; line-height: 1.6; color: var(--catalog-muted); font-weight: 500; }
body.catalog-page .product-card .product-name { margin-top: 0; font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--catalog-navy); }
body.catalog-page .product-tags { margin-top: 6px; margin-bottom: 6px; font-size: 11px; color: var(--catalog-muted); }
body.catalog-page .optional-preview { margin-top: 2px; margin-bottom: 12px; font-size: 12px; line-height: 1.6; color: var(--catalog-muted); }
body.catalog-page .optional-preview p { margin: 3px 0; line-height: inherit; overflow-wrap: anywhere; }
body.catalog-page .product-action {
  margin-top: auto;
  padding: 12px 14px;
  min-height: 48px;
  gap: 8px;
  background: var(--catalog-card);
  border-top: 1px solid var(--catalog-line);
  color: var(--catalog-navy);
  font-size: 13px;
  text-align: left;
  line-height: 1.5;
}
body.catalog-page .product-action > span:first-child { min-width: 0; overflow-wrap: anywhere; }
body.catalog-page .product-action > span:last-child { flex: none; }
body.catalog-page .catalog-pagination { padding: 22px 0 28px; font-size: 13px; color: var(--catalog-muted); }
body.catalog-page .catalog-pagination .secondary { min-height: 46px; padding: 10px 20px; border-radius: 999px; border-color: var(--catalog-divider); background: var(--catalog-card); color: var(--catalog-navy); }
body.catalog-page .empty-state { border-color: var(--catalog-divider); border-radius: 14px; background: var(--catalog-card); color: var(--catalog-muted); }

/* Product dialogs also open from the home page; scope to this dialog variant. */
dialog.catalog-detail-dialog { background: var(--catalog-paper); border: 1px solid var(--catalog-line); border-radius: 16px; color: var(--catalog-navy); }
dialog.catalog-detail-dialog .dialog-close { width: 44px; height: 44px; top: 10px; right: 10px; border: 1px solid var(--catalog-line); background: var(--catalog-card); color: var(--catalog-navy); }
dialog.catalog-detail-dialog .catalog-detail-layout { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
dialog.catalog-detail-dialog .catalog-detail-media { background: var(--catalog-surface); }
dialog.catalog-detail-dialog .catalog-detail-media .detail-image { object-fit: contain; object-position: center; }
dialog.catalog-detail-dialog .catalog-detail-content { padding: 36px 28px 28px; }
dialog.catalog-detail-dialog .catalog-detail-content > .eyebrow { margin-bottom: 8px; color: var(--catalog-muted); font-size: 10px; }
dialog.catalog-detail-dialog .catalog-detail-content h2 { padding-right: 22px; font-size: 27px; line-height: 1.4; letter-spacing: 0; }
dialog.catalog-detail-dialog .detail-id { margin: 8px 0; font-size: 12px; color: var(--catalog-muted); }
dialog.catalog-detail-dialog .preview-tags { margin: 8px 0; font-size: 12px; line-height: 1.7; color: var(--catalog-muted); }
dialog.catalog-detail-dialog .optional-preview { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--catalog-line); border-radius: 10px; background: var(--catalog-card); font-size: 13px; color: var(--catalog-muted); }
dialog.catalog-detail-dialog .optional-preview:empty { display: none; }
dialog.catalog-detail-dialog .optional-preview p { margin: 4px 0; line-height: 1.6; }
dialog.catalog-detail-dialog .microcopy { font-size: 12px; line-height: 1.75; color: var(--catalog-muted); }
dialog.catalog-detail-dialog .dialog-actions { gap: 9px; margin: 16px 0; }
dialog.catalog-detail-dialog .dialog-actions > button { min-height: 48px; min-width: 140px; padding: 12px 14px; border-radius: 999px; font-size: 14px; line-height: 1.5; }
dialog.catalog-detail-dialog .dialog-actions > .primary { background: var(--catalog-navy); border-color: var(--catalog-navy); color: var(--catalog-card); }
dialog.catalog-detail-dialog .dialog-actions > .secondary { background: var(--catalog-card); border-color: var(--catalog-divider); color: var(--catalog-navy); }
dialog.catalog-detail-dialog .dialog-actions > .primary:hover:not(:disabled) { background: #2e3d58; }
dialog.catalog-detail-dialog .locked-fields { margin: 20px 0; padding: 18px; border-color: var(--catalog-navy); border-radius: 14px; background: var(--catalog-navy); color: var(--catalog-card); }
dialog.catalog-detail-dialog .locked-fields h3 { margin-bottom: 12px; font-size: 16px; line-height: 1.5; }
dialog.catalog-detail-dialog .locked-fields dl { gap: 12px; font-size: 12px; line-height: 1.6; }
dialog.catalog-detail-dialog .locked-fields dt { color: #f1eae1; }
dialog.catalog-detail-dialog .locked-fields dd { color: #c8cdd6; }
dialog.catalog-detail-dialog .locked-fields .microcopy { margin-bottom: 0; color: #e2dcd3; }
dialog.catalog-detail-dialog .detail-list { font-size: 14px; grid-template-columns: 98px minmax(0, 1fr); }
dialog.catalog-detail-dialog .detail-list dt,
dialog.catalog-detail-dialog .detail-list dd { border-color: var(--catalog-line); }
dialog.catalog-detail-dialog .detail-list dt { color: var(--catalog-muted); }
dialog.catalog-detail-dialog .selection-toggle { min-height: 46px; border-radius: 999px; }
dialog.catalog-detail-dialog .feedback-buttons .secondary { min-height: 44px; border-radius: 999px; }
dialog.catalog-detail-dialog .catalog-detail-content > .text-button { min-height: 44px; font-size: 13px; color: var(--catalog-muted); }

@media (max-width: 980px) and (min-width: 701px) {
  body.catalog-page .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.catalog-page .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog.catalog-detail-dialog .catalog-detail-content { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 700px) {
  body.catalog-page main { padding: 0 16px; }
  body.catalog-page .legal-update-notice { margin: 10px 0; padding: 10px 12px; font-size: 12px; line-height: 1.65; }
  body.catalog-page .legal-update-notice .legal-links { gap: 0 14px; }
  body.catalog-page .catalog-intro { padding: 10px 0 8px; gap: 8px; align-items: center; }
  body.catalog-page .catalog-intro > div:first-child { min-width: 0; }
  body.catalog-page .catalog-intro .eyebrow,
  body.catalog-page .catalog-intro h1 br,
  body.catalog-page .catalog-intro h1 em,
  body.catalog-page .catalog-intro p:not(.eyebrow) { display: none; }
  body.catalog-page .catalog-intro h1 { font-size: 22px; line-height: 1.4; }
  body.catalog-page .catalog-intro-stat { max-width: 140px; padding-top: 0; }
  body.catalog-page .catalog-intro-stat strong { font-size: 23px; }
  body.catalog-page .catalog-intro-stat span { font-size: 10px; }
  body.catalog-page .catalog-intro-stat small { font-size: 10px; line-height: 1.5; }
  body.catalog-page .catalog-section,
  body.catalog-page.member-view .catalog-section { margin-top: 8px; }
  body.catalog-page .catalog-section > .section-heading { margin-bottom: 8px; }
  body.catalog-page .catalog-section > .section-heading .eyebrow { display: none; }
  body.catalog-page .catalog-section > .section-heading { align-items: center; gap: 10px; }
  body.catalog-page .catalog-section > .section-heading h2 { font-size: 18px; }
  body.catalog-page .catalog-section > .section-heading .subtle { max-width: 52%; font-size: 11px; text-align: right; }
  body.catalog-page .catalog-toolbar { padding: 10px; margin-bottom: 12px; }
  body.catalog-page .catalog-toolbar-top { gap: 10px; margin-bottom: 10px; }
  body.catalog-page .catalog-toolbar-top .filter-tabs { flex-wrap: nowrap; }
  body.catalog-page .catalog-toolbar-top .filter-tab { flex: 1; padding: 8px 12px; font-size: 13px; }
  body.catalog-page .catalog-toolbar-top .search-field { width: 100%; max-width: none; }
  body.catalog-page .catalog-filter-panel > summary { min-height: 44px; padding-top: 8px; font-size: 13px; }
  body.catalog-page .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.catalog-page .catalog-filters > .catalog-select,
  body.catalog-page .catalog-filters > .brand-filter { min-height: 72px; padding: 8px; }
  body.catalog-page .catalog-select label { font-size: 11px; }
  body.catalog-page .catalog-select select { font-size: 14px; min-height: 40px; }
  body.catalog-page .brand-filter > summary { min-height: 54px; font-size: 13px; }
  body.catalog-page .catalog-sort-row { gap: 8px; justify-content: space-between; }
  body.catalog-page .catalog-sort-row .catalog-select { flex: 1; gap: 6px; }
  body.catalog-page .catalog-sort-row select { max-width: 160px; width: 100%; font-size: 13px; }
  body.catalog-page .catalog-sort-row .clear-filters { flex: none; font-size: 12px; }
  body.catalog-page .catalog-common-filters .catalog-sort-row { grid-column: 1 / -1; }
  body.catalog-page .date-anchor { font-size: 11px; }
  body.catalog-page .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  body.catalog-page .product-card { border-radius: 12px; }
  body.catalog-page .product-card > .product-meta,
  body.catalog-page .product-card > .product-brand-title,
  body.catalog-page .product-card > .product-name,
  body.catalog-page .product-card > .product-tags,
  body.catalog-page .product-card > .optional-preview { margin-left: 10px; margin-right: 10px; }
  body.catalog-page .product-meta { margin-top: 10px; font-size: 10px; line-height: 1.5; }
  body.catalog-page .product-brand-title { font-size: 11px; }
  body.catalog-page .product-card .product-name { font-size: 14px; line-height: 1.5; }
  body.catalog-page .product-tags { font-size: 10px; }
  body.catalog-page .optional-preview { font-size: 11px; line-height: 1.6; }
  body.catalog-page .product-action { min-height: 46px; padding: 10px; font-size: 12px; }
  body.catalog-page .catalog-pagination { gap: 10px; padding-top: 18px; font-size: 12px; }
  body.catalog-page .catalog-pagination p { margin: 0; }
  body.catalog-page .catalog-pagination .secondary { flex: 1; }
  dialog.catalog-detail-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
  dialog.catalog-detail-dialog .catalog-detail-layout { grid-template-columns: minmax(0, 1fr); }
  dialog.catalog-detail-dialog .catalog-detail-media { position: static; }
  dialog.catalog-detail-dialog .catalog-detail-media .detail-image { height: 32svh; min-height: 180px; max-height: 280px; }
  dialog.catalog-detail-dialog .catalog-detail-media > .product-placeholder { min-height: 180px; }
  dialog.catalog-detail-dialog .catalog-detail-content { padding: 20px 18px 24px; }
  dialog.catalog-detail-dialog .catalog-detail-content h2 { padding-right: 0; font-size: 23px; line-height: 1.4; }
  dialog.catalog-detail-dialog .catalog-detail-content > .eyebrow { margin-bottom: 6px; }
  dialog.catalog-detail-dialog .detail-id,
  dialog.catalog-detail-dialog .preview-tags { margin: 6px 0; font-size: 11px; }
  dialog.catalog-detail-dialog .optional-preview { margin: 10px 0; padding: 10px 12px; font-size: 12px; }
  dialog.catalog-detail-dialog .dialog-actions { gap: 8px; margin: 12px 0; }
  dialog.catalog-detail-dialog .dialog-actions > button { flex-basis: 100%; min-width: 0; min-height: 48px; font-size: 14px; }
  dialog.catalog-detail-dialog .locked-fields { margin: 16px 0; padding: 15px; }
  dialog.catalog-detail-dialog .locked-fields h3 { font-size: 15px; }
  dialog.catalog-detail-dialog .locked-fields dl { gap: 11px; font-size: 12px; }
  dialog.catalog-detail-dialog .detail-list { grid-template-columns: 88px minmax(0, 1fr); font-size: 13px; }
  dialog.catalog-detail-dialog .microcopy { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  body.catalog-page .product-card { transition: none; }
}

@media (min-width: 601px) {
  body.catalog-page .catalog-common-filters > .catalog-select { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px 10px; }
  body.catalog-page .catalog-common-filters .catalog-select label { flex: none; }
  body.catalog-page .catalog-common-filters .catalog-select select { flex: 1; width: 0; min-height: 44px; }
}
