/* ==========================================================================
   PC BUILDER — three-column redesign. Scoped under #pcb so it never fights
   the Journal theme. Loads only on the builder page.
   ========================================================================== */
#pcb {
  --pcb-ink: #1a2233;
  --pcb-muted: #6b7385;
  --pcb-surface: #ffffff;
  --pcb-panel: #f6f8fb;
  --pcb-line: #e5e9f0;
  --pcb-accent: #ff7a00;         /* orange, matches store */
  --pcb-accent-ink: #ffffff;
  --pcb-accent-soft: #fff2e6;
  --pcb-blue: #2f6bff;
  --pcb-ok: #17864b;
  --pcb-ok-bg: #e8f6ee;
  --pcb-warn: #8a6100;
  --pcb-warn-bg: #fdf3dd;
  --pcb-bad: #c0362c;
  --pcb-bad-bg: #fbe9e7;
  --pcb-radius: 14px;
  color: var(--pcb-ink);
  min-height: 80vh;
  margin: 0 0 40px;
  padding-top: 8px;
}
#pcb *, #pcb *::before, #pcb *::after { box-sizing: border-box; }
html { scroll-padding-top: 130px; }

/* Full-width page, kill side columns / most-viewed */
#pcb-page { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
#column-left, #column-right, .column-left, .column-right { display: none !important; }
#content { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
[id^="side_products"], .products-block, .module-products,
.journal-carousel, [class*="most-viewed"] { display: none !important; }

