/* Wildlings & Aster Estimate Calculator
 * Fonts and text colour are inherited from the theme (Roisin).
 * The accent colour is set in Estimate Calculator > Settings.
 */
.wa-ec {
	--wa-ec-accent: #7d8f6f;
	--wa-ec-border: rgba(0, 0, 0, 0.12);
	--wa-ec-soft: rgba(0, 0, 0, 0.035);
	max-width: 860px;
	margin: 0 auto;
	font: inherit;
	color: inherit;
	box-sizing: border-box;
}
.wa-ec *,
.wa-ec *::before,
.wa-ec *::after { box-sizing: border-box; }

.wa-ec__header { text-align: center; margin-bottom: 2rem; }
.wa-ec__title { margin: 0 0 .5rem; }
.wa-ec__intro { margin: 0 auto; max-width: 560px; opacity: .85; }

.wa-ec__group { margin-bottom: 2.25rem; }
.wa-ec__group-title {
	margin: 0 0 .25rem;
	padding-bottom: .6rem;
	border-bottom: 1px solid var(--wa-ec-border);
}
.wa-ec__group-desc { margin: .6rem 0 0; opacity: .8; font-size: .95em; }

/* Item row */
.wa-ec__item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 1rem 1.5rem;
	align-items: center;
	padding: 1rem .5rem;
	border-bottom: 1px solid var(--wa-ec-border);
	transition: background .2s ease;
}
.wa-ec__item.has-image { grid-template-columns: 84px 1fr auto; }
.wa-ec__item.is-active { background: var(--wa-ec-soft); }

.wa-ec__img {
	width: 84px;
	height: 84px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}
.wa-ec__name { margin: 0 0 .15rem; font-size: 1.05em; }
.wa-ec__desc { margin: 0 0 .3rem; font-size: .9em; opacity: .8; }
.wa-ec__price { margin: 0; font-size: .95em; }
.wa-ec__unit { opacity: .65; margin-left: .25em; }

.wa-ec__controls {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: .35rem;
	min-width: 140px;
}
.wa-ec__qty { display: inline-flex; align-items: stretch; }
.wa-ec__btn {
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--wa-ec-border);
	background: #fff;
	color: inherit;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 0;
	transition: background .15s ease, border-color .15s ease;
}
.wa-ec__minus { border-radius: 4px 0 0 4px; }
.wa-ec__plus { border-radius: 0 4px 4px 0; }
.wa-ec__btn:hover { background: var(--wa-ec-soft); border-color: var(--wa-ec-accent); }
.wa-ec__btn:focus-visible,
.wa-ec__input:focus-visible,
.wa-ec__open:focus-visible,
.wa-ec__submit:focus-visible { outline: 2px solid var(--wa-ec-accent); outline-offset: 2px; }

.wa-ec__input {
	width: 56px;
	height: 38px;
	margin: 0;
	padding: 0 4px;
	text-align: center;
	border: 1px solid var(--wa-ec-border);
	border-left: 0;
	border-right: 0;
	border-radius: 0;
	background: #fff;
	color: inherit;
	font: inherit;
	-moz-appearance: textfield;
}
.wa-ec__input::-webkit-outer-spin-button,
.wa-ec__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.wa-ec__line { min-height: 1.3em; font-size: .9em; font-weight: 600; color: var(--wa-ec-accent); }

