/* ==========================================================================
   WOOCOMMERCE : éléments communs aux pages boutique, fiche, panier, commande, confirmation et compte.
   Structure neutre : uniquement les variables du contrat (§3). L'habillage final vient de assets/css/design/.
   ========================================================================== */

/* ---------- Cadre des pages panier / commande / compte ---------- */
.bdp-woo-page {
	padding-block: var(--esp-7, 2.5rem) var(--esp-9, 5rem);
}

.bdp-woo-page__titre {
	margin: 0 0 var(--esp-6, 2rem);
	font-size: var(--fs-3xl, 2.5rem);
}

.bdp-etapes-nav {
	margin-bottom: var(--esp-5, 1.5rem);
}

.bdp-etapes__lien {
	color: inherit;
	text-decoration: none;
}

a.bdp-etapes__lien:hover {
	text-decoration: underline;
}

/* ---------- Notices : icône + texte ---------- */
.bdp-notice--avec-icone {
	display: flex;
	align-items: flex-start;
	gap: var(--esp-3, 0.75rem);
}

/* Messages WooCommerce : leur HTML est filtré par WooCommerce, l'icône est donc un pictogramme CSS. */
.bdp-notice.woocommerce-message,
.bdp-notice.woocommerce-error {
	display: flex;
	align-items: flex-start;
	gap: var(--esp-3, 0.75rem);
}

