/* Crown Print Bundle Builder — front-end styling
   Brand palette: black / chrome-silver / copper-orange, matching the
   Crown Print badge mark. Everything is scoped under .cpb-scope, with a
   box-sizing + button/input reset up top, specifically so this can't be
   knocked off-kilter by whatever the active theme does with its own
   default <button>/<input> skins and global box-sizing rules. */

.cpb-scope {
	--cpb-black: #1a1a1a;
	--cpb-accent: #d9540f;
	--cpb-accent-dark: #b8460c;
	--cpb-silver: #8f8f8f;
	--cpb-green: #2e7d32;
	--cpb-green-bg: #e8f5e9;
	--cpb-border: #dcdcdc;
	--cpb-bg-soft: #f5f5f5;
	--cpb-text: #1a1a1a;
	--cpb-text-muted: #6b6b6b;
	--cpb-radius: 10px;

	color: var(--cpb-text);
}

.cpb-scope,
.cpb-scope *,
.cpb-scope *::before,
.cpb-scope *::after {
	box-sizing: border-box !important;
}

/* Every direct child of the widget and its main sub-containers gets an
   explicit block/full-width floor, so a page builder's "shrink to fit"
   or "inline everything" defaults can't quietly collapse a whole
   section down to its content width. */
.cpb-scope > div,
.cpb-scope > form,
.cpb-bundle-app > div,
.cpb-accordion-body > div {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
}

/* :where() keeps these resets at effectively zero specificity, so every
   component rule further down this file — however plainly it's written —
   always wins over both this reset AND any theme skinning on the same
   elements, regardless of source order. */
:where(.cpb-scope) button,
:where(.cpb-scope) input,
:where(.cpb-scope) select,
:where(.cpb-scope) textarea {
	all: revert;
	box-sizing: border-box !important;
	font-family: inherit;
	color: inherit;
}

:where(.cpb-scope) button {
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	text-align: left;
	line-height: normal;
}

:where(.cpb-scope) ul,
:where(.cpb-scope) ol {
	list-style: revert;
}

:where(.cpb-scope) a {
	color: var(--cpb-accent);
}

.cpb-save-badge {
	display: inline-block;
	background: var(--cpb-green-bg);
	color: var(--cpb-green);
	font-weight: 700;
	font-size: 0.8em;
	padding: 0.2em 0.6em;
	border-radius: 999px;
	margin-left: 0.5em;
	vertical-align: middle;
}

/* ---------- Trust badges ---------- */

.cpb-trust-row {
	display: flex;
	flex-direction: column;
	margin: 1.25em 0;
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	overflow: hidden;
	background: #fff;
}

.cpb-trust-item {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.75em 1em;
	border-bottom: 1px solid var(--cpb-border);
}

.cpb-trust-item:last-child {
	border-bottom: none;
}

.cpb-trust-icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	color: var(--cpb-black);
	border: 1px solid var(--cpb-black);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.8em;
}

.cpb-trust-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
	min-width: 0;
}

.cpb-trust-text strong {
	font-size: 0.88em;
}

.cpb-trust-text small {
	color: var(--cpb-text-muted);
	font-size: 0.76em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Accordions (what's included / groups) ---------- */

.cpb-accordion {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	margin-bottom: 0.85em;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cpb-accordion-toggle {
	display: flex !important;
	width: 100% !important;
	max-width: 100% !important;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	background: none !important;
	background-image: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0.9em 1em !important;
	margin: 0 !important;
	font: inherit;
	font-size: 1em;
	text-align: left;
	color: inherit;
}

/* Belt-and-braces: pin the "What's Included" accordion specifically by
   ID, which out-ranks any theme/page-builder rule short of another
   !important ID rule — covers cases where a generic class-based fix
   still loses to page-builder-injected styling on this one element. */
#cpb-whats-included,
#cpb-whats-included > .cpb-accordion-toggle {
	display: flex !important;
	width: 100% !important;
	max-width: 100% !important;
}

#cpb-whats-included {
	flex-direction: column !important;
}

.cpb-accordion-toggle:hover {
	background: var(--cpb-bg-soft);
}

.cpb-chevron {
	transition: transform 0.15s ease;
	color: var(--cpb-text-muted);
	flex: 0 0 auto;
}

.cpb-accordion.cpb-open > .cpb-accordion-toggle .cpb-chevron {
	transform: rotate(180deg);
}

.cpb-accordion-body {
	display: none;
	padding: 0 1em 1em;
	border-top: 1px solid var(--cpb-border);
}

.cpb-accordion.cpb-open > .cpb-accordion-body {
	display: block;
	padding-top: 1em;
}

#cpb-whats-included .cpb-accordion-toggle {
	font-weight: 700;
}

