.cpc-calculator {
	--cpc-border-color: var(--wp--preset--color--contrast-3, currentColor);
	--cpc-muted-color: var(--wp--preset--color--contrast-2, currentColor);
	--cpc-surface-color: var(--wp--preset--color--base, transparent);
	--cpc-accent-color: var(--wp--preset--color--accent, currentColor);
	--cpc-warning-bg: color-mix(in srgb, var(--cpc-accent-color) 12%, transparent);
	--cpc-warning-text: var(--cpc-accent-color);
	max-width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

.cpc-panel {
	padding: 1.5rem;
	border: 1px solid color-mix(in srgb, var(--cpc-border-color) 16%, transparent);
	border-radius: 1rem;
	background: color-mix(in srgb, var(--cpc-surface-color) 92%, transparent);
	box-shadow: 0 1px 2px color-mix(in srgb, var(--cpc-border-color) 6%, transparent);
}

.cpc-common-sizes,
.cpc-calculator-entry {
	max-width: 72rem;
	margin-left: auto;
	margin-right: auto;
}

.cpc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.cpc-common-sizes {
	margin-bottom: 1.5rem;
}

.cpc-common-sizes-header {
	max-width: 56rem;
	margin: 0 auto 1rem;
	text-align: center;
}

.cpc-common-sizes-header h2 {
	margin: 0 0 0.4rem;
	font-size: clamp(1.4rem, 2vw, 1.8rem);
}

.cpc-common-sizes-header p {
	margin: 0;
	color: var(--cpc-muted-color);
}

.cpc-common-sizes-controls {
	display: flex;
	justify-content: center;
	margin-top: 1rem;
}

.cpc-trade-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	border: 1px solid #ce0000;
	border-radius: 999px;
	background: color-mix(in srgb, var(--cpc-surface-color) 94%, transparent);
	font-weight: 600;
	text-align: center;
}

.cpc-trade-toggle input[type="checkbox"] {
	margin: 0;
	accent-color: #ce0000;
}

.cpc-common-sizes-table-wrap {
	overflow-x: auto;
}

.cpc-common-sizes-table {
	width: 100%;
	border-collapse: collapse;
	font: inherit;
	color: inherit;
	table-layout: fixed;
}

.cpc-common-sizes-table th,
.cpc-common-sizes-table td {
	padding: 0.75rem;
	border-bottom: 1px solid color-mix(in srgb, var(--cpc-border-color) 16%, transparent);
	text-align: center;
	vertical-align: middle;
}

.cpc-common-sizes-table thead th {
	color: #ce0000;
}

.cpc-common-sizes-table thead th:first-child,
.cpc-common-sizes-table tbody th {
	width: 16%;
}

.cpc-common-sizes-table thead th:not(:first-child),
.cpc-common-sizes-table tbody td {
	width: 21%;
}

.cpc-common-sizes-table tbody th {
	font-weight: 600;
}

