/* ===== BASE ===== */
.custom-pc {
    background: #f6f8fc;
}

/* ===== COMPONENT CARDS ===== */
.component-card {
    position: relative;
    border: 1px solid #e6eaf2;
    border-radius: 14px;
    padding: 10px;
    text-align: left;
    background: #ffffff;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.component-card.active {
    border: 1.5px solid #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
    background: #ffffff;
}

.component-card:not(.active) {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.component-card:not(.active)::before {
    content: "+";
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-card img {
    height: 56px;
    object-fit: contain;
    display: block;
    margin: 8px auto;
}

.card-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    margin-bottom: 2px;
}

.card-img-wrap img {
    height: 56px;
    object-fit: contain;
    margin: 0;
}

.card-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: .2px;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-primary {
    background: #ede9fe;
    color: #6d28d9;
}

.component-card h6 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.card-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 11px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.footer-text {
    font-size: 11px;
    color: #111827;
    font-weight: 500;
}

.check-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    color: #fff;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-scroll {
    max-height: 460px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.component-scroll::-webkit-scrollbar {
    width: 5px;
}

.component-scroll::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.row.g-3>[class*="col-"] {
    display: flex;
}

/* ===== BUTTONS ===== */
.smart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5ff;
    color: #3b82f6;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.smart-btn:hover {
    background: #e0e7ff;
}

.smart-btn .spark {
    font-size: 14px;
}

.btn-light {
    background: #f3f4f6;
    border: none;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
}

.btn-outline-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 8px;
}

.btn-outline-primary:hover {
    background: #2563eb;
    color: #fff;
}

/* ===== LIVE PREVIEW CARD ===== */
.live-preview-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border-radius: 18px !important;
    min-height: 0;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.preview-header h6 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.preview-pc-img {
    width: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* ===== GENERIC CARD ===== */
.card {
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

/* ===== SELECTED COMPONENTS BAR ===== */
.selected-components-wrap {
    background: #fff;
    border-radius: 20px;
    padding: 14px 18px;
    border: 1px solid #eef1f6;
    overflow: hidden;
}

.selected-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 15px;
}

.selected-top .left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.selected-top h6 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.compatibility-ok {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #e5e5e5;
    padding: 5px 10px;
    border-radius: 12px;
}

.compat-check {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.compat-check i {
    color: #fff;
    font-size: 6.2px;
    font-weight: 700;
}

.compatibility-text {
    font-size: 10px;
    font-weight: 600;
    color: #22c55e;
}

.right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.edit-all-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.selected-components-scroll {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 6px;
}

.selected-components-scroll::-webkit-scrollbar {
    height: 5px;
}

.selected-components-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 20px;
}

.selected-item {
    min-width: 240px;
    border: 1px solid #edf0f5;
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    flex-shrink: 0;
}

.selected-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-info small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 3px;
}

.item-info h6 {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #111827;
    line-height: 1.2;
}

.item-info span {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    line-height: 1.2;
}

.item-info .price {
    margin-top: 4px;
    font-weight: 700;
    font-size: 13px;
    color: #111827;
}

.delete-btn {
    border: none;
    background: transparent;
    color: #848484;
    cursor: pointer;
}

/* ===== BOTTOM BAR ===== */
.build-bottom-bar {
    position: sticky;
    bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 18px 20px;
    margin-top: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.bottom-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.circle-progress {
    position: relative;
    width: 50px;
    height: 50px;
}

.circle-progress svg {
    width: 50px;
    height: 50px;
    transform: rotate(-90deg);
}

.circle-progress .bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 4;
}

.circle-progress .progress {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 126;
}

.cube-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #6b7280;
}

.selected-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.selected-count {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.selected-label {
    font-size: 11px;
    color: #6b7280;
}

.price-comparison {
    display: flex;
    align-items: baseline;
    margin: 4px 0;
}

.price-original {
    font-size: 20px;
    color: #6b7280;
    text-decoration: line-through;
}

.price-discounted {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.modal-price-original {
    font-size: 14px;
    color: #6b7280;
    text-decoration: line-through;
}

.modal-price-discounted {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.discount-amount {
    font-size: 16px;
    font-weight: 600;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

.bottom-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-summary-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 24px;
    font-size: 13px;
    color: #667085;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    cursor: pointer;
}

.checkout-btn {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
    cursor: pointer;
}

/* ===== BUILD SUMMARY ===== */
.summary-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
}

.summary-card::-webkit-scrollbar {
    width: 3px;
}

.summary-card::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-header h6 {
    font-size: 14px;
    font-weight: 600;
}

.close-btn {
    font-size: 16px;
    color: #9ca3af;
    cursor: pointer;
}

.section-title {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.profile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.profile-card {
    width: calc(50% - 4px);
    flex: none;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    font-size: 9px;
    color: #6b7280;
}

.profile-card.active {
    border-color: #3b82f6;
    background: #eef2ff;
    color: #3b82f6;
}

.highlight-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #f5f3ff 0%, #eef2ff 100%);
    border-radius: 12px;
    padding: 12px;
    margin-top: 15px;
}

.diamond {
    font-size: 14px;
    color: #8b5cf6;
    background: #ede9fe;
    padding: 6px;
    border-radius: 8px;
}

.highlight-box strong {
    font-size: 13px;
    font-weight: 600;
    color: #6d28d9;
    display: block;
}

.highlight-box p {
    font-size: 9px;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
}

.perf-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 8px;
}

.summary-section .progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
}

.progress-bar {
    background: #6366f1;
}

.progress.purple .progress-bar {
    background: #8b5cf6;
}

.progress.pink .progress-bar {
    background: #a855f7;
}

.compat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.compat-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.compat-icon {
    color: #22c55e;
    font-size: 12px;
}

.compat-text {
    font-size: 12px;
    color: #22c55e;
}

.price-box {
    margin-top: 12px;
}

.price {
    font-weight: 700;
    font-size: 18px;
    margin: 6px 0 10px;
}

.save-outline-btn {
    width: 100%;
    background: #ffffff;
    border: 1px solid #2563eb;
    color: #2563eb;
    border-radius: 12px;
    padding: 10px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.save-outline-btn:hover {
    background: #eff6ff;
}

.download-link {
    width: 100%;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 12px;
    margin-top: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .preview-pc-img {
        height: 240px !important;
    }

    .build-bottom-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .bottom-right {
        width: 100%;
        flex-direction: column;
    }

    .checkout-btn,
    .view-summary-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .preview-pc-img {
        height: 200px !important;
    }

    .selected-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .selected-top .left,
    .selected-top .right {
        width: 100%;
        flex-wrap: wrap;
    }
}