/* =====================================================================
   Page « Contact » (chargée seulement sur cette page, après style.css)
   ---------------------------------------------------------------------
   - Colonnes « adv-contact » : formulaire à gauche (700 px), encadré
     « Liens utiles » à droite (340 px), 100 px d'écart = 1140 px.
   - Formulaire Contact Form 7 n° 5 : classes « adv-contact__… » écrites
     dans le modèle du formulaire (Contact > Formulaires > Formulaire de
     contact). Contact Form 7 ajoute lui-même des <p> autour des champs.
   - js/page-contact.js complète l'accessibilité du formulaire (case de
     consentement obligatoire, noms des champs dans le résumé des erreurs).
   ===================================================================== */

/* 1. Introduction et colonnes
   --------------------------------------------------------------------- */
.adv-page .adv-contact__intro {
	max-width: 840px;
	margin-bottom: 40px;
}

/* « après-vente » n'est pas coupé en fin de ligne */
.adv-contact__insecable {
	white-space: nowrap;
}

.adv-page .adv-contact {
	gap: clamp(2rem, 7vw, 100px);
	align-items: flex-start;
	margin-bottom: 0;
}


/* 2. Champs du formulaire
   --------------------------------------------------------------------- */
.adv-contact .wpcf7-form p {
	margin: 0;
}

.adv-contact .wpcf7-form .adv-contact__note {
	margin: 0 0 24px;
	color: var(--adv-gris-texte);
	font-size: 15px;
}

/* Prénom et Nom côte à côte */
.adv-contact__ligne {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 24px;
}

.adv-contact__champ {
	margin-bottom: 24px;
}

/* Étiquettes comme « Couleur du cadre » sur la maquette produit (Poppins) */
.adv-contact__champ label {
	display: block;
	margin-bottom: 8px;
	color: var(--adv-noir);
	font-family: var(--adv-police-titres);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.4;
}

.adv-contact .wpcf7-form-control-wrap {
	display: block;
}

/* Lien du résumé des erreurs vers un champ : le champ ET son étiquette
   restent visibles sous l'en-tête fixe. */
.adv-contact .wpcf7-form-control-wrap .wpcf7-form-control {
	scroll-margin-top: calc(var(--adv-hauteur-entete) + 56px);
}

/* Champs aussi hauts que la recherche de la maquette « Nos magasins » */
.adv-contact input[type="text"],
.adv-contact input[type="email"],
.adv-contact textarea {
	display: block;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 14px 20px;
	border: 1px solid #c4c4c4;
	border-radius: 2px;
	box-shadow: none;
	line-height: 1.5;
}

.adv-contact textarea {
	height: 200px;
	min-height: 140px;
	resize: vertical;
}

.adv-contact input[type="text"]:hover,
.adv-contact input[type="email"]:hover,
.adv-contact textarea:hover {
	border-color: var(--adv-gris-moyen);
}

/* Bordure verte au focus, même si la souris survole encore le champ
   (le contour violet du focus clavier vient de style.css) */
.adv-contact input[type="text"]:focus,
.adv-contact input[type="email"]:focus,
.adv-contact textarea:focus {
	border-color: var(--adv-vert);
}

/* Champ en erreur : bordure rouge renforcée + message sous le champ */
.adv-contact input.wpcf7-not-valid,
.adv-contact textarea.wpcf7-not-valid {
	border-color: #b3261e;
	box-shadow: inset 0 0 0 1px #b3261e;
}

.adv-contact .wpcf7-not-valid-tip {
	display: block;
	margin-top: 8px;
	padding-left: 24px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23b3261e'/%3E%3Cpath d='M8 3.5v5.5M8 11v1.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left 0.2em / 16px 16px;
	color: #b3261e;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
}


/* 3. Consentement RGPD : case à cocher et informations dépliables
   --------------------------------------------------------------------- */
.adv-contact__consentement {
	margin-bottom: 16px;
}

.adv-contact__consentement .wpcf7-list-item {
	display: block;
	margin: 0;
}

.adv-contact__consentement label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	line-height: 1.5;
}

.adv-contact__consentement input[type="checkbox"] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--adv-vert);
	cursor: pointer;
}

.adv-contact__consentement .wpcf7-not-valid-tip {
	margin-left: 32px;
}

/* Case non cochée lors de l'envoi : contour rouge (le contour violet du
   focus clavier reste prioritaire) */
.adv-contact__consentement .wpcf7-not-valid input[type="checkbox"]:not(:focus-visible) {
	outline: 2px solid #b3261e;
	outline-offset: 2px;
}

/* Bloc « Vos données et vos droits (RGPD) » : <details> natif, se déplie
   au clic ou au clavier (Entrée / Espace), même sans JavaScript. */
.adv-contact__rgpd {
	margin: 0 0 32px;
	border: 1px solid var(--adv-gris-bordure);
	border-radius: var(--adv-rayon);
	background: var(--adv-gris-fond);
}

.adv-contact__rgpd summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 20px;
	border-radius: var(--adv-rayon);
	color: var(--adv-texte);
	font-family: var(--adv-police-titres);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	list-style: none;
	cursor: pointer;
}

.adv-contact__rgpd summary::-webkit-details-marker {
	display: none;
}

/* Chevron (décoratif) qui pivote quand le bloc est ouvert */
.adv-contact__rgpd summary::after {
	content: "";
	flex: none;
	width: 12px;
	height: 8px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23202020' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center / contain;
}

