/* ============================================================
   Pavilift – Disque Offert — Styles du formulaire
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
	--pv-orange:   #e85d1a;
	--pv-orange-h: #c94d0f;
	--pv-grey-bg:  #f5f5f5;
	--pv-border:   #d9d9d9;
	--pv-text:     #333;
	--pv-radius:   30px;
	--pv-input-h:  52px;
}

/* ── Wrapper ────────────────────────────────────────────────── */
.pv-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 20px 40px;
	font-family: inherit;
	color: var(--pv-text);
}

/* ── Hero ───────────────────────────────────────────────────── */
.pv-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
	padding: 40px 0 30px;
	flex-wrap: wrap;
}
.pv-hero__text {
	flex: 1 1 300px;
}
.pv-hero__text h2 {
	font-size: 1.8em;
	font-weight: 700;
	margin-bottom: 12px;
}
.pv-hero__text p {
	line-height: 1.6;
	margin-bottom: 8px;
}
.pv-hero__text a {
	color: var(--pv-orange);
	text-decoration: underline;
}
.pv-hero__product {
	flex: 0 0 auto;
	text-align: center;
}
.pv-hero__product img {
	width: 160px;
	height: auto;
	display: block;
	margin: 0 auto 6px;
}
.pv-ref {
	font-size: 0.75em;
	color: #888;
}

/* ── Formulaire ─────────────────────────────────────────────── */
#pv-form {
	background: #fff;
	padding: 30px 0;
}

.pv-row {
	display: grid;
	gap: 16px;
	margin-bottom: 16px;
}
.pv-row--3 {
	grid-template-columns: 1fr 1fr 1fr;
}
.pv-row--center {
	display: flex;
	justify-content: center;
	margin-top: 8px;
}

/* ── Champs texte / email / tel ─────────────────────────────── */
.pv-field input[type="text"],
.pv-field input[type="email"],
.pv-field input[type="tel"],
.pv-field input[type="number"] {
	display: block;
	width: 100%;
	height: var(--pv-input-h);
	padding: 0 20px;
	border: 1.5px solid var(--pv-border);
	border-radius: var(--pv-radius);
	background: var(--pv-grey-bg);
	font-size: 0.95em;
	color: var(--pv-text);
	box-sizing: border-box;
	transition: border-color 0.2s;
	outline: none;
}
.pv-field input:focus {
	border-color: var(--pv-orange);
	background: #fff;
}
.pv-field input.pv-error {
	border-color: #e00;
	background: #fff5f5;
}

/* Champ relais : curseur pointer + fond légèrement différent */
#pv-relay-display {
	cursor: pointer !important;
}
#pv-relay-display:hover {
	border-color: var(--pv-orange);
}

/* ── Champ fichier ──────────────────────────────────────────── */
.pv-field--file {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.pv-file-label {
	font-size: 0.82em;
	color: #555;
	padding-left: 4px;
}
.pv-file-btn {
	display: inline-block;
	height: var(--pv-input-h);
	line-height: var(--pv-input-h);
	padding: 0 24px;
	background: #fff;
	border: 1.5px solid var(--pv-orange);
	border-radius: var(--pv-radius);
	color: var(--pv-orange);
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	transition: background 0.2s, color 0.2s;
}
.pv-file-btn:hover {
	background: var(--pv-orange);
	color: #fff;
}
#pv-receipt {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0,0,0,0);
}
.pv-file-name {
	font-size: 0.8em;
	color: #888;
	padding-left: 4px;
}

/* ── Bouton Envoyer ─────────────────────────────────────────── */
.pv-submit {
	display: inline-block;
	min-width: 220px;
	height: var(--pv-input-h);
	padding: 0 40px;
	background: var(--pv-orange);
	color: #fff;
	border: none;
	border-radius: var(--pv-radius);
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}
.pv-submit:hover {
	background: var(--pv-orange-h);
}
.pv-submit:active {
	transform: scale(0.98);
}
.pv-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ── Messages retour ────────────────────────────────────────── */
.pv-messages {
	display: none;
	margin-top: 20px;
	padding: 16px 24px;
	border-radius: 8px;
	font-size: 0.95em;
}
.pv-success-msg {
	background: #eaf7ea;
	border: 1px solid #6db86d;
	color: #2e7d2e;
}
.pv-error-msg {
	background: #fff0f0;
	border: 1px solid #e08080;
	color: #c0392b;
}
.pv-messages p { margin: 0; }

/* ── Mentions légales ───────────────────────────────────────── */
.pv-legal {
	font-size: 0.78em;
	color: #777;
	text-align: center;
	margin-top: 24px;
	line-height: 1.6;
}

