/* ── PC Builder — ForgePC Design Port ────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
    --pcb-red:   #dc0000;
    --pcb-green: #0a8a3f;
    --pcb-ink:   #141414;
    --pcb-muted: #9a9a9a;
    --pcb-line:  #ececec;
    --pcb-bg:    #ffffff;
}

.pc-builder-wrap *,
.pc-builder-wrap *::before,
.pc-builder-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.pc-builder-wrap {
    font-family: 'Rajdhani', sans-serif;
    color: var(--pcb-ink);
    background: var(--pcb-bg);
    border: 1px solid var(--pcb-line);
    border-radius: 8px;
    overflow: hidden;
    line-height: 1.4;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.pcb-app {
    display: flex;
    min-height: 600px;
    max-height: 88vh;
    overflow: hidden;
}

/* ── Left summary panel ───────────────────────────────────────────────────── */

.pcb-summary {
    width: 38%;
    flex: 0 0 38%;
    border-right: 1px solid var(--pcb-line);
    padding: 30px 32px 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pcb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.pcb-diamond {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    background: var(--pcb-red);
    transform: rotate(45deg);
}

.pcb-brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--pcb-ink);
}
.pcb-brand-name span { color: var(--pcb-red); }

.pcb-case-preview {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--pcb-line);
    background: #f4f4f4;
    position: relative;
}

.pcb-case-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.pcb-case-tag {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: var(--pcb-ink);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 5px 10px;
    border-radius: 3px;
}

.pcb-total-label {
    margin-top: 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    color: #8a8a8a;
    text-transform: uppercase;
}

.pcb-total-value {
    font-size: 52px;
    font-weight: 700;
    color: var(--pcb-red);
    line-height: 1.1;
    margin-top: 4px;
}

.pcb-total-sub {
    font-size: 13px;
    font-weight: 500;
    color: var(--pcb-muted);
    margin-top: 6px;
}

.pcb-selected-list {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--pcb-line);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    padding-bottom: 16px;
}

.pcb-sel-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f3f3;
}

.pcb-sel-cat {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #b0b0b0;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.pcb-sel-nm {
    font-size: 14px;
    font-weight: 600;
    color: #2a2a2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcb-sel-pr {
    font-size: 14px;
    font-weight: 700;
    color: var(--pcb-red);
    white-space: nowrap;
}

.pcb-empty-hint {
    font-size: 13px;
    font-weight: 500;
    color: #b5b5b5;
    line-height: 1.6;
    padding-top: 4px;
}

/* ── Mobile bar ───────────────────────────────────────────────────────────── */

.pcb-mobile-bar     { display: none; }
.pcb-mobile-summary { display: none; }

/* ── Main panel ───────────────────────────────────────────────────────────── */

.pcb-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pcb-progress-head {
    padding: 20px 30px 18px;
    border-bottom: 1px solid var(--pcb-line);
    flex-shrink: 0;
}

.pcb-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.pcb-configure-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pcb-configure-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--pcb-muted);
    margin-top: 2px;
}

.pcb-progress-count {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #555;
    white-space: nowrap;
}

.pcb-progress-count b {
    color: var(--pcb-red);
    font-size: 16px;
}

.pcb-bar {
    width: 100%;
    height: 5px;
    background: #efefef;
    border-radius: 4px;
    overflow: hidden;
}

.pcb-bar-fill {
    height: 100%;
    background: var(--pcb-red);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ── Accordion ────────────────────────────────────────────────────────────── */

.pcb-accordion {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.pcb-cat {
    border-bottom: 1px solid var(--pcb-line);
}

.pcb-cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 30px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.pcb-cat-head:hover          { background: #fafafa; }
.pcb-cat--open .pcb-cat-head { background: #fbfbfb; }

.pcb-cat-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pcb-cat-left-text { display: flex; flex-direction: column; }
.pcb-cat-sel-mobile { display: none; }

.pcb-cat-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    transform: rotate(45deg);
    background: #d6d6d6;
    transition: background 0.15s;
}
.pcb-cat--selected .pcb-cat-dot { background: var(--pcb-red); }

.pcb-cat-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.pcb-cat-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pcb-sel-name {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.pcb-sel-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pcb-red);
    white-space: nowrap;
}

.pcb-clear-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.1s;
    font-family: 'Rajdhani', sans-serif;
}
.pcb-clear-btn:hover { color: var(--pcb-red); }

.pcb-pill {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 4px 10px;
    border-radius: 3px;
    white-space: nowrap;
}
.pcb-pill--req { background: var(--pcb-ink); color: #fff; }
.pcb-pill--opt { background: #f0f0f0; color: #999; border: 1px solid #e0e0e0; }

.pcb-chevron {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 1.5px solid #d2d2d2;
    color: #888;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s;
}
.pcb-cat--open .pcb-chevron { border-color: var(--pcb-red); color: var(--pcb-red); }

/* ── Category body ────────────────────────────────────────────────────────── */

.pcb-cat-body {
    padding: 6px 30px 20px;
    background: #fbfbfb;
}

.pcb-prod-msg {
    text-align: center;
    color: #bbb;
    padding: 24px;
    font-size: 13px;
}

/* ── Product rows ─────────────────────────────────────────────────────────── */

.pcb-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.12s;
}

.pcb-product:hover:not(.pcb-product--nostock) { border-color: #c0c0c0; }

.pcb-product--active {
    border: 1px solid var(--pcb-red);
    border-left: 4px solid var(--pcb-red);
    box-shadow: 0 2px 10px rgba( 220, 0, 0, 0.10 );
}

.pcb-product--nostock {
    opacity: 0.35;
    cursor: not-allowed;
}

.pcb-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcb-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pcb-product--active .pcb-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba( 220, 0, 0, 0.08 );
}

.pcb-check {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pcb-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.pcb-prod-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pcb-prod-name {
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1c;
    line-height: 1.2;
}

.pcb-prod-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pcb-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 3px 8px;
    border-radius: 3px;
    color: #fff;
    white-space: nowrap;
    text-transform: uppercase;
}
.pcb-badge--popular { background: var(--pcb-red); }
.pcb-badge--value   { background: var(--pcb-green); }
.pcb-badge--new     { background: #0066cc; }

.pcb-prod-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    padding-left: 6px;
}

.pcb-prod-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--pcb-ink);
    white-space: nowrap;
}