.adv-contact__rgpd[open] summary::after {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: no-preference) {
	.adv-contact__rgpd summary::after {
		transition: transform 0.2s ease;
	}
}

.adv-contact__rgpd summary:hover {
	color: var(--adv-vert-fonce);
}

.adv-contact .adv-contact__rgpd p {
	margin: 0;
	padding: 0 20px 14px;
	color: var(--adv-gris-texte);
	font-size: 15px;
	line-height: 1.6;
}

.adv-contact__rgpd a {
	color: var(--adv-vert-fonce);
}


/* 4. Bouton « Envoyer » (comme le bouton « Acheter » de la maquette)
   --------------------------------------------------------------------- */
.adv-contact__envoi p {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.adv-contact .wpcf7-submit {
	min-width: 145px;
	min-height: 45px;
	padding: 10px 36px;
	font-size: 17px;
	cursor: pointer;
}

.adv-contact .wpcf7-submit:hover,
.adv-contact .wpcf7-submit:focus-visible {
	background-color: var(--adv-vert-fonce);
	color: var(--adv-blanc);
}


/* 5. Message de réponse (envoi réussi ou erreurs)
   --------------------------------------------------------------------- */
.adv-contact .wpcf7 form .wpcf7-response-output {
	margin: 24px 0 0;
	padding: 14px 20px;
	border: 2px solid var(--adv-vert);
	border-radius: var(--adv-rayon);
	font-weight: 700;
	line-height: 1.5;
}

.adv-contact .wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--adv-vert);
	background: #effaec;
	color: #0d5c00;
}

.adv-contact .wpcf7 form.invalid .wpcf7-response-output,
.adv-contact .wpcf7 form.unaccepted .wpcf7-response-output,
.adv-contact .wpcf7 form.payment-required .wpcf7-response-output,
.adv-contact .wpcf7 form.failed .wpcf7-response-output,
.adv-contact .wpcf7 form.aborted .wpcf7-response-output,
.adv-contact .wpcf7 form.spam .wpcf7-response-output {
	border-color: #b3261e;
	background: #fdf0ef;
	color: #8c1d18;
}

/* Résumé des erreurs de Contact Form 7, au-dessus du formulaire : il est
   réservé aux lecteurs d'écran, mais ses liens vers les champs en erreur
   reçoivent le focus au clavier. Il s'affiche donc dès qu'un de ses liens
   a le focus, pour que le focus ne disparaisse jamais de l'écran. */
.adv-contact .wpcf7 .screen-reader-response:focus-within {
	position: static;
	width: auto;
	height: auto;
	margin: 0 0 24px;
	padding: 14px 20px;
	overflow: visible;
	clip: auto;
	clip-path: none;
	border: 2px solid #b3261e;
	border-radius: var(--adv-rayon);
	background: #fdf0ef;
	color: #8c1d18;
	line-height: 1.5;
}

.adv-contact .wpcf7 .screen-reader-response:focus-within p {
	margin: 0 0 8px;
	font-weight: 700;
}

.adv-contact .wpcf7 .screen-reader-response:focus-within ul {
	margin: 0;
	padding-left: 20px;
}

.adv-contact .wpcf7 .screen-reader-response li + li {
	margin-top: 4px;
}

.adv-contact .wpcf7 .screen-reader-response a {
	color: #8c1d18;
	text-decoration: underline;
}


/* 6. Encadré « Liens utiles »
   --------------------------------------------------------------------- */
.adv-contact__infos {
	padding: 32px;
	border-radius: var(--adv-rayon);
	background: var(--adv-gris-fond);
}

.adv-contact .adv-contact__titre {
	margin: 0 0 20px;
	color: var(--adv-noir);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.adv-contact .adv-contact__liens {
	margin: 0;
	padding: 0;
	list-style: none;
}

.adv-contact__liens li {
	margin: 0;
	padding: 16px 0;
	border-top: 1px solid var(--adv-gris-bordure);
}

.adv-contact__liens li:first-child {
	padding-top: 0;
	border-top: 0;
}

.adv-contact__liens li:last-child {
	padding-bottom: 0;
}

.adv-contact__liens a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--adv-vert);
	font-family: var(--adv-police-titres);
	font-weight: 600;
	text-decoration: none;
}

/* Petite flèche décorative après le lien */
.adv-contact__liens a::after {
	content: "";
	width: 7px;
	height: 12px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='12' viewBox='0 0 7 12'%3E%3Cpath d='M1 1l5 5-5 5' fill='none' stroke='%2319af00' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat center / contain;
}

.adv-contact__liens a:hover,
.adv-contact__liens a:focus-visible {
	color: var(--adv-vert-fonce);
	text-decoration: underline;
}

.adv-contact__aide {
	display: block;
	margin-top: 4px;
	color: var(--adv-gris-texte);
	font-size: 15px;
	line-height: 1.5;
}


/* 7. Petits écrans
   --------------------------------------------------------------------- */
@media (max-width: 781px) {
	.adv-page .adv-contact__intro {
		margin-bottom: 32px;
	}

	.adv-contact__infos {
		padding: 24px;
	}
}

/* Prénom et Nom l'un sous l'autre sur téléphone */
@media (max-width: 600px) {
	.adv-contact__ligne {
		grid-template-columns: minmax(0, 1fr);
	}
}
