/* ===== PC Builder Wrapper ===== */
.hacom-pcb-wrap {
    font-family: inherit;
    box-sizing: border-box;
}
.hacom-pcb-wrap *, .hacom-pcb-wrap *::before, .hacom-pcb-wrap *::after {
    box-sizing: border-box;
}

/* ===== Table ===== */
.hacom-pcb-wrap .hacom-pcb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.hacom-pcb-wrap .hacom-pcb-row td {
    background: #fff;
    border: 0;
    padding: 12px 16px;
    vertical-align: middle;
}

.hacom-pcb-wrap .hacom-pcb-row:last-child td { border-bottom: none; }
.hacom-pcb-wrap .hacom-pcb-row:nth-child(even) td { background: #fafafa; }

.hacom-pcb-wrap .hacom-pcb-label {
    width: 200px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
    color: #222;
}

.hacom-pcb-wrap .hacom-pcb-action {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* ===== Select Button ===== */
.hacom-pcb-wrap .hacom-pcb-btn-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    text-decoration: none;
    line-height: 1.4;
}

.hacom-pcb-wrap .hacom-pcb-btn-select:hover {
    background: #c62828;
    color: #fff;
    text-decoration: none;
}


/* ===== Selected Product Card ===== */
.hacom-pcb-wrap .hacom-pcb-selected-product {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.hacom-pcb-wrap .hacom-pcb-selected-product img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.hacom-pcb-wrap .hacom-pcb-selected-info {
    flex: 1;
    min-width: 0;
}

.hacom-pcb-wrap .hacom-pcb-selected-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a237e;
    line-height: 1.4;
    margin-bottom: 2px;
}

.hacom-pcb-wrap .hacom-pcb-selected-meta {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

.hacom-pcb-wrap .hacom-pcb-stock-in  { color: #2e7d32; }
.hacom-pcb-wrap .hacom-pcb-stock-out { color: #c62828; }

/* Price + qty block */
.hacom-pcb-wrap .hacom-pcb-selected-price-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.hacom-pcb-wrap .hacom-pcb-unit-price {
    font-size: 13px;
    color: #333;
}

.hacom-pcb-wrap .hacom-pcb-times {
    font-size: 13px;
    color: #888;
}

.hacom-pcb-wrap .hacom-pcb-selected-total {
    font-size: 14px;
    font-weight: 700;
    color: #e53935;
    min-width: 90px;
    text-align: right;
}

/* Qty controls */
.hacom-pcb-wrap .hacom-pcb-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.hacom-pcb-wrap .hacom-pcb-qty-btn {
    background: #f5f5f5;
    border: none;
    width: 26px;
    height: 26px;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    color: #444;
    flex-shrink: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-transform: none;
}

.hacom-pcb-wrap .hacom-pcb-qty-btn:hover {
    background: #e0e0e0;
    color: #444;
}

.hacom-pcb-wrap .hacom-pcb-qty {
    width: 36px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 13px;
    height: 26px;
    padding: 0;
    outline: none;
    -moz-appearance: textfield;
}
.hacom-pcb-wrap .hacom-pcb-qty::-webkit-outer-spin-button,
.hacom-pcb-wrap .hacom-pcb-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Action buttons (edit / remove) */
.hacom-pcb-wrap .hacom-pcb-selected-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hacom-pcb-wrap .hacom-pcb-btn-edit,
.hacom-pcb-wrap .hacom-pcb-btn-remove {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.2s;
    opacity: 0.6;
    box-shadow: none;
    border-radius: 0;
    text-transform: none;
}

.hacom-pcb-wrap .hacom-pcb-btn-edit   { color: #1a237e; }
.hacom-pcb-wrap .hacom-pcb-btn-remove { color: #c62828; }
.hacom-pcb-wrap .hacom-pcb-btn-edit:hover,
.hacom-pcb-wrap .hacom-pcb-btn-remove:hover { opacity: 1; }

/* ===== Summary ===== */
.hacom-pcb-wrap .hacom-pcb-summary-wrap {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.hacom-pcb-wrap .hacom-pcb-note {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    min-width: 280px;
}

.hacom-pcb-wrap .hacom-pcb-note-tag {
    display: inline-block;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 8px;
}

.hacom-pcb-wrap .hacom-pcb-summary {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    min-width: 280px;
    width: 340px;
    flex-shrink: 0;
}

.hacom-pcb-wrap .hacom-pcb-summary-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
}

.hacom-pcb-wrap .hacom-pcb-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.hacom-pcb-wrap .hacom-pcb-total-row {
    font-weight: 700;
    font-size: 15px;
    color: #222;
    border-bottom: none;
}

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

.hacom-pcb-wrap .hacom-pcb-btn-cart,
.hacom-pcb-wrap .hacom-pcb-btn-order {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    text-decoration: none;
    line-height: 1.4;
}

.hacom-pcb-wrap .hacom-pcb-btn-cart {
    background: #fff;
    border: 2px solid #1a237e;
    color: #1a237e;
}

.hacom-pcb-wrap .hacom-pcb-btn-order {
    background: #1a237e;
    border: none;
    color: #fff;
}

.hacom-pcb-wrap .hacom-pcb-btn-cart:disabled,
.hacom-pcb-wrap .hacom-pcb-btn-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hacom-pcb-wrap .hacom-pcb-btn-cart:not(:disabled):hover {
    background: #e8eaf6;
    color: #1a237e;
}
.hacom-pcb-wrap .hacom-pcb-btn-order:not(:disabled):hover {
    background: #283593;
    color: #fff;
}

/* ===== Action Bar (below summary) ===== */
.hacom-pcb-wrap .hacom-pcb-action-bar {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.hacom-pcb-wrap .hacom-pcb-action-btn {
    flex: 1;
    min-width: 160px;
    padding: 13px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.2px;
    transition: opacity 0.15s, filter 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: none;
    box-shadow: none;
    text-decoration: none;
    line-height: 1.4;
}

.hacom-pcb-wrap .hacom-pcb-action-red {
    background: #e53935;
    color: #fff;
}

.hacom-pcb-wrap .hacom-pcb-action-navy {
    background: #1a237e;
    color: #fff;
}

.hacom-pcb-wrap .hacom-pcb-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.hacom-pcb-wrap .hacom-pcb-action-btn:not(:disabled):hover {
    filter: brightness(1.1);
}

@media (max-width: 640px) {
    .hacom-pcb-wrap .hacom-pcb-action-bar { flex-direction: column; }
    .hacom-pcb-wrap .hacom-pcb-action-btn { min-width: unset; }
}

/* ===== Capture Div (off-screen) ===== */
#hacom-pcb-capture {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 600px;
    visibility: hidden;
    pointer-events: none;
}

#hacom-pcb-capture.hacom-pcb-cap-rendering {
    visibility: visible;
}

.hacom-pcb-cap-wrap {
    width: 600px;
    background: #fff;
    font-family: Arial, 'Helvetica Neue', sans-serif;
    padding: 24px 30px 20px;
    box-sizing: border-box;
    color: #222;
}

.hacom-pcb-cap-header {
    text-align: center;
    margin-bottom: 12px;
}

.hacom-pcb-cap-logo {
    max-height: 60px;
    max-width: 200px;
    display: block;
    margin: 0 auto 8px;
    object-fit: contain;
}

.hacom-pcb-cap-logo-text {
    font-size: 28px;
    font-weight: 900;
    color: #e53935;
    letter-spacing: 1px;
}

.hacom-pcb-cap-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin: 6px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hacom-pcb-cap-hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 12px 0;
}

/* Product rows in capture */
.hacom-pcb-cap-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.hacom-pcb-cap-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 4px;
}

.hacom-pcb-cap-info {
    flex: 1;
    min-width: 0;
}

.hacom-pcb-cap-name {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    margin-bottom: 3px;
}

.hacom-pcb-cap-meta {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

.hacom-pcb-cap-unit {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-top: 4px;
}

.hacom-pcb-cap-price {
    font-size: 18px;
    font-weight: 700;
    color: #e53935;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
    padding-top: 2px;
}

/* Totals */
.hacom-pcb-cap-totals {
    padding: 8px 0;
}

.hacom-pcb-cap-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    color: #e53935;
    padding: 4px 0;
}

.hacom-pcb-cap-total-row span:first-child { color: #222; }

.hacom-pcb-cap-total-main {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

.hacom-pcb-cap-total-main span:first-child { color: #222; }

/* Footer */
.hacom-pcb-cap-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #444;
    line-height: 1.8;
}

.hacom-pcb-cap-thanks {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
}

.hacom-pcb-cap-site {
    color: #1565c0;
    font-weight: 600;
}

/* ===== Modal Overlay ===== */
.hacom-pcb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.hacom-pcb-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* ===== Modal Header ===== */
.hacom-pcb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a237e;
    color: #fff;
}

.hacom-pcb-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.hacom-pcb-modal-header .hacom-pcb-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
    box-shadow: none;
    border-radius: 0;
    text-transform: none;
}
.hacom-pcb-modal-header .hacom-pcb-modal-close:hover { opacity: 1; }

/* ===== Modal Body ===== */
.hacom-pcb-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.hacom-pcb-modal-sidebar {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
}

.hacom-pcb-filter-title {
    font-size: 13px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.hacom-pcb-filter-section {
    margin-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 16px;
}

.hacom-pcb-filter-section:last-child { border-bottom: none; }

.hacom-pcb-filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    margin-bottom: 10px;
    user-select: none;
}

.hacom-pcb-toggle-icon { font-size: 12px; color: #888; }

.hacom-pcb-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    padding: 4px 0;
    cursor: pointer;
}

.hacom-pcb-filter-option input[type="radio"],
.hacom-pcb-filter-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #1a237e;
}

/* ===== Modal Main ===== */
.hacom-pcb-modal-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hacom-pcb-modal-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    flex-wrap: wrap;
}

.hacom-pcb-search-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 14px;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.hacom-pcb-search-wrap .hacom-pcb-search {
    border: none ;
    outline: none;
    font-size: 13px;
    flex: 1;
    background: transparent;
}

.hacom-pcb-search-icon { font-size: 14px; }

.hacom-pcb-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.hacom-pcb-sort {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    width: auto;
}

.hacom-pcb-result-info {
    padding: 10px 16px;
    font-size: 13px;
    color: #e53935;
    border-bottom: 1px solid #f0f0f0;
}

/* ===== Product List ===== */
.hacom-pcb-products-list {
    flex: 1;
    padding: 8px 16px;
}

.hacom-pcb-product-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}

