/* ==========================================================================
   PM Estimate Calculator — wizard d'estimation
   Styles autonomes mais alignés sur la palette Pause Ménage
   (#017faf primary, #f0f9ff sky, #fffbeb amber, Montserrat).
   ========================================================================== */

.pm-estimate {
	--pme-primary: #017faf;
	--pme-primary-hover: #056387;
	--pme-text: #0d0a00;
	--pme-grey: rgba(13,10,0,0.15);
	--pme-grey-bg: #f3f9fc;
	--pme-sky: #f0f9ff;
	--pme-amber: #fffbeb;
	--pme-success: #16a34a;
	--pme-error: #b91c1c;

	font-family: 'Montserrat', 'Inter', system-ui, -apple-system, sans-serif;
	color: var(--pme-text);
	margin: 0 auto;
	/* Padding latéral à 0 : c'est le wrapper `.pm-home__container` du fallback de
	   page.php qui apporte le padding horizontal (`var(--pm-container-px)`).
	   On garde uniquement le padding vertical pour aérer au-dessus/dessous du
	   wizard. */
	padding: 2rem 0;
}

.pm-estimate__loading,
.pm-estimate__noscript {
	padding: 2rem;
	text-align: center;
	color: var(--pme-text);
}

/* ---- Stepper ---- */
.pm-estimate__steps {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	font-size: 0.9rem;
}
.pm-estimate__step {
	flex: 1 1 auto;
	min-width: 120px;
	padding: 0.65rem 1rem;
	background: var(--pme-grey-bg);
	border-radius: 0.5rem;
	color: var(--pme-text);
	opacity: 0.55;
	text-align: center;
}
.pm-estimate__step.is-current {
	background: var(--pme-primary);
	color: #fff;
	opacity: 1;
	font-weight: 500;
}
.pm-estimate__step.is-done {
	background: var(--pme-sky);
	opacity: 0.85;
}

/* Mobile (< 768px) : on n'affiche que les numéros, plus gros, sur une seule
   ligne. Évite que les 5 étapes ne tombent sur 2-3 rangées. */
@media (max-width: 767.98px) {
	.pm-estimate__steps {
		flex-wrap: nowrap;
		gap: 0.4rem;
	}
	.pm-estimate__step {
		flex: 1 1 0;
		min-width: 0;
		padding: 0.85rem 0.25rem;
		font-size: 1.15rem;
		font-weight: 600;
		line-height: 1;
	}
	.pm-estimate__step-label { display: none; }
}

/* ---- Layout ---- */
.pm-estimate__layout {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 2rem;
	align-items: start;
}
@media (max-width: 768px) {
	.pm-estimate__layout { grid-template-columns: 1fr; }
}

.pm-estimate__main { min-width: 0; }

/* Sidebar sticky : reste visible quand on scrolle dans le wizard */
.pm-estimate__side {
	position: sticky;
	top: 1rem;
	align-self: start;     /* nécessaire si le parent grid a align-items: stretch */
	max-height: calc(100vh - 2rem);
	overflow-y: auto;       /* si le résumé devient plus haut que la viewport */
}
@media (max-width: 768px) {
	/* Pas de sticky en mobile, le sidebar passe au-dessus/en-dessous du contenu */
	.pm-estimate__side {
		position: static;
		max-height: none;
		overflow: visible;
	}
}

.pm-estimate__panel {
	background: #fff;
	border: 1px solid var(--pme-grey);
	border-radius: 0.75rem;
	padding: 2rem;
}
.pm-estimate__panel--success {
	background: var(--pme-sky);
	border-color: var(--pme-primary);
}

/* Réduction globale des H2/H3 du wizard pour ne pas dominer la hiérarchie
   visuelle. Une seule règle qui s'applique à toutes les étapes.
   Note : on chaîne `.pm-estimate.pm-estimate` pour porter la spécificité à 0,2,1,
   ce qui bat les règles du thème `.pm-body h2 { font-size: var(--pm-h2-d) }`
   qui ont 0,1,1 et chargent après. */
.pm-estimate.pm-estimate h2,
.pm-estimate.pm-estimate h3 {
	font-size: 1.125rem;
	line-height: 1.3;
	font-weight: 500;
}
/* H4 (titres de groupe : Chambres, Salon, etc.) — encore plus petit */
.pm-estimate.pm-estimate h4 {
	font-size: 0.95rem;
	line-height: 1.3;
	font-weight: 500;
	margin: 0 0 0.5rem;
	color: var(--pme-text);
}

