.compuart-pc-builder {
  --pcb-primary: #a84ae4;
  --pcb-accent: #3676f2;
  --pcb-text: #0f1d47;
  --pcb-muted: #62708a;
  --pcb-line: #e7ebf3;
  --pcb-grad: linear-gradient(135deg, var(--pcb-primary), var(--pcb-accent));
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 18px;
  box-shadow: 0 10px 28px rgba(12, 30, 90, 0.06);
}

.compuart-pcb-preset-picker {
  grid-column: 1 / -1;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 14px;
  background: #f9f9f9;
}

.compuart-pcb-preset-picker.is-hidden {
  display: none;
}

.compuart-pc-builder__main.is-hidden,
.compuart-pc-builder__summary.is-hidden {
  display: none;
}

.compuart-pcb-preset-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.compuart-pcb-preset-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.compuart-pcb-preset-card h4 {
  margin: 0 0 8px;
}

.compuart-pcb-preset-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: #111;
  color: #fff;
}

.compuart-pcb-preset-card p {
  margin: 0 0 8px;
  color: #444;
  font-size: 13px;
}

.compuart-pcb-preset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #666;
}

.compuart-pcb-steps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.compuart-pcb-step {
  background: #f5f7fb;
  border: 1px solid var(--pcb-line);
  color: var(--pcb-text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.16s ease;
}

.compuart-pcb-step.is-active {
  background: var(--pcb-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(90, 102, 240, 0.2);
}

.compuart-pcb-step.is-done {
  border-color: #86c28c;
  background: #f5fff6;
  color: var(--pcb-text);
}

.compuart-pcb-step:hover {
  border-color: #cfd6e5;
  background: #fff;
}

.compuart-pcb-step.is-active:hover {
  background: var(--pcb-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(90, 102, 240, 0.2);
}

/* When a completed step is currently active, keep active styling (not the green done state). */
.compuart-pcb-step.is-active.is-done,
.compuart-pcb-step.is-active.is-done:hover,
.compuart-pcb-step.is-done.is-active,
.compuart-pcb-step.is-done.is-active:hover {
  background: var(--pcb-grad) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(90, 102, 240, 0.2);
}

/* Completed inactive steps keep a subtle done style without becoming washed out. */
.compuart-pcb-step.is-done:hover:not(.is-active) {
  background: #eefbf0;
  border-color: #75b97f;
  color: var(--pcb-text);
}

.compuart-pcb-presets-panel,
.compuart-pcb-global-tools,
.compuart-pc-builder__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.compuart-pcb-global-tools,
.compuart-pc-builder__toolbar {
  padding: 10px 12px;
  border: 1px solid var(--pcb-line);
  border-radius: 12px;
  background: #f8faff;
}

.compuart-pcb-global-tools label,
.compuart-pc-builder__toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pcb-text);
  font-size: 13px;
  font-weight: 600;
}

.compuart-pcb-global-tools input[type="checkbox"],
.compuart-pc-builder__toolbar input[type="checkbox"] {
  margin: 0;
}

.compuart-pcb-brand-filter {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--pcb-line);
  padding: 0 10px;
}

.compuart-pcb-search {
  min-width: 260px;
  border-radius: 10px;
  border: 1px solid var(--pcb-line);
  min-height: 42px;
  padding: 0 12px;
}

.compuart-pc-builder__products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compuart-pcb-product-card {
  border: 1px solid var(--pcb-line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  background: #fff;
  align-items: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.compuart-pcb-product-card:hover {
  border-color: #cfd6e8;
  box-shadow: 0 8px 22px rgba(17, 29, 71, 0.08);
}

.compuart-pcb-product-card.is-blocked {
  opacity: 0.55;
  background: #f8f8f8;
}

.compuart-pcb-product-card.is-warning {
  border-color: #d98600;
}

.compuart-pcb-product-card input {
  grid-column: 1 / -1;
  margin: 0 0 2px;
}

.compuart-pcb-product-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.compuart-pcb-product-media img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.compuart-pcb-product-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 6px;
  color: var(--pcb-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 56px;
}

.compuart-pcb-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--pcb-muted);
  font-size: 12px;
  min-height: 18px;
}

.compuart-pcb-product-meta span {
  white-space: nowrap;
}

.compuart-pcb-product-price {
  margin-top: 8px;
  font-weight: 700;
  color: var(--pcb-text);
  min-height: 22px;
}