/* ---------- What's included ---------- */

.cpb-included-count {
	color: var(--cpb-text-muted);
	margin: 0 0 0.5em;
	font-weight: 600;
}

.cpb-included-list {
	margin: 0 0 0.6em;
	padding-left: 1.2em;
}

.cpb-included-list li {
	margin-bottom: 0.3em;
}

.cpb-included-logo {
	color: var(--cpb-green);
	font-weight: 600;
	margin: 0;
}

/* ---------- Savings banner ---------- */

.cpb-savings-banner {
	background: var(--cpb-green-bg);
	color: var(--cpb-green);
	border: 1px solid #c8e6c9;
	border-radius: var(--cpb-radius);
	padding: 0.75em 1em;
	margin-bottom: 1.25em;
	font-size: 0.98em;
}

.cpb-savings-banner strong {
	font-size: 1.05em;
}

/* ---------- How it works ---------- */

.cpb-how-it-works {
	display: flex;
	flex-direction: column;
	margin-bottom: 1.5em;
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	overflow: hidden;
	background: #fff;
}

.cpb-step {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.75em 1em;
	border-bottom: 1px solid var(--cpb-border);
}

.cpb-step:last-child {
	border-bottom: none;
}

.cpb-step-num {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--cpb-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85em;
}

.cpb-step strong {
	display: block;
	font-size: 0.95em;
}

.cpb-step small {
	color: var(--cpb-text-muted);
	font-size: 0.82em;
}

.cpb-step-arrow {
	display: none;
}

/* ---------- Builder header + progress bar ---------- */

.cpb-builder-header {
	margin: 1.5em 0 1em;
	padding-bottom: 0.75em;
}

.cpb-builder-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.6em;
	margin-bottom: 0.6em;
}

.cpb-builder-header-top h2 {
	margin: 0;
	font-size: 1.3em;
	flex: 1 1 auto;
}

.cpb-size-guide-link {
	font-size: 0.9em;
	text-decoration: underline;
	white-space: nowrap;
}

.cpb-overall-counter {
	font-weight: 700;
	background: #f5f5f5;
	color: var(--cpb-text);
	border: 1px solid var(--cpb-border);
	padding: 0.3em 0.8em;
	border-radius: 999px;
	font-size: 0.9em;
	white-space: nowrap;
}

.cpb-progress-track {
	height: 8px;
	background: #ececec;
	border-radius: 999px;
	overflow: hidden;
}

.cpb-progress-fill {
	height: 100%;
	width: 0%;
	background: var(--cpb-accent);
	transition: width 0.2s ease;
}

/* ---------- Logo field ---------- */

.cpb-logo-field {
	margin-bottom: 1.25em;
	padding: 0.75em 1em;
	background: var(--cpb-bg-soft);
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
}

.cpb-logo-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4em;
}

.cpb-logo-field input[type="text"] {
	width: 100%;
	max-width: 480px;
}

.cpb-logo-upload-wrap {
	margin-top: 0.85em;
	padding-top: 0.75em;
	border-top: 1px solid var(--cpb-border);
}

.cpb-logo-upload-label {
	font-weight: 600;
	margin-bottom: 0.4em;
}

.cpb-logo-upload-wrap input[type="file"] {
	display: block;
	max-width: 480px;
	font-size: 0.9em;
}

.cpb-logo-upload-wrap .description {
	display: block;
	font-size: 0.8em;
	color: var(--cpb-text-muted);
	margin-top: 0.3em;
}

