/**
 * RM Sound System Estimator - wizard styles.
 *
 * Design intent: a calm, technical "spec sheet" that sits inside any theme.
 * It inherits the theme's font (Arabic fonts vary a lot between themes) and
 * keeps one emphasised element: the grand-total band.
 *
 * Palette
 *   ink     #16302e   text
 *   muted   #566664   secondary text
 *   line    #d3dcda   hairlines
 *   surface #f2f6f5   room panels / table heads
 *   accent  #0d5c55   actions, progress, total band
 *   brass   #9a6a12   sale / notice accent
 *   danger  #b3261e   errors
 */

.rm-estimator {
	--rm-ink: #16302e;
	--rm-muted: #566664;
	--rm-line: #d3dcda;
	--rm-surface: #f2f6f5;
	--rm-accent: #0d5c55;
	--rm-accent-dark: #094741;
	--rm-brass: #9a6a12;
	--rm-danger: #b3261e;
	--rm-ok: #1b7a4a;

	box-sizing: border-box;
	max-width: 860px;
	margin: 24px auto;
	padding: 28px 24px;
	color: var(--rm-ink);
	background: #fff;
	border: 1px solid var(--rm-line);
	border-radius: 6px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.7;
	text-align: right;
}

.rm-estimator *,
.rm-estimator *::before,
.rm-estimator *::after {
	box-sizing: inherit;
}

.rm-estimator [hidden] {
	display: none !important;
}

.rm-estimator h2 {
	margin: 0 0 6px;
	font-size: 1.5rem;
	line-height: 1.4;
	color: var(--rm-ink);
}

.rm-estimator h2:focus {
	outline: none;
}

.rm-estimator h3 {
	margin: 0 0 12px;
	font-size: 1.1rem;
	line-height: 1.5;
	color: var(--rm-ink);
}

.rm-estimator .rm-lead {
	margin: 0 0 22px;
	color: var(--rm-muted);
}

/* ---- Progress ---------------------------------------------------------- */

.rm-estimator .rm-progress {
	display: flex;
	margin: 0 0 30px;
	padding: 0;
	list-style: none;
}

.rm-estimator .rm-progress__item {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 0;
	color: var(--rm-muted);
	font-size: 0.85rem;
	text-align: center;
}

/* Connector from this step to the next one. */
.rm-estimator .rm-progress__item::before {
	content: "";
	position: absolute;
	top: 17px;
	inset-inline-start: 50%;
	width: 100%;
	height: 2px;
	background: var(--rm-line);
}

.rm-estimator .rm-progress__item:last-child::before,
.rm-estimator .rm-progress__item.is-last::before {
	display: none;
}

.rm-estimator .rm-progress__item.is-done::before {
	background: var(--rm-accent);
}

.rm-estimator .rm-progress__num {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin-bottom: 6px;
	border: 2px solid var(--rm-line);
	border-radius: 50%;
	background: #fff;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.rm-estimator .is-done .rm-progress__num {
	border-color: var(--rm-accent);
	color: var(--rm-accent);
}

.rm-estimator .is-current .rm-progress__num {
	border-color: var(--rm-accent);
	background: var(--rm-accent);
	color: #fff;
}

.rm-estimator .is-current {
	color: var(--rm-ink);
	font-weight: 700;
}

/* Each step is a button: reached steps can be clicked to jump to them. The
   reset keeps theme button styles (backgrounds, borders, uppercase, shadows)
   out of the progress bar. */
.rm-estimator .rm-progress__btn {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 0 4px 2px;
	border: 0;
	border-radius: 6px;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.4;
	cursor: pointer;
}

.rm-estimator .rm-progress__btn:disabled {
	cursor: default;
	opacity: 1; /* Unreached steps keep their muted colours instead of a theme's faded look. */
}

.rm-estimator .rm-progress__btn[aria-current="step"] {
	cursor: default;
}

.rm-estimator .rm-progress__btn:not(:disabled):not([aria-current="step"]):hover .rm-progress__num {
	border-color: var(--rm-accent);
	background: rgba(13, 92, 85, 0.08);
}

.rm-estimator .rm-progress__btn:not(:disabled):not([aria-current="step"]):hover .rm-progress__label {
	color: var(--rm-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rm-estimator .rm-progress__btn:focus-visible {
	outline: 3px solid rgba(13, 92, 85, 0.4);
	outline-offset: 2px;
}

/* After the request was sent the whole bar is read-only. */
.rm-estimator .rm-progress.is-locked .rm-progress__btn {
	cursor: default;
}

/* ---- Fields ------------------------------------------------------------ */

.rm-estimator .rm-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 20px;
}

.rm-estimator .rm-field {
	margin: 0;
	min-width: 0;
}

.rm-estimator .rm-field--wide {
	grid-column: 1 / -1;
}

.rm-estimator .rm-field label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
}