.compuart-pcb-price-old {
  text-decoration: line-through;
  color: #777;
  font-weight: 500;
}

.compuart-pcb-price-sale {
  color: #b71c1c;
}

.compuart-pcb-stock {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}

.compuart-pcb-stock.instock {
  color: #2e7d32;
}

.compuart-pcb-stock.outofstock {
  color: #b71c1c;
}

.compuart-pcb-rule-msg {
  margin-top: 6px;
  font-size: 12px;
}

.compuart-pcb-rule-msg.is-block {
  color: #b71c1c;
}

.compuart-pcb-rule-msg.is-warn {
  color: #9a6d00;
}

.compuart-pcb-details-btn {
  margin-top: auto;
  align-self: flex-end;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 0;
  background: var(--pcb-grad);
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(80, 90, 240, 0.16);
}

.compuart-pcb-details-btn:hover {
  color: #fff !important;
  opacity: 0.96;
}


.compuart-pcb-debug {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #c8c8c8;
  border-radius: 6px;
  background: #f7f7f7;
  font-size: 11px;
  line-height: 1.4;
}

.compuart-pcb-debug-row + .compuart-pcb-debug-row {
  margin-top: 4px;
}

.compuart-pcb-compat-warning-banner {
  margin: 8px 0;
  padding: 8px 10px;
  background: #fff8e1;
  border: 1px solid #f0d18b;
  border-radius: 6px;
  font-size: 12px;
}

.compuart-pcb-compat-warning-banner ul {
  margin: 6px 0 0 18px;
}

.compuart-pcb-compat-debug-context {
  margin: 8px 0;
}

.compuart-pcb-debug-context-inner {
  padding: 8px;
  border: 1px dashed #bcbcbc;
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 11px;
}

.compuart-pcb-debug-context-inner pre {
  white-space: pre-wrap;
  margin: 4px 0 8px;
  font-size: 11px;
}

.compuart-pcb-load-more-wrap {
  grid-column: 1 / -1;
  text-align: center;
}

.compuart-pcb-loading {
  animation: compuartPulse 1.2s ease-in-out infinite;
}

@keyframes compuartPulse {
  0% { opacity: 0.45; }
  50% { opacity: 1; }
  100% { opacity: 0.45; }
}

.compuart-pc-builder__controls {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.compuart-pc-builder__summary {
  border: 1px solid var(--pcb-line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfcff;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}

.compuart-pcb-summary-list,
.compuart-pcb-warnings {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.compuart-pcb-summary-item {
  padding: 10px 0;
  border-bottom: 1px dashed #e2e2e2;
}

.compuart-pcb-summary-item > div:first-child {
  line-height: 1.45;
}

.compuart-pcb-summary-qty {
  margin: 4px 0 8px 0;
}

.compuart-pcb-qty-input {
  width: 72px;
  margin-left: 6px;
}

.compuart-pcb-summary-item.missing {
  color: var(--pcb-text);
}

.compuart-pcb-summary-item.ok {
  color: var(--pcb-text);
}

.compuart-pcb-summary-item strong {
  color: var(--pcb-text);
}

.compuart-pcb-summary-item.missing strong {
  color: var(--pcb-primary);
}

.compuart-pcb-summary-item.ok strong {
  color: var(--pcb-accent);
}

.compuart-pcb-summary-item.optional strong {
  color: var(--pcb-primary);
}

.compuart-pcb-summary-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.compuart-pcb-summary-actions .button-link,
.compuart-pcb-summary-actions .button-link-delete {
  text-decoration: none;
  font-weight: 700;
}

.compuart-pcb-summary-actions button.compuart-pcb-change.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--pcb-grad);
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(80, 90, 240, 0.16);
}

.compuart-pc-builder .compuart-pcb-summary-actions .compuart-pcb-change {
  color: #fff !important;
}

.compuart-pcb-summary-actions button.compuart-pcb-change.button-link:hover {
  color: #fff !important;
  opacity: 0.96;
}

.compuart-pcb-summary-actions button.compuart-pcb-remove.button-link-delete {
  color: #b71c1c !important;
}

.compuart-pcb-summary-subtotal,
.compuart-pcb-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--pcb-line);
  background: #fff;
}

.compuart-pcb-summary-total {
  background: linear-gradient(135deg, rgba(168, 74, 228, 0.07), rgba(54, 118, 242, 0.07));
}

.compuart-pcb-summary-subtotal strong,
.compuart-pcb-summary-total strong {
  color: var(--pcb-text);
}

