/*
 * Panier, commande, mon compte - direction Marche, thème autonome.
 * Consomme uniquement les tokens --od-* (assets/css/tokens.css, agent A) et les boutons
 * .od-btn / .od-btn--ghost déjà définis dans assets/css/base.css (agent A) : ils ne sont jamais
 * redéfinis ici, seulement appliqués. Mobile d'abord (Guyane, réseau instable) : règles de base
 * pensées pour petit écran, améliorations en @media (min-width: ...) pour tablette/desktop.
 */

/* ------------------------------------------------------------------------ */
/* Panier                                                                    */
/* ------------------------------------------------------------------------ */

.od-cart {
	max-width: 1180px;
	margin: 0 auto;
	padding: var(--od-gutter);
	display: flex;
	flex-direction: column;
	gap: clamp(24px, 5vw, 40px);
}

@media (min-width: 900px) {
	.od-cart {
		display: grid;
		grid-template-columns: 1.6fr 1fr;
		align-items: start;
	}
}

.od-cart__form {
	min-width: 0;
}

/* Table du panier : mobile d'abord, une carte par article. Les cellules portent déjà un
   attribut data-title (cart.php) qui sert de libellé via ::before. À partir de 860px, le
   tableau redevient un vrai tableau. */
.od-cart__table {
	width: 100%;
	border-collapse: collapse;
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
}

.od-cart__table thead {
	display: none;
}

.od-cart__table,
.od-cart__table tbody,
.od-cart__table tr,
.od-cart__table td {
	display: block;
	width: 100%;
}

.od-cart__table tr.od-cart__item {
	padding: 14px;
	border-bottom: 1px solid var(--od-border);
}

.od-cart__table tr.od-cart__actions-row {
	padding: 14px;
}

.od-cart__table tr.od-cart__item:last-of-type {
	border-bottom: none;
}

.od-cart__table td {
	border: none;
	padding: 4px 0;
}

.od-cart__table td.product-remove,
.od-cart__table td.product-thumbnail {
	display: inline-block;
	width: auto;
	vertical-align: middle;
	padding: 0;
}

.od-cart__table td.product-remove {
	float: right;
}

.od-cart__table td.product-thumbnail {
	margin-right: 10px;
}

.od-cart__table td.product-name,
.od-cart__table td.product-price,
.od-cart__table td.product-quantity,
.od-cart__table td.product-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	color: var(--od-ink);
	text-align: right;
}

.od-cart__table td.product-name {
	clear: both;
	padding-top: 10px;
	font-weight: 700;
	justify-content: flex-start;
}

.od-cart__table td[data-title]::before {
	content: attr(data-title);
	font-weight: 700;
	color: var(--od-muted);
	text-align: left;
}

.od-cart__table td.product-name::before {
	content: none;
}

.od-cart__table img {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: var(--od-radius-sm);
	background: var(--od-bg-2);
}

.od-cart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid var(--od-border);
	color: var(--od-ink);
	text-decoration: none;
	font-size: 1.1rem;
	line-height: 1;
}

.od-cart__remove:hover,
.od-cart__remove:focus-visible {
	background: var(--od-maison-tint);
	color: var(--od-ink-on-tint);
}

.od-cart__table .quantity .qty {
	width: 3.8em;
	min-height: 44px;
	border-radius: var(--od-radius-sm);
	border: var(--od-line) solid var(--od-border);
	background: var(--od-bg);
	color: var(--od-ink);
	text-align: center;
	font-size: 1rem;
}

.od-cart__table .quantity .qty:focus-visible {
	outline: 3px solid var(--od-accent);
	outline-offset: 2px;
}

.od-cart__table .actions {
	background: transparent;
}

.od-cart__coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.od-cart__coupon label {
	width: 100%;
	font-weight: 600;
	color: var(--od-muted);
}

.od-cart__coupon .input-text {
	flex: 1 1 200px;
	min-height: 44px;
	padding: 0 1em;
	border-radius: var(--od-radius-sm);
	border: var(--od-line) solid var(--od-border);
	background: var(--od-surface);
	color: var(--od-ink);
}

.od-cart__coupon .input-text:focus-visible {
	outline: 3px solid var(--od-accent);
	outline-offset: 2px;
}

