/**
 * Dahu Theme Annad 2026 — page Commande en zone claire, comme le panier.
 *
 * Vaut pour les trois écrans servis par la page Commande (is_checkout()) : le formulaire de commande
 * (bloc WooCommerce « Commande » ou shortcode), la confirmation (endpoint order-received) et le
 * paiement d'une commande en attente (order-pay). page.php pose .annad-light-page sur le conteneur :
 * fond, tokens, champs, boutons et tableaux viennent du socle light-zone.css, comme pour le panier.
 * Ici, seulement ce que ce socle ne couvre pas : le fond de bord à bord, le titre, et les règles
 * sombres de templates.css (.annad-wc-page) qui visent la commande.
 * La carte du récapitulatif reste sombre, comme la carte des totaux du panier.
 */

.annad-checkout-page {
	padding-block: 2rem 4rem;
}

/* Fond clair d'un bord à l'autre : porté par le <body>, comme body.woocommerce-cart (cart.css).
   WooCommerce pose woocommerce-checkout sur le body des trois écrans. */
body.woocommerce-checkout {
	background-color: var(--color-light-bg);
}

.annad-checkout-page .annad-page-title {
	max-width: var(--container-max);
	margin: 0 auto 2.5rem;
	font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
	font-weight: 800;
	line-height: 1.15;
	text-align: left;
	color: var(--color-on-surface-light);
}

/* ---------- Bloc « Commande » ---------- */

/* Libellés : le socle clair met tout <label> en petites capitales grises, posées en bloc (pensé pour
   les formulaires classiques). Dans le bloc, cela détachait la case « Utiliser la même adresse » de
   son libellé et passait les modes de livraison et de paiement en capitales. Retour au texte normal ;
   les libellés flottants des champs gardent la taille et la position que leur donne WooCommerce. */