.compuart-pcb-budget-wrap,
.compuart-pcb-summary-subtotal,
.compuart-pcb-summary-total,
.compuart-pcb-shipping,
.compuart-pcb-share-wrap {
  margin-bottom: 10px;
}

.compuart-pcb-budget-input,
.compuart-pcb-share-link {
  width: 100%;
}

.compuart-pcb-warnings li {
  color: #9a6d00;
  font-size: 12px;
}

.compuart-pcb-whatsapp-share.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.compuart-pcb-product-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.compuart-pcb-product-modal.is-open {
  display: block;
}

.compuart-pcb-product-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.compuart-pcb-product-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  margin: 12px auto;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.compuart-pcb-product-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: var(--pcb-grad);
  color: #fff;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(80, 90, 240, 0.25);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.compuart-pcb-product-modal__close:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.compuart-pcb-product-modal__close:focus {
  outline: 2px solid #4a72f0;
  outline-offset: 2px;
}

.compuart-pcb-modal-head {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.compuart-pcb-modal-head img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.compuart-pcb-modal-head h4 {
  margin: 0 0 8px;
  color: var(--pcb-text);
}

.compuart-pcb-modal-price {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--pcb-text);
}

.compuart-pcb-modal-specs {
  margin: 6px 0 14px 18px;
}

.compuart-pcb-modal-specs li {
  margin-bottom: 4px;
}

.compuart-pcb-modal-description {
  line-height: 1.6;
  color: #33425f;
}

.compuart-pcb-product-modal__content h5 {
  margin: 12px 0 8px;
  color: var(--pcb-text);
  font-size: 14px;
}

.compuart-pcb-product-modal__content a {
  color: var(--pcb-accent);
  font-weight: 600;
}

.compuart-pcb-mobile-sticky {
  display: none;
}

@media (max-width: 980px) {
  .compuart-pc-builder {
    grid-template-columns: 1fr;
  }
  .compuart-pc-builder__summary {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .compuart-pcb-preset-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .compuart-pc-builder {
    padding: 12px;
    gap: 12px;
    border-radius: 12px;
  }

  .compuart-pcb-steps-list {
    gap: 6px;
    margin-bottom: 12px;
  }

  .compuart-pcb-step {
    font-size: 11px;
    padding: 6px 10px;
  }

  .compuart-pcb-global-tools,
  .compuart-pc-builder__toolbar {
    gap: 8px;
    margin-bottom: 8px;
    padding: 10px;
  }

  .compuart-pcb-global-tools label,
  .compuart-pc-builder__toolbar label {
    font-size: 12px;
  }

  .compuart-pcb-summary-actions button.compuart-pcb-change.button-link {
    min-width: 88px;
    height: 32px;
    font-size: 12px;
  }

  .compuart-pc-builder__products {
    grid-template-columns: 1fr;
  }

  .compuart-pcb-preset-cards {
    grid-template-columns: 1fr;
  }

  .compuart-pcb-search {
    min-width: 0;
    width: 100%;
  }

  .compuart-pcb-product-card {
    grid-template-columns: 78px 1fr;
    gap: 9px;
    padding: 10px;
  }

  .compuart-pcb-product-media img {
    width: 78px;
    height: 78px;
  }

  .compuart-pcb-product-title {
    font-size: 13px;
    min-height: 50px;
    -webkit-line-clamp: 2;
  }

  .compuart-pcb-details-btn {
    font-size: 11px;
    padding: 4px 9px;
  }

  .compuart-pcb-mobile-sticky {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    margin-top: 8px;
    background: rgba(17, 17, 17, 0.96);
    color: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  }

  .compuart-pcb-mobile-meta {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
  }

  .compuart-pcb-mobile-total {
    font-size: 14px;
  }

  .compuart-pcb-mobile-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
  }

  .compuart-pcb-mobile-nav .button {
    min-width: 88px;
    height: 38px;
    line-height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #fff !important;
  }

  .compuart-pcb-mobile-prev[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    color: #fff !important;
  }

  .compuart-pcb-modal-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .compuart-pcb-modal-head img {
    width: 120px;
    height: 120px;
  }

  .compuart-pcb-product-modal__dialog {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
    margin: 7px auto;
    padding: 14px;
    border-radius: 12px;
  }

  .compuart-pcb-product-modal__close {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    line-height: 34px;
    border-radius: 9px;
    font-size: 20px;
  }
}