/* ---- Hero banner ---- */
.pcb-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  background: linear-gradient(100deg, #12151c 0%, #1c2230 60%, #2a1c0e 100%);
  border-radius: var(--pcb-radius);
  padding: 26px 28px;
  margin-bottom: 20px;
  color: #fff;
}
.pcb-hero-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: #fff; }
.pcb-hero-title::after { content: ""; }
.pcb-hero-sub { margin: 0; color: #b9c0cf; font-size: 14px; max-width: 52ch; }
.pcb-hero-flow { display: flex; gap: 22px; flex-wrap: wrap; }
.pcb-flow-step { display: flex; align-items: center; gap: 10px; }
.pcb-flow-ico {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: rgba(255,255,255,.1); display: grid; place-items: center; font-size: 18px;
}
.pcb-flow-step strong { display: block; font-size: 13px; }
.pcb-flow-step small { color: #aab2c2; font-size: 11.5px; }

/* ---- Global toolbar (between hero and columns) ---- */
.pcb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--pcb-surface);
  border: 1px solid var(--pcb-line);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
}
.pcb-toolbar-toggles {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.pcb-toolbar-reset {
  background: none;
  border: 1px solid var(--pcb-line);
  color: var(--pcb-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.pcb-toolbar-reset:hover { border-color: var(--pcb-bad); color: var(--pcb-bad); background: var(--pcb-bad-bg); }

/* WhatsApp share button */
.pcb-toolbar-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25D366;
  border: 1.5px solid #25D366;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
  margin-left: 8px;
}
.pcb-toolbar-share:hover:not(:disabled) { background: #1ebe5b; border-color: #1ebe5b; }
.pcb-toolbar-share:disabled { opacity: .6; cursor: not-allowed; }
.pcb-toolbar-share svg { flex: none; }

/* ---- 3-column layout ---- */
#pcb .pcb-layout {
  display: flex !important;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}
#pcb .pcb-nav     { flex: 0 0 250px; width: 250px; }
#pcb .pcb-main    { flex: 1 1 0%; min-width: 0; }
#pcb .pcb-summary { flex: 0 0 300px; width: 300px; position: sticky; top: 16px; }

@media (max-width: 1100px) {
  #pcb .pcb-layout { flex-wrap: wrap; }
  #pcb .pcb-nav { flex: 0 0 100%; width: 100%; }
  #pcb .pcb-main { flex: 1 1 60%; }
  #pcb .pcb-summary { flex: 0 0 300px; position: static; }
}
@media (max-width: 760px) {
  #pcb .pcb-main, #pcb .pcb-summary { flex: 0 0 100%; width: 100%; }
}

/* ---- LEFT: step navigator ---- */
.pcb-nav {
  background: var(--pcb-surface);
  border: 1px solid var(--pcb-line);
  border-radius: var(--pcb-radius);
  padding: 18px;
}
.pcb-nav-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.pcb-nav-title { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--pcb-ink); }
.pcb-nav-count { font-size: 12px; color: var(--pcb-muted); }
.pcb-progress { height: 8px; background: var(--pcb-line); border-radius: 5px; overflow: hidden; }
.pcb-progress-bar { height: 100%; background: var(--pcb-accent); border-radius: 5px; transition: width .3s ease; }
.pcb-progress-pct { display: block; text-align: right; font-size: 11px; color: var(--pcb-muted); margin: 4px 0 14px; }

.pcb-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pcb-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  transition: background .12s ease;
  position: relative;
}
.pcb-nav-item:hover { background: var(--pcb-panel); }
.pcb-nav-item.active { background: var(--pcb-accent-soft); }
.pcb-nav-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--pcb-line); color: var(--pcb-muted);
}
.pcb-nav-item.active .pcb-nav-num { background: var(--pcb-accent); color: #fff; }
.pcb-nav-item.done .pcb-nav-num { background: var(--pcb-ok); color: #fff; }
.pcb-nav-name { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; }
.pcb-nav-item.active .pcb-nav-name { color: var(--pcb-accent); }
.pcb-nav-check { display: none; color: var(--pcb-ok); font-weight: 800; }
.pcb-nav-item.done .pcb-nav-check { display: block; }

/* A step holding a part that CONFLICTS with the rest of the build: red badge
   instead of a green tick, so an impossible pair can never look finished. */
.pcb-nav-warn { display: none; flex: none; font-weight: 800; color: #fff; cursor: help; }
.pcb-nav-item.bad .pcb-nav-warn {
  display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--pcb-bad); font-size: 12px; line-height: 1;
}
.pcb-nav-item.bad { background: var(--pcb-bad-bg); }
.pcb-nav-item.bad .pcb-nav-num { background: var(--pcb-bad); color: #fff; }
.pcb-nav-item.bad .pcb-nav-name { color: var(--pcb-bad); }
.pcb-nav-item.bad.active { background: var(--pcb-bad-bg); }
.pcb-nav-item.bad.active .pcb-nav-name { color: var(--pcb-bad); }

.pcb-help {
  margin-top: 16px; padding: 14px; border-radius: 10px;
  background: var(--pcb-panel); display: flex; gap: 10px; align-items: flex-start;
}
.pcb-help-ico { font-size: 20px; }
.pcb-help-body strong { display: block; font-size: 13px; margin-bottom: 3px; }
.pcb-help-body small { color: var(--pcb-muted); font-size: 11.5px; line-height: 1.4; display: block; margin-bottom: 8px; }

/* ---- CENTER: product grid ---- */
.pcb-main {
  background: var(--pcb-surface);
  border: 1px solid var(--pcb-line);
  border-radius: var(--pcb-radius);
  padding: 20px;
}
.pcb-main-head { margin-bottom: 16px; }
.pcb-main-title-wrap { display: flex; align-items: center; gap: 14px; }
.pcb-main-ico {
  width: 46px; height: 46px; flex: none; border-radius: 10px;
  background: var(--pcb-panel); display: grid; place-items: center; font-size: 22px;
}
.pcb-main-title { font-size: 22px; font-weight: 800; margin: 0; }
.pcb-main-desc { margin: 2px 0 0; color: var(--pcb-muted); font-size: 13px; }

.pcb-filters { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.pcb-search-wrap { flex: 1; min-width: 180px; position: relative; }
.pcb-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .5; }
.pcb-search {
  width: 100%; padding: 10px 12px 10px 34px;
  border: 1px solid var(--pcb-line); border-radius: 9px; font-size: 14px; background: #fff;
}
.pcb-search:focus { outline: 2px solid var(--pcb-accent); outline-offset: 1px; }

.pcb-stock-toggle-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; flex: none; }
.pcb-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.pcb-toggle-track { position: relative; width: 40px; height: 22px; background: #d0d5dd; border-radius: 11px; transition: background .2s; flex: none; }
.pcb-toggle-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.pcb-toggle-input:checked + .pcb-toggle-track { background: var(--pcb-ok); }
.pcb-toggle-input:checked + .pcb-toggle-track .pcb-toggle-thumb { transform: translateX(18px); }
.pcb-toggle-text { font-size: 13px; font-weight: 600; color: var(--pcb-muted); white-space: nowrap; }

/* Product grid */
.pcb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
@media (max-width: 1300px) { .pcb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .pcb-grid { grid-template-columns: 1fr; } }
/* Chipset tier bar — sits above the grid on the motherboard step. */
.pcb-tierbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px;
  background: var(--pcb-panel); border: 1px solid var(--pcb-line); border-radius: 10px;
}
.pcb-tier-lead { font-size: 12.5px; color: var(--pcb-muted); margin-right: 4px; }
.pcb-tier-chip {
  font: inherit; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--pcb-line); background: #fff; color: var(--pcb-ink);
  transition: border-color .12s ease, background .12s ease;
}
.pcb-tier-chip:hover { border-color: var(--pcb-accent); }
.pcb-tier-chip.active { border-color: var(--pcb-accent); background: var(--pcb-accent-soft); }
.pcb-tier-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.pcb-tier-meta { font-size: 11px; color: var(--pcb-muted); line-height: 1.3; }
.pcb-tier-meta:empty { display: none; }

/* Chipset code on the card, where it explains the price next to it. */
.pcb-card-img { position: relative; }
.pcb-card-chipset {
  position: absolute; top: 0; right: 0;
  padding: 2px 7px; border-radius: 999px;
  background: var(--pcb-panel); border: 1px solid var(--pcb-line);
  font-size: 10.5px; font-weight: 700; color: var(--pcb-muted); letter-spacing: .02em;
}

.pcb-card {
  background: #fff; border: 1px solid var(--pcb-line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .12s ease, box-shadow .12s ease;
  height: 100%;
}
.pcb-card:hover { border-color: var(--pcb-accent); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.pcb-card-oos { opacity: .6; }

/* A part the engine has proven cannot work with the current build. Only ever
   visible with "Compatible only" switched off. */
.pcb-card { position: relative; }
.pcb-card-bad { border-color: var(--pcb-bad); background: var(--pcb-bad-bg); }
.pcb-card-bad:hover { border-color: var(--pcb-bad); box-shadow: 0 6px 18px rgba(192,54,44,.14); }
.pcb-card-bad .pcb-select-btn { opacity: .75; }
.pcb-card-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  max-width: calc(100% - 16px);
  padding: 3px 8px; border-radius: 999px;
  background: var(--pcb-bad); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1.35;
  letter-spacing: .01em;
}
.pcb-card-img { height: 120px; display: grid; place-items: center; flex: none; }
.pcb-card-img img { max-width: 100%; max-height: 120px; object-fit: contain; }
.pcb-card-name {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;      /* show at most 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.4em * 2); /* keep short names from making the card too short */
}
/* Spacer pushes price + button to the bottom so buttons align across the row */
.pcb-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.pcb-card-price { font-size: 16px; font-weight: 800; color: var(--pcb-accent); }
.pcb-stock { font-size: 10px; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.pcb-stock.in { color: var(--pcb-ok); background: var(--pcb-ok-bg); }
.pcb-stock.out { color: var(--pcb-bad); background: var(--pcb-bad-bg); }
.pcb-select-btn {
  width: 100%; padding: 9px; border: none; border-radius: 8px;
  background: var(--pcb-accent); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background .12s ease; flex: none;
}
.pcb-select-btn:hover { background: #e86e00; }

.pcb-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; }
.pcb-pager-info { font-size: 13px; color: var(--pcb-muted); }
.pcb-empty-msg { grid-column: 1/-1; color: var(--pcb-muted); font-size: 14px; padding: 40px 0; text-align: center; }

/* Selection feedback toast */
.pcb-toast {
  background: var(--pcb-ok-bg);
  color: var(--pcb-ok);
  border: 1px solid var(--pcb-ok);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 14px;
  transition: opacity .4s ease;
  line-height: 1.4;
}
.pcb-toast strong { font-weight: 800; }

/* ---- Multi-select pick popup (RAM / storage) ---- */
.pcb-pick-overlay {
  position: fixed; inset: 0;
  background: rgba(15,18,25,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100000;
  opacity: 0; transition: opacity .2s ease;
  padding: 20px;
}
.pcb-pick-overlay.pcb-pick-show { opacity: 1; }
.pcb-pick-modal {
  background: #fff; border-radius: 16px;
  padding: 28px 28px 24px; width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  transform: translateY(12px) scale(.97); transition: transform .2s ease;
}
.pcb-pick-overlay.pcb-pick-show .pcb-pick-modal { transform: none; }
.pcb-pick-check {
  width: 54px; height: 54px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--pcb-ok-bg, #e8f6ee);
  color: var(--pcb-ok, #17864b);
  display: grid; place-items: center; font-size: 28px; font-weight: 800;
}
.pcb-pick-title { font-size: 17px; font-weight: 800; margin: 0 0 6px; color: var(--pcb-ink, #1a2233); line-height: 1.35; }
.pcb-pick-sub { font-size: 13.5px; color: var(--pcb-muted, #6b7385); margin: 0 0 20px; line-height: 1.5; }
.pcb-pick-sub strong { color: var(--pcb-ink, #1a2233); }
.pcb-pick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pcb-pick-more, .pcb-pick-next {
  flex: 1 1 0; min-width: 140px;
  padding: 12px 14px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--pcb-line, #e5e9f0); transition: all .12s ease;
  white-space: nowrap;
}
.pcb-pick-more { background: #fff; color: var(--pcb-ink, #1a2233); }
.pcb-pick-more:hover { border-color: var(--pcb-accent, #ff7a00); color: var(--pcb-accent, #ff7a00); background: var(--pcb-accent-soft, #fff2e6); }
.pcb-pick-next { background: var(--pcb-accent, #ff7a00); color: #fff; border-color: var(--pcb-accent, #ff7a00); }
.pcb-pick-next:hover { background: #e86e00; border-color: #e86e00; }
@media (max-width: 420px) {
  .pcb-pick-actions { flex-direction: column; }
  .pcb-pick-more, .pcb-pick-next { min-width: 0; }
}

/* ---- RIGHT: summary ---- */
.pcb-summary-card { background: var(--pcb-surface); border: 1px solid var(--pcb-line); border-radius: var(--pcb-radius); padding: 18px; }
.pcb-summary-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pcb-summary-title { font-size: 17px; font-weight: 800; margin: 0; }
.pcb-reset-link {
  background: none; border: none; color: var(--pcb-muted); font-size: 12px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; font-weight: 600;
}
.pcb-reset-link:hover { background: var(--pcb-panel); color: var(--pcb-ink); }

.pcb-summary-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.pcb-sum-row { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--pcb-line); }
.pcb-sum-row:last-child { border-bottom: none; padding-bottom: 0; }
.pcb-sum-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcb-sum-role { font-size: 13px; font-weight: 700; color: var(--pcb-ink); }
.pcb-sum-empty { font-size: 12px; color: var(--pcb-muted); }
.pcb-sum-choose {
  background: none; border: 1px solid var(--pcb-accent); color: var(--pcb-accent);
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 7px; cursor: pointer;
}
.pcb-sum-choose:hover { background: var(--pcb-accent); color: #fff; }
.pcb-sum-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pcb-sum-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--pcb-muted); }
.pcb-sum-price { font-weight: 700; flex: none; }
.pcb-sum-x { background: none; border: none; color: var(--pcb-bad); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; flex: none; }
.pcb-sum-addmore { align-self: flex-start; background: none; border: 1px dashed var(--pcb-line); color: var(--pcb-muted); font-size: 11.5px; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.pcb-sum-addmore:hover { border-color: var(--pcb-accent); color: var(--pcb-accent); }

.pcb-total-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--pcb-line); padding-top: 14px; margin-bottom: 14px; }
.pcb-total-row > span:first-child { font-size: 14px; font-weight: 700; }
.pcb-total { font-size: 24px; font-weight: 800; color: var(--pcb-ink); }

.pcb-compat { border: 1px solid var(--pcb-line); border-radius: 10px; padding: 12px; margin-bottom: 14px; background: var(--pcb-panel); }
.pcb-compat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pcb-compat-label { font-weight: 700; font-size: 13px; }
.pcb-compat-dot { width: 11px; height: 11px; border-radius: 50%; background: #cbd2de; flex: none; }
.pcb-compat-dot[data-state="ok"] { background: var(--pcb-ok); }
.pcb-compat-dot[data-state="unverified"] { background: var(--pcb-warn); }
.pcb-compat-dot[data-state="conflict"] { background: var(--pcb-bad); }
.pcb-compat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pcb-compat-list li { font-size: 12px; line-height: 1.4; padding: 7px 9px; border-radius: 7px; border-left: 3px solid var(--pcb-line); background: #fff; }
.pcb-compat-empty { color: var(--pcb-muted); }
.pcb-c-ok { border-left-color: var(--pcb-ok) !important; background: var(--pcb-ok-bg) !important; }
.pcb-c-unverified { border-left-color: var(--pcb-warn) !important; background: var(--pcb-warn-bg) !important; }
.pcb-c-conflict { border-left-color: var(--pcb-bad) !important; background: var(--pcb-bad-bg) !important; }

/* Buttons */
.pcb-btn { font: inherit; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent; transition: background .12s ease, border-color .12s ease; }
.pcb-btn-primary { width: 100%; background: var(--pcb-accent); color: var(--pcb-accent-ink); font-size: 15px; padding: 13px; font-weight: 800; }
.pcb-btn-primary:hover:not(:disabled) { background: #e86e00; }
.pcb-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.pcb-btn-ghost { background: transparent; border-color: var(--pcb-line); color: var(--pcb-ink); }
.pcb-btn-ghost:hover:not(:disabled) { border-color: var(--pcb-accent); color: var(--pcb-accent); }
.pcb-btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.pcb-btn-sm { font-size: 12px; padding: 6px 12px; }
.pcb-add-msg { font-size: 12.5px; margin-top: 10px; text-align: center; min-height: 1em; }
.pcb-add-msg.ok { color: var(--pcb-ok); }
.pcb-add-msg.err { color: var(--pcb-bad); }
.pcb-note { color: var(--pcb-muted); background: var(--pcb-panel); border: 1px solid var(--pcb-line); border-radius: var(--pcb-radius); padding: 20px; }

@media (prefers-reduced-motion: reduce) { #pcb * { transition: none !important; } }

/* ---- Hide the footer + "Most Viewed" on the PC Builder page only ----
   This stylesheet loads only on the builder page, so these rules are
   scoped to it and won't affect any other page. */
footer,
#footer,
.footer,
.footer-container,
[class*="footer"],
[id^="side_products"],
.products-block,
[class*="most-viewed"] {
  display: none !important;
}
