/* Plant Configurator — front end
   Everything is scoped under .pcw so a theme can't leak into it,
   and the type inherits the shop's own font so it looks native. */

.pcw.pcw-configurator {
	--pcw-ink: #16241f;
	--pcw-green: #1f4c3c;
	--pcw-green-deep: #123328;
	--pcw-tint: #eef3ee;
	--pcw-line: #dfe3da;
	--pcw-line-strong: #b9c4bb;
	--pcw-muted: #6b7770;
	--pcw-paper: #fff;
	--pcw-shell: #fbfbf8;
	--pcw-radius: 14px;

	box-sizing: border-box;
	margin: 28px 0;
	padding: 26px 24px 24px;
	border: 1px solid var(--pcw-line);
	border-radius: 18px;
	background: var(--pcw-shell);
	color: var(--pcw-ink);
	font-family: inherit;
	line-height: 1.45;
	text-align: left;
}

.pcw.pcw-configurator *,
.pcw.pcw-configurator *::before,
.pcw.pcw-configurator *::after {
	box-sizing: border-box;
}

.pcw .pcw__title {
	margin: 0 0 22px;
	padding: 0;
	border: 0;
	color: var(--pcw-green-deep);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
	text-transform: none;
}

/* ---------- groups ---------- */

.pcw .pcw__group {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
	background: none;
}

.pcw .pcw__legend {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-width: 100%;
	margin: 0 0 11px;
	padding: 0;
	float: none;
	color: var(--pcw-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
}

.pcw .pcw__step {
	display: inline-flex;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--pcw-tint);
	color: var(--pcw-green);
	font-size: 11px;
	font-weight: 700;
}

.pcw .pcw__legend-text {
	flex: 0 1 auto;
}

.pcw .pcw__chosen {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	color: var(--pcw-muted);
	font-size: 12.5px;
	font-weight: 400;
	text-align: right;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- option cards ---------- */

.pcw .pcw__options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
	gap: 10px;
}

.pcw .pcw__option {
	position: relative;
	display: flex;
	min-height: 58px;
	align-items: center;
	gap: 11px;
	margin: 0;
	padding: 12px 34px 12px 13px;
	border: 1px solid var(--pcw-line);
	border-radius: var(--pcw-radius);
	background: var(--pcw-paper);
	color: var(--pcw-ink);
	cursor: pointer;
	font-size: 14px;
	font-weight: 400;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.pcw .pcw__option:hover {
	border-color: var(--pcw-line-strong);
}

.pcw .pcw__option.is-selected {
	border-color: var(--pcw-green);
	background: var(--pcw-paper);
	box-shadow: inset 0 0 0 1px var(--pcw-green);
}

.pcw .pcw__option:focus-within {
	outline: 2px solid var(--pcw-green);
	outline-offset: 2px;
}

/* the real radio stays in the DOM for keyboard + form submission */
.pcw .pcw__option .pcw__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
}