.annad-checkout-page .wc-block-checkout label {
	margin-bottom: 0;
	font-weight: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.annad-checkout-page .wc-block-checkout .wc-block-components-checkbox label {
	display: flex;
	align-items: flex-start;
	font-size: inherit;
	color: inherit;
}

.annad-checkout-page .wc-block-checkout .wc-block-components-radio-control__option {
	font-size: inherit;
	color: inherit;
}

/* Champs : fond blanc, filet et arrondi du socle clair. templates.css les met sur le fond sombre
   des champs du thème (le pays s'affichait en pastille noire), et la variante « contrôles sombres »
   du bloc les écrirait en blanc. */
.annad-checkout-page .wc-block-checkout :is(
	.wc-block-components-text-input input,
	.wc-block-components-combobox .wc-block-components-combobox-control input,
	.wc-blocks-components-select .wc-blocks-components-select__select,
	.wc-block-components-textarea
) {
	color: var(--color-on-surface-light);
	background-color: var(--light-field);
	border-color: var(--light-line);
	border-radius: var(--light-radius);
}

/* Pays / région : le socle clair donne à tout <select> l'espacement d'un champ classique, et la
   valeur passait sous le libellé flottant. Espacement de WooCommerce rétabli (place du libellé). */
.annad-checkout-page .wc-block-checkout .wc-blocks-components-select .wc-blocks-components-select__select {
	min-height: 0;
	padding: 16px 9px 0;
}

.annad-checkout-page .wc-block-checkout :is(
	.wc-block-components-text-input label,
	.wc-block-components-combobox label,
	.wc-blocks-components-select__label
) {
	color: var(--light-muted);
}

/* ---------- Commande classique (shortcode) et paiement en attente : cartes sombres ---------- */

/* Récapitulatif « Votre commande » et moyens de paiement : cartes sombres de templates.css, comme
   la carte des totaux du panier. Le tableau du socle clair (carte claire) y devenait illisible :
   il redevient transparent, au texte de la carte, avec les filets du thème sombre. */
.annad-checkout-page .woocommerce-checkout-review-order table.shop_table {
	color: inherit;
	background: none;
	border-radius: 0;
}

.annad-checkout-page .woocommerce-checkout-review-order table.shop_table th,
.annad-checkout-page .woocommerce-checkout-review-order table.shop_table td {
	border-bottom-color: var(--color-border);
}

.annad-checkout-page .woocommerce-checkout-review-order table.shop_table thead th {
	color: var(--color-text-muted);
}

/* Libellés des modes de livraison et de paiement : texte de la carte, pas les petites capitales
   grises (foncées) du socle clair, invisibles sur la carte sombre. */
.annad-checkout-page :is(.woocommerce-checkout-review-order, #payment) label {
	display: inline;
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
}

/* ---------- Commande classique : mise en page de la page Panier (4.50.0) ----------
   Gabarit woocommerce/checkout/form-checkout.php du thème : copie du gabarit de WooCommerce, mêmes
   hooks dans le même ordre, plus deux conteneurs (.annad-checkout__main, .annad-checkout__aside).
   Relevé sur le bloc Panier : colonne de gauche, récapitulatif à droite sur 35 % (426px à 1440),
   écart 3,5rem, non collant ; carte sombre (surface 2, rayon large, 1,5rem) ; intitulés en petites
   capitales de 13px ; filets entre les sections ; total en 20px ; bouton vert lime en pilule pleine
   largeur. Une colonne sous 64em, récapitulatif sous le formulaire, comme le panier.
   Les éléments ajoutés par les extensions (livraison dahu-post, paiements, devis YITH, avoirs) ne
   sont ni déplacés ni masqués : ils héritent des couleurs de la carte. */

.annad-checkout-page {
	--annad-checkout-aside: 35%;
	--annad-checkout-gap: 3.5rem;
	--annad-checkout-line: color-mix(in srgb, var(--color-on-surface) 20%, transparent);
	--annad-field-error: #a61b1b;
}

.annad-checkout-page form.annad-checkout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

@media (min-width: 64em) {
	.annad-checkout-page form.annad-checkout {
		grid-template-columns: minmax(0, 1fr) var(--annad-checkout-aside);
		gap: 2rem var(--annad-checkout-gap);
	}

	/* Rappel « Déjà client ? » et code promo (au-dessus du formulaire, woocommerce_before_checkout_form) :
	   largeur de la colonne de gauche, alignés sur les champs. */
	.annad-checkout-page :is(.woocommerce-form-login-toggle, form.woocommerce-form-login, .woocommerce-form-coupon-toggle, form.checkout_coupon) {
		max-width: calc(100% - var(--annad-checkout-aside) - var(--annad-checkout-gap));
	}
}

/* Tout ce que le script de WooCommerce ou une extension insère directement dans le formulaire
   (notices d'erreur de validation en tête) : sur toute la largeur, au-dessus des colonnes. */
.annad-checkout-page form.annad-checkout > :not(.annad-checkout__main):not(.annad-checkout__aside) {
	grid-column: 1 / -1;
}

/* Colonne de gauche : facturation, livraison et notes l'une sous l'autre (woocommerce.css les met
   côte à côte à 48 %). */
.annad-checkout-page .annad-checkout #customer_details.col2-set .col-1,
.annad-checkout-page .annad-checkout #customer_details.col2-set .col-2 {
	float: none;
	width: auto;
}

.annad-checkout-page .annad-checkout #customer_details .col-2 {
	margin-top: 1.5rem;
}

.annad-checkout-page .annad-checkout #customer_details::before,
.annad-checkout-page .annad-checkout #customer_details::after {
	content: none;
}

/* Titres des sections du formulaire : petites capitales et filet, comme l'en-tête « Produit / Total »
   de la liste du panier. */
.annad-checkout-page .annad-checkout__main :is(.woocommerce-billing-fields, .woocommerce-shipping-fields, .woocommerce-additional-fields, .woocommerce-account-fields) > h3,
.annad-checkout-page .annad-checkout__main #ship-to-different-address {
	margin: 0 0 1.25rem;
	padding-bottom: 0.75rem;
	font-family: var(--font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--color-on-surface-light);
	border-bottom: 1px solid var(--color-on-surface-light);
}

/* « Expédier à une adresse différente ? » : filet sur toute la largeur (woocommerce.css le réduit à
   celle du texte), case et libellé sur une ligne */
.annad-checkout-page .annad-checkout__main #ship-to-different-address {
	display: block;
	float: none;
	width: 100%;
}

.annad-checkout-page .annad-checkout__main #ship-to-different-address label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	color: inherit;
	cursor: pointer;
}

.annad-checkout-page .annad-checkout__main #ship-to-different-address input {
	margin: 0;
}

/* Champs refusés à la validation : filet et message de WooCommerce (sous le champ) bien visibles */
.annad-checkout-page .annad-checkout .woocommerce-invalid :is(input.input-text, select, textarea, .select2-container .select2-selection) {
	border-color: var(--annad-field-error);
}

