/* ══════════════════════════════════════════════════════════
   DÉTAIL D'UNE COMMANDE — cartes de woocommerce/order/rmp-order-layout.php
   Partagé par Mon compte > Commande (myaccount/view-order.php) et la page
   de confirmation de commande (checkout/thankyou.php). Chargé sur ces deux
   pages seulement (functions.php). Déplacé tel quel depuis account.css.
══════════════════════════════════════════════════════════ */


.rmp-order-detail {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* En-tête — tout sur une ligne : titre + date à gauche, badge de
   statut à l'extrême droite. */
.rmp-order-detail__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}

.rmp-order-detail__header-main {
	display: flex;
	align-items: baseline;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.rmp-order-detail__number {
	margin: 0;
	color: var(--rmp-text);
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

.rmp-order-detail__meta-item {
	position: relative;
	top: 0.0625rem;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-meta);
	line-height: 1;
}

.rmp-order-detail__meta-item svg {
	flex-shrink: 0;
	opacity: 0.8;
}

.rmp-order-detail__header mark.order-status {
	display: inline-flex !important;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.25rem;
	padding: 0.35rem 0.75rem 0.35rem 0.6rem !important;
	font-size: var(--rmp-fs-badge) !important;
	flex-shrink: 0;
}

.rmp-order-status-dot {
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

/* Layout 2 colonnes : produits + mode de paiement (large) | résumé +
   adresses (étroit). Deux colonnes flex simples, pas de placement
   grid-row manuel — la carte "Mode de paiement" est un enfant normal
   de .rmp-order-detail__main, juste après les produits. */
.rmp-order-detail__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 20rem;
	gap: 1.5rem;
	align-items: start;
	margin-bottom: 1.5rem;
}

.rmp-order-detail__main {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

/* ── Produits : une seule card blanche, en-tête de colonnes visible ── */
.rmp-order-detail__products {
	background: #fff;
	border: 1px solid #ececef;
	border-radius: 1rem;
	overflow: hidden;
}

.rmp-order-products-head {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 0.875rem 1.25rem;
	border-bottom: 1px solid #ececef;
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-badge);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.rmp-order-products-head__name { flex: 1; min-width: 0; }
.rmp-order-products-head__qty { flex-shrink: 0; width: 2rem; text-align: center; }
.rmp-order-products-head__price { flex-shrink: 0; width: 5rem; text-align: right; }

.rmp-order-detail__items {
	display: flex;
	flex-direction: column;
}

.rmp-order-item {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #f2f2f5;
}

.rmp-order-item:last-child {
	border-bottom: none;
}

.rmp-order-item__thumb {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
}

.rmp-order-item__img {
	display: block;
	width: 72px !important;
	height: 72px !important;
	object-fit: contain;
	object-position: center;
	border-radius: 0.75rem;
	background: var(--rmp-bg-gray);
	padding: 0;
	box-sizing: border-box;
}

.rmp-order-item__img--placeholder {
	width: 72px;
	height: 72px;
	border-radius: 0.75rem;
	background: #ececef;
}

.rmp-order-item__body {
	flex: 1;
	min-width: 0;
}

.rmp-order-item__name {
	color: var(--rmp-text);
	font-size: var(--rmp-fs-meta);
	font-weight: 500;
	line-height: 1.4;
}

.rmp-order-item__name a {
	color: var(--rmp-text);
	text-decoration: none;
}

.rmp-order-item__name a:hover {
	color: var(--rmp-brand);
}

.rmp-order-item__meta {
	list-style: none;
	margin: 0.2rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 0.5rem;
}

.rmp-order-item__meta li {
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-meta);
}

.rmp-order-item__review-link {
	display: inline-block;
	margin-top: 0.3rem;
	color: var(--rmp-brand);
	font-size: var(--rmp-fs-meta);
	text-decoration: none;
}

.rmp-order-item__review-link:hover {
	text-decoration: underline;
}

.rmp-order-item__qty {
	flex-shrink: 0;
	width: 2rem;
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-meta);
	text-align: center;
}

.rmp-order-item__price {
	flex-shrink: 0;
	width: 5rem;
	color: var(--rmp-text);
	font-size: var(--rmp-fs-meta);
	font-weight: 500;
	text-align: right;
}

