/**
 * Poils & Compagnie – estimator styles.
 * Modern take on the reference mockup: teal header, lime section bars, map card.
 */

.ptr-widget {
	--ptr-teal: #0d3b3b;
	--ptr-teal-soft: #13403f;
	--ptr-lime: #a4c714;
	--ptr-lime-dark: #8fae10;
	--ptr-grey: #eef0f2;
	--ptr-line: #e3e6e9;
	--ptr-text: #1f2a2a;
	--ptr-muted: #7a8686;
	--ptr-radius: 16px;
	--ptr-shadow: 0 18px 45px rgba(13, 59, 59, 0.12);

	box-sizing: border-box;
	max-width: 1180px;
	margin: 0 auto;
	color: var(--ptr-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* Adapt to the WIDTH OF THE CONTAINER, not just the screen — so the form
	   collapses correctly even inside a narrow column on a wide screen. */
	container-type: inline-size;
	container-name: ptr;
}

.ptr-widget *,
.ptr-widget *::before,
.ptr-widget *::after {
	box-sizing: border-box;
}

.ptr-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 26px;
	align-items: start;
}

/* ---------- Left panel ---------- */
.ptr-panel {
	background: #fff;
	border-radius: var(--ptr-radius);
	box-shadow: var(--ptr-shadow);
	overflow: hidden;
}

.ptr-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 22px;
	background: #fff;
	border-bottom: 1px solid var(--ptr-line);
}

.ptr-header-badge {
	background: var(--ptr-teal);
	color: #fff;
	font-weight: 800;
	letter-spacing: 2px;
	font-size: 20px;
	padding: 12px 20px;
	border-radius: 10px;
}

.ptr-header-title {
	color: var(--ptr-teal);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.25;
}

.ptr-section-bar {
	background: var(--ptr-lime);
	color: var(--ptr-teal);
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	font-size: 13px;
	padding: 12px 22px;
}

.ptr-section-bar-note {
	margin-left: 10px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	font-size: 13px;
}

.ptr-section-bar--grey {
	background: var(--ptr-grey);
	color: var(--ptr-text);
}

.ptr-row {
	display: grid;
	gap: 0;
}

.ptr-row-2 {
	grid-template-columns: 1fr 1fr;
}

.ptr-field {
	padding: 16px 22px;
	border-bottom: 1px solid var(--ptr-line);
}

.ptr-row-2 .ptr-field:first-child {
	border-right: 1px solid var(--ptr-line);
}

.ptr-field label {
	display: block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ptr-muted);
	margin-bottom: 8px;
}

.ptr-field-warning {
	margin: -2px 0 8px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ptr-text);
}

.ptr-field-warning strong {
	text-decoration: underline;
}

.ptr-field input,
.ptr-field select {
	width: 100%;
	border: none;
	outline: none;
	font-size: 15px;
	color: var(--ptr-text);
	background: transparent;
	padding: 4px 0;
}

.ptr-field input::placeholder {
	color: #b3bcbc;
}

.ptr-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230d3b3b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 2px center;
	cursor: pointer;
}

/* Options */
.ptr-options {
	padding: 8px 22px 16px;
}

.ptr-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid var(--ptr-line);
	cursor: pointer;
	font-size: 14px;
}

.ptr-option:last-child {
	border-bottom: none;
}

.ptr-option input {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--ptr-lime-dark);
}

.ptr-option-body {
	flex: 1;
	min-width: 0;
}

.ptr-option-label {
	display: block;
}

.ptr-option-desc {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ptr-muted);
}

.ptr-option-price {
	flex: none;
	margin-top: 1px;
	font-weight: 700;
	color: var(--ptr-teal);
	white-space: nowrap;
}

.ptr-option-price.is-free {
	color: var(--ptr-muted);
	font-weight: 600;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 1px;
}

/* "Réservation obligatoire" banner */
.ptr-notice {
	background: var(--ptr-teal);
	color: #fff;
	text-align: center;
	font-weight: 800;
	letter-spacing: 0.3px;
	font-size: 14px;
	padding: 12px 18px;
}

/* Availability agenda (Google Calendar) */
.ptr-avail-hint,
.ptr-avail-msg {
	margin: 0 0 10px;
	font-size: 13px;
	color: var(--ptr-muted);
}

.ptr-avail-grid {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 6px;
}

.ptr-avail-day {
	flex: 0 0 auto;
	width: 92px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ptr-avail-dayhead {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ptr-teal);
	text-align: center;
	padding: 4px 0;
	border-bottom: 2px solid var(--ptr-lime);
}

