/* ─────────────────────────────────────────────────────────────────
   /catalog — page-scoped under .page-catalog
   ───────────────────────────────────────────────────────────────── */

.page-catalog .catalog-head {
  background:
    radial-gradient(circle at 90% 0%, rgba(29,78,216,0.05), transparent 50%),
    var(--bg-page);
  padding: var(--sp-7) 0 var(--sp-5);
}
@media (min-width: 768px) { .page-catalog .catalog-head { padding: var(--sp-8) 0 var(--sp-6); } }

.page-catalog .catalog-head h1 { font-size: clamp(40px, 7vw, 64px); }

.page-catalog .catalog-body { padding-top: var(--sp-7); }

.page-catalog .catalog-cat { margin-bottom: var(--sp-5); }
.page-catalog .catalog-cat:last-child { margin-bottom: 0; }

/* Collapsible header — full-width clickable bar with title, count, chevron */
.page-catalog .catalog-cat__toggle {
  appearance: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4) var(--sp-3);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.page-catalog .catalog-cat__toggle:hover {
  background: var(--bg-section);
  border-bottom-color: var(--text-tertiary);
}
.page-catalog .catalog-cat__toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-md);
}
.page-catalog .catalog-cat__title {
  flex: 1;
  font-family: var(--ff-display);
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: var(--tracking-heading);
  margin: 0;
  padding: 0;
  border: none;
}
.page-catalog .catalog-cat__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 var(--sp-2);
  background: var(--bg-section);
  border: 1px solid var(--border-default);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
}
.page-catalog .catalog-cat__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--text-tertiary);
  transition: transform var(--t-base), color var(--t-fast);
}
.page-catalog .catalog-cat__toggle.is-open .catalog-cat__chevron {
  transform: rotate(180deg);
  color: var(--cta-bg);
}
.page-catalog .catalog-cat__toggle.is-open {
  border-bottom-color: var(--cta-bg);
}
.page-catalog .catalog-cat__toggle.is-open .catalog-cat__count {
  background: var(--bcf-amber-light);
  color: var(--cta-bg);
  border-color: var(--cta-bg);
}

/* Grid spacing when expanded */
.page-catalog .catalog-cat .catalog-grid { margin-top: var(--sp-5); }

/* Sticky type filter — pills above the grid. */
.page-catalog .catalog-filter {
  position: sticky;
  top: 56px; /* clears the fixed nav */
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--sp-5);
}
.page-catalog .catalog-filter__pill {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
}
.page-catalog .catalog-filter__pill:hover {
  border-color: var(--brand);
  color: var(--text-primary);
}
.page-catalog .catalog-filter__pill.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.page-catalog .catalog-filter__pill:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.page-catalog .catalog-filter__count {
  background: rgba(0,0,0,0.06);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 1.7em;
  text-align: center;
}
.page-catalog .catalog-filter__pill.is-active .catalog-filter__count {
  background: rgba(255,255,255,0.25);
}

.page-catalog .catalog-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 600px)  { .page-catalog .catalog-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .page-catalog .catalog-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); } }

/* Footnote under the price showing the auto-attached dev/install fee on
   apps when "Buy outright" is selected. Subtle so it doesn't compete
   with the headline price. */
.page-catalog .bcf-product__install-note {
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  font-style: italic;
  letter-spacing: 0.01em;
}

/* Mode toggle (Buy outright / Subscribe) on dual-priced product cards.
   Horizontal margin matches the var(--sp-5) gutter used by .bcf-product__body
   and .bcf-product__price so the pill aligns with the rest of the card content. */
.page-catalog .bcf-product__mode {
  display: inline-flex;
  background: var(--bg-tertiary, #f1f5f9);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 3px;
  margin: 0 var(--sp-5) var(--sp-3);
  gap: 2px;
}
.page-catalog .bcf-product__mode-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
  letter-spacing: 0.01em;
}
.page-catalog .bcf-product__mode-pill:hover { color: var(--text-primary); }
.page-catalog .bcf-product__mode-pill.is-active {
  background: var(--bg-page, #fff);
  color: var(--brand, #1d4ed8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.page-catalog .bcf-product__mode-pill:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