/* Transparent au flex de .rmp-order-item en desktop — qty/price restent
   des enfants flex directs. Sous 640px, redevient un vrai flex container
   (voir bloc mobile plus bas) pour garder qty+price groupés sur leur
   propre ligne au lieu de se réordonner indépendamment. */
.rmp-order-item__qty-price {
	display: contents;
}

/* ── Colonne latérale : résumé + adresses, cards avec en-tête gris ── */
.rmp-order-detail__side {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.rmp-order-detail__card {
	background: #fff;
	border: 1px solid #ececef;
	border-radius: 1rem;
	overflow: hidden;
}

.rmp-order-detail__card-head {
	padding: 0.875rem 1.125rem 0;
	color: var(--rmp-text);
	font-size: var(--rmp-fs-body);
	font-weight: 600;
}

/* Seul le récapitulatif garde un fond gris — les autres cards
   (adresses, mode de paiement, notes) ont un header blanc, sans
   bordure, avec moins d'espace avant le contenu. */
.rmp-order-detail__card--summary .rmp-order-detail__card-head {
	padding: 0.75rem 1.125rem;
	background: var(--rmp-bg-gray);
}

.rmp-order-detail__card-body {
	padding: 0.375rem 1.125rem 1rem;
}

.rmp-order-detail__card-body address,
.rmp-order-detail__card-body p {
	margin: 0;
	color: #3a3a3c;
	font-size: var(--rmp-fs-meta);
	line-height: 1.7;
	font-style: normal;
}

.rmp-order-address-block__phone,
.rmp-order-address-block__email {
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-meta);
}

.rmp-order-detail__totals {
	display: flex;
	flex-direction: column;
	padding: 0.25rem 1.125rem;
}

.rmp-order-total-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.625rem 0;
}

.rmp-order-total-row__label {
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-meta);
}

.rmp-order-total-row__value {
	color: var(--rmp-text);
	font-size: var(--rmp-fs-meta);
}

.rmp-order-total-row--grand {
	border-top: 1px solid #e5e5e7;
	margin-top: 0.25rem;
	padding-top: 0.875rem;
	padding-bottom: 0.875rem;
}

.rmp-order-total-row--grand .rmp-order-total-row__label {
	color: var(--rmp-text);
	font-weight: 600;
	font-size: var(--rmp-fs-meta);
}

.rmp-order-total-row--grand .rmp-order-total-row__value {
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

/* « Voir la commande » (page de confirmation) : bouton fond blanc sous
   l'adresse de facturation — le seul bouton bleu de la page est celui de la
   cagnotte The Club. */
.rmp-order-detail__view {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.6rem 1.25rem;
	border: 1px solid var(--rmp-border);
	border-radius: var(--rmp-radius);
	background: #fff;
	color: var(--rmp-text);
	font-size: var(--rmp-fs-body);
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s ease;
}

.rmp-order-detail__view:hover {
	background: var(--rmp-bg-gray);
	color: var(--rmp-text);
}

.rmp-order-detail__view:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rmp-brand) 25%, transparent);
}

/* Notes */
.rmp-order-notes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.rmp-order-note {
	background: var(--rmp-bg-gray);
	border-radius: 0.75rem;
	padding: 0.875rem 1rem;
}

.rmp-order-note p {
	margin: 0 0 0.25rem;
	color: #3a3a3c;
	font-size: var(--rmp-fs-meta);
	line-height: 1.6;
}

.rmp-order-note time {
	color: var(--rmp-text-soft);
	font-size: var(--rmp-fs-meta);
}

/* Actions (Payer, Annuler) — pas de bordure/wrapper visible, juste
   un espacement au-dessus. Vide si la commande n'a ni paiement ni
   annulation possible (ex. terminée/livrée). */
.rmp-order-detail__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: 1.5rem;
}

.rmp-order-detail__actions:empty {
	display: none;
}

/* Colonne unique — produits + mode de paiement puis résumé/adresses
   s'empilent dans l'ordre du DOM. */