.bdp-notice.woocommerce-message::before,
.bdp-notice.woocommerce-error::before {
	flex: none;
	display: grid;
	place-items: center;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: var(--r-pill, 999px);
	background: var(--c-succes, #1b7f3b);
	color: var(--c-bg, #fff);
	font-size: var(--fs-xs, 0.75rem);
	font-weight: 700;
	content: "\2713" / "";
}

.bdp-notice.woocommerce-error::before {
	background: var(--c-erreur, #b00020);
	content: "!" / "";
}

.bdp-notice.woocommerce-error .bdp-notice__liste {
	list-style: none;
	padding-left: 0;
}

.bdp-notice__icone {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.2em;
}

.bdp-notice--succes .bdp-notice__icone { color: var(--c-succes, #1b7f3b); }
.bdp-notice--erreur .bdp-notice__icone { color: var(--c-erreur, #b00020); }

.bdp-notice__texte {
	margin: 0;
}

.bdp-notice a:not(.button) {
	font-weight: 600;
}

.bdp-notice .button {
	margin-left: var(--esp-3, 0.75rem);
}

/* ---------- Champs de formulaire WooCommerce ---------- */
.bdp-champs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--esp-4, 1rem);
	margin-bottom: var(--esp-4, 1rem);
}

.bdp-champs > .bdp-champ,
.bdp-champs > .form-row {
	grid-column: 1 / -1;
	margin: 0;
}

@media (min-width: 600px) {
	.bdp-champs > .form-row-first { grid-column: 1; }
	.bdp-champs > .form-row-last { grid-column: 2; }
}

.bdp-champ .woocommerce-input-wrapper {
	display: block;
}

.bdp-champ .required,
.bdp-champ abbr {
	color: var(--c-erreur, #b00020);
	text-decoration: none;
}

.bdp-champ .optional {
	color: var(--c-texte-doux, #555);
	font-weight: 400;
}

.bdp-champ .description {
	display: block;
	margin-top: var(--esp-2, 0.5rem);
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-sm, 0.9rem);
}

.bdp-champ.woocommerce-invalid .bdp-champ__input {
	border-color: var(--c-erreur, #b00020);
	border-width: calc(var(--filet, 1px) * 2);
}

/* L'erreur accessible est gérée par checkout.js : le message intégré de WooCommerce est masqué. */
.checkout-inline-error-message {
	display: none;
}

.bdp-champ .bdp-champ__erreur::before {
	content: "\26A0\FE0E\00a0";
}

.bdp-groupe {
	min-width: 0;
	margin: 0 0 var(--esp-6, 2rem);
	padding: 0;
	border: 0;
}

.bdp-groupe__legende {
	width: 100%;
	margin-bottom: var(--esp-4, 1rem);
	padding: 0;
	font-family: var(--f-titre, inherit);
	font-size: var(--fs-lg, 1.25rem);
	font-weight: var(--fw-titre, 700);
}

.bdp-formulaire__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--esp-4, 1rem);
	margin-top: var(--esp-5, 1.5rem);
}

.bdp-formulaire__aide {
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-sm, 0.9rem);
}

.bdp-case__nombre {
	color: var(--c-texte-doux, #555);
}

.bdp-btn--petit {
	min-height: 2.5rem;
	padding: 0.4em 1.1em;
	font-size: var(--fs-xs, 0.75rem);
}

/* Mot de passe : bouton afficher / masquer (account.js). */
.bdp-mdp {
	position: relative;
}

.bdp-mdp .bdp-champ__input {
	padding-right: 3.2rem;
}

.bdp-mdp__bascule {
	position: absolute;
	top: 50%;
	right: 0.4rem;
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	border: 0;
	background: transparent;
	color: var(--c-texte-doux, #555);
	transform: translateY(-50%);
}

.bdp-mdp__bascule:hover {
	color: var(--c-texte, #111);
}

/* ---------- Emplacement d'image (photo à venir) ---------- */
.bdp-image-vide {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-height: 100%;
	aspect-ratio: 1;
	background: linear-gradient(135deg, var(--c-surface-2, #eee), var(--c-surface, #f8f8f8));
	color: var(--c-texte-doux, #555);
}

.bdp-image-vide__icone {
	width: 2.5rem;
	height: 2.5rem;
	opacity: 0.45;
}

/* ---------- Quantité : champ entre les boutons − et + ---------- */
.bdp-quantite {
	background: var(--c-surface, #fff);
}

.bdp-quantite:focus-within {
	outline: 3px solid var(--c-focus, #1a73e8);
	outline-offset: 1px;
}

/* Les boutons − et + n'ont de sens qu'avec JavaScript. */
html:not(.js) .bdp-quantite__bouton,
html:not(.js) .bdp-reglement__bascule {
	display: none;
}

.bdp-quantite__bouton {
	color: var(--c-texte, #111);
	transition: background-color var(--duree-s, 0.2s) var(--ease, ease);
}

.bdp-quantite__bouton:hover {
	background: var(--c-surface-2, #eee);
}

.bdp-quantite__champ {
	width: 3rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--c-texte, #111);
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
}

.bdp-quantite__champ:focus-visible {
	outline: none;
}

html.js .bdp-quantite__champ::-webkit-inner-spin-button,
html.js .bdp-quantite__champ::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

html.js .bdp-quantite__champ {
	appearance: textfield;
}

/* ---------- Totaux (panier et récapitulatif de commande) ---------- */
.bdp-totaux {
	margin: 0;
	padding: 0;
}

.bdp-totaux__ligne {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--esp-4, 1rem);
	padding-block: var(--esp-3, 0.75rem);
	border-bottom: var(--filet, 1px) solid var(--c-ligne, #ddd);
}

.bdp-totaux__ligne dt {
	margin: 0;
	color: var(--c-texte-doux, #555);
}

.bdp-totaux__ligne dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
}

.bdp-totaux__ligne--total {
	padding-top: var(--esp-4, 1rem);
	border-bottom: 0;
}

.bdp-totaux__ligne--total dt {
	color: var(--c-texte, #111);
	font-size: var(--fs-lg, 1.25rem);
	font-weight: 700;
}

.bdp-totaux__ligne--total dd {
	color: var(--c-prix, #aa272e);
	font-size: var(--fs-2xl, 2rem);
}

.bdp-totaux__ligne--abonne dd {
	color: var(--c-succes, #1b7f3b);
}

.bdp-totaux__ligne.woocommerce-shipping-totals {
	flex-direction: column;
	align-items: stretch;
}

.bdp-totaux__ligne.woocommerce-shipping-totals dd {
	text-align: left;
}

.bdp-totaux .woocommerce-remove-coupon {
	display: inline-block;
	margin-left: var(--esp-2, 0.5rem);
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 400;
}

.bdp-totaux .includes_tax {
	display: block;
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-xs, 0.75rem);
	font-weight: 400;
}

/* ---------- Modes de livraison (cartes) ---------- */
.bdp-modes__liste {
	display: grid;
	gap: var(--esp-3, 0.75rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bdp-mode {
	position: relative;
}

.bdp-mode__radio {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.bdp-mode__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--esp-4, 1rem);
	padding: var(--esp-4, 1rem) var(--esp-5, 1.5rem);
	border: var(--filet, 1px) solid var(--c-ligne, #ddd);
	border-radius: var(--r-m, 4px);
	background: var(--c-surface, #fff);
	cursor: pointer;
	transition: border-color var(--duree-s, 0.2s) var(--ease, ease), box-shadow var(--duree-s, 0.2s) var(--ease, ease);
}

.bdp-mode__label::before {
	content: "";
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	border: calc(var(--filet, 1px) * 2) solid var(--c-texte-doux, #555);
	border-radius: var(--r-pill, 999px);
	background: var(--c-surface, #fff);
}

.bdp-mode__nom {
	flex: 1;
	font-weight: 600;
}

.bdp-mode__prix {
	font-weight: 700;
}

.bdp-mode__radio:checked + .bdp-mode__label,
.bdp-mode.is-choisi .bdp-mode__label {
	border-color: var(--c-primaire, #123);
	box-shadow: 0 0 0 var(--filet, 1px) var(--c-primaire, #123);
}

.bdp-mode__radio:checked + .bdp-mode__label::before,
.bdp-mode.is-choisi .bdp-mode__label::before {
	border-color: var(--c-primaire, #123);
	background: radial-gradient(circle, var(--c-primaire, #123) 45%, var(--c-surface, #fff) 50%);
}

.bdp-mode__radio:focus-visible + .bdp-mode__label {
	outline: 3px solid var(--c-focus, #1a73e8);
	outline-offset: 2px;
}

.bdp-modes__message,
.bdp-modes__destination {
	margin: 0;
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-sm, 0.9rem);
}

.bdp-totaux .bdp-mode__label {
	padding: var(--esp-3, 0.75rem) var(--esp-4, 1rem);
}

/* ---------- État vide (panier, liste de produits, commandes) ---------- */
.bdp-vide {
	display: grid;
	justify-items: center;
	gap: var(--esp-3, 0.75rem);
	padding: var(--esp-9, 5rem) var(--esp-5, 1.5rem);
	border: var(--filet, 1px) dashed var(--c-ligne, #ddd);
	border-radius: var(--r-l, 8px);
	background: var(--c-surface, #fff);
	text-align: center;
}

.bdp-vide__icone {
	width: 3rem;
	height: 3rem;
	color: var(--c-texte-doux, #555);
	opacity: 0.6;
}

.bdp-vide__titre {
	margin: 0;
	font-family: var(--f-titre, inherit);
	font-size: var(--fs-xl, 1.5rem);
	font-weight: var(--fw-titre, 700);
}

.bdp-vide__texte {
	max-width: 36ch;
	margin: 0 0 var(--esp-3, 0.75rem);
	color: var(--c-texte-doux, #555);
}

/* ---------- Tableaux de données (commandes) ---------- */
.bdp-table {
	width: 100%;
	border-collapse: collapse;
}

.bdp-table th,
.bdp-table td {
	padding: var(--esp-3, 0.75rem) var(--esp-4, 1rem);
	border-bottom: var(--filet, 1px) solid var(--c-ligne, #ddd);
	text-align: left;
	vertical-align: top;
}

.bdp-table thead th {
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-xs, 0.75rem);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bdp-table tfoot th {
	font-weight: 600;
}

.bdp-table td:last-child,
.bdp-table tfoot td {
	text-align: right;
}

@media (max-width: 719px) {
	.bdp-table--empilee thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.bdp-table--empilee,
	.bdp-table--empilee tbody,
	.bdp-table--empilee tr,
	.bdp-table--empilee th,
	.bdp-table--empilee td {
		display: block;
	}

	.bdp-table--empilee tr {
		margin-bottom: var(--esp-4, 1rem);
		border: var(--filet, 1px) solid var(--c-ligne, #ddd);
		border-radius: var(--r-m, 4px);
		background: var(--c-surface, #fff);
	}

	.bdp-table--empilee th,
	.bdp-table--empilee td {
		display: flex;
		justify-content: space-between;
		gap: var(--esp-4, 1rem);
		border-bottom: var(--filet, 1px) solid var(--c-ligne, #ddd);
		text-align: right;
	}

	.bdp-table--empilee td:last-child {
		border-bottom: 0;
	}

	.bdp-table--empilee [data-title]::before {
		content: attr(data-title);
		color: var(--c-texte-doux, #555);
		font-weight: 600;
		text-align: left;
	}
}

/* ---------- Statut de commande ---------- */
.bdp-statut {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.2em 0.8em;
	border-radius: var(--r-pill, 999px);
	background: var(--c-surface-2, #eee);
	color: var(--c-texte, #111);
	font-size: var(--fs-xs, 0.75rem);
	font-weight: 700;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.bdp-statut::before {
	content: "";
	width: 0.55em;
	height: 0.55em;
	border-radius: var(--r-pill, 999px);
	background: var(--c-texte-doux, #555);
}

.bdp-statut--completed::before { background: var(--c-succes, #1b7f3b); }
.bdp-statut--processing::before { background: var(--c-primaire, #123); }
.bdp-statut--on-hold::before,
.bdp-statut--pending::before { background: var(--c-alerte, #b26a00); }
.bdp-statut--cancelled::before,
.bdp-statut--failed::before,
.bdp-statut--refunded::before { background: var(--c-erreur, #b00020); }

/* ---------- Adresses ---------- */
.bdp-adresse {
	font-style: normal;
	line-height: 1.7;
}

.bdp-adresse > span {
	display: block;
	color: var(--c-texte-doux, #555);
}

/* ---------- Coupon ---------- */
.bdp-coupon__ligne {
	display: flex;
	gap: var(--esp-3, 0.75rem);
}

.bdp-coupon__ligne .bdp-champ__input {
	flex: 1;
	min-width: 0;
}

.coupon-error-notice {
	margin: var(--esp-2, 0.5rem) 0 0;
	color: var(--c-erreur, #b00020);
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 600;
}

/* ---------- Cartes produits : compléments ---------- */
.bdp-card-produit__categorie {
	margin: 0;
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-xs, 0.75rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Prix alignés sur une même ligne dans toutes les grilles : le corps remplit la carte, le prix reste en bas. */
.bdp-card-produit__corps {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--esp-1, 0.25rem);
}

.bdp-card-produit__prix {
	margin-top: auto;
	padding-top: var(--esp-1, 0.25rem);
}

.bdp-card-produit__image .bdp-image-vide {
	position: absolute;
	inset: 0;
}

.bdp-card-produit__prix .bdp-prix__actuel {
	font-size: var(--fs-base, 1rem);
}

/* ---------- Produits liés ou suggérés ---------- */
.bdp-lies {
	padding-block: var(--esp-8, 4rem) 0;
}

.bdp-lies__titre {
	margin-bottom: var(--esp-6, 2rem);
	font-size: var(--fs-2xl, 2rem);
}

/* ---------- Détail de commande (confirmation et compte) ---------- */
.bdp-commande-detail__titre,
.bdp-adresses-commande__titre {
	margin-bottom: var(--esp-4, 1rem);
	font-size: var(--fs-xl, 1.5rem);
}

.bdp-commande-detail__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--esp-3, 0.75rem);
	margin-top: var(--esp-4, 1rem);
}

.bdp-adresses-commande {
	display: grid;
	gap: var(--esp-5, 1.5rem);
	margin-top: var(--esp-6, 2rem);
}

@media (min-width: 640px) {
	.bdp-adresses-commande {
		grid-template-columns: 1fr 1fr;
	}
}

.bdp-adresses-commande__colonne {
	padding: var(--esp-5, 1.5rem);
	border: var(--filet, 1px) solid var(--c-ligne, #ddd);
	border-radius: var(--r-l, 8px);
	background: var(--c-surface, #fff);
}

.bdp-adresses-commande__titre {
	font-size: var(--fs-lg, 1.25rem);
}

/* ---------- Filet de sécurité : boutons natifs WooCommerce non remplacés ---------- */
.bdp-notice .button,
.bdp-woo-page .button,
.bdp-woo-page button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.5em 1.4em;
	border: calc(var(--filet, 1px) * 1.5) solid var(--c-texte, #111);
	border-radius: var(--r-m, 4px);
	background: transparent;
	color: var(--c-texte, #111);
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.bdp-notice .button:hover,
.bdp-woo-page .button:hover {
	background: var(--c-texte, #111);
	color: var(--c-bg, #fff);
}

/* Lien « Voir le panier » ajouté par WooCommerce après un ajout rapide. */
.added_to_cart {
	display: block;
	margin-top: var(--esp-2, 0.5rem);
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 600;
	text-align: center;
}

.add_to_cart_button.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Contenu éditorial dans les accordéons. */
.bdp-accordeon__panneau.bdp-contenu > :first-child {
	margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
	.bdp-mode__label {
		transition: none;
	}
}