.cpb-logo-upload-status {
	display: block;
	font-size: 0.82em;
	font-weight: 600;
	margin-top: 0.35em;
}

.cpb-logo-upload-status.cpb-upload-ok {
	color: var(--cpb-green);
}

.cpb-logo-upload-status.cpb-upload-error {
	color: #c8102e;
}

/* ---------- Group cards ---------- */

.cpb-group-header {
	align-items: flex-start;
}

.cpb-group-header-left {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	text-align: left;
}

.cpb-group-title {
	font-weight: 700;
	font-size: 1.05em;
}

.cpb-group-subtitle {
	font-size: 0.85em;
	color: var(--cpb-text-muted);
}

.cpb-group-header-right {
	display: flex;
	align-items: center;
	gap: 0.75em;
	flex: 0 0 auto;
}

.cpb-style-thumbs {
	display: flex;
	gap: 0.25em;
}

.cpb-thumb-icon {
	width: 30px;
	height: 30px;
	object-fit: cover;
	border-radius: 5px;
	border: 1px solid var(--cpb-border);
	background: #fff;
}

.cpb-group-status-block {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.3;
}

.cpb-group-status-label {
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--cpb-text-muted);
	text-transform: uppercase;
}

.cpb-group-counter {
	font-weight: 700;
	font-size: 0.95em;
}

.cpb-group-complete .cpb-group-status-label {
	color: var(--cpb-green);
}

.cpb-group-complete {
	border-color: var(--cpb-green);
}

.cpb-style-cards {
	display: flex;
	flex-direction: column;
	gap: 5rem !important;

}

/* ---------- Style cards ---------- */

.cpb-style-card {
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	padding: 1em;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cpb-style-card.cpb-locked .cpb-swatch:not(.cpb-swatch-active) {
	opacity: 0.4;
	pointer-events: none;
}

.cpb-style-top {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	margin-bottom: 0.6em;
}

.cpb-style-thumb-link {
	flex: 0 0 auto;
}

.cpb-style-thumb {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--cpb-border);
}

.cpb-style-info {
	flex: 1 1 auto;
	min-width: 0;
}

.cpb-style-name {
	font-weight: 700;
}

.cpb-style-meta {
	font-size: 0.85em;
	color: var(--cpb-text-muted);
}

.cpb-style-chips {
	font-size: 0.82em;
	color: var(--cpb-accent);
	font-weight: 600;
	margin-top: 0.3em;
}

.cpb-style-counter {
	flex: 0 0 auto;
	font-weight: 700;
	background: var(--cpb-bg-soft);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cpb-style-sizes-line {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	font-size: 0.85em;
	padding: 0.5em 0;
	border-top: 1px solid var(--cpb-border);
	flex-wrap: wrap;
}

.cpb-scope .cpb-features-toggle {
	background: none !important;
	background-image: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: var(--cpb-accent) !important;
	text-decoration: underline !important;
	cursor: pointer !important;
	font-size: 0.95em !important;
	padding: 0 !important;
	margin: 0 !important;
}

.cpb-features-list {
	margin: 0.4em 0 0.6em;
	padding-left: 1.2em;
	font-size: 0.85em;
	color: var(--cpb-text-muted);
}

.cpb-swatch-label {
	font-size: 0.85em;
	font-weight: 600;
	margin: 0.6em 0 0.5em;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.4em;
}

.cpb-colour-count {
	font-weight: 400;
	color: var(--cpb-text-muted);
}

.cpb-colour-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-bottom: 0.5em;
}

/* Belt-and-braces like the accordion fix above: some themes apply their own
   global button skin (background/border/radius) directly to bare <button>
   elements, at a specificity our plain .cpb-swatch rule can't beat. Doubling
   the selector + !important on every visual property guarantees the swatch
   always renders as a plain round colour circle regardless of theme CSS.
   The actual colour comes through a CSS custom property (set inline by JS)
   rather than an inline background — a plain inline background can still
   lose to a theme's own !important button rule, but var() referenced from
   an !important rule in our own stylesheet cannot. */