/* Desktop (>= 860px) : retour à un tableau classique, les libellés data-title disparaissent. */
@media (min-width: 860px) {
	.od-cart__table thead {
		display: table-header-group;
	}

	.od-cart__table {
		display: table;
	}

	/* table-row-group, surtout pas table : un tbody en display table devient
	   un tableau independant qui ignore les largeurs de colonnes de l'en-tete
	   et se compacte en min-content (bug constate en previsualisation le
	   2026-08-13). */
	.od-cart__table tbody {
		display: table-row-group;
	}

	.od-cart__table tr {
		display: table-row;
	}

	.od-cart__table td,
	.od-cart__table th {
		display: table-cell;
		vertical-align: middle;
	}

	.od-cart__table th,
	.od-cart__table td {
		padding: 0.9em 0.7em;
		border-bottom: 1px solid var(--od-border);
		text-align: left;
	}

	.od-cart__table thead th {
		background: var(--od-bg-2);
		font-family: var(--font-display, inherit);
		font-weight: 700;
		font-size: 0.85rem;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	.od-cart__table tr.od-cart__item,
	.od-cart__table tr.od-cart__actions-row {
		padding: 0;
	}

	.od-cart__table td.product-remove,
	.od-cart__table td.product-thumbnail,
	.od-cart__table td.product-name,
	.od-cart__table td.product-price,
	.od-cart__table td.product-quantity,
	.od-cart__table td.product-subtotal {
		float: none;
		display: table-cell;
		margin: 0;
		text-align: left;
	}

	.od-cart__table td.product-price,
	.od-cart__table td.product-subtotal {
		justify-content: flex-start;
	}

	.od-cart__table td[data-title]::before {
		content: none;
	}

	.od-cart__table tr.od-cart__item:last-of-type {
		border-bottom: 1px solid var(--od-border);
	}

	/* Largeurs de colonnes explicites (table-layout fixed) : sans elles, le
	   texte long injecte par Local Pickup Plus dans la colonne produit pousse
	   le tableau en mode min-content, la colonne nom s'ecrase a ~100px et le
	   tableau deborde de sa piste de grille (bug constate en previsualisation
	   le 2026-08-13). Avec fixed, la colonne nom recoit tout l'espace restant
	   et le texte s'y replie proprement. */
	.od-cart__table {
		table-layout: fixed;
	}

	.od-cart__table th.product-remove {
		width: 44px;
	}

	.od-cart__table th.product-thumbnail {
		width: 76px;
	}

	.od-cart__table th.product-price {
		width: 92px;
	}

	.od-cart__table th.product-quantity {
		width: 110px;
	}

	.od-cart__table th.product-subtotal {
		width: 104px;
	}
}

/* Contre le coeur WooCommerce (.woocommerce table.shop_table img fige la
   vignette a 32px, plus fort en specificite que .od-cart__table img seul). */
.woocommerce .od-cart__table img,
.woocommerce-page .od-cart__table img {
	width: 56px;
	height: 56px;
}

/* Boutons d'action WooCommerce coeur (fond violet #7f54b3 par defaut, hors
   palette) ramenes a l'accent de la direction Marche. Meme specificite que
   les regles du coeur, feuille chargee apres : la notre gagne. */
.woocommerce .od-cart a.checkout-button,
.woocommerce .od-cart .wc-proceed-to-checkout a.checkout-button,
#place_order {
	background: var(--od-accent);
	color: var(--od-on-accent);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-pill);
	font-weight: 700;
	text-align: center;
}

.woocommerce .od-cart a.checkout-button:hover,
.woocommerce .od-cart a.checkout-button:focus-visible,
#place_order:hover,
#place_order:focus-visible {
	background: var(--od-ink);
	color: var(--od-bg);
}

/* Récapitulatif (cart-totals.php, hors périmètre TA-1-E) : restylé par classes stables
   WooCommerce. Le retrait en magasin (Local Pickup Plus) s'affiche dans ce bloc. */
.od-cart__collaterals {
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
	padding: clamp(16px, 3vw, 24px);
}

@media (min-width: 900px) {
	.od-cart__collaterals {
		position: sticky;
		top: 24px;
	}
}

.od-cart__collaterals .cart_totals h2 {
	font-family: var(--font-display, inherit);
	font-weight: 800;
	font-size: 1.3rem;
	color: var(--od-ink);
	margin-top: 0;
}