.rm-estimator .rm-req {
	color: var(--rm-danger);
}

.rm-estimator input[type="text"],
.rm-estimator input[type="tel"],
.rm-estimator select,
.rm-estimator textarea {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #8a9b98;
	border-radius: 4px;
	background: #fff;
	color: var(--rm-ink);
	font: inherit;
	box-shadow: none;
}

.rm-estimator textarea {
	resize: vertical;
}

.rm-estimator input:focus-visible,
.rm-estimator select:focus-visible,
.rm-estimator textarea:focus-visible,
.rm-estimator .rm-btn:focus-visible,
.rm-estimator .rm-qty button:focus-visible {
	outline: 3px solid rgba(13, 92, 85, 0.4);
	outline-offset: 1px;
	border-color: var(--rm-accent);
}

.rm-estimator [aria-invalid="true"] {
	border-color: var(--rm-danger);
	background: #fffafa;
}

.rm-estimator .rm-hint {
	margin: 4px 0 0;
	color: var(--rm-muted);
	font-size: 0.85rem;
}

.rm-estimator .rm-field-error {
	margin: 6px 0 0;
	color: var(--rm-danger);
	font-size: 0.875rem;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.rm-estimator .rm-hp {
	position: absolute !important;
	inset-inline-start: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Rooms ------------------------------------------------------------- */

.rm-estimator fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.rm-estimator legend {
	padding: 0;
	font-weight: 700;
}

.rm-estimator .rm-rooms-pick {
	margin: 0 0 8px;
}

.rm-estimator .rm-check {
	display: flex;
	gap: 10px;
	align-items: center;
	margin: 0;
	padding: 6px 0;
	cursor: pointer;
}

.rm-estimator .rm-check input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--rm-accent);
}

.rm-estimator .rm-room {
	margin: 18px 0;
	padding: 18px 20px;
	border-inline-start: 4px solid var(--rm-line);
	background: var(--rm-surface);
}

.rm-estimator .rm-room--required {
	border-inline-start-color: var(--rm-accent);
}

.rm-estimator .rm-mode {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}

.rm-estimator .rm-mode legend {
	width: 100%;
	margin-bottom: 8px;
	font-weight: 600;
}

.rm-estimator .rm-chip {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.rm-estimator .rm-chip input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.rm-estimator .rm-chip span {
	display: inline-block;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid #8a9b98;
	border-radius: 999px;
	background: #fff;
}

.rm-estimator .rm-chip input:checked + span {
	border-color: var(--rm-accent);
	background: var(--rm-accent);
	color: #fff;
}

.rm-estimator .rm-chip input:focus-visible + span {
	outline: 3px solid rgba(13, 92, 85, 0.4);
	outline-offset: 2px;
}

.rm-estimator .rm-area-preview {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--rm-accent-dark);
	font-weight: 600;
}

.rm-estimator .rm-room .rm-grid + .rm-grid {
	margin-top: 16px;
}

/* ---- Buttons ----------------------------------------------------------- */

.rm-estimator .rm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 28px 0 0;
}

.rm-estimator .rm-btn {
	display: inline-block;
	min-height: 46px;
	margin: 0;
	padding: 10px 26px;
	border: 2px solid var(--rm-accent);
	border-radius: 4px;
	background: transparent;
	color: var(--rm-accent);
	font: inherit;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.rm-estimator .rm-btn--primary {
	background: var(--rm-accent);
	color: #fff;
}

.rm-estimator .rm-btn--primary:hover:not(:disabled) {
	background: var(--rm-accent-dark);
	border-color: var(--rm-accent-dark);
}

.rm-estimator .rm-btn--whatsapp,.rm-estimator .rm-result-actions [data-rm-action="send"] {	background: #25d366;	border-color: #25d366;	color: #fff;}.rm-estimator .rm-btn--whatsapp:hover,.rm-estimator .rm-result-actions [data-rm-action="send"]:hover:not(:disabled) {	background: #1da851;	border-color: #1da851;	color: #fff;}.rm-estimator .rm-status .rm-btn--whatsapp {	margin-top: 10px;}
.rm-estimator .rm-btn--ghost:hover:not(:disabled) {
	background: var(--rm-surface);
}

.rm-estimator .rm-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ---- Accessories ------------------------------------------------------- */

.rm-estimator .rm-loading,
.rm-estimator .rm-empty {
	margin: 0;
	padding: 22px 0;
	color: var(--rm-muted);
}

.rm-estimator .rm-acc {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--rm-line);
}

.rm-estimator .rm-acc.is-unavailable {
	opacity: 0.65;
}

.rm-estimator .rm-acc__img {
	display: block;
	width: 64px;
	height: 64px;
	border-radius: 4px;
	background: var(--rm-surface);
	object-fit: contain;
}

.rm-estimator .rm-acc__name {
	display: block;
	font-weight: 700;
}

.rm-estimator .rm-price {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.rm-estimator .rm-price s {
	margin-inline-start: 8px;
	color: var(--rm-muted);
	font-weight: 400;
}

.rm-estimator .rm-stock {
	display: block;
	color: var(--rm-muted);
	font-size: 0.85rem;
}

.rm-estimator .rm-stock--out {
	color: var(--rm-danger);
	font-weight: 700;
}

.rm-estimator .rm-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #8a9b98;
	border-radius: 4px;
	overflow: hidden;
}

.rm-estimator .rm-qty button {
	width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--rm-surface);
	color: var(--rm-ink);
	font: inherit;
	font-size: 1.25rem;
	cursor: pointer;
}