.pcw .pcw__option-text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.pcw .pcw__option-name {
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pcw .pcw__option-price {
	color: var(--pcw-muted);
	font-size: 12px;
	line-height: 1.3;
}

.pcw .pcw__option-price .woocommerce-Price-amount {
	color: inherit;
	font-size: inherit;
	font-weight: 600;
}

.pcw .pcw__option.is-selected .pcw__option-price {
	color: var(--pcw-green);
}

/* colour cards need a little more room for the swatch + name */
.pcw .pcw__group--colour .pcw__options {
	grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

/* swatch + thumbnail */

.pcw .pcw__swatch {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	border: 1px solid rgba(0, 0, 0, .14);
	border-radius: 50%;
	background: var(--pcw-swatch, #d8dbd2);
	box-shadow: inset 0 0 0 2px #fff;
}

.pcw .pcw__thumb {
	display: block;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	overflow: hidden;
	border-radius: 9px;
	background: var(--pcw-tint);
}

.pcw .pcw__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

/* selection tick */

.pcw .pcw__tick {
	position: absolute;
	top: 50%;
	right: 12px;
	width: 17px;
	height: 17px;
	margin-top: -8.5px;
	border: 1px solid var(--pcw-line-strong);
	border-radius: 50%;
	background: transparent;
	transition: background-color .15s ease, border-color .15s ease;
}

.pcw .pcw__option.is-selected .pcw__tick {
	border-color: var(--pcw-green);
	background: var(--pcw-green);
}

.pcw .pcw__option.is-selected .pcw__tick::after {
	position: absolute;
	top: 3.5px;
	left: 5.5px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 1.8px 1.8px 0;
	content: "";
	transform: rotate(43deg);
}

/* ---------- request field ---------- */

.pcw .pcw__field {
	position: relative;
	margin: 0 0 22px;
}

.pcw .pcw__field-label {
	display: block;
	margin: 0 0 8px;
	color: var(--pcw-ink);
	font-size: 14px;
	font-weight: 600;
	text-transform: none;
}

.pcw .pcw__optional {
	margin-left: 6px;
	color: var(--pcw-muted);
	font-size: 12.5px;
	font-weight: 400;
}

.pcw .pcw__field textarea {
	display: block;
	width: 100%;
	min-height: 92px;
	margin: 0;
	padding: 13px 14px 26px;
	border: 1px solid var(--pcw-line);
	border-radius: var(--pcw-radius);
	background: var(--pcw-paper);
	color: var(--pcw-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
}

.pcw .pcw__field textarea::placeholder {
	color: #9aa49e;
}

.pcw .pcw__field textarea:focus {
	border-color: var(--pcw-green);
	outline: 2px solid rgba(31, 76, 60, .16);
	outline-offset: 0;
}

.pcw .pcw__counter {
	position: absolute;
	right: 12px;
	bottom: 10px;
	color: #9aa49e;
	font-size: 11px;
	pointer-events: none;
}

/* ---------- summary ---------- */

.pcw .pcw__summary {
	margin: 0;
	padding: 16px 18px;
	border: 1px solid var(--pcw-line);
	border-radius: var(--pcw-radius);
	background: var(--pcw-paper);
}

.pcw .pcw__summary-list {
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.pcw .pcw__summary-list > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 3px 0;
}

.pcw .pcw__summary-list dt {
	margin: 0;
	color: var(--pcw-muted);
	font-weight: 400;
}

.pcw .pcw__summary-list dd {
	margin: 0;
	color: var(--pcw-ink);
	font-weight: 600;
	text-align: right;
}

.pcw .pcw__summary-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--pcw-line);
	color: var(--pcw-muted);
	font-size: 13px;
}

.pcw .pcw__total-price,
.pcw .pcw__total-price .woocommerce-Price-amount {
	color: var(--pcw-green-deep);
	font-size: 21px;
	font-weight: 700;
	line-height: 1.1;
}

/* ---------- responsive ---------- */

@media (max-width: 782px) {
	.pcw.pcw-configurator {
		margin: 22px 0;
		padding: 20px 16px 18px;
		border-radius: 16px;
	}

	.pcw .pcw__title {
		margin-bottom: 18px;
		font-size: 18px;
	}

	.pcw .pcw__options,
	.pcw .pcw__group--colour .pcw__options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.pcw .pcw__option {
		min-height: 60px;
		padding: 11px 30px 11px 11px;
		gap: 9px;
	}

	.pcw .pcw__thumb {
		flex-basis: 32px;
		width: 32px;
		height: 32px;
	}

	/* room is vertical on a phone, so wrap the name rather than clipping it */
	.pcw .pcw__option-name {
		overflow: visible;
		text-overflow: clip;
		white-space: normal;
		word-break: break-word;
	}

	.pcw .pcw__chosen {
		display: none;
	}
}

@media (max-width: 340px) {
	.pcw .pcw__options,
	.pcw .pcw__group--colour .pcw__options {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcw .pcw__option,
	.pcw .pcw__tick {
		transition: none;
	}
}