.od-cart__collaterals table.shop_table {
	width: 100%;
	border-collapse: collapse;
}

.od-cart__collaterals table.shop_table th,
.od-cart__collaterals table.shop_table td {
	padding: 0.6em 0;
	border-bottom: 1px solid var(--od-border);
	color: var(--od-ink);
	text-align: left;
}

.od-cart__collaterals table.shop_table tr:last-child th,
.od-cart__collaterals table.shop_table tr:last-child td {
	border-bottom: none;
	font-weight: 800;
	font-size: 1.1rem;
}

.od-cart__collaterals .wc-proceed-to-checkout {
	margin-top: 16px;
}

.od-cart__collaterals .wc-proceed-to-checkout .checkout-button {
	display: block;
	width: 100%;
	min-height: 52px;
	line-height: 52px;
	text-align: center;
	border-radius: var(--od-radius-pill);
	border: var(--od-line) solid var(--od-border);
	background: var(--od-accent);
	color: var(--od-on-accent);
	font-family: var(--font-display, inherit);
	font-weight: 800;
	text-decoration: none;
}

.od-cart__collaterals .wc-proceed-to-checkout .checkout-button:hover,
.od-cart__collaterals .wc-proceed-to-checkout .checkout-button:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: var(--od-shadow-sm) var(--od-shadow-sm) 0 0 var(--od-ink);
}

.od-cart__collaterals .wc-proceed-to-checkout .checkout-button:focus-visible {
	outline: 2px solid var(--od-ink);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------------ */
/* Commande                                                                  */
/* ------------------------------------------------------------------------ */

.od-checkout {
	max-width: 1180px;
	margin: 0 auto;
	padding: var(--od-gutter);
}

.od-checkout__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(24px, 5vw, 40px);
}

@media (min-width: 900px) {
	.od-checkout__grid {
		grid-template-columns: 1.5fr 1fr;
		align-items: start;
	}
}

.od-checkout__customer {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(20px, 4vw, 32px);
}

@media (min-width: 640px) {
	.od-checkout__customer.col2-set {
		grid-template-columns: 1fr 1fr;
	}
}

.od-checkout__details h3 {
	font-family: var(--font-display, inherit);
	font-weight: 800;
	font-size: 1.3rem;
	color: var(--od-ink);
}

.od-checkout__details .form-row {
	margin: 0 0 14px;
}

.od-checkout__details label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--od-muted);
}

.od-checkout__details .input-text,
.od-checkout__details select,
.od-checkout__details textarea {
	width: 100%;
	min-height: 48px;
	padding: 0 1em;
	border-radius: var(--od-radius-sm);
	border: var(--od-line) solid var(--od-border);
	background: var(--od-surface);
	color: var(--od-ink);
	font-size: 16px;
	box-sizing: border-box;
}

.od-checkout__details textarea {
	min-height: 96px;
	padding: 0.8em 1em;
}

.od-checkout__details .input-text:focus-visible,
.od-checkout__details select:focus-visible,
.od-checkout__details textarea:focus-visible {
	outline: 3px solid var(--od-accent);
	outline-offset: 2px;
}

.od-checkout__details .select2-container .select2-selection--single {
	min-height: 48px;
	border-radius: var(--od-radius-sm);
	border: var(--od-line) solid var(--od-border);
}

#order_review_heading {
	font-family: var(--font-display, inherit);
	font-weight: 800;
	font-size: 1.3rem;
	color: var(--od-ink);
	margin-top: 0;
}

/* Récapitulatif de commande : sticky en desktop uniquement (WORKFLOW-COMMANDE.md). En mobile
   il reste dans le flux normal, sous les coordonnées. */
.od-checkout__review {
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
	padding: clamp(18px, 3vw, 28px);
}

@media (min-width: 900px) {
	.od-checkout__review {
		position: sticky;
		top: 24px;
	}
}

#order_review table.shop_table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}

#order_review table.shop_table th,
#order_review table.shop_table td {
	padding: 0.6em 0;
	border-bottom: 1px solid var(--od-border);
	color: var(--od-ink);
	text-align: left;
}

#order_review table.shop_table tr.order-total th,
#order_review table.shop_table tr.order-total td {
	border-bottom: none;
	font-weight: 800;
	font-size: 1.15rem;
}