.pcb-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--pcb-red);
    border-radius: 4px;
    overflow: hidden;
}

.pcb-qty-btn {
    background: none;
    border: none;
    width: 28px;
    height: 26px;
    font-size: 16px;
    font-weight: 700;
    color: var(--pcb-red);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    font-family: 'Rajdhani', sans-serif;
}
.pcb-qty-btn:hover { background: var(--pcb-red); color: #fff; }

.pcb-qty-val {
    width: 26px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--pcb-ink);
    border-left: 1.5px solid var(--pcb-red);
    border-right: 1.5px solid var(--pcb-red);
    line-height: 26px;
}

.pcb-qty-total {
    font-size: 11px;
    font-weight: 600;
    color: var(--pcb-red);
    white-space: nowrap;
}

.pcb-qty-confirm {
    background: var(--pcb-red);
    color: #fff;
    border: none;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Rajdhani', sans-serif;
    transition: background 0.12s;
}
.pcb-qty-confirm:hover { background: #b00000; }

.pcb-prod-price em {
    font-style: normal;
    font-size: 12px;
    color: var(--pcb-red);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.pcb-footer {
    padding: 14px 30px;
    border-top: 1px solid var(--pcb-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pcb-cart-err {
    font-size: 12px;
    color: var(--pcb-red);
    margin-right: auto;
}

.pcb-btn-pdf {
    background: #fff;
    color: var(--pcb-ink);
    border: 2px solid var(--pcb-ink);
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    font-family: 'Rajdhani', sans-serif;
}
.pcb-btn-pdf:hover { background: var(--pcb-ink); color: #fff; }

.pcb-btn-cart {
    background: var(--pcb-ink);
    color: #fff;
    border: none;
    padding: 13px 28px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    font-family: 'Rajdhani', sans-serif;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pcb-btn-cart:hover:not(:disabled) { background: var(--pcb-red); }
.pcb-btn-cart:disabled              { opacity: 0.5; cursor: not-allowed; }
.pcb-btn-cart--missing              { background: #bbb; }
.pcb-btn-cart--missing:hover        { background: #aaa !important; }

.pcb-loading {
    padding: 60px;
    text-align: center;
    color: #bbb;
    font-family: 'Rajdhani', sans-serif;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* ── Build tier ───────────────────────────────────────────────────────────── */

.pcb-build-tier {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 3px;
    margin: 4px 20px 2px;
    transition: background 0.3s;
}
.pcb-build-tier:empty { display: none; }

.pcb-tier--budget  { background: #2563eb; color: #fff; }
.pcb-tier--mid     { background: #7c3aed; color: #fff; }
.pcb-tier--high    { background: #d97706; color: #fff; }
.pcb-tier--extreme { background: var(--pcb-red); color: #fff; }

/* ── Build at a Glance ────────────────────────────────────────────────────── */

.pcb-glance {
    padding: 28px 30px 24px;
    border-top: 1px solid #f0f0f0;
    background: #f8f8f8;
}

.pcb-glance-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 18px;
}

/* ── Stat blocks ── */
.pcb-glance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.pcb-glance-stat-block {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
}

.pcb-glance-stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
    line-height: 1;
}

.pcb-glance-stat-num {
    font-size: 26px;
    font-weight: 800;
    color: #111;
    line-height: 1;
    margin-bottom: 6px;
}

.pcb-glance-stat-unit {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin-left: 2px;
}

.pcb-glance-stat-lbl {
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
}

/* ── Compatibility pills ── */
.pcb-glance-compat-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 10px;
}

.pcb-glance-compat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pcb-glance-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pcb-glance-pill--ok   { background: #dcfce7; color: #166534; }
.pcb-glance-pill--fail { background: #fee2e2; color: #991b1b; }
.pcb-glance-pill--warn { background: #fef9c3; color: #854d0e; }

@media (max-width: 600px) {
    .pcb-glance-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Warning banners ──────────────────────────────────────────────────────── */

.pcb-warnings { padding: 0 30px; }

.pcb-warning-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    margin-bottom: 6px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    line-height: 1.4;
}

/* ── Product-level warning ────────────────────────────────────────────────── */

.pcb-prod-warn {
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border-radius: 3px;
    padding: 3px 7px;
    margin-top: 4px;
}

/* ── Low stock badge ──────────────────────────────────────────────────────── */

.pcb-low-stock {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: #ef4444;
    padding: 2px 7px;
    border-radius: 3px;
    margin-left: 4px;
    animation: pcb-pulse 1.6s ease-in-out infinite;
}

@keyframes pcb-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* ── Savings badge ────────────────────────────────────────────────────────── */

.pcb-badge--save {
    background: var(--pcb-green);
    color: #fff;
}

/* ── Recommended badge ────────────────────────────────────────────────────── */

.pcb-badge--rec {
    background: #16a34a;
    color: #fff;
}

.pcb-product--rec {
    border-left: 3px solid #16a34a;
}

/* ── FPS badge ────────────────────────────────────────────────────────────── */

.pcb-badge--fps {
    background: #0ea5e9;
    color: #fff;
}

.pcb-badge--sticks {
    background: #7c3aed;
    color: #fff;
}

/* ── Was / sale price ─────────────────────────────────────────────────────── */

.pcb-was-price {
    font-size: 11px;
    color: #aaa;
    text-decoration: line-through;
    margin-top: 1px;
}

/* ── Qty max label ────────────────────────────────────────────────────────── */

.pcb-qty-max {
    font-size: 10px;
    color: #aaa;
    font-weight: 500;
}

/* ── Share button ─────────────────────────────────────────────────────────── */

.pcb-btn-share {
    background: #fff;
    color: var(--pcb-ink);
    border: 2px solid var(--pcb-ink);
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    font-family: 'Rajdhani', sans-serif;
}
.pcb-btn-share:hover { background: var(--pcb-ink); color: #fff; }
.pcb-btn-share--disabled { opacity: 0.4; cursor: default; }
.pcb-btn-share--disabled:hover { background: #fff; color: var(--pcb-ink); }

/* ── Toast notification ───────────────────────────────────────────────────── */

#pcb-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #141414;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

#pcb-toast.pcb-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media ( max-width: 820px ) {
    .pcb-app           { flex-direction: column; max-height: none; }
    .pcb-summary       { display: none; }
    .pcb-mobile-bar {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 18px;
        border-bottom: 1px solid var(--pcb-line);
        background: #fff;
        cursor: pointer;
    }
    .pcb-mobile-left   { display: flex; align-items: center; gap: 10px; }
    .pcb-m-label       { font-size: 9px; font-weight: 600; letter-spacing: 2px; color: #8a8a8a; text-transform: uppercase; }
    .pcb-m-total       { font-size: 26px; font-weight: 700; color: var(--pcb-red); line-height: 1; }
    .pcb-m-count       { font-size: 18px; font-weight: 700; color: #555; text-align: right; }
    .pcb-m-count b     { color: var(--pcb-red); }
    .pcb-m-x           { color: #c4c4c4; }
    .pcb-m-sub         { font-size: 11px; font-weight: 500; color: var(--pcb-muted); text-align: right; }
    .pcb-m-chevron     { font-size: 10px; color: #aaa; }

    .pcb-mobile-summary {
        display: block;
        background: #111;
        padding: 0 18px;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .pcb-mobile-summary--open { max-height: 520px; padding: 0 18px 14px; }
    .pcb-mobile-summary .pcb-sel-row  { border-bottom-color: #222; }
    .pcb-mobile-summary .pcb-sel-cat  { color: #555; }
    .pcb-mobile-summary .pcb-sel-nm   { color: #ccc; }
    .pcb-mobile-summary .pcb-sel-pr   { color: var(--pcb-red); }

    .pcb-main          { min-height: 0; overflow: visible; }
    .pcb-accordion     { max-height: 60vh; }
    .pcb-progress-head { padding: 14px 18px 12px; }
    .pcb-progress-count { display: none; }
    .pcb-cat-head      { padding: 14px 18px; }
    .pcb-cat-body      { padding: 4px 18px 16px; }
    .pcb-sel-name         { display: none; }
    .pcb-cat-left-text    { display: flex; flex-direction: column; gap: 2px; }
    .pcb-cat-sel-mobile   { display: block; font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
    .pcb-footer        { padding: 12px 16px; }
    .pcb-btn-cart      { flex: 1; justify-content: center; }
}
