/* ============================================================
   Custom PC Builder — Design System & Layout
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --pcb-bg: #f6f6f6;
  --pcb-surface: #ffffff;
  --pcb-primary: #2761e7;
  --pcb-primary-soft: #e6effd;
  --pcb-text: #111827;
  --pcb-text-muted: #6b7280;
  --pcb-border: #e5e7eb;
  --pcb-success: #22c55e;
  --pcb-danger: #ef4444;
  --pcb-radius-sm: 10px;
  --pcb-radius-md: 14px;
  --pcb-radius-lg: 16px;
  --pcb-shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
  --pcb-shadow-md: 0 4px 14px rgba(0, 0, 0, .08);
  --pcb-transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ---- Reset scope ---- */
.pcb-wrap,
.pcb-wrap *,
.pcb-wrap *::before,
.pcb-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Container ---- */
.pcb-wrap {
  font-family: 'Lexend Deca', sans-serif;
  color: var(--pcb-text);
  background: var(--pcb-bg);
  max-width: 1280px;
  margin: 0px;
  padding: 0px;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============ HEADER ============ */
.pcb-header {
  margin-bottom: 28px;
}

.pcb-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--pcb-primary);
  margin-bottom: 8px;
}

.pcb-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--pcb-text);
  margin-bottom: 8px;
}

.pcb-desc {
  color: var(--pcb-text-muted);
  font-size: 14px;
  max-width: 520px;
  margin-bottom: 0;
}

/* progress row */
.pcb-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.pcb-header-left {
  flex: 1;
  min-width: 260px;
}

.pcb-progress-wrap {
  flex-shrink: 0;
  text-align: right;
  min-width: 240px;
}

.pcb-progress-labels {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 6px;
}

.pcb-progress-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--pcb-text-muted);
}

.pcb-progress-step {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--pcb-text);
}

.pcb-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--pcb-border);
  overflow: hidden;
}

.pcb-progress-fill {
  height: 100%;
  width: 14.28%;
  border-radius: 999px;
  background: var(--pcb-primary);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

/* ============ LAYOUT GRID ============ */
.pcb-layout {
  display: grid;
  grid-template-columns: 2fr minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

/* ============ ACCORDION ============ */
.pcb-accordion-step {
  background: var(--pcb-surface);
  border-radius: var(--pcb-radius-lg);
  border: 1px solid var(--pcb-border);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow var(--pcb-transition);
}

.pcb-accordion-step:hover {
  box-shadow: var(--pcb-shadow-sm);
}

/* locked state */
.pcb-accordion-step.is-locked {
  opacity: .55;
  pointer-events: none;
}

.pcb-accordion-step.is-locked .pcb-step-chevron {
  display: none;
}

.pcb-accordion-step.is-locked .pcb-step-lock {
  display: flex;
}

.pcb-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--pcb-transition);
}

.pcb-step-header:hover {
  background: #fafbfc;
}

.pcb-step-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--pcb-primary-soft);
  color: var(--pcb-primary);
  flex-shrink: 0;
}

.pcb-step-icon svg {
  width: 18px;
  height: 18px;
}

.pcb-step-info {
  flex: 1;
}

.pcb-step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--pcb-text);
}

.pcb-step-meta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--pcb-text-muted);
  margin-top: 2px;
}

/* chevron & lock */
.pcb-step-chevron {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pcb-text-muted);
  transition: transform var(--pcb-transition);
}

.pcb-accordion-step.is-open .pcb-step-chevron {
  transform: rotate(180deg);
}

.pcb-step-lock {
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--pcb-text-muted);
}

.pcb-step-lock svg,
.pcb-step-chevron svg {
  width: 18px;
  height: 18px;
}

/* body */
.pcb-step-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}

.pcb-accordion-step.is-open .pcb-step-body {
  max-height: 15000px;
  opacity: 1;
}

.pcb-step-body-inner {
  padding: 20px 20px;
}

/* ============ PRODUCT GRID ============ */
.pcb-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ============ PRODUCT CARD ============ */
.pcb-product-card {
  background: var(--pcb-surface);
  border-radius: var(--pcb-radius-md);
  border: 1.5px solid var(--pcb-border);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: box-shadow var(--pcb-transition), border-color var(--pcb-transition), transform var(--pcb-transition);
}