.annad-checkout-page .annad-checkout .woocommerce-invalid > label,
.annad-checkout-page .annad-checkout .checkout-inline-error-message {
	color: var(--annad-field-error);
}

.annad-checkout-page .annad-checkout .checkout-inline-error-message {
	margin: 0.375rem 0 0;
	font-size: 0.875rem;
	line-height: 1.4;
}

/* ---------- Colonne de droite : carte sombre « Votre commande » ---------- */

.annad-checkout-page .annad-checkout__aside {
	padding: 1.5rem;
	color: var(--color-on-surface);
	background-color: var(--color-surface-2);
	border-radius: var(--radius-large);
}

/* La carte est la colonne entière : le récapitulatif n'en dessine plus une seconde (templates.css) */
.annad-checkout-page .annad-checkout__aside .woocommerce-checkout-review-order {
	padding: 0;
	background: none;
	border-radius: 0;
}

/* Titre : comme « Total panier » */
.annad-checkout-page .annad-checkout__aside #order_review_heading {
	margin: 0;
	padding-bottom: 0.75rem;
	font-family: var(--font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.4;
	text-transform: uppercase;
	color: inherit;
	border-bottom: 1px solid var(--annad-checkout-line);
}

/* Libellés et liens de la carte (livraison, paiement, CGV, contenus d'extensions) : texte de la carte,
   pas les petites capitales grises foncées du socle clair. */
.annad-checkout-page .annad-checkout__aside label {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
}

.annad-checkout-page .annad-checkout__aside a:not(.button):not(.annad-btn) {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Tableau du récapitulatif : lignes sans fond, filets entre les sections */
.annad-checkout-page .annad-checkout__aside table.shop_table {
	width: 100%;
	margin: 0;
	font-size: 0.875rem;
	border: 0;
	border-collapse: collapse;
}

.annad-checkout-page .annad-checkout__aside table.shop_table :is(th, td) {
	padding: 0.625rem 0;
	vertical-align: top;
	background: none;
	border: 0;
}

.annad-checkout-page .annad-checkout__aside table.shop_table thead th {
	padding-top: 1rem;
	font-size: 0.8125rem;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--color-text-muted);
}

.annad-checkout-page .annad-checkout__aside table.shop_table :is(td.product-total, tfoot td, thead th.product-total) {
	text-align: right;
}

.annad-checkout-page .annad-checkout__aside table.shop_table .product-name {
	font-weight: 500;
}

.annad-checkout-page .annad-checkout__aside table.shop_table tfoot tr:first-child > * {
	border-top: 1px solid var(--annad-checkout-line);
}

.annad-checkout-page .annad-checkout__aside table.shop_table tfoot th {
	font-weight: 400;
	text-align: left;
}

/* Modes de livraison : liste à gauche sous « Expédition » (dahu-post : Colissimo, Chronopost,
   points relais), sur toute la largeur de la carte. */
.annad-checkout-page .annad-checkout__aside table.shop_table tr.woocommerce-shipping-totals > td {
	text-align: left;
}

.annad-checkout-page .annad-checkout__aside #shipping_method {
	margin: 0;
	padding: 0;
	list-style: none;
}

.annad-checkout-page .annad-checkout__aside #shipping_method li {
	margin: 0 0 0.5rem;
}

/* Libellé en texte courant, prix en gras (le libellé entier était en gras) */
.annad-checkout-page .annad-checkout__aside #shipping_method li label {
	font-weight: 400;
}

.annad-checkout-page .annad-checkout__aside #shipping_method li .amount {
	font-weight: 600;
}

/* Total : gros, séparé du reste, comme « Total estimé » */
.annad-checkout-page .annad-checkout__aside table.shop_table tr.order-total > * {
	padding-top: 1rem;
	font-size: 1.25rem;
	font-weight: 500;
	border-top: 1px solid var(--annad-checkout-line);
}

.annad-checkout-page .annad-checkout__aside table.shop_table tr.order-total small {
	display: block;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--color-text-muted);
}

/* Paiement : section de la carte, plus une carte dans la carte (templates.css : surface 3) */
.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment {
	margin-top: 0.5rem;
	color: inherit;
	background: none;
	border-top: 1px solid var(--annad-checkout-line);
	border-radius: 0;
}