/* Le titre principal de chaque étape garde sa marge inférieure pour aérer le contenu */
.pm-estimate .pm-estimate__title {
	margin: 0 0 1rem;
	color: var(--pme-text);
}

/* Sous-titre sous le titre d'étape (ex. récurrence : « Quelle sera la fréquence ? ») */
.pm-estimate .pm-estimate__subtitle {
	margin: -0.5rem 0 1.5rem;
	font-size: 1rem;
	color: var(--pme-text);
	opacity: 0.85;
}

/* ---- Forms ---- */
.pm-estimate__inline-form {
	display: flex;
	gap: 0.75rem;
	margin: 1rem 0;
}
.pm-estimate__inline-form input {
	flex: 1;
	padding: 0.65rem 1rem;
	font-size: 1rem;
	border: 1px solid var(--pme-grey);
	border-radius: 0.5rem;
}
.pm-estimate__inline-form input:focus {
	outline: none;
	border-color: var(--pme-primary);
	box-shadow: 0 0 0 3px rgba(1,127,175,0.15);
}

.pm-estimate__form { display: grid; gap: 1rem; }
.pm-estimate__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
@media (max-width: 600px) { .pm-estimate__row { grid-template-columns: 1fr; } }

.pm-estimate__form label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.95rem;
}
.pm-estimate__form input,
.pm-estimate__form textarea {
	width: 100%;
	padding: 0.65rem 1rem;
	font-size: 1rem;
	border: 1px solid var(--pme-grey);
	border-radius: 0.5rem;
	font-family: inherit;
	box-sizing: border-box;
}
.pm-estimate__form input:focus,
.pm-estimate__form textarea:focus {
	outline: none;
	border-color: var(--pme-primary);
	box-shadow: 0 0 0 3px rgba(1,127,175,0.15);
}
.pm-estimate__checkbox {
	flex-direction: row !important;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
}
.pm-estimate__checkbox input { width: auto !important; margin-top: 0.25rem; }

/* ---- Zone cards ---- */
.pm-estimate__zones {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin: 1.5rem 0;
}
@media (max-width: 768px) { .pm-estimate__zones { grid-template-columns: 1fr; } }
.pm-estimate__zone-card {
	background: #fff;
	border: 1px solid var(--pme-grey);
	border-radius: 0.5rem;
	padding: 1.5rem;
	text-align: left;
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.pm-estimate__zone-card:hover {
	border-color: var(--pme-primary);
	box-shadow: 0 4px 12px rgba(1,127,175,0.1);
}
.pm-estimate__zone-card h3 {
	margin: 0 0 0.5rem;
	color: var(--pme-primary);
}
.pm-estimate__zone-card p { margin: 0; color: var(--pme-text); font-size: 0.9rem; line-height: 1.5; }

/* ---- Pricing groups & items ---- */
.pm-estimate__section {
	margin-bottom: 2rem;
}
.pm-estimate__section h3 {
	margin: 0 0 1rem;
	color: var(--pme-primary);
	border-bottom: 1px solid var(--pme-grey);
	padding-bottom: 0.5rem;
}
/* Grille 2 colonnes pour les groupes (comme le live) */
.pm-estimate__groups-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem 2rem;
}
@media (max-width: 600px) {
	.pm-estimate__groups-grid { grid-template-columns: 1fr; }
}

.pm-estimate__group { margin: 0; }
/* Note : la taille du h4 est gérée par la règle globale `.pm-estimate.pm-estimate h4`
   plus haut (spé 0,2,1 pour battre `.pm-body h4` du thème). */
.pm-estimate__items {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.4rem;
}

/* Select pour les groupes multi-items */
.pm-estimate__select-wrap { position: relative; }
.pm-estimate__select {
	width: 100%;
	padding: 0.65rem 1rem;
	font-family: inherit;
	font-size: 1rem;
	color: var(--pme-text);
	background: #fff;
	border: 1px solid var(--pme-grey);
	border-radius: 0.5rem;
	cursor: pointer;
	appearance: auto;
}
.pm-estimate__select:focus {
	outline: none;
	border-color: var(--pme-primary);
	box-shadow: 0 0 0 3px rgba(1,127,175,0.15);
}