@media (max-width: 960px) {
	.rmp-order-detail__layout {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 640px) {
	/* Détail commande : le prix passe sous le nom du produit plutôt
	   que de tasser thumb/nom/qté/prix sur une seule ligne étroite.
	   L'en-tête de colonnes n'a plus de sens une fois empilé. */
	.rmp-order-products-head {
		display: none;
	}

	/* thumb + body restent côte à côte sur leur ligne (comme sur desktop) —
	   qty + price (groupés dans .rmp-order-item__qty-price, display:contents
	   en desktop) passent ensemble sur une 2e ligne pleine largeur en
	   dessous, décalée sous le texte (retrait = largeur thumb + gap).
	   Avant ce correctif, body avait flex-basis:100% avec le même order
	   que thumb : ça forçait un retour à la ligne entre les deux malgré
	   tout (flex-basis:100% s'impose peu importe l'order), donc l'image
	   se retrouvait seule sur sa ligne au-dessus du texte — gâchis de
	   hauteur, surtout visible avec plusieurs articles dans la commande. */
	.rmp-order-item {
		flex-wrap: wrap;
	}

	.rmp-order-item__body {
		order: 0;
		flex: 1;
		min-width: 0;
	}

	.rmp-order-item__qty-price {
		order: 1;
		flex-basis: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 0.5rem;
		padding-left: calc(72px + 1.25rem);
	}

	.rmp-order-item__qty,
	.rmp-order-item__price {
		width: auto;
	}
}

/* ══════════════════════════════════════════════════════════
   PAGE DE CONFIRMATION DE COMMANDE — woocommerce/checkout/thankyou.php
   En-tête « Merci … » + cartes ci-dessus + liens de sortie. Colonne
   centrée plus étroite que le site : une seule chose à lire ici.
══════════════════════════════════════════════════════════ */

.rmp-thankyou {
	max-width: 62rem;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2.5rem, 5vw, 4rem);
	font-family: var(--rmp-font);
}

.rmp-ty-hero {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 2rem;
}

.rmp-ty-hero__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.5rem;
	height: 2.5rem;
	margin-top: 0.1rem;
	border-radius: 50%;
	background: #1f9d55;
	color: #fff;
}

.rmp-ty-hero.is-failed .rmp-ty-hero__icon {
	background: #d93025;
}

.rmp-ty-hero__icon svg {
	width: 1.3rem;
	height: 1.3rem;
}

.rmp-ty-hero__text {
	min-width: 0;
}

.rmp-thankyou .rmp-ty-hero__title {
	margin: 0;
	color: var(--rmp-text);
	font-size: clamp(1.4rem, 3vw, 1.85rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.rmp-thankyou .rmp-ty-hero__lead {
	margin: 0.75rem 0 0;
	max-width: 44rem;
	color: #3a3a3c;
	font-size: var(--rmp-fs-body);
	line-height: 1.6;
}

.rmp-thankyou .rmp-ty-hero__lead + .rmp-ty-hero__lead {
	margin-top: 0.4rem;
}

.rmp-ty-hero__email {
	color: var(--rmp-text);
	font-weight: 500;
	overflow-wrap: anywhere;
}

.rmp-ty-hero__actions {
	margin-top: 1.25rem;
}

/* Cagnotte The Club — sous le merci : étoile dorée pleine du site, texte,
   et le seul bouton bleu de la page. Même cadre que les cartes de commande. */
.rmp-ty-club {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding: 1.25rem 1.5rem;
	background: #fff;
	border: 1px solid #ececef;
	border-radius: 1rem;
}

.rmp-ty-club__star {
	flex-shrink: 0;
	width: 2.25rem;
	height: 2.25rem;
	fill: #f5b301;
}

.rmp-ty-club__body {
	flex: 1;
	min-width: 0;
}

.rmp-thankyou .rmp-ty-club__title {
	color: var(--rmp-text);
	font-size: var(--rmp-fs-lg);
	font-weight: 600;
	line-height: 1.3;
}

.rmp-thankyou .rmp-ty-club__line {
	margin: 0.15rem 0 0;
	color: var(--rmp-text);
	font-size: var(--rmp-fs-body);
	line-height: 1.5;
}

.rmp-thankyou .rmp-ty-club__line strong {
	font-weight: 600;
}

.rmp-thankyou .rmp-ty-club__line--soft {
	color: var(--rmp-text-soft);
}

.rmp-thankyou .rmp-ty-club__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	min-height: 2.75rem;
	padding: 0.6rem 1.5rem;
	border: 1px solid var(--rmp-brand);
	border-radius: var(--rmp-radius);
	background: var(--rmp-brand);
	color: #fff;
	font-size: var(--rmp-fs-body);
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease;
}

.rmp-thankyou .rmp-ty-club__btn:hover {
	background: var(--rmp-brand-hover);
	border-color: var(--rmp-brand-hover);
	color: #fff;
}

.rmp-thankyou .rmp-ty-club__btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rmp-brand) 25%, transparent);
}