/* Total bar: sticks to the bottom of the viewport while scrolling the calculator */
.wa-ec__total {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 1rem;
	padding: 1rem 1.25rem;
	background: #fff;
	border: 1px solid var(--wa-ec-border);
	border-top: 3px solid var(--wa-ec-accent);
	border-radius: 4px;
	box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
}
.wa-ec__total[hidden] { display: none; }
.wa-ec__total-text { display: flex; flex-direction: column; }
.wa-ec__total-label { font-size: .85em; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.wa-ec__total-value { font-size: 1.6em; line-height: 1.2; }

.wa-ec__open,
.wa-ec__submit {
	display: inline-block;
	padding: .8rem 1.6rem;
	border: 1px solid var(--wa-ec-accent);
	background: var(--wa-ec-accent);
	color: #fff;
	font: inherit;
	letter-spacing: .04em;
	cursor: pointer;
	border-radius: 2px;
	transition: opacity .15s ease;
}
.wa-ec__open:hover:not(:disabled),
.wa-ec__submit:hover:not(:disabled) { opacity: .88; }
.wa-ec__open:disabled,
.wa-ec__submit:disabled { opacity: .45; cursor: not-allowed; }

.wa-ec__disclaimer { margin: .9rem 0 0; font-size: .85em; opacity: .7; text-align: center; }

/* Form */
.wa-ec__form {
	margin-top: 2.5rem;
	padding: 1.75rem;
	border: 1px solid var(--wa-ec-border);
	border-radius: 4px;
}
.wa-ec__form[hidden],
.wa-ec__success[hidden],
.wa-ec__message[hidden] { display: none; }
.wa-ec__form-title { margin: 0 0 .4rem; text-align: center; }
.wa-ec__form-intro { margin: 0 auto 1.25rem; max-width: 520px; text-align: center; opacity: .85; }

.wa-ec__summary ul { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.wa-ec__summary li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .45rem 0;
	border-bottom: 1px dashed var(--wa-ec-border);
	font-size: .95em;
}
.wa-ec__summary .wa-ec__summary-total { border-bottom: 0; font-weight: 700; padding-top: .8rem; }

.wa-ec__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.wa-ec__field { margin: 0 0 1rem; }
.wa-ec__field--wide { grid-column: 1 / -1; }
.wa-ec__field label { display: block; margin-bottom: .3rem; font-size: .9em; }
.wa-ec__field .req { color: #b3261e; }
.wa-ec__field input,
.wa-ec__field textarea {
	width: 100%;
	padding: .65rem .75rem;
	border: 1px solid var(--wa-ec-border);
	border-radius: 2px;
	background: #fff;
	color: inherit;
	font: inherit;
}
.wa-ec__field input:focus,
.wa-ec__field textarea:focus { outline: 2px solid var(--wa-ec-accent); outline-offset: 0; border-color: var(--wa-ec-accent); }

.wa-ec__check { margin: 0 0 .75rem; font-size: .9em; }
.wa-ec__check label { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.wa-ec__check input { margin-top: .25rem; }

/* Honeypot: off-screen, not display:none (some bots skip those) */
.wa-ec__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.wa-ec__message {
	margin: 0 0 1rem;
	padding: .75rem 1rem;
	border-left: 3px solid #b3261e;
	background: rgba(179, 38, 30, 0.07);
	font-size: .92em;
}
.wa-ec__submit { width: 100%; }

.wa-ec__success {
	margin-top: 2rem;
	padding: 2rem 1.5rem;
	text-align: center;
	border: 1px solid var(--wa-ec-accent);
	border-radius: 4px;
	background: var(--wa-ec-soft);
}
.wa-ec__success p { margin: 0; }

@media (max-width: 600px) {
	.wa-ec__item,
	.wa-ec__item.has-image { grid-template-columns: 1fr; }
	.wa-ec__item.has-image { grid-template-columns: 72px 1fr; }
	.wa-ec__item.has-image .wa-ec__img { width: 72px; height: 72px; }
	.wa-ec__item.has-image .wa-ec__controls { grid-column: 1 / -1; }
	.wa-ec__controls { flex-direction: row; justify-content: space-between; align-items: center; min-width: 0; }
	.wa-ec__fields { grid-template-columns: 1fr; }
	.wa-ec__total { padding: .8rem 1rem; }
	.wa-ec__total-value { font-size: 1.35em; }
	.wa-ec__form { padding: 1.25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	.wa-ec * { transition: none !important; }
}
