#pcb-builder {
	--pcb-brand: #30347E;
	max-width: 950px;
	margin: 30px auto;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	font-family: inherit;
}

/* Header */
.pcb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	border-bottom: 1px solid #eee;
	flex-wrap: wrap;
	gap: 12px;
}
.pcb-logo { max-height: 42px; }
.pcb-header-right { display: flex; gap: 20px; flex-wrap: wrap; }
.pcb-hdr-btn {
	background: none; border: none; cursor: pointer;
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	font-size: 12px; color: #444;
}
.pcb-hdr-btn .pcb-icon { font-size: 18px; }
.pcb-hdr-btn:hover:not(:disabled) { color: var(--pcb-brand); }
.pcb-hdr-btn:disabled { opacity: .4; cursor: not-allowed; }
#pcb-hdr-cart .pcb-icon { color: var(--pcb-brand); }

/* Subheader */
.pcb-subheader {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 24px; flex-wrap: wrap; gap: 14px;
}
.pcb-subheader h2 { margin: 0 0 6px; font-size: 20px; color: var(--pcb-brand); }
.pcb-hide-toggle { font-size: 13px; color: #666; }

.pcb-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.pcb-badge {
	display: flex; flex-direction: column; align-items: center;
	border-radius: 6px; padding: 8px 18px; min-width: 90px;
}
.pcb-badge-outline { border: 1px dashed var(--pcb-brand); }
.pcb-badge-outline strong { color: var(--pcb-brand); font-size: 17px; }
.pcb-badge-solid { background: var(--pcb-brand); }
.pcb-badge-solid strong { color: #fff; font-size: 17px; }
.pcb-badge span { font-size: 11px; color: #888; }
.pcb-badge-solid span { color: #cfd0e8; }

/* Warnings */
#pcb-warnings { padding: 0 24px; }
.pcb-warning {
	background: #fff3cd; color: #7a5900; border: 1px solid #ffe08a;
	padding: 8px 12px; font-size: 13px; border-radius: 4px; margin-bottom: 8px;
}

/* Group */
.pcb-group-bar {
	background: #8a8f9e; color: #fff; font-weight: 600;
	padding: 8px 24px; font-size: 13px; letter-spacing: .3px;
}
.pcb-group-rows { padding: 0 24px; }

/* Row */
.pcb-row {
	display: flex; align-items: center; gap: 16px;
	padding: 14px 0; border-bottom: 1px solid #f0f0f0;
	flex-wrap: wrap;
}
.pcb-cat-icon { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.pcb-cat-icon-placeholder {
	display: flex; align-items: center; justify-content: center;
	background: #f2f0fa; border-radius: 6px; color: var(--pcb-brand); font-size: 18px;
}
.pcb-row-info { flex: 1 1 200px; min-width: 0; }
.pcb-row-label { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcb-required-badge {
	background: #444; color: #fff; font-size: 10px; padding: 2px 6px;
	border-radius: 3px; font-weight: 500; text-transform: uppercase;
}
.pcb-row-selected { font-size: 13px; color: #555; display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pcb-row-selected em { color: #999; font-style: normal; }
.pcb-thumb { width: 28px; height: 28px; object-fit: contain; border: 1px solid #eee; border-radius: 4px; }
.pcb-item-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcb-item-price { color: var(--pcb-brand); font-weight: 600; }

.pcb-qty-stepper { display: flex; align-items: center; gap: 6px; border: 1px solid #ddd; border-radius: 14px; padding: 2px 4px; }
.pcb-qty-minus, .pcb-qty-plus {
	width: 20px; height: 20px; border-radius: 50%; border: none; background: #f2f0fa;
	color: var(--pcb-brand); cursor: pointer; font-size: 13px; line-height: 1;
}
.pcb-qty-val { min-width: 14px; text-align: center; font-size: 13px; }

.pcb-row-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pcb-btn-choose {
	background: #fff; color: var(--pcb-brand); border: 1px solid var(--pcb-brand);
	padding: 8px 20px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.pcb-btn-choose:hover { background: var(--pcb-brand); color: #fff; }
.pcb-btn-remove {
	background: #f3f3f3; border: none; color: #999; width: 26px; height: 26px;
	border-radius: 50%; cursor: pointer; font-size: 13px;
}
.pcb-btn-remove:hover { background: #eee; color: #d33; }

/* Modal */
#pcb-modal-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,.5);
	display: flex; align-items: center; justify-content: center; z-index: 99999;
	padding: 16px;
}
#pcb-modal-overlay.pcb-hidden { display: none; }
#pcb-modal { background: #fff; width: 100%; max-width: 760px; max-height: 85vh; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.pcb-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; }
.pcb-modal-header h4 { margin: 0; }
#pcb-modal-close { cursor: pointer; font-size: 22px; color: #999; }

.pcb-modal-toolbar { display: flex; gap: 10px; padding: 12px 20px; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
#pcb-modal-search { flex: 1 1 200px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
#pcb-modal-sort { padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }

#pcb-modal-body { padding: 20px; overflow-y: auto; }
.pcb-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pcb-product-card { border: 1px solid #eee; border-radius: 6px; padding: 12px; text-align: center; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.pcb-product-card:hover { border-color: var(--pcb-brand); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pcb-product-card img { width: 100%; height: 90px; object-fit: contain; margin-bottom: 8px; }
.pcb-product-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pcb-product-price { font-size: 13px; color: var(--pcb-brand); }
.pcb-out-stock { color: #d33; font-size: 12px; margin-top: 4px; }

.pcb-hidden { display: none !important; }

/* ---------- Mobile responsiveness ---------- */
@media (max-width: 768px) {
	#pcb-builder { margin: 0; border-radius: 0; border-left: none; border-right: none; }
	.pcb-header { padding: 12px 14px; }
	.pcb-header-right { gap: 14px; justify-content: flex-start; width: 100%; }
	.pcb-subheader { padding: 14px; flex-direction: column; align-items: flex-start; }
	.pcb-badges { width: 100%; justify-content: space-between; }
	.pcb-badge { min-width: 0; flex: 1; padding: 8px 6px; }
	.pcb-group-rows { padding: 0 14px; }
	.pcb-group-bar { padding: 8px 14px; }
	#pcb-warnings { padding: 0 14px; }

	.pcb-row { padding: 14px 0; }
	.pcb-row-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
	.pcb-item-name { max-width: 140px; }

	#pcb-modal-overlay { padding: 0; align-items: flex-end; }
	#pcb-modal { max-width: 100%; max-height: 92vh; border-radius: 12px 12px 0 0; }
	.pcb-product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
	.pcb-badge span { font-size: 10px; }
	.pcb-badge strong { font-size: 14px; }
	.pcb-hdr-btn span { display: none; }
	.pcb-hdr-btn { font-size: 0; }
	.pcb-hdr-btn .pcb-icon { font-size: 20px; }
}

@media print {
	.pcb-hdr-btn, #pcb-hide-unconfigured, .pcb-btn-choose, .pcb-btn-remove, .pcb-qty-stepper { display: none !important; }
	#pcb-modal-overlay { display: none !important; }
}