@media (max-width: 640px) {
	.rmp-ty-club {
		flex-wrap: wrap;
		align-items: flex-start;
		padding: 1.125rem 1rem;
	}

	.rmp-ty-club__star {
		width: 1.75rem;
		height: 1.75rem;
	}

	.rmp-thankyou .rmp-ty-club__btn {
		width: 100%;
	}
}

/* Sortie d'un moyen de paiement (ex. coordonnées bancaires d'un virement) :
   une carte comme les autres, au-dessus du détail. */
.rmp-ty-gateway {
	margin-bottom: 1.5rem;
	padding: 1rem 1.25rem;
	background: #fff;
	border: 1px solid #ececef;
	border-radius: 1rem;
	font-size: var(--rmp-fs-body);
}

.rmp-ty-gateway > :first-child { margin-top: 0; }
.rmp-ty-gateway > :last-child { margin-bottom: 0; }

.rmp-ty-order .rmp-order-detail__layout {
	margin-bottom: 0;
}

.rmp-ty-after {
	margin-top: 1.5rem;
}


.rmp-thankyou .rmp-ty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.6rem 1.25rem;
	border: 1px solid var(--rmp-border);
	border-radius: var(--rmp-radius);
	background: #fff;
	color: var(--rmp-text);
	font-size: var(--rmp-fs-body);
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}

.rmp-thankyou .rmp-ty-btn:hover {
	background: var(--rmp-bg-gray);
}

.rmp-thankyou .rmp-ty-btn--primary {
	background: var(--rmp-brand);
	border-color: var(--rmp-brand);
	color: #fff;
}

.rmp-thankyou .rmp-ty-btn--primary:hover {
	background: var(--rmp-brand-hover);
	border-color: var(--rmp-brand-hover);
	color: #fff;
}

.rmp-thankyou .rmp-ty-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rmp-brand) 25%, transparent);
}

@media (max-width: 640px) {
	.rmp-ty-hero {
		gap: 0.75rem;
		margin-bottom: 1.5rem;
	}

	.rmp-ty-hero__icon {
		width: 2rem;
		height: 2rem;
	}

	.rmp-ty-hero__icon svg {
		width: 1.05rem;
		height: 1.05rem;
	}
}

/* Lien rouvert plus tard sans être connecté : WooCommerce demande l'e-mail
   de la commande (checkout/form-verify-email.php). Même carte centrée que
   la page de connexion de Mon compte. */
body.woocommerce-order-received .woocommerce:has(> .woocommerce-verify-email) {
	max-width: 26rem;
	margin: clamp(2rem, 6vw, 4rem) auto;
	padding: clamp(1.5rem, 3vw, 2.25rem);
	background: #fff;
	border: 1px solid #e5e5e7;
	border-radius: 1.25rem;
	font-family: var(--rmp-font);
}

body.woocommerce-order-received .woocommerce > .woocommerce-thankyou-order-received {
	margin: 0 0 0.5rem;
	padding: 0;
	background: none;
	border: 0;
	color: var(--rmp-text);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
}

body.woocommerce-order-received .woocommerce-verify-email p {
	margin: 0 0 1rem;
	color: #3a3a3c;
	font-size: var(--rmp-fs-body);
	line-height: 1.55;
}

body.woocommerce-order-received .woocommerce-verify-email a {
	color: var(--rmp-brand);
}

body.woocommerce-order-received .woocommerce-verify-email .form-row:last-child {
	margin-bottom: 0;
}

body.woocommerce-order-received .woocommerce-verify-email .input-text,
body.woocommerce-order-received .woocommerce-verify-email .button {
	width: 100%;
}