.pcb-product-card:hover {
  box-shadow: var(--pcb-shadow-md);
  border-color: var(--pcb-primary);
  transform: translateY(-2px);
}

/* selected */
.pcb-product-card.is-selected {
  border: 2px solid var(--pcb-primary);
}

.pcb-product-card .pcb-card-check {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pcb-primary);
  color: #fff;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.pcb-product-card.is-selected .pcb-card-check {
  display: flex;
}

.pcb-card-check svg {
  width: 14px;
  height: 14px;
}

/* image */
.pcb-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--pcb-radius-sm);
  background: #f3f4f6;
  overflow: hidden;
  margin-bottom: 10px;
}

.pcb-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* text */
.pcb-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--pcb-text);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcb-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.pcb-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--pcb-text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pcb-card-price svg {
  width: 14px;
  height: 14px;
  color: var(--pcb-text-muted);
  transition: color var(--pcb-transition);
}

.pcb-card-ext-link {
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.pcb-card-ext-link:hover svg {
  color: var(--pcb-primary);
}

/* select button */
.pcb-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 8px 16px !important;
  border-radius: 8px;
  border: none !important;
  background: #f1f5f9;
  color: #4b5563;
  cursor: pointer;
  transition: all var(--pcb-transition);
  white-space: nowrap;
  line-height: 1 !important;
  min-height: auto !important;
  margin: 0 !important;
}

.pcb-card-btn:hover {
  background: #e2e8f0;
}

/* selected badge */
.pcb-card-selected-badge {
  display: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--pcb-primary);
  background: var(--pcb-primary-soft);
  padding: 8px 16px !important;
  border-radius: 8px;
  line-height: 1 !important;
  min-height: auto !important;
  margin: 0 !important;
}

.pcb-product-card.is-selected .pcb-card-btn {
  display: none;
}

.pcb-product-card.is-selected .pcb-card-selected-badge {
  display: inline-block;
}

/* ============ SUMMARY SIDEBAR ============ */
.pcb-sidebar-wrap {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pcb-summary {
  background: var(--pcb-surface);
  border-radius: var(--pcb-radius-lg);
  border: 1px solid var(--pcb-border);
  padding: 24px 20px;
  overflow: hidden;
}

/* compat badge */
.pcb-summary-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pcb-compat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--pcb-success);
  background: #ecfdf5;
  border: none;
  padding: 5px 10px;
  border-radius: 9999px;
  margin-bottom: 0;
  width: fit-content;
  line-height: 1;
}

.pcb-compat span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pcb-compat svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

/* share button */
.pcb-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--pcb-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--pcb-transition);
  padding: 0;
  flex-shrink: 0;
}

.pcb-share-btn:hover {
  color: var(--pcb-primary);
  background: var(--pcb-primary-soft);
}

.pcb-share-btn svg {
  width: 18px;
  height: 18px;
}

/* share toast */
.pcb-share-toast {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  animation: pcb-toast-in .3s ease;
}

.pcb-toast-login {
  color: #0c4a6e;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.pcb-toast-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.pcb-toast-success {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

@keyframes pcb-toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* header */
.pcb-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pcb-summary-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--pcb-text);
  outline: none;
}

.pcb-summary-edit {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--pcb-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--pcb-transition);
}

.pcb-summary-edit:hover {
  background: var(--pcb-primary-soft);
  color: var(--pcb-primary);
}

.pcb-summary-edit svg {
  width: 16px;
  height: 16px;
}

.pcb-summary-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--pcb-text-muted);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--pcb-border);
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

/* selected items */
.pcb-selected-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pcb-selected-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
  border-bottom: none;
}

.pcb-selected-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f3f4f6;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--pcb-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pcb-selected-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pcb-selected-thumb.is-empty {
  background: transparent;
  border: 1px dashed #d1d5db;
  color: #9ca3af;
}

.pcb-selected-thumb.is-empty>div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.pcb-selected-thumb.is-empty>div svg {
  width: 100%;
  height: 100%;
  max-width: 24px;
  max-height: 24px;
}

.pcb-selected-thumb.is-empty img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain;
}

.pcb-selected-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
}

.pcb-selected-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pcb-selected-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--pcb-text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.pcb-selected-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--pcb-text);
  flex-shrink: 0;
  margin-left: 10px;
}