.hacom-pcb-product-item:last-child { border-bottom: none; }

.hacom-pcb-product-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.hacom-pcb-product-info { flex: 1; }

.hacom-pcb-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin-bottom: 3px;
}

.hacom-pcb-product-sku {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.hacom-pcb-product-warranty {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.hacom-pcb-product-price {
    font-size: 14px;
    font-weight: 700;
    color: #e53935;
}

.hacom-pcb-product-stock {
    font-size: 12px;
    color: #2e7d32;
    font-weight: 600;
}

.hacom-pcb-product-stock.out { color: #c62828; }

.hacom-pcb-product-item .hacom-pcb-btn-add {
    background: #1a237e;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
    text-transform: none;
    box-shadow: none;
    text-decoration: none;
    line-height: 1.4;
}

.hacom-pcb-product-item .hacom-pcb-btn-add:hover {
    background: #283593;
    color: #fff;
}

/* ===== Pagination ===== */
.hacom-pcb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 16px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.hacom-pcb-page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0 4px;
    text-transform: none;
    box-shadow: none;
    text-decoration: none;
    line-height: 1;
}

.hacom-pcb-page-btn:hover {
    background: #e8eaf6;
    border-color: #1a237e;
    color: #1a237e;
}
.hacom-pcb-page-btn.active {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
}
.hacom-pcb-page-btn.dots {
    cursor: default;
    border: none;
    background: none;
}
.hacom-pcb-page-btn.dots:hover {
    background: none;
    color: #333;
}

/* ===== Loading ===== */
.hacom-pcb-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

.hacom-pcb-no-products {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .hacom-pcb-wrap .hacom-pcb-label { min-width: 120px; font-size: 13px; }
    .hacom-pcb-modal-sidebar { width: 160px; min-width: 160px; }
    .hacom-pcb-wrap .hacom-pcb-summary-wrap { flex-direction: column; }
    .hacom-pcb-wrap .hacom-pcb-summary { width: 100%; }
}