/* Zone de paiement (Stripe, paiement express, conditions générales) : espacement uniquement,
   aucun élément masqué ni de z-index modifié, pour ne jamais recouvrir un bouton de paiement. */
#order_review #payment {
	margin-top: 16px;
	border-radius: var(--od-radius-md);
	border: var(--od-line) solid var(--od-border);
	overflow: hidden;
}

#order_review #payment .payment_methods {
	padding: 12px;
	margin: 0;
	list-style: none;
}

#order_review #payment div.form-row {
	padding: 0 12px 12px;
}

#order_review #place_order {
	margin-top: 4px;
	width: 100%;
}

.woocommerce-terms-and-conditions-wrapper {
	margin: 12px 0;
	font-size: 0.9rem;
	color: var(--od-muted);
}

.woocommerce-terms-and-conditions-wrapper a {
	color: var(--od-ink);
}

/* Formulaire de coupon replié (natif WooCommerce, comportement par défaut déjà en place) :
   restyle du lien de bascule et du bloc uniquement. */
.od-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
	background: var(--od-bg-2);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-md);
	padding: 0.8em 1em;
	color: var(--od-ink);
}

.od-checkout .woocommerce-form-coupon-toggle a {
	color: var(--od-ink);
	font-weight: 700;
	text-decoration: underline;
}

.od-checkout .checkout_coupon.woocommerce-form-coupon {
	margin: 0 0 16px;
	padding: clamp(16px, 3vw, 24px);
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
}

.od-checkout .checkout_coupon.woocommerce-form-coupon .form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.od-checkout .checkout_coupon.woocommerce-form-coupon .input-text {
	flex: 1 1 200px;
}

/* Message pour un client non connecté (woocommerce_checkout_login_form) : natif WooCommerce,
   restylé en carte simple. */
.od-checkout .woocommerce-form-login-toggle .woocommerce-info,
.od-checkout .woocommerce-form-login {
	background: var(--od-bg-2);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-md);
	padding: clamp(16px, 3vw, 24px);
	color: var(--od-ink);
	margin-bottom: 16px;
}

.od-checkout .woocommerce-form-login .form-row label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--od-muted);
}

.od-checkout .woocommerce-form-login .input-text {
	width: 100%;
	min-height: 44px;
	padding: 0 1em;
	border-radius: var(--od-radius-sm);
	border: var(--od-line) solid var(--od-border);
	background: var(--od-surface);
	color: var(--od-ink);
	box-sizing: border-box;
}

/* ------------------------------------------------------------------------ */
/* Mon compte : connexion, inscription, navigation, tableau de bord         */
/* ------------------------------------------------------------------------ */

/* ---------- Page de connexion / inscription ---------- */

.od-account-page {
	max-width: 960px;
	margin: 0 auto;
	padding: clamp(24px, 5vw, 56px) var(--od-gutter);
}

.od-account-hero {
	text-align: center;
	margin-bottom: clamp(24px, 4vw, 40px);
}

.od-account-logo img {
	max-height: 64px;
	width: auto;
	margin: 0 auto 12px;
}

.od-account-brand {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: clamp(22px, 4vw, 30px);
	color: var(--od-ink);
	margin: 0 0 8px;
}

.od-account-tagline {
	color: var(--od-muted);
	font-size: 15px;
	margin: 0;
}

.od-account-columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

.od-account-columns.u-columns.col2-set {
	grid-template-columns: 1fr;
}

@media (min-width: 720px) {
	.od-account-columns.u-columns.col2-set {
		grid-template-columns: 1fr 1fr;
	}
}

.od-account-card {
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
	padding: clamp(20px, 4vw, 32px);
}

.od-account-card__title {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: 20px;
	color: var(--od-ink);
	margin: 0 0 20px;
}

.od-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.od-form-row {
	margin: 0;
}

.od-form-row label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: var(--od-ink);
	margin-bottom: 6px;
}

.od-form-row .required {
	color: var(--od-maison);
}

.od-input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	background: var(--od-bg);
	color: var(--od-ink);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-sm);
	font-size: 16px;
	line-height: 1.4;
}

.od-input:focus-visible {
	outline: 3px solid var(--od-accent);
	outline-offset: 2px;
}

.od-form-row--actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.od-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--od-ink);
	font-weight: 400;
	cursor: pointer;
}

