/**
 * Formulaire de commande — Cave du Pont
 * Reprend la palette du thème : brun profond et crème.
 */

.cdp-form {
	--cdp-creme: #fee8d4;
	--cdp-fond: #3a0600;
	--cdp-trait: rgba(254, 232, 212, 0.35);
	--cdp-voile: rgba(254, 232, 212, 0.08);

	max-width: 780px;
	margin: 40px 0;
	color: var(--cdp-creme);
}

/* ---------- Blocs ---------- */

.cdp-bloc {
	border: 1px solid var(--cdp-trait);
	border-radius: 12px;
	padding: 30px;
	margin: 0 0 30px 0;
}

.cdp-bloc legend,
.cdp-bloc h3 {
	font-size: 22px;
	font-weight: normal;
	padding: 0 12px;
	margin: 0;
	color: var(--cdp-creme);
	border: 0;
}

.cdp-bloc h3 {
	padding: 0;
	margin-bottom: 20px;
}

.cdp-aide {
	font-size: 15px;
	opacity: 0.75;
	margin: 10px 0 20px 0;
}

.cdp-requis {
	color: var(--cdp-creme);
}

.cdp-facultatif {
	opacity: 0.6;
	font-size: 14px;
}

/* ---------- Cases à cocher et boutons radio ----------
 *
 * Le thème applique « input { padding: 20px; border: 1px solid; width: 100% } »
 * à TOUS les champs, y compris les cases et les radios, qui se retrouvent
 * déformés. On rétablit l'apparence native ici.
 */

.cdp-form input[type="checkbox"],
.cdp-form input[type="radio"] {
	-webkit-appearance: auto;
	appearance: auto;
	width: 22px;
	min-width: 22px;
	height: 22px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	flex: 0 0 auto;
	accent-color: var(--cdp-creme);
	cursor: pointer;
}

/* ---------- Produits ---------- */

.cdp-produits {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cdp-produit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 18px;
	margin-bottom: 12px;
	border: 1px solid var(--cdp-trait);
	border-radius: 10px;
	transition: background 0.2s ease-in;
}

.cdp-produit.est-choisi {
	background: var(--cdp-voile);
}

.cdp-produit-choix {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1 1 320px;
}

.cdp-produit-choix label {
	margin: 0;
	cursor: pointer;
	display: block;
	width: auto;
}

.cdp-produit-nom {
	display: block;
	font-size: 17px;
}

.cdp-produit-prix {
	display: block;
	font-size: 15px;
	opacity: 0.75;
	margin-top: 3px;
}

.cdp-produit-qte {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.cdp-produit-qte label {
	margin: 0;
	width: auto;
	font-size: 14px;
	opacity: 0.75;
}

.cdp-produit-qte input[type="number"] {
	width: 90px;
	padding: 10px;
	text-align: center;
	border-radius: 8px;
}

.cdp-produit-qte input[type="number"]:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.cdp-sous-total {
	min-width: 95px;
	text-align: right;
	font-size: 16px;
}

/* ---------- Panier repris ---------- */

.cdp-panier-repris {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	margin: 0 0 20px 0;
	border: 1px dashed var(--cdp-trait);
	border-radius: 10px;
	font-size: 15px;
}

.cdp-lien-bouton {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	color: var(--cdp-creme);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
	width: auto;
}

.cdp-lien-bouton:hover {
	opacity: 0.75;
}

/* ---------- Modes de livraison ---------- */

.cdp-modes {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin-top: 10px;
}

.cdp-mode {
	flex: 1 1 260px;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 18px;
	border: 1px solid var(--cdp-trait);
	border-radius: 10px;
	cursor: pointer;
	margin: 0;
	width: auto;
	transition: background 0.2s ease-in;
}

.cdp-mode:hover,
.cdp-mode:focus-within {
	background: var(--cdp-voile);
}

.cdp-mode input[type="radio"] {
	margin-top: 3px;
}

.cdp-mode span {
	font-size: 15px;
	line-height: 1.5;
}

/* ---------- Récapitulatif ---------- */

.cdp-recap {
	background: var(--cdp-voile);
}

.cdp-recap-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 18px;
}

.cdp-recap-table th,
.cdp-recap-table td {
	padding: 10px 0;
	text-align: left;
	font-weight: normal;
	border: 0;
}

.cdp-recap-table td {
	text-align: right;
	white-space: nowrap;
}

.cdp-recap-qte {
	text-align: center !important;
	opacity: 0.7;
	font-size: 15px;
}

.cdp-recap-table tbody tr {
	border-bottom: 1px solid var(--cdp-trait);
}

.cdp-recap-sous th,
.cdp-recap-sous td {
	padding-top: 14px;
}

.cdp-recap-total th,
.cdp-recap-total td {
	font-size: 22px;
	padding-top: 16px;
	border-top: 2px solid var(--cdp-creme);
}

.cdp-tva {
	list-style: none;
	margin: 0 0 12px 0;
	padding: 0;
	font-size: 14px;
	opacity: 0.75;
}

.cdp-tva li {
	display: flex;
	justify-content: space-between;
	padding: 3px 0;
}

/* ---------- Champs ---------- */

.cdp-form label {
	display: block;
	width: 100%;
	margin-bottom: 8px;
}

.cdp-form input[type="text"],
.cdp-form input[type="email"],
.cdp-form input[type="tel"],
.cdp-form input[type="number"],
.cdp-form textarea {
	width: 100%;
	padding: 16px;
	background: transparent;
	border: 1px solid var(--cdp-trait);
	border-radius: 8px;
	color: var(--cdp-creme);
	font-weight: lighter;
}

.cdp-form input:focus,
.cdp-form textarea:focus {
	border-color: var(--cdp-creme);
	outline: 2px solid transparent;
}

.cdp-form input:focus-visible,
.cdp-form textarea:focus-visible,
.cdp-form input[type="checkbox"]:focus-visible,
.cdp-form input[type="radio"]:focus-visible {
	outline: 3px solid var(--cdp-creme);
	outline-offset: 3px;
}

.cdp-ligne-double {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.cdp-ligne-double > p {
	flex: 1 1 180px;
}

.cdp-form p {
	margin-bottom: 22px;
}

/* ---------- Envoi ---------- */

.cdp-envoi input[type="submit"] {
	display: inline-block;
	min-width: 240px;
	padding: 18px 40px;
	font-size: 19px;
	background: transparent;
	border: 3px solid var(--cdp-creme);
	color: var(--cdp-creme);
	cursor: pointer;
	transition: background 0.3s ease-in;
}

.cdp-envoi input[type="submit"]:hover {
	background: rgba(254, 232, 212, 0.5);
}

/* ---------- Messages ---------- */

.cdp-message {
	padding: 25px 30px;
	border: 2px solid #fee8d4;
	border-radius: 12px;
	margin-bottom: 30px;
	color: #fee8d4;
}

.cdp-message.cdp-erreur {
	border-style: dashed;
}

.cdp-message h2 {
	margin-top: 0;
	border: 0;
}

.cdp-message ul {
	margin: 12px 0 0 22px;
}

/* ---------- Piège à robots ---------- */

.cdp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ---------- Petits écrans ---------- */

@media (max-width: 620px) {
	.cdp-bloc {
		padding: 20px;
	}

	.cdp-produit {
		flex-direction: column;
		align-items: stretch;
	}

	.cdp-produit-qte {
		justify-content: space-between;
		padding-left: 36px;
	}

	.cdp-envoi input[type="submit"] {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cdp-form * {
		transition: none !important;
	}
}