/* ---- Plages horaires (date + time) ---- */
.pm-estimate__slot-row {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 1rem;
	align-items: end;
	margin-bottom: 1rem;
}
@media (max-width: 600px) {
	.pm-estimate__slot-row { grid-template-columns: 1fr; }
}
.pm-estimate__slot-row label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.95rem;
}
.pm-estimate__slot-row input[type="date"],
.pm-estimate__slot-row select {
	padding: 0.65rem 1rem;
	font-size: 1rem;
	border: 1px solid var(--pme-grey);
	border-radius: 0.5rem;
	font-family: inherit;
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}
.pm-estimate__slot-row input:focus,
.pm-estimate__slot-row select:focus {
	outline: none;
	border-color: var(--pme-primary);
	box-shadow: 0 0 0 3px rgba(1,127,175,0.15);
}
.pm-estimate__slot-remove {
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--pme-grey);
	color: var(--pme-error);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pm-estimate__slot-remove:hover {
	background: var(--pme-error);
	color: #fff;
	border-color: var(--pme-error);
}
.pm-estimate__slot-add {
	background: none;
	border: 0;
	color: var(--pme-primary);
	font-family: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	padding: 0.5rem 0;
	text-decoration: underline;
}
.pm-estimate__slot-add:hover { color: var(--pme-primary-hover); }
.pm-estimate__item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--pme-grey);
	border-radius: 0.4rem;
	background: #fff;
	cursor: pointer;
	transition: background 0.1s;
}
.pm-estimate__item:hover { background: var(--pme-sky); }
.pm-estimate__item input { margin: 0; accent-color: var(--pme-primary); }
.pm-estimate__item-title { font-size: 0.95rem; }
.pm-estimate__item-price { font-weight: 500; color: var(--pme-primary); white-space: nowrap; }

/* ---- Recurrence radios ---- */
.pm-estimate__radios {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 0.5rem;
	margin: 1rem 0 2rem;
}
.pm-estimate__radio {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem;
	border: 1px solid var(--pme-grey);
	border-radius: 0.5rem;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.1s, background 0.1s;
}
.pm-estimate__radio:hover { background: var(--pme-sky); }
.pm-estimate__radio input { margin: 0; accent-color: var(--pme-primary); }
.pm-estimate__radio-label { font-size: 0.95rem; }
.pm-estimate__radio-rebate {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--pme-primary);
	white-space: nowrap;
}

/* ---- Summary sidebar ---- */
.pm-estimate__summary {
	background: var(--pme-sky);
	border: 1px solid var(--pme-grey);
	border-radius: 0.75rem;
	padding: 1.5rem;
}
.pm-estimate .pm-estimate__summary h3 {
	margin: 0 0 1rem;
	color: var(--pme-primary);
}
.pm-estimate__summary p {
	display: flex;
	justify-content: space-between;
	margin: 0.4rem 0;
	font-size: 0.9rem;
}
.pm-estimate__summary hr {
	border: 0;
	border-top: 1px solid var(--pme-grey);
	margin: 0.75rem 0;
}
.pm-estimate__summary-total {
	font-size: 1.1rem !important;
	font-weight: 600;
	color: var(--pme-primary);
	margin-top: 1rem !important;
	padding-top: 0.75rem;
	border-top: 2px solid var(--pme-primary);
}

/* ---- Buttons ---- */
.pm-estimate .pm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	border-radius: 0.5rem;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pm-estimate .pm-btn--primary {
	background: var(--pme-primary);
	color: #fff;
	border-color: var(--pme-primary);
}
.pm-estimate .pm-btn--primary:hover { background: var(--pme-primary-hover); border-color: var(--pme-primary-hover); }
.pm-estimate .pm-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.pm-estimate .pm-btn--outline {
	background: #fff;
	color: var(--pme-primary);
	border-color: var(--pme-primary);
}
.pm-estimate .pm-btn--outline:hover { background: var(--pme-sky); }

.pm-estimate__nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1.5rem;
}

/* ---- Messages ---- */
.pm-estimate__msg {
	padding: 0.5rem 0;
	font-size: 0.9rem;
	min-height: 1.5em;
}
.pm-estimate__msg--error { color: var(--pme-error); }
.pm-estimate__msg--success { color: var(--pme-success); }