.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment ul.payment_methods {
	padding: 1rem 0;
	border-bottom: 1px solid var(--annad-checkout-line);
}

.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment ul.payment_methods li {
	line-height: 1.5;
}

.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment ul.payment_methods li img {
	max-height: 1.5rem;
	vertical-align: middle;
}

/* Logos des cartes de Stripe (cards.svg, dans le libellé « Carte de crédit/débit ») masqués
   (4.56.1). Sans .annad-checkout-page : la page Commande peut être sur un autre gabarit
   (pleine largeur sur le staging). */
.woocommerce-checkout #payment img.stripe-cards-icon.stripe-icon {
	display: none;
}

/* Description et champs d'un moyen de paiement (Stripe, SEPA, virement…, tout .payment_method_*) :
   gris clair standard du thème (« Surface claire » de la palette, 4.52.0 ; fond translucide avant),
   texte foncé. Les liens gardent la couleur du texte, soulignés. */
.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment div.payment_box {
	margin: 0.75rem 0 0.25rem;
	padding: 0.875rem 1rem;
	font-size: 0.875rem;
	color: var(--color-on-surface-light);
	background-color: var(--color-surface-light);
	border-radius: var(--light-radius, 0.625rem);
}

.woocommerce-checkout .annad-checkout-page #payment div.payment_box a {
	color: inherit;
	text-decoration: underline;
}

/* Hors de la carte du récapitulatif (paiement d'une commande en attente, order-pay) : même fond */
.woocommerce-checkout .annad-checkout-page #payment div.payment_box {
	color: var(--color-on-surface-light);
	background-color: var(--color-surface-light);
}

.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment div.payment_box::before {
	content: none;
}

/* Champs de paiement dans une colonne de 35 % : un <fieldset> (formulaire Stripe) garde par défaut
   la largeur de son contenu le plus long (min-width: min-content) et faisait déborder la page
   (+207px à 1440, constaté avec un message d'erreur de Stripe d'un seul tenant). Contenus d'extension
   et messages ramenés à la largeur de la carte. */
.annad-checkout-page .annad-checkout__aside :is(fieldset, .payment_box, .woocommerce-error, .woocommerce-message, .woocommerce-info) {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.woocommerce-checkout .annad-checkout-page .annad-checkout__aside #payment div.form-row {
	padding: 1rem 0 0;
}

/* Bouton « Commander » : comme « Valider mon panier » */
.annad-checkout-page .annad-checkout__aside #place_order {
	float: none;
	width: 100%;
	min-height: 3.1875rem;
	margin-top: 1rem;
	padding: 0.75rem 1.5rem;
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--color-on-surface-light);
	background-color: var(--color-brand-green);
	border: 0;
	border-radius: 999px;
}

.annad-checkout-page .annad-checkout__aside #place_order:hover {
	color: var(--color-on-surface-light);
	background-color: color-mix(in srgb, var(--color-brand-green) 88%, var(--color-on-surface-light));
}

/* « Demander un devis » (YITH Request a Quote, sur la page Commande) : action secondaire, en pilule
   claire à contour comme le bouton « Demander un devis » du panier, au lieu du bleu de l'extension.
   Même place, même comportement. */
.annad-checkout-page .annad-checkout__aside #ywraq_checkout_quote_button {
	width: 100%;
	min-height: 3.1875rem;
	padding: 0.75rem 1.5rem;
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--color-on-surface);
	background: none;
	border: 1px solid color-mix(in srgb, var(--color-on-surface) 55%, transparent);
	border-radius: 999px;
	box-shadow: none;
}

.annad-checkout-page .annad-checkout__aside #ywraq_checkout_quote_button:hover {
	color: var(--color-on-surface);
	background-color: color-mix(in srgb, var(--color-on-surface) 10%, transparent);
	border-color: var(--color-on-surface);
}

/* ---------- Confirmation de commande (order-received) et paiement en attente (order-pay) ---------- */

/* Tableau « Détails de la commande » : sur la carte claire du socle. templates.css y laissait ses
   en-têtes clairs (illisibles sur fond clair) et ses filets foncés. */
.annad-checkout-page table.shop_table thead th {
	color: var(--light-muted);
}

.annad-checkout-page table.shop_table th,
.annad-checkout-page table.shop_table td {
	border-bottom-color: var(--light-line);
}