.cpc-common-size-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-height: 2.5rem;
	padding: 0.5rem 0.9rem;
	border: 1px solid color-mix(in srgb, #ce0000 24%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, #ce0000 6%, var(--cpc-surface-color));
	color: #ce0000;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cpc-common-size-button::after {
	content: ">";
	font-size: 0.85em;
	line-height: 1;
	opacity: 0.72;
	transform: translateX(0);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.cpc-common-size-button:hover,
.cpc-common-size-button:focus {
	border-color: #ce0000;
	background: color-mix(in srgb, #ce0000 12%, var(--cpc-surface-color));
	color: var(--cpc-accent-color);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, #ce0000 12%, transparent);
	transform: translateY(-1px);
}

.cpc-common-size-button:hover::after,
.cpc-common-size-button:focus::after {
	opacity: 1;
	transform: translateX(2px);
}

.cpc-common-size-button:focus-visible {
	outline: none;
}

.cpc-common-size-button:active {
	transform: translateY(0);
}

.cpc-common-size-row[hidden] {
	display: none !important;
}

.cpc-common-sizes-footer {
	display: flex;
	justify-content: center;
	margin-top: 1rem;
}

.cpc-view-more-button {
	padding: 0.625rem 1rem;
	border: 1px solid color-mix(in srgb, var(--cpc-border-color) 20%, transparent);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cpc-view-more-button:hover,
.cpc-view-more-button:focus {
	border-color: color-mix(in srgb, var(--cpc-accent-color) 45%, transparent);
	color: var(--cpc-accent-color);
	outline: none;
}

.cpc-calculator-entry-header {
	margin-bottom: 1.25rem;
	text-align: center;
}

.cpc-calculator-entry-header h2 {
	margin: 0 0 0.4rem;
	font-size: clamp(1.35rem, 1.8vw, 1.7rem);
}

.cpc-calculator-entry-header p {
	margin: 0;
	color: var(--cpc-muted-color);
}

.cpc-calculator-entry-header .cpc-common-sizes-controls {
	margin-top: 1rem;
}

.cpc-calculator-entry .cpc-grid {
	margin-bottom: 1rem;
}

.cpc-field label {
	display: block;
	margin-bottom: 0.4rem;
	font: inherit;
	font-weight: 600;
	color: inherit;
}

.cpc-field input[type="number"] {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--cpc-border-color) 22%, transparent);
	border-radius: 0.5rem;
	background: inherit;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

.cpc-field select {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--cpc-border-color) 22%, transparent);
	border-radius: 0.5rem;
	background: inherit;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

.cpc-results {
	width: 100%;
	border-collapse: collapse;
	color: inherit;
	font: inherit;
	table-layout: fixed;
	margin-left: auto;
	margin-right: auto;
}

.cpc-results-wrap {
	overflow-x: auto;
	max-width: 64rem;
	margin-left: auto;
	margin-right: auto;
}

.cpc-status-message {
	margin: 0 0 1rem;
	font-weight: 600;
	color: var(--cpc-muted-color);
}

.cpc-status-message[data-state="idle"] {
	color: var(--cpc-muted-color);
}

.cpc-status-message[data-state="loading"] {
	color: var(--cpc-muted-color);
}

.cpc-status-message[data-state="loading"]::before {
	content: "";
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	margin-right: 0.4em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	vertical-align: -0.1em;
	animation: cpc-spin 0.7s linear infinite;
}

.cpc-status-message[data-state="error"] {
	color: #9f1239;
}

.cpc-status-message[data-state="error"]::before {
	content: "\26A0  ";
}

@keyframes cpc-spin {
	to {
		transform: rotate(360deg);
	}
}

.cpc-results th,
.cpc-results td {
	padding: 0.75rem;
	border-bottom: 1px solid color-mix(in srgb, var(--cpc-border-color) 16%, transparent);
	text-align: left;
	vertical-align: middle;
}

.cpc-results th {
	font-weight: 600;
}

.cpc-results thead th {
	background: color-mix(in srgb, var(--cpc-surface-color) 88%, transparent);
	color: #ce0000;
}

.cpc-results td[data-cpc-price] {
	font-weight: 600;
}

.cpc-finish-title {
	font-weight: 600;
}

.cpc-breakdown {
	display: grid;
	gap: 0.35rem;
	margin-top: 0.75rem;
}

.cpc-breakdown div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.cpc-cart-form {
	margin: 0;
}

.cpc-cart-form .button,
.cpc-cart-form button {
	width: 100%;
	font: inherit;
}

.cpc-product-configurator {
	--cpc-config-border: color-mix(in srgb, var(--cpc-border-color, currentColor) 16%, transparent);
	margin: 0 0 1.5rem;
	padding: 1.5rem;
	border: 1px solid var(--cpc-config-border);
	border-radius: 1rem;
	background: color-mix(in srgb, var(--cpc-surface-color, transparent) 92%, transparent);
}

.cpc-product-configurator-header h3,
.cpc-config-step-header h4 {
	margin: 0 0 0.35rem;
}

.cpc-product-configurator-header p {
	margin: 0 0 1rem;
	color: var(--cpc-muted-color, inherit);
}

.cpc-product-configurator-steps {
	display: grid;
	gap: 1rem;
}

	.cpc-config-step {
		display: grid;
		gap: 0.75rem;
	}

	.cpc-config-step[hidden] {
		display: none !important;
	}

.cpc-config-step-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.cpc-config-step-options--finish {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	justify-content: start;
	align-items: start;
}

@media (min-width: 520px) {
	.cpc-config-step-options--finish {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.cpc-option-card {
	display: grid;
	gap: 0.45rem;
	height: 100%;
}

.cpc-option-button {
	display: inline-flex;
	position: relative;
	align-items: center;
	gap: 0.45rem;
	padding: 0.875rem 1rem;
	border: 2px solid color-mix(in srgb, var(--cpc-border-color, currentColor) 35%, transparent);
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.cpc-option-button:hover:not(:disabled),
.cpc-option-button:focus-visible:not(:disabled) {
	border-color: color-mix(in srgb, #ce0000 38%, var(--cpc-border-color, currentColor));
	box-shadow: 0 10px 24px color-mix(in srgb, #0f172a 10%, transparent);
	transform: translateY(-1px);
}

.cpc-option-button:focus-visible {
	outline: 3px solid color-mix(in srgb, #ce0000 28%, transparent);
	outline-offset: 2px;
}

.cpc-option-button--finish {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
	grid-template-columns: minmax(0, 1fr);
	grid-auto-flow: row;
	width: 100%;
	height: auto;
	min-height: 0;
	padding: 0;
	text-align: left;
	overflow: hidden;
	border-radius: 0.75rem;
	background: #fff;
}

.cpc-option-button--finish:hover:not(:disabled),
.cpc-option-button--finish:focus-visible:not(:disabled) {
	box-shadow: 0 14px 30px color-mix(in srgb, #0f172a 14%, transparent);
}

.cpc-config-step-options--finish .cpc-option-media,
.cpc-config-step-options--finish .cpc-option-content {
	grid-column: 1;
	width: 100%;
}

.cpc-config-step-options--finish .cpc-option-media {
	height: auto;
	min-height: 0;
	aspect-ratio: 4 / 3;
}

.cpc-option-media {
	display: block;
	aspect-ratio: 4 / 3;
	background: color-mix(in srgb, var(--cpc-border-color, currentColor) 10%, white);
	overflow: hidden;
}

.cpc-option-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cpc-option-content {
	display: grid;
	gap: 0.25rem;
	padding: 0.85rem 0.95rem 0.95rem;
}

.cpc-config-step-options--finish .cpc-option-content {
	align-content: end;
	min-height: 0;
	padding: 0.55rem 0.75rem 0.7rem;
}

.cpc-config-step-options--finish .cpc-option-card--finish {
	position: relative;
	grid-template-rows: minmax(0, 1fr);
}

.cpc-option-label {
	font-weight: 600;
}

.cpc-option-button.is-selected {
	border-color: #ce0000;
	box-shadow: 0 0 0 2px color-mix(in srgb, #ce0000 18%, transparent);
}

.cpc-option-button.is-unavailable {
	opacity: 0.55;
	text-decoration: line-through;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.cpc-option-button.is-unavailable::after {
	content: "X";
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	font-size: 1.2rem;
	font-weight: 700;
	color: #ce0000;
	pointer-events: none;
}

.cpc-option-button--finish.is-unavailable {
	opacity: 1;
	text-decoration: none;
	border-color: color-mix(in srgb, var(--cpc-border-color, currentColor) 22%, transparent);
	background: color-mix(in srgb, #f8fafc 88%, white);
}

.cpc-option-button--finish.is-unavailable:hover,
.cpc-option-button--finish.is-unavailable:focus-visible {
	transform: none;
	box-shadow: none;
}

.cpc-option-button--finish.is-unavailable .cpc-option-media {
	filter: grayscale(1) saturate(0.3);
	opacity: 0.52;
}

.cpc-option-button--finish.is-unavailable .cpc-option-content {
	position: relative;
	color: color-mix(in srgb, currentColor 68%, white);
}

.cpc-option-button--finish.is-unavailable::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, transparent 47%, rgba(206, 0, 0, 0.7) 49%, rgba(206, 0, 0, 0.7) 51%, transparent 53%);
	pointer-events: none;
	z-index: 1;
}

.cpc-option-button--finish.is-unavailable::after {
	content: "Unavailable";
	position: absolute;
	left: 0.75rem;
	right: 0.75rem;
	bottom: 0.75rem;
	transform: none;
	inset: auto 0.75rem 0.75rem;
	padding: 0.32rem 0.55rem;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.84);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-align: center;
	text-transform: uppercase;
	pointer-events: none;
	z-index: 2;
}

.cpc-option-price {
	color: #5b2a86;
	font-weight: 600;
}

.cpc-option-preview-trigger {
	position: absolute;
	top: 0.7rem;
	right: 0.7rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
	background: rgba(17, 24, 39, 0.62);
	color: #fff;
	font: inherit;
	line-height: 0;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
	cursor: pointer;
}

.cpc-option-preview-trigger:hover,
.cpc-option-preview-trigger:focus-visible {
	background: rgba(17, 24, 39, 0.8);
	border-color: rgba(255, 255, 255, 0.72);
}

.cpc-option-preview-trigger svg {
	width: 1rem;
	height: 1rem;
	display: block;
	fill: currentColor;
}

.cpc-finish-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 1.25rem;
}

.cpc-finish-lightbox[hidden] {
	display: none !important;
}

.cpc-finish-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 18, 28, 0.72);
}

.cpc-finish-lightbox-dialog {
	position: relative;
	z-index: 1;
	width: min(92vw, 780px);
	max-height: 90vh;
	padding: 1rem;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 80px rgba(12, 18, 28, 0.25);
}

.cpc-finish-lightbox-close {
	position: absolute;
	top: 0.65rem;
	right: 0.75rem;
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid rgba(17, 17, 17, 0.12);
	border-radius: 999px;
	background: rgba(17, 17, 17, 0.08);
	color: #111;
	font: inherit;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cpc-finish-lightbox-close:hover,
.cpc-finish-lightbox-close:focus-visible {
	background: rgba(17, 17, 17, 0.18);
	border-color: rgba(17, 17, 17, 0.22);
}

.cpc-finish-lightbox-close:hover {
	transform: translateY(-1px);
}

.cpc-finish-lightbox-close:focus-visible {
	outline: 3px solid color-mix(in srgb, #ce0000 24%, transparent);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.cpc-finish-lightbox-body {
	display: grid;
	gap: 0.85rem;
}

.cpc-finish-lightbox-body img {
	display: block;
	width: 100%;
	max-height: 72vh;
	object-fit: contain;
	border-radius: 12px;
	background: #f6f7f7;
}

.cpc-finish-lightbox-caption {
	margin: 0;
	font-weight: 600;
	text-align: center;
}

.cpc-product-configurator-footer {
	display: grid;
	gap: 0.85rem;
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--cpc-config-border);
}

.cpc-product-configurator-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.cpc-product-configurator-total strong {
	font-size: 1.5rem;
	color: #5b2a86;
}

.cpc-product-configurator-summary {
	display: grid;
	gap: 0.3rem;
	font-size: 0.95rem;
}

.cpc-muted {
	color: var(--cpc-muted-color);
	font-size: 0.92rem;
}

@media (max-width: 640px) {
	.cpc-calculator {
		padding: 0;
	}

	.cpc-panel {
		padding: 1rem;
	}

	.cpc-results,
	.cpc-results thead,
	.cpc-results tbody,
	.cpc-results tr,
	.cpc-results th,
	.cpc-results td {
		display: block;
	}

	.cpc-results thead {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.cpc-results tr {
		padding: 0.75rem 0;
		border-bottom: 1px solid color-mix(in srgb, var(--cpc-border-color) 16%, transparent);
	}

	.cpc-results td {
		padding: 0.5rem 0;
		border: 0;
	}

	.cpc-breakdown div {
		flex-direction: column;
		gap: 0.15rem;
	}

	.cpc-common-sizes-table,
	.cpc-common-sizes-table thead,
	.cpc-common-sizes-table tbody,
	.cpc-common-sizes-table tr,
	.cpc-common-sizes-table th,
	.cpc-common-sizes-table td {
		display: block;
		width: 100% !important;
		box-sizing: border-box;
	}

	.cpc-common-sizes-table thead {
		position: absolute;
		width: 1px !important;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.cpc-common-sizes-table tr {
		padding: 0.9rem 0;
		border-bottom: 1px solid color-mix(in srgb, var(--cpc-border-color) 16%, transparent);
	}

	.cpc-common-size-row {
		padding: 0.75rem 0;
		border-bottom: 2px solid color-mix(in srgb, var(--cpc-border-color) 10%, transparent);
	}

	.cpc-common-sizes-table th,
	.cpc-common-sizes-table td {
		padding: 0.4rem 0;
		border: 0;
		text-align: left;
		white-space: normal;
	}

	.cpc-common-sizes-table tbody td::before {
		content: attr(data-cpc-label);
		display: block;
		margin-bottom: 0.15rem;
		color: #ce0000;
		font-weight: 600;
	}

	.cpc-common-size-row:nth-child(even) td {
		background: color-mix(in srgb, var(--cpc-border-color) 3%, transparent);
	}

	.cpc-common-size-row td,
	.cpc-common-size-row th {
		padding-left: 0.55rem;
		padding-right: 0.55rem;
	}

	.cpc-product-configurator {
		padding: 1rem;
	}

	.cpc-product-configurator-total {
		flex-direction: column;
		align-items: flex-start;
	}
}
