/* ============================================================================
   VGNW — PC builder on the hardware catalog (inc/pc-builder.php, assets/js/pc-builder.js).
   The kit's pcbuild.css (in the pc-build bundle) does the layout; this file adds what the real catalog needs:
   section heads (carts.css is not in the bundle), product tiles, the picker's filter row, "unknown" checks,
   optional slots. Tokens only, monochrome.
   ============================================================================ */

/* Section heads of the hub (kit carts.css, not part of the pc-build bundle). */
.vgnw-pbx .vgnw-ct-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle); }
.vgnw-pbx .vgnw-ct-sechead-l { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; }
.vgnw-pbx .vgnw-ct-h2 { font-family: var(--font-deck); font-weight: 600; font-size: 26px; letter-spacing: 0; margin: 0; }
.vgnw-pbx .vgnw-ct-seccount { font-family: var(--font-micro); font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.vgnw-pbx .vgnw-breadcrumb { margin-bottom: 0; }
.vgnw-pbx [hidden] { display: none !important; }

/* Catalog cards on the hub. */
.vgnw-pbx-catgrid { grid-template-columns: repeat(5, 1fr); }
.vgnw-pbx-cat .vgnw-pb-start-t { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.vgnw-pbx-cat .vgnw-pb-start-p { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; }
.vgnw-pbx-cat .vgnw-pb-start-p i { transition: transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.vgnw-pbx-cat:hover .vgnw-pb-start-p i { transform: translateX(3px); }
.vgnw-pb-start-p b + small { margin-left: 4px; }

/* Strictly monochrome (owner, 2026-11-27): the kit's status accents become greys inside the builder; states are
   told apart by icon and weight, errors by an inverted badge. */
.vgnw-pbx { --accent-success: var(--fg-default); --accent-success-bg: var(--bg-inset); --accent-warning: var(--fg-default); --accent-warning-bg: var(--bg-inset); --accent-danger: var(--fg-default); --accent-danger-bg: var(--bg-inset); --accent-info: var(--fg-default); --accent-info-bg: var(--bg-inset); }
.vgnw-pbx .vgnw-pb-flag--err { background: var(--bg-inverse); color: var(--fg-inverse); }
.vgnw-pbx .vgnw-pb-flag--oos, .vgnw-pbx .vgnw-pb-flag--neutral { color: var(--fg-muted); }
.vgnw-pbx .vgnw-pb-check--err span { font-weight: 600; }
.vgnw-pbx .vgnw-pb-slot.is-error .vgnw-pb-slot-cat { color: var(--fg-default); }
.vgnw-pbx .vgnw-pb-plan-note--danger { color: var(--fg-default); font-weight: 500; }

/* Out-of-stock offers: plain muted text with the last seen price, no strikethrough. */
.vgnw-pbx .vgnw-pb-offer.is-out { opacity: 1; color: var(--fg-subtle); border-style: dashed; }
.vgnw-pbx .vgnw-pb-offer.is-out b { text-decoration: none; color: var(--fg-subtle); }
.vgnw-pbx-out { color: var(--fg-subtle); }
.vgnw-pbx-noprice { font-family: var(--font-micro); font-weight: 700; font-size: 12px; color: var(--fg-muted); white-space: nowrap; }
.vgnw-pb-prow-price .vgnw-pbx-noprice { display: block; text-align: right; }
.vgnw-pbx-alt { display: block; font-family: var(--font-micro); font-weight: 400; font-size: 11px; color: var(--fg-subtle); text-align: right; white-space: nowrap; margin-top: 2px; }

/* Product tile: the catalog's transparent cut-out on a neutral tile; the category icon when there is no image. */
.vgnw-pbx-thumb { position: relative; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 8px; background: var(--bg-inset); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.vgnw-pbx-thumb img { width: 88%; height: 88%; object-fit: contain; display: block; transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.vgnw-pbx-thumb.is-empty i { font-size: 24px; color: var(--fg-subtle); }
.vgnw-pbx-thumb--sm { width: 44px; height: 44px; border-radius: 7px; }
.vgnw-pbx-thumb--sm.is-empty i { font-size: 20px; }
.vgnw-pb-prow:hover .vgnw-pbx-thumb img, .vgnw-pb-slot:hover .vgnw-pbx-thumb img { transform: scale(1.06); }
.vgnw-pb-cmp-row--head .vgnw-pbx-thumb { display: flex; margin-bottom: 8px; }

/* Slots: tile + text in the body column. */
.vgnw-pbx-slot-body { flex-direction: row; align-items: center; gap: 12px; }
.vgnw-pbx-slot-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vgnw-pb-slot.is-empty .vgnw-pb-slot-choose { align-self: flex-start; }
.vgnw-pbx-link { color: inherit; text-decoration: none; }
.vgnw-pbx-link:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.vgnw-pb-slot-m { overflow-wrap: anywhere; }
.vgnw-pbx-opt-h { display: flex; align-items: baseline; gap: 10px; margin: 8px 2px -6px; }
.vgnw-pbx-opt-d { font-family: var(--font-micro); font-size: 12px; color: var(--fg-subtle); }
.vgnw-pbx-loading { padding: 20px; animation: vgnwPbxPulse 1.2s ease-in-out infinite alternate; }
@keyframes vgnwPbxPulse { from { opacity: 0.55; } to { opacity: 1; } }

/* Checks of unknown outcome (a spec is missing): neither pass nor fail. */
.vgnw-pb-check--unk i { color: var(--fg-subtle); }
.vgnw-pb-check--unk span { color: var(--fg-muted); }
.vgnw-pb-watt-note + .vgnw-pb-watt-note { margin-top: 4px; }
.vgnw-pbx-fine { font-family: var(--font-micro); font-size: 11.5px; line-height: 1.5; color: var(--fg-subtle); margin: 0 4px; }

/* Picker: header, tools and filters keep their height on a solid surface; only the list scrolls, below them. */
.vgnw-pbx .vgnw-pb-sheet-h, .vgnw-pbx .vgnw-pb-sheet-tools, .vgnw-pbx-filters, .vgnw-pbx .vgnw-pb-comparebar { flex: 0 0 auto; position: relative; z-index: 1; background: var(--bg-surface); }
.vgnw-pbx .vgnw-pb-comparebar { background: var(--bg-raised); }
.vgnw-pbx .vgnw-pb-sheet-list { flex: 1 1 auto; min-height: 0; position: relative; z-index: 0; overscroll-behavior: contain; }

/* Picker: category switch (storage), filter row, rows with tiles. */
.vgnw-pbx-cats { margin: 0; flex: 0 0 auto; }
.vgnw-pbx-cats button { padding: 8px 12px; }
.vgnw-pbx-filters { display: flex; align-items: center; gap: 8px; padding: 10px 24px; min-height: 51px; box-sizing: border-box; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; scrollbar-width: none; }
.vgnw-pbx-filters:empty { display: none; }
.vgnw-pbx-filters::-webkit-scrollbar { display: none; }
.vgnw-pbx-fsel { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 1px solid var(--border-default); border-radius: 999px; padding: 0 28px 0 12px; height: 30px; background: var(--bg-surface); color: var(--fg-muted); font-family: var(--font-micro); font-weight: 700; font-size: 12px; cursor: pointer; transition: border-color 160ms, background 160ms, color 160ms; }
.vgnw-pbx-fsel:hover { border-color: var(--border-strong); color: var(--fg-default); }
.vgnw-pbx-fsel.is-on { background: var(--bg-inverse); color: var(--fg-inverse); border-color: var(--bg-inverse); }
.vgnw-pbx-fsel-l { white-space: nowrap; }
.vgnw-pbx-fsel select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.vgnw-pbx-fsel i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; }
.vgnw-pbx-prow { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; }
.vgnw-pbx-prow > .vgnw-pbx-thumb { grid-row: 1; align-self: start; }
.vgnw-pbx-prow-main { min-width: 0; }
.vgnw-pbx-prow .vgnw-pb-prow-r { grid-column: 3; grid-row: 1; }
.vgnw-pbx-prow .vgnw-pb-prow-offers { grid-column: auto; }
.vgnw-pbx-more { display: flex; justify-content: center; padding: 14px 24px 18px; }

/* Hub list of builds saved on the device. */
.vgnw-pbx .vgnw-pb-mlist { margin-top: 20px; }

@media (max-width: 1080px) {
  .vgnw-pbx-catgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .vgnw-pbx .vgnw-ct-sechead { flex-wrap: wrap; }
  .vgnw-pbx .vgnw-ct-h2 { font-size: 22px; }
  .vgnw-pbx-catgrid { grid-template-columns: repeat(2, 1fr); }
  .vgnw-pbx-filters { padding: 10px 16px; }
  .vgnw-pb-sheet-h, .vgnw-pb-sheet-tools, .vgnw-pb-prow, .vgnw-pb-comparebar { padding-left: 16px; padding-right: 16px; }
  .vgnw-pbx-prow { grid-template-columns: 44px minmax(0, 1fr); }
  .vgnw-pbx-prow > .vgnw-pbx-thumb { width: 44px; height: 44px; }
  .vgnw-pbx-prow .vgnw-pb-prow-r { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
  .vgnw-pbx-prow .vgnw-pb-prow-btns { margin-left: auto; }
  .vgnw-pbx-prow .vgnw-pb-prow-price .vgnw-pbx-noprice, .vgnw-pbx-prow .vgnw-pbx-alt { text-align: left; }
  .vgnw-pb-slot-price { align-items: flex-start; text-align: left; }
  .vgnw-pb-headactions { width: 100%; }
  .vgnw-pb-headactions .vgnw-btn { flex: 1 1 auto; justify-content: center; }
  .vgnw-pb-cmp { padding: 12px 16px; overflow-x: auto; }
  .vgnw-pb-cmp-grid { min-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  [class*="vgnw-pbx"] { animation: none !important; transition: none !important; }
}