.pcb-selected-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pcb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcb-selected-remove {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--pcb-danger) !important;
  cursor: pointer;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: auto !important;
  box-shadow: none !important;
  text-transform: uppercase;
  text-align: left;
  transition: opacity var(--pcb-transition);
  align-self: flex-start;
  display: inline-block;
}

.pcb-selected-remove:hover {
  opacity: .7;
  background: transparent !important;
}

.pcb-selected-placeholder-text {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- pricing ---- */
.pcb-pricing {
  border-top: 1px solid var(--pcb-border);
  background: #f8fafc;
  margin: 0 -20px;
  padding: 24px 20px 20px;
}

.pcb-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--pcb-text-muted);
  margin-bottom: 6px;
}

.pcb-price-row span:last-child {
  font-weight: 600;
  color: var(--pcb-text);
}

.pcb-price-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--pcb-border);
}

.pcb-price-total-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--pcb-text);
}

.pcb-price-total-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--pcb-primary);
  text-align: right;
}

.pcb-price-total-sub {
  font-size: 11px;
  color: var(--pcb-text-muted);
  font-weight: 400;
  text-align: right;
  margin-top: 2px;
}

/* ---- actions ---- */
.pcb-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #f8fafc;
  margin: 0 -20px -24px;
  padding: 0 20px 24px;
}

.pcb-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  background: var(--pcb-primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--pcb-transition);
  box-shadow: 0px 4px 4px rgba(39, 97, 231, 0.2) !important;
}

.pcb-btn-primary:hover {
  color: #fff;
  background: #1d4ed8;
  box-shadow: 0 4px 16px rgba(39, 97, 231, .35);
  transform: translateY(-1px);
}

.pcb-btn-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.pcb-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--pcb-text);
  background: var(--pcb-surface);
  border: 1.5px solid var(--pcb-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--pcb-transition);
}

.pcb-btn-secondary:hover {
  border-color: var(--pcb-primary);
  color: var(--pcb-primary);
  background: var(--pcb-primary-soft);
}

.pcb-btn-secondary svg {
  width: 14px;
  height: 14px;
}

/* ---- lifetime support ---- */
.pcb-support-badges {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--pcb-surface);
  border-radius: var(--pcb-radius-lg);
  border: 1px solid var(--pcb-border);
  padding: 20px;
}

.pcb-support {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.pcb-support-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pcb-text-muted);
  flex-shrink: 0;
}

.pcb-support-icon svg {
  width: 20px;
  height: 20px;
}

.pcb-support-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--pcb-text);
  margin-bottom: 2px;
}

.pcb-support-desc {
  font-size: 11px;
  color: var(--pcb-text-muted);
  line-height: 1.5;
}

/* ---- support badges container ---- */
.pcb-support-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .pcb-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pcb-summary {
    position: static;
  }

  .pcb-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .pcb-progress-wrap {
    width: 100%;
    text-align: left;
  }

  .pcb-progress-labels {
    justify-content: flex-start;
  }

  .pcb-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .pcb-wrap {
    padding: 16px 0;
  }

  .pcb-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pcb-title {
    font-size: 24px;
  }

  .pcb-step-body-inner {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .pcb-btn-secondary-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ PAY LATER TOOLTIP ============ */
.pcb-pay-later-wrapper {
  position: relative;
  display: inline-block;
}

.pcb-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 50%;
  font-size: 11px;
  cursor: help;
  margin-left: 4px;
  transition: all 0.2s;
}

.pcb-pay-later-wrapper:hover .pcb-info-icon {
  background: var(--pcb-primary);
  color: #fff;
}

.pcb-pay-later-tooltip {
  position: absolute;
  bottom: 100%;
  right: -5px;
  transform: translateY(-10px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 260px;
  max-width: 85vw;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pcb-pay-later-wrapper:hover .pcb-pay-later-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-5px);
}

.pcb-tooltip-title {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  text-align: center;
}

.pcb-tooltip-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.pcb-tooltip-icons img {
  height: 24px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  transition: transform 0.2s;
}

.pcb-tooltip-icons img:hover {
  transform: scale(1.1);
}

/* Tooltip Arrow */
.pcb-pay-later-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 7px;
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}