/* Theme tokens are documented in docs/quote-plugin.md in the theme. */

.wc247q__trap {
	position: absolute;
	left: -9999px;
}

.wc247q__step {
	min-width: 0;
	margin: 0 0 1.5rem;
	padding: 0;
	border: 0;
}

.wc247q__step legend {
	margin-bottom: 0.75rem;
	padding: 0;
	font-family: var(--display);
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.1;
	outline: none;
}

.wc247q__progress {
	margin: 0 0 0.5rem;
	font-weight: 600;
}

.wc247q__hint {
	margin: 0 0 1rem;
}

.wc247q__options {
	display: grid;
	gap: 0.5rem;
	margin-bottom: 1.1rem;
}

.quote__form .wc247q__option {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin: 0;
	padding: 0.7rem 0.8rem;
	border: 2px solid var(--ink);
	border-radius: 3px;
	background: var(--white);
	font-weight: 400;
	cursor: pointer;
}

.wc247q__option:has(input:checked) {
	background: var(--ink);
	color: var(--white);
}

.wc247q__option:has(input:focus-visible) {
	outline: 3px solid var(--green);
	outline-offset: 2px;
}

.wc247q__option input {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	accent-color: var(--green);
}

.quote__form .wc247q__count {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 5.5rem;
	gap: 1rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

.wc247q__count small {
	display: block;
	font-size: 0.9rem;
	font-weight: 400;
}

.quote__form .wc247q__count input {
	margin-top: 0;
}

.wc247q__nav {
	display: flex;
	gap: 0.75rem;
	justify-content: space-between;
}

.wc247q__nav [hidden] {
	display: none;
}

.wc247q__nav button:last-of-type,
.wc247q__nav [data-wc247q-next]:not([hidden]) {
	margin-left: auto;
}

.wc247q__back {
	background: transparent;
	color: var(--ink);
	box-shadow: inset 0 0 0 2px var(--ink);
}

.wc247q__back:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wc247q__nav [aria-busy="true"] {
	cursor: progress;
}

.wc247q__nav [aria-busy="true"]::before {
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-right: 0.5em;
	border: 3px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -0.05em;
}

@media (prefers-reduced-motion: no-preference) {
	.wc247q__nav [aria-busy="true"]::before {
		animation: wc247q-spin 700ms linear infinite;
	}
}

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

.wc247q-notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: 3px;
	background: var(--white);
	font-weight: 600;
}

.wc247q-notice--error {
	border-left: 6px solid #a11d0f;
	color: #a11d0f;
}

.wc247q__result {
	padding: 1.5rem;
	border-radius: 3px;
	background: var(--white);
	outline: none;
}

.wc247q__result h3 {
	margin-top: 0;
	font-family: var(--display);
	font-size: 1.75rem;
}

.wc247q__lines {
	width: 100%;
	margin-bottom: 1rem;
	border-collapse: collapse;
}

.wc247q__lines td,
.wc247q__lines th {
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--concrete);
	font-weight: 400;
	text-align: left;
	vertical-align: top;
}

.wc247q__lines td:last-child {
	padding-left: 1rem;
	text-align: right;
	white-space: nowrap;
}

.wc247q__total th,
.wc247q__total td {
	border-bottom: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.wc247q__photos {
	margin-bottom: 1.1rem;
}

.quote__form .wc247q__photo-add {
	margin-bottom: 0.5rem;
}

/* With JavaScript the label is the button, and the real input stays reachable by keyboard. */
.has-js .wc247q__photo-add {
	position: relative;
	width: fit-content;
	padding: 0.7rem 1rem;
	border: 2px solid var(--ink);
	border-radius: 3px;
	background: var(--white);
	cursor: pointer;
}

.has-js .wc247q__photo-add:focus-within {
	outline: 3px solid var(--green);
	outline-offset: 2px;
}

.has-js .wc247q__photo-add:has(input:disabled) {
	opacity: 0.6;
	cursor: not-allowed;
}

.has-js .wc247q__photo-add input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
}

.wc247q__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wc247q__thumbs[hidden] {
	display: none;
}

.wc247q__thumbs li {
	position: relative;
	width: 5.5rem;
	height: 5.5rem;
}

.wc247q__thumbs img {
	display: block;
	width: 100%;
	height: 100%;
	border: 2px solid var(--ink);
	border-radius: 3px;
	object-fit: cover;
}

.wc247q__thumbs button {
	position: absolute;
	top: -0.5rem;
	right: -0.5rem;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ink);
	color: var(--white);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}