/* ── Modal DPD ──────────────────────────────────────────────── */
.pv-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pv-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}
.pv-modal__box {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.25);
	width: 95vw;
	max-width: 900px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.pv-modal__title {
	margin: 0;
	padding: 18px 24px 14px;
	font-size: 1.05em;
	font-weight: 700;
	border-bottom: 1px solid var(--pv-border);
	flex-shrink: 0;
}
.pv-modal__close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
	color: #555;
	padding: 0 4px;
}
.pv-modal__close:hover { color: #000; }

/* Empêcher le scroll du body quand la modal est ouverte */
body.pv-modal-open { overflow: hidden; }

/* ── Barre de recherche dans la modal ───────────────────────── */
.pv-relay-search-bar {
	display: flex;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--pv-border);
	flex-shrink: 0;
}
.pv-relay-search-bar input {
	flex: 1;
	height: 42px;
	padding: 0 14px;
	border: 1.5px solid var(--pv-border);
	border-radius: 6px;
	font-size: 0.95em;
	outline: none;
}
.pv-relay-search-bar input:focus {
	border-color: var(--pv-orange);
}
.pv-relay-search-bar button {
	height: 42px;
	padding: 0 18px;
	background: var(--pv-orange);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
}
.pv-relay-search-bar button:hover {
	background: var(--pv-orange-h);
}

/* ── Résultats relais ────────────────────────────────────────── */
#pv-relay-results {
	flex: 1;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.pv-relay-empty {
	text-align: center;
	color: #888;
	padding: 30px 20px;
	font-size: 0.9em;
	line-height: 1.6;
}

/* Spinner chargement */
.pv-relay-loading {
	text-align: center;
	padding: 30px 20px;
	color: #555;
	font-size: 0.9em;
}
.pv-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ddd;
	border-top-color: var(--pv-orange);
	border-radius: 50%;
	animation: pv-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}
@keyframes pv-spin {
	to { transform: rotate(360deg); }
}

/* Liste de relais */
.pv-relay-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.pv-relay-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s;
}
.pv-relay-item:last-child { border-bottom: none; }
.pv-relay-item:hover {
	background: #fff8f5;
}
.pv-relay-item__icon {
	font-size: 1.4em;
	flex-shrink: 0;
}
.pv-relay-item__info {
	flex: 1;
	min-width: 0;
}
.pv-relay-item__name {
	display: block;
	font-size: 0.95em;
	font-weight: 700;
	color: var(--pv-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pv-relay-item__addr {
	display: block;
	font-size: 0.8em;
	color: #777;
	margin-top: 2px;
	line-height: 1.4;
}
.pv-relay-item__arrow {
	color: var(--pv-orange);
	font-size: 1.4em;
	font-weight: 700;
	flex-shrink: 0;
}
.pv-relay-item__dist {
	font-size: 0.75em;
	color: #aaa;
	white-space: nowrap;
	margin-left: auto;
	padding-left: 8px;
}

/* ── Layout carte + liste ────────────────────────────────────── */
.pv-relay-layout {
	display: flex;
	flex: 1;
	overflow: hidden;
}
#pv-relay-map {
	flex: 0 0 55%;
	height: 100%;
	min-height: 400px;
	border-right: 1px solid var(--pv-border);
	z-index: 0;
}
#pv-relay-list {
	flex: 1;
	overflow-y: auto;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Bouton sélection dans les popups Leaflet */
.pv-map-select-btn {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 6px 12px;
	background: var(--pv-orange);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 0.85em;
	cursor: pointer;
	font-weight: 600;
}
.pv-map-select-btn:hover { background: var(--pv-orange-h); }

/* Icône marker custom */
.pv-map-marker {
	background: none;
	border: none;
}
.pv-map-marker span { font-size: 1.6em; line-height: 1; }

/* Leaflet popup */
.leaflet-popup-content { font-size: 0.85em; line-height: 1.4; min-width: 160px; }

@media ( max-width: 640px ) {
	.pv-relay-layout { flex-direction: column; }
	#pv-relay-map { flex: 0 0 220px; height: 220px; border-right: none; border-bottom: 1px solid var(--pv-border); }
	#pv-relay-list { flex: 1; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media ( max-width: 768px ) {
	.pv-row--3 {
		grid-template-columns: 1fr;
	}
	.pv-hero {
		flex-direction: column;
		text-align: center;
	}
	.pv-hero__product {
		order: -1;
	}
	.pv-submit {
		width: 100%;
	}
}