.rm-estimator .rm-qty button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.rm-estimator .rm-qty input {
	width: 56px;
	min-height: 44px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	border-inline: 1px solid var(--rm-line);
	border-radius: 0;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* ---- Result ------------------------------------------------------------ */

.rm-estimator .rm-result h3 {
	margin: 28px 0 10px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--rm-ink);
}

.rm-estimator .rm-result h3:first-child {
	margin-top: 8px;
}

.rm-estimator .rm-table-wrap {
	overflow-x: auto;
}

.rm-estimator .rm-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.rm-estimator .rm-table th,
.rm-estimator .rm-table td {
	padding: 9px 10px;
	border: 0;
	border-bottom: 1px solid var(--rm-line);
	text-align: right;
	vertical-align: top;
}

.rm-estimator .rm-table th {
	background: var(--rm-surface);
	font-weight: 700;
	white-space: nowrap;
}

.rm-estimator .rm-table td.rm-num {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.rm-estimator .rm-kv {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 18px;
	margin: 0;
}

.rm-estimator .rm-kv dt {
	color: var(--rm-muted);
}

.rm-estimator .rm-kv dd {
	margin: 0;
	font-variant-numeric: tabular-nums;
}

.rm-estimator .rm-subtotals {
	margin: 18px 0 0;
}

.rm-estimator .rm-grand {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px 20px;
	margin: 14px 0 0;
	padding: 18px 22px;
	background: var(--rm-accent);
	color: #fff;
	border-radius: 4px;
}

.rm-estimator .rm-grand__label {
	font-size: 1.05rem;
	font-weight: 600;
}

.rm-estimator .rm-grand__value {
	font-size: 1.9rem;
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.rm-estimator .rm-note {
	margin: 18px 0;
	padding: 12px 16px;
	border-inline-start: 4px solid var(--rm-brass);
	background: #fbf6ea;
	font-size: 0.92rem;
}

.rm-estimator .rm-result-actions {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin: 20px 0 0;
}

.rm-estimator .rm-result-actions .rm-btn {
	padding-inline: 10px;
}

.rm-estimator .rm-status {
	margin: 14px 0 0;
	padding: 10px 14px;
	border-inline-start: 4px solid var(--rm-ok);
	background: #edf7f1;
}

.rm-estimator .rm-status--error {
	border-inline-start-color: var(--rm-danger);
	background: #fdeceb;
}

.rm-estimator .rm-alert {
	margin: 0 0 20px;
	padding: 12px 16px;
	border-inline-start: 4px solid var(--rm-danger);
	background: #fdeceb;
	color: #7a1a14;
}

.rm-estimator-error {
	padding: 14px 18px;
	border: 1px solid #b3261e;
	color: #7a1a14;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 720px) {
	.rm-estimator .rm-result-actions {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 640px) {
	.rm-estimator {
		padding: 20px 16px;
	}

	.rm-estimator .rm-grid {
		grid-template-columns: 1fr;
	}

	.rm-estimator .rm-progress__label {
		display: none;
	}

	.rm-estimator .rm-progress__item.is-current .rm-progress__label {
		display: block;
	}

	.rm-estimator .rm-acc {
		grid-template-columns: 56px 1fr;
	}

	.rm-estimator .rm-acc__img {
		width: 56px;
		height: 56px;
	}

	.rm-estimator .rm-acc .rm-qty {
		grid-column: 1 / -1;
		justify-self: start;
	}
}

@media (max-width: 420px) {
	.rm-estimator .rm-result-actions {
		grid-template-columns: 1fr;
	}

	.rm-estimator .rm-actions .rm-btn {
		flex: 1 1 100%;
	}
}