.cpb-scope .cpb-swatch,
.cpb-scope button.cpb-swatch {
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	min-height: 30px !important;
	border-radius: 50% !important;
	border: 2px solid var(--cpb-border) !important;
	background-color: var(--cpb-swatch-hex, #cccccc) !important;
	background-image: none !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: inset 0 0 0 2px #fff !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	line-height: 1 !important;
	flex: 0 0 auto !important;
}

.cpb-scope .cpb-swatch:hover {
	border-color: #bbb !important;
}

.cpb-scope .cpb-swatch-active {
	border-color: var(--cpb-accent) !important;
	box-shadow: 0 0 0 2px var(--cpb-accent) !important;
}

.cpb-swatch-check {
	font-size: 0.75em;
	color: #fff;
	text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
}

.cpb-size-stepper-panel {
	background: var(--cpb-bg-soft);
	border-radius: var(--cpb-radius);
	padding: 0.75em;
	margin-top: 0.5em;
}

.cpb-size-stepper-header {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.6em;
	font-size: 0.9em;
}

.cpb-mini-swatch {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid var(--cpb-border);
	display: inline-block;
}

.cpb-size-stepper-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
	gap: 0.5em;
}

.cpb-stepper-box {
	background: #fff;
	border: 1px solid var(--cpb-border);
	border-radius: 6px;
	padding: 0.5em;
	text-align: center;
}

.cpb-stepper-size {
	display: block;
	font-weight: 700;
	font-size: 0.85em;
	margin-bottom: 0.35em;
}

.cpb-stepper-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
}

.cpb-scope .cpb-stepper-controls button {
	width: 24px !important;
	height: 24px !important;
	min-width: 24px !important;
	min-height: 24px !important;
	border-radius: 50% !important;
	border: 1px solid var(--cpb-border) !important;
	background: #fff !important;
	background-image: none !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	font-size: 0.95em !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.cpb-scope .cpb-stepper-controls button:hover:not([disabled]) {
	border-color: var(--cpb-accent) !important;
	color: var(--cpb-accent) !important;
}

.cpb-scope .cpb-stepper-controls button[disabled] {
	opacity: 0.35 !important;
	cursor: not-allowed !important;
}

.cpb-stepper-qty {
	min-width: 18px;
	font-weight: 700;
}

/* ---------- Footer / submit ---------- */

/* Hidden entirely per request — no box, no background, no text. The group
   cards' own counters/progress bar already communicate what's left. */
.cpb-footer-notice {
	display: none !important;
}

.cpb-footer-line1 {
	margin: 0 0 0.2em;
	color: var(--cpb-text-muted);
}

.cpb-footer-line2 {
	margin: 0;
	font-weight: 700;
	color: var(--cpb-accent);
}

.cpb-add-to-cart-btn {
	margin-top: 0.5em;
}

.cpb-add-to-cart-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.cpb-notice {
	padding: 0.75em 1em;
	background: #fff4e5;
	border: 1px solid #ffd8a8;
	border-radius: var(--cpb-radius);
}

/* ---------- Product datasheets ---------- */

.cpb-datasheets {
	margin-top: 1.5em;
	padding: 1em;
	border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius);
	background: #fff;
}

.cpb-datasheets-title {
	margin: 0 0 0.75em;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.cpb-datasheets-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cpb-datasheets-item {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.65em 0;
	border-bottom: 1px solid var(--cpb-border);
}

.cpb-datasheets-item:last-child {
	border-bottom: none;
}

.cpb-datasheets-icon {
	flex: 0 0 auto;
	font-size: 1.1em;
}

.cpb-scope .cpb-datasheets-link {
	color: var(--cpb-accent) !important;
	font-weight: 700 !important;
	text-decoration: underline !important;
}

@media ( max-width: 600px ) {
	.cpb-builder-header-top {
		flex-direction: column;
		align-items: flex-start;
	}

	.cpb-group-header {
		flex-wrap: wrap;
	}

	.cpb-group-header-right {
		width: 100%;
		justify-content: space-between;
	}
}