.od-checkbox-label input[type='checkbox'] {
	width: 18px;
	height: 18px;
	accent-color: var(--od-accent);
}

.od-lost-password {
	margin: 0;
	font-size: 14px;
}

.od-lost-password a {
	color: var(--od-muted);
	text-decoration: underline;
}

.od-lost-password a:hover,
.od-lost-password a:focus-visible {
	color: var(--od-ink);
}

.od-form-note {
	font-size: 14px;
	color: var(--od-muted);
	margin: 0;
}

/* ---------- Layout general Mon compte (nav + contenu) ---------- */

.woocommerce-account .woocommerce {
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(24px, 5vw, 56px) var(--od-gutter);
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

@media (min-width: 860px) {
	.woocommerce-account .woocommerce {
		grid-template-columns: 260px 1fr;
	}
}

/* Le conteneur de notices WooCommerce (souvent vide) est le premier enfant de
   la grille : sans cette regle il occupe la piste de 260px destinee a la
   navigation, et nav + contenu s'entassent dans la seconde piste (bug
   constate en previsualisation le 2026-08-13). */
.woocommerce-account .woocommerce .woocommerce-notices-wrapper {
	grid-column: 1 / -1;
}

/* Contre le coeur WooCommerce : float + largeurs en pourcentage sur la
   navigation (30%) et le contenu (68%) du compte, qui se resolvent contre la
   piste de grille et ecrasent les deux colonnes. */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: auto;
}

/* La page compte a besoin de plus de largeur que les pages de contenu
   simples (navigation 260px + tableau de bord cote a cote). */
.od-page--account .od-page__inner {
	max-width: 1160px;
}

.woocommerce-MyAccount-content {
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
	padding: clamp(20px, 4vw, 32px);
}

/* ---------- Navigation laterale ---------- */

.od-account-nav {
	background: var(--od-surface);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-lg);
	padding: 12px;
}

.od-account-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.od-account-nav__link {
	display: block;
	padding: 12px 16px;
	border-radius: var(--od-radius-sm);
	color: var(--od-ink);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
}

.od-account-nav__link:hover,
.od-account-nav__link:focus-visible {
	background: var(--od-bg-2);
}

.od-account-nav__link:focus-visible {
	outline: 3px solid var(--od-accent);
	outline-offset: -3px;
}

.od-account-nav__item.is-active .od-account-nav__link {
	background: var(--od-accent);
	color: var(--od-on-accent);
}

/* ---------- Tableau de bord ---------- */

.od-dashboard__welcome {
	margin-bottom: 24px;
}

.od-dashboard__greeting {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: clamp(20px, 3vw, 26px);
	color: var(--od-ink);
	margin: 0 0 6px;
}

.od-dashboard__logout {
	font-size: 14px;
	color: var(--od-muted);
	margin: 0;
}

.od-dashboard__logout a {
	color: var(--od-muted);
	text-decoration: underline;
}

.od-dashboard__logout a:hover,
.od-dashboard__logout a:focus-visible {
	color: var(--od-ink);
}

.od-dashboard__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

@media (min-width: 640px) {
	.od-dashboard__grid {
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	}
}

.od-dashboard__card {
	background: var(--od-bg-2);
	border: var(--od-line) solid var(--od-border);
	border-radius: var(--od-radius-md);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.od-dashboard__card-title {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: 17px;
	color: var(--od-ink);
	margin: 0;
}

.od-dashboard__stat {
	font-size: 15px;
	color: var(--od-ink);
	margin: 0;
	font-weight: 600;
}

.od-dashboard__stat--empty {
	color: var(--od-muted);
	font-weight: 400;
}

.od-dashboard__last-order {
	font-size: 14px;
	color: var(--od-muted);
	margin: 0;
}

.od-dashboard__card-text {
	font-size: 14px;
	color: var(--od-muted);
	margin: 0;
}

.od-dashboard__card-action {
	margin: 4px 0 0;
}

/* ------------------------------------------------------------------------ */
/* Mouvement réduit                                                          */
/* ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.od-cart__remove,
	.od-cart__collaterals .wc-proceed-to-checkout .checkout-button,
	.od-account-nav__link,
	.od-input,
	.od-lost-password a,
	.od-dashboard__logout a {
		transition: none !important;
	}
}
