/* CNC Kit Builder – front end.
 * Colours can be changed from the theme's custom CSS, e.g.
 * .ckb-wrap { --ckb-accent: #d71920; }
 */

.ckb-wrap {
	--ckb-accent: #2c7bc4;
	--ckb-border: #dcdcdc;
	--ckb-muted: #6b6b6b;
	--ckb-surface: #fff;
	--ckb-soft: #f3f3f3;
	--ckb-radius: 6px;
	margin: 2em 0;
}

.ckb-wrap--wide {
	clear: both;
	width: auto;
	float: none;
	box-sizing: border-box;
}

.ckb-layout-list .ckb-step__title {
	margin-bottom: 0.5em;
}

.ckb-form [hidden] {
	display: none !important;
}

.ckb-heading {
	text-align: center;
	margin: 0 0 1.25em;
}

/* ---- Overview tiles --------------------------------------------------- */

.ckb-tiles {
	list-style: none;
	margin: 0 0 2em;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2em 1.25em;
}

@media (min-width: 700px) {
	.ckb-tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 2.5em 2em;
	}
}

.ckb-tile {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-width: 0;
}

.ckb-tile__title {
	font-size: 1.1em;
	font-weight: 400;
	margin: 0 0 0.75em;
}

.ckb-tile__optional {
	color: var(--ckb-muted);
	font-weight: 400;
}

.ckb-tile__media {
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 260px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.ckb-tile__media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: 0 auto;
}

.ckb-tile__selection {
	margin: 0.9em 0 0;
	font-size: 0.95em;
	color: var(--ckb-muted);
	overflow-wrap: anywhere;
}

.ckb-tile.is-chosen .ckb-tile__selection {
	color: inherit;
	font-weight: 600;
}

.ckb-tile__price {
	margin: 0.15em 0 0;
	font-size: 0.95em;
	min-height: 1.4em;
}

.ckb-tile__button {
	margin-top: 0.6em;
}

/* ---- Step-by-step ----------------------------------------------------- */

.ckb-stepper ol {
	list-style: none;
	margin: 0 0 1.5em;
	padding: 0 0 0.25em;
	display: flex;
	gap: 0.5em;
	overflow-x: auto;
	scrollbar-width: thin;
}

.ckb-stepper li {
	margin: 0;
	flex: 0 0 auto;
}

.ckb-stepper__item {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.4em 0.8em 0.4em 0.4em;
	border: 1px solid var(--ckb-border);
	border-radius: 999px;
	background: var(--ckb-surface);
	color: inherit;
	font: inherit;
	font-size: 0.9em;
	line-height: 1.2;
	cursor: pointer;
}

.ckb-stepper__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7em;
	height: 1.7em;
	border-radius: 50%;
	background: var(--ckb-soft);
	font-weight: 600;
	font-size: 0.85em;
}

.ckb-stepper__item.is-done .ckb-stepper__num {
	background: var(--ckb-accent);
	color: #fff;
}

.ckb-stepper__item.is-current {
	border-color: var(--ckb-accent);
	box-shadow: inset 0 0 0 1px var(--ckb-accent);
	font-weight: 600;
}

.ckb-step {
	border: 0;
	margin: 0 0 1.5em;
	padding: 0;
	min-width: 0;
}

.ckb-step__title {
	display: block;
	width: 100%;
	font-size: 1.35em;
	font-weight: 600;
	margin: 0 0 0.6em;
	padding: 0;
	outline: none;
}

.ckb-step__count {
	display: block;
	font-size: 0.6em;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ckb-muted);
	margin-bottom: 0.2em;
}

.ckb-step__optional {
	font-weight: 400;
	font-size: 0.75em;
	color: var(--ckb-muted);
}

.ckb-step__description {
	color: var(--ckb-muted);
	margin-bottom: 1em;
}

.ckb-step__description p:last-child {
	margin-bottom: 0;
}

.ckb-form .ckb-step__search input[type="search"] {
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
}

.ckb-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1em;
}

@media (max-width: 480px) {
	.ckb-options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.6em;
	}
}

.ckb-option {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0.75em;
	border: 1px solid var(--ckb-border);
	border-radius: var(--ckb-radius);
	background: var(--ckb-surface);
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	min-width: 0;
}

.ckb-option:hover {
	border-color: #a8a8a8;
}

.ckb-option__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.ckb-option:has(.ckb-option__input:checked) {
	border-color: var(--ckb-accent);
	box-shadow: inset 0 0 0 1px var(--ckb-accent);
}

.ckb-option:has(.ckb-option__input:focus-visible) {
	outline: 2px solid var(--ckb-accent);
	outline-offset: 2px;
}

.ckb-option.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ckb-option__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	margin-bottom: 0.6em;
	background: var(--ckb-surface);
}

.ckb-option__media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ckb-option__media--none {
	font-size: 2.2em;
	color: #b5b5b5;
	background: var(--ckb-soft);
	border-radius: calc(var(--ckb-radius) - 2px);
}

.ckb-option__body {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
	min-width: 0;
}