.ptr-avail-slot {
	border: 1px solid var(--ptr-line);
	background: #fff;
	color: var(--ptr-text);
	border-radius: 8px;
	padding: 7px 0;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ptr-avail-slot:hover:not(:disabled) {
	border-color: var(--ptr-lime-dark);
	background: #f6fae6;
}

.ptr-avail-slot.is-selected {
	background: var(--ptr-teal);
	border-color: var(--ptr-teal);
	color: #fff;
}

.ptr-avail-slot.is-busy {
	color: #c2c9c9;
	background: #f3f5f5;
	border-style: dashed;
	cursor: not-allowed;
	text-decoration: line-through;
}

/* Promo code */
.ptr-promo-input {
	text-transform: uppercase;
	letter-spacing: 1px;
}

.ptr-promo-input::placeholder {
	text-transform: none;
	letter-spacing: 0;
}

.ptr-promo-note {
	margin: 8px 0 0;
	font-size: 13px;
	min-height: 0;
}

.ptr-promo-note.is-ok {
	color: var(--ptr-lime-dark);
	font-weight: 700;
}

.ptr-promo-note.is-bad {
	color: #c0392b;
	font-weight: 600;
}

/* Honeypot */
.ptr-hp {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
}

.ptr-submit {
	display: block;
	width: 100%;
	border: none;
	cursor: pointer;
	background: var(--ptr-teal);
	color: #fff;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.5px;
	padding: 18px;
	transition: background 0.18s ease, transform 0.08s ease;
}

.ptr-submit:hover {
	background: #0a2e2e;
}

.ptr-submit:active {
	transform: translateY(1px);
}

.ptr-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.ptr-feedback {
	margin: 0;
	padding: 0 22px;
	min-height: 0;
	font-size: 14px;
}

.ptr-feedback.is-error { color: #c0392b; padding: 12px 22px; }
.ptr-feedback.is-success { color: var(--ptr-lime-dark); padding: 12px 22px; font-weight: 700; }
.ptr-feedback.is-info { color: var(--ptr-muted); padding: 12px 22px; }

/* ---------- Right side ---------- */
.ptr-side {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ptr-map {
	position: relative;
	width: 100%;
	min-height: 430px;
	height: 430px;
	border-radius: var(--ptr-radius);
	overflow: hidden;
	box-shadow: var(--ptr-shadow);
	background: #dfe4e6;
}

.ptr-map-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	padding: 30px;
	color: var(--ptr-muted);
}

.ptr-map-fallback .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: var(--ptr-lime-dark);
}

.ptr-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.ptr-stat {
	background: #fff;
	border-radius: 14px;
	box-shadow: var(--ptr-shadow);
	padding: 18px 20px;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 14px;
	align-items: center;
}

.ptr-stat-icon {
	grid-row: 1 / span 2;
	font-size: 26px;
}

.ptr-stat-label {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ptr-muted);
}

.ptr-stat-value {
	font-size: 22px;
	font-weight: 800;
	color: var(--ptr-teal);
}

/* "Votre tarif" heading above the estimate */
.ptr-side-title {
	margin: 0 0 12px;
	color: var(--ptr-teal);
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 0.3px;
}

.ptr-estimate-block {
	display: flex;
	flex-direction: column;
}

/* Estimate box */
.ptr-estimate {
	background: #fff;
	border-radius: 14px;
	box-shadow: var(--ptr-shadow);
	overflow: hidden;
}

.ptr-estimate-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--ptr-teal);
	color: #fff;
	padding: 16px 20px;
	font-weight: 700;
	font-size: 15px;
}

.ptr-estimate-total {
	font-size: 24px;
	font-weight: 800;
	color: var(--ptr-lime);
}

.ptr-estimate-lines {
	list-style: none;
	margin: 0;
	padding: 8px 20px;
}

.ptr-estimate-lines li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px dashed var(--ptr-line);
	font-size: 14px;
	color: #40514f;
}

.ptr-estimate-lines li:last-child {
	border-bottom: none;
}

.ptr-estimate-lines li span:last-child {
	font-weight: 700;
	white-space: nowrap;
	color: var(--ptr-text);
}

.ptr-estimate-note {
	margin: 0;
	padding: 12px 20px 16px;
	font-size: 12px;
	color: var(--ptr-muted);
}

/* Google Places autocomplete dropdown above everything */
.pac-container {
	z-index: 100000;
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
	border: none;
	margin-top: 4px;
	font-family: inherit;
}

/* ---------- Responsive (container-based) ----------
   The rules react to the width available to the widget itself. This is what
   makes the form behave inside a narrow sidebar/column, where classic
   viewport media queries would never trigger on a wide screen. Media queries
   are kept below as a fallback for browsers without container-query support. */
@container ptr (max-width: 900px) {
	.ptr-form {
		grid-template-columns: 1fr;
	}

	.ptr-side {
		order: -1;
	}

	.ptr-map,
	.ptr-map-fallback {
		min-height: 300px;
		height: 300px;
	}
}

@container ptr (max-width: 520px) {
	.ptr-row-2 {
		grid-template-columns: 1fr;
	}

	.ptr-row-2 .ptr-field:first-child {
		border-right: none;
	}

	.ptr-header {
		flex-wrap: wrap;
		gap: 10px;
	}

	.ptr-header-badge {
		font-size: 16px;
		padding: 10px 14px;
	}

	.ptr-header-title {
		font-size: 14px;
	}

	.ptr-field,
	.ptr-section-bar,
	.ptr-options {
		padding-left: 16px;
		padding-right: 16px;
	}

	.ptr-stats {
		grid-template-columns: 1fr;
	}

	.ptr-stat-value {
		font-size: 18px;
	}
}

/* Fallback for browsers without container queries (older Safari/Firefox). */
@supports not (container-type: inline-size) {
	@media (max-width: 900px) {
		.ptr-form {
			grid-template-columns: 1fr;
		}

		.ptr-side {
			order: -1;
		}

		.ptr-map,
		.ptr-map-fallback {
			min-height: 300px;
			height: 300px;
		}
	}

	@media (max-width: 480px) {
		.ptr-row-2 {
			grid-template-columns: 1fr;
		}

		.ptr-row-2 .ptr-field:first-child {
			border-right: none;
		}

		.ptr-header-badge {
			font-size: 16px;
			padding: 10px 14px;
		}

		.ptr-stats {
			grid-template-columns: 1fr;
		}
	}
}