.ckb-option__title {
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.ckb-option__desc {
	font-size: 0.85em;
	color: var(--ckb-muted);
	line-height: 1.4;
}

.ckb-option__price {
	font-size: 0.95em;
}

.ckb-option__price del {
	opacity: 0.6;
	margin-right: 0.3em;
}

.ckb-option__price ins {
	text-decoration: none;
	background: none;
	font-weight: 600;
}

.ckb-option__stock {
	font-size: 0.8em;
	margin: 0 !important;
}

.ckb-qty-note,
.ckb-included {
	color: var(--ckb-muted);
}

.ckb-option__check {
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	width: 1.5em;
	height: 1.5em;
	border-radius: 50%;
	background: var(--ckb-accent);
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.ckb-option__check::after {
	content: "";
	position: absolute;
	left: 0.52em;
	top: 0.3em;
	width: 0.35em;
	height: 0.65em;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.ckb-option:has(.ckb-option__input:checked) .ckb-option__check {
	opacity: 1;
	transform: scale(1);
}

.ckb-no-matches,
.ckb-empty {
	grid-column: 1 / -1;
	color: var(--ckb-muted);
	margin: 0;
}

/* Without the script every step is shown as a plain list. */
.ckb-form:not(.ckb-js) .ckb-step {
	margin-bottom: 2.5em;
}

.ckb-wizard__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
	margin: 0 0 2em;
	padding-top: 1em;
	border-top: 1px solid var(--ckb-border);
}

.ckb-wizard__nav .ckb-next {
	margin-left: auto;
}

.ckb-to-overview {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

/* ---- Summary ---------------------------------------------------------- */

.ckb-notice {
	margin: 0 0 1.25em !important;
}

.ckb-total {
	font-size: 1.25em;
	margin: 0 0 1em;
}

.ckb-total__label {
	margin-right: 0.35em;
}

.ckb-total__amount {
	font-weight: 700;
}

.ckb-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75em;
}

.ckb-actions .quantity {
	margin: 0 !important;
	float: none !important;
}

.ckb-actions .single_add_to_cart_button {
	float: none !important;
	margin: 0 !important;
}

.ckb-actions .single_add_to_cart_button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---- Cart, checkout, mini cart, order pages --------------------------- */

.ckb-label {
	font-weight: 600;
}

.ckb-child-qty {
	display: inline-block;
	min-width: 2em;
	text-align: center;
}

tr.ckb-child td.product-name {
	padding-left: 2.2em !important;
	position: relative;
}

tr.ckb-child td.product-name::before {
	content: "\21B3";
	position: absolute;
	left: 0.8em;
	opacity: 0.5;
}

tr.ckb-child td.product-thumbnail img {
	max-width: 40px;
	opacity: 0.9;
}

tr.ckb-child td {
	font-size: 0.95em;
}

.woocommerce-mini-cart-item.ckb-child {
	padding-left: 1.5em !important;
	font-size: 0.92em;
}

/* Blocks */
.wc-block-cart-items__row.ckb-child .wc-block-cart-item__image,
.wc-block-components-order-summary-item.ckb-child .wc-block-components-order-summary-item__image {
	padding-left: 1.5em;
}

.wc-block-cart-items__row.ckb-child .wc-block-cart-item__image img {
	max-width: 48px;
	margin-left: auto;
}

/* ---- Shared extras ---------------------------------------------------- */

.ckb-step__num {
	display: none;
}

.ckb-plus {
	margin-right: 0.1em;
}

.ckb-option__details {
	align-self: flex-start;
	font-size: 0.8em;
	text-decoration: underline;
	position: relative;
	z-index: 1;
}

/* ---- Layout: all steps on one page ------------------------------------ */

.ckb-layout-list .ckb-heading {
	text-align: left;
}

.ckb-layout-list .ckb-step {
	padding-top: 1.5em;
	margin-bottom: 1.5em;
	border-top: 1px solid var(--ckb-border);
}

.ckb-layout-list .ckb-step__count {
	display: none;
}

.ckb-layout-list .ckb-step__num {
	display: inline;
	margin-right: 0.3em;
}

.ckb-layout-list .ckb-step__optional {
	display: block;
	font-size: 0.65em;
	margin-top: 0.15em;
}

.ckb-layout-list .ckb-options {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 0.75em;
}

.ckb-layout-list .ckb-option {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.75em;
	padding: 0.65em 2.2em 0.65em 0.65em;
}

.ckb-layout-list .ckb-option__media {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	aspect-ratio: auto;
	margin: 0;
}

.ckb-layout-list .ckb-option__media--none {
	font-size: 1.6em;
}

.ckb-layout-list .ckb-option__desc {
	display: none;
}

@media (max-width: 480px) {
	.ckb-layout-list .ckb-options {
		grid-template-columns: 1fr;
	}
}

.ckb-summary__title {
	margin: 0 0 0.6em;
	padding-top: 1.5em;
	border-top: 1px solid var(--ckb-border);
}

.ckb-chosen {
	list-style: none;
	margin: 0 0 1.25em;
	padding: 0;
}

.ckb-chosen li {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.5em;
	padding: 0.45em 0;
	border-bottom: 1px dashed var(--ckb-border);
	margin: 0;
}

.ckb-chosen__step {
	color: var(--ckb-muted);
}

.ckb-chosen__name {
	flex: 1 1 auto;
	min-width: 0;
}

.ckb-chosen__price {
	font-weight: 600;
	white-space: nowrap;
}

/* ---- Multiple-choice steps --------------------------------------------- */

.ckb-step__multi {
	display: block;
	font-size: 0.65em;
	font-weight: 400;
	color: var(--ckb-muted);
	margin-top: 0.15em;
}

.ckb-step[data-multiple="1"] .ckb-option__check {
	border-radius: 4px;
}

/* ---- Conditional choices ------------------------------------------------ */

.ckb-option.is-filtered {
	display: none !important;
}
