/**
 * LA LIVRAISON, DITE AU CLIENT (2026-11-05).
 *
 * Le bandeau de la carte, la fenetre « Zones et tarifs » et l'encadre du
 * panier et de la caisse. Les couleurs viennent de jetons.css ; aucune n'est
 * ecrite ici. Seuls `transform` et `opacity` sont animes.
 *
 * @package Restaurant_Manager
 */

/* ---------- Le bandeau de la carte ---------- */
.rm-liv-bandeau {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 28px 0 0;
	padding: 14px 16px;
	border: 1px solid color-mix( in srgb, var( --rm-terracotta ) 22%, transparent );
	border-radius: 16px;
	background:
		linear-gradient( 120deg, color-mix( in srgb, var( --rm-terracotta ) 9%, transparent ), transparent 70% ),
		var( --rm-creme-chaud );
	color: var( --rm-brun );
}

.rm-liv-bandeau + .rm-carte-nav {
	margin-top: 12px;
}

.rm-liv-bandeau__icone,
.rm-liv-etat__icone {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 9999px;
	background-color: var( --rm-terracotta );
	color: var( --rm-creme );
}

.rm-liv-bandeau__texte {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rm-liv-bandeau__titre {
	font-family: var( --rm-fa-titre, inherit );
	font-size: 1.08rem;
	font-weight: 500;
	line-height: 1.25;
}

.rm-liv-bandeau__ligne {
	color: var( --rm-texte-doux );
	font-size: 0.92rem;
	font-variant-numeric: tabular-nums;
}

.rm-liv-bandeau__bouton,
.rm-liv-etat__zones {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var( --rm-terracotta );
	border-radius: 9999px;
	background-color: transparent;
	color: var( --rm-terracotta-sombre );
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	transition: background-color var( --rm-duree-reponse ) var( --rm-courbe ), color var( --rm-duree-reponse ) var( --rm-courbe ), transform var( --rm-duree-reponse ) var( --rm-courbe );
}

.rm-liv-bandeau__bouton:hover,
.rm-liv-etat__zones:hover {
	background-color: var( --rm-terracotta );
	color: var( --rm-creme );
}

.rm-liv-bandeau__bouton:active,
.rm-liv-etat__zones:active {
	transform: scale( 0.97 );
}

.rm-liv-bandeau__bouton:focus-visible,
.rm-liv-etat__zones:focus-visible,
.rm-liv-fenetre__fermer:focus-visible,
.rm-liv-fenetre__recherche:focus-visible,
.rm-liv-etat__liste:focus-visible {
	outline: var( --rm-focus-epaisseur ) solid var( --rm-brun );
	outline-offset: 2px;
}

@media ( max-width: 600px ) {

	.rm-liv-bandeau {
		flex-wrap: wrap;
	}

	.rm-liv-bandeau__texte {
		flex-basis: calc( 100% - 60px );
	}

	.rm-liv-bandeau__bouton {
		width: 100%;
	}
}

/* ---------- La fenetre « Zones et tarifs » ---------- */
.rm-liv-fenetre {
	width: min( 560px, calc( 100vw - 32px ) );
	max-height: min( 720px, calc( 100vh - 48px ) );
	padding: 0;
	overflow: auto;
	border: 0;
	border-radius: 20px;
	background-color: var( --rm-creme );
	color: var( --rm-brun );
	box-shadow: 0 30px 60px -20px color-mix( in srgb, var( --rm-brun-nuit ) 60%, transparent );
}

.rm-liv-fenetre[ open ] {
	animation: rm-liv-entree 0.22s var( --rm-courbe );
}

.rm-liv-fenetre::backdrop {
	background-color: color-mix( in srgb, var( --rm-brun-nuit ) 55%, transparent );
}

@keyframes rm-liv-entree {

	from {
		opacity: 0;
		transform: translateY( 12px ) scale( 0.98 );
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.rm-liv-fenetre__tete {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 10px;
	background-color: var( --rm-creme );
}

.rm-liv-fenetre__titre {
	margin: 0;
	font-family: var( --rm-fa-titre, inherit );
	font-size: 1.45rem;
	font-weight: 450;
	line-height: 1.2;
}

.rm-liv-fenetre__fermer {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 9999px;
	background-color: var( --rm-creme-chaud );
	color: var( --rm-brun );
	cursor: pointer;
	font-size: 1.6rem;
	line-height: 1;
	transition: background-color var( --rm-duree-reponse ) var( --rm-courbe );
}

.rm-liv-fenetre__fermer:hover {
	background-color: color-mix( in srgb, var( --rm-terracotta ) 14%, var( --rm-creme-chaud ) );
}

.rm-liv-fenetre__intro,
.rm-liv-fenetre__vide {
	margin: 0;
	padding: 0 20px;
	color: var( --rm-texte-doux );
	font-size: 0.95rem;
	line-height: 1.45;
}

.rm-liv-fenetre__vide {
	padding-bottom: 20px;
	color: var( --rm-terracotta-sombre );
	font-weight: 600;
}

.rm-liv-fenetre__recherche {
	display: block;
	box-sizing: border-box;
	width: calc( 100% - 40px );
	min-height: 48px;
	margin: 14px 20px 6px;
	padding: 0 16px;
	border: 1px solid color-mix( in srgb, var( --rm-brun ) 25%, transparent );
	border-radius: 12px;
	background-color: var( --rm-creme-chaud );
	color: var( --rm-brun );
	font: inherit;
	font-size: 1rem;
}

.rm-liv-fenetre__corps {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px 20px 22px;
}

.rm-liv-zone {
	padding: 14px 16px;
	border: 1px solid color-mix( in srgb, var( --rm-terracotta ) 18%, transparent );
	border-radius: 14px;
	background-color: var( --rm-creme-chaud );
}

.rm-liv-zone__entete {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.rm-liv-zone__nom {
	margin: 0;
	font-family: var( --rm-fa-titre, inherit );
	font-size: 1.15rem;
	font-weight: 500;
}

.rm-liv-zone__prix {
	color: var( --rm-terracotta-sombre );
	font-size: 1.1rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.rm-liv-zone__conditions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 4px 0 10px;
	padding: 0;
	color: var( --rm-texte-doux );
	font-size: 0.9rem;
	list-style: none;
}

.rm-liv-zone__offerte {
	color: var( --rm-succes );
	font-weight: 600;
}

.rm-liv-zone__communes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rm-liv-zone__commune {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 5px 11px;
	border-radius: 9999px;
	background-color: var( --rm-creme );
	font-size: 0.92rem;
}

.rm-liv-zone__commune--trouvee {
	background-color: var( --rm-terracotta );
	color: var( --rm-creme );
}

.rm-liv-zone__cp {
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.7;
}

/* ---------- La livraison offerte, bien en vue ---------- */
.rm-liv-bandeau__offerte {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 4px;
	min-height: 36px;
	padding: 0 14px;
	border-radius: 9999px;
	background-color: var( --rm-succes );
	color: var( --rm-creme );
	font-size: 0.92rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	box-shadow: 0 6px 14px -8px color-mix( in srgb, var( --rm-succes ) 80%, transparent );
}

/*
 * SUR TELEPHONE, LA PASTILLE PLIE PLUTOT QUE DE POUSSER LA PAGE.
 *
 * « nowrap » + « flex: 0 0 auto » veut dire : une seule ligne, et pas
 * question de retrecir. C est tenable tant que le texte est court ; des qu il
 * s allonge, la pastille impose sa largeur au bandeau, le bandeau a la page,
 * et la page entiere se met a glisser — sur toute sa hauteur, loin de
 * l endroit ou le defaut se trouve.
 *
 * Mesure du 2026-11-21 avant correction : pastille 378 px, document 423 px
 * sur un ecran de 320. Apres : la page tient de 320 a 430 px.
 */
@media ( max-width: 600px ) {

	.rm-liv-bandeau__offerte {
		/*
		 * « display: block » ET NON « inline-flex ».
		 *
		 * La pastille contient deux choses : « Livraison offerte » en gras,
		 * puis « selon votre commune et le montant ». En boite flexible,
		 * ce sont DEUX COLONNES : le gras a gauche sur deux lignes, le reste
		 * a droite sur trois. Mesure visuelle du 2026-11-21 a 320 px : on ne
		 * lisait plus une phrase, on lisait un tableau.
		 *
		 * En bloc, les deux se suivent et la phrase se lit d'un trait, le
		 * gras ouvrant la ligne comme il doit.
		 */
		display: block;
		flex: 0 1 auto;
		min-width: 0;
		min-height: 0;
		padding: 7px 13px;
		border-radius: 14px;
		line-height: 1.34;
		white-space: normal;
		text-wrap: pretty;
	}
}

.rm-liv-zone--offerte {
	border-color: color-mix( in srgb, var( --rm-succes ) 40%, transparent );
}

.rm-liv-zone__entete {
	flex-wrap: wrap;
}

.rm-liv-zone__ruban {
	order: 3;
	flex: 1 0 100%;
	align-self: flex-start;
	width: max-content;
	max-width: max-content;
	margin-top: 4px;
	padding: 3px 10px;
	border-radius: 9999px;
	background-color: var( --rm-succes );
	color: var( --rm-creme );
	font-size: 0.85rem;
	font-weight: 600;
}

/* ---------- L'encadre du panier et de la caisse ---------- */
.rm-liv-etat {
	--rm-liv-teinte: var( --rm-terracotta );

	margin: 0 0 18px;
	overflow: hidden;
	border: 1px solid color-mix( in srgb, var( --rm-liv-teinte ) 30%, transparent );
	border-radius: 18px;
	background-color: var( --rm-creme-chaud );
	color: var( --rm-brun );
	box-shadow: 0 14px 30px -24px color-mix( in srgb, var( --rm-brun-nuit ) 70%, transparent );
}

.rm-liv-etat[ hidden ],
.rm-liv-etat [ hidden ] {
	display: none !important;
}

/* La couleur dit tout de suite si c'est bon. */
.rm-liv-etat--livrable,
.rm-liv-etat--offerte {
	--rm-liv-teinte: var( --rm-succes );
}

.rm-liv-etat--hors_zone,
.rm-liv-etat--fermee {
	--rm-liv-teinte: var( --rm-terracotta-sombre );
}

.rm-liv-etat--adresse {
	--rm-liv-teinte: var( --rm-brun );
}

/* La tete : une bande de couleur, l'icone, le titre, le prix. */
.rm-liv-etat__tete {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background:
		linear-gradient( 120deg, color-mix( in srgb, var( --rm-creme ) 16%, transparent ), transparent 55% ),
		var( --rm-liv-teinte );
	color: var( --rm-creme );
}

.rm-liv-etat__icone {
	width: 42px;
	height: 42px;
	background-color: color-mix( in srgb, var( --rm-creme ) 20%, transparent );
	color: var( --rm-creme );
}

.rm-liv-etat__titres {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rm-liv-etat__titre {
	margin: 0;
	font-family: var( --rm-fa-titre, inherit );
	font-size: 1.2rem;
	font-weight: 500;
	line-height: 1.2;
}

.rm-liv-etat__message {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.35;
	opacity: 0.95;
}

.rm-liv-etat__prix {
	flex: 0 0 auto;
	padding: 6px 14px;
	border-radius: 9999px;
	background-color: var( --rm-creme );
	color: var( --rm-liv-teinte );
	font-size: 1.1rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	white-space: nowrap;
}

.rm-liv-etat__corps {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 16px;
}

/* La jauge et ses reperes. */
.rm-liv-etat__parcours {
	padding: 2px 0 0;
}

.rm-liv-etat__piste {
	position: relative;
	height: 10px;
	border-radius: 9999px;
	background-color: color-mix( in srgb, var( --rm-brun ) 12%, transparent );
}

.rm-liv-etat__plein {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient( 90deg, var( --rm-terracotta ), var( --rm-terracotta-vif ) );
	transform: scaleX( 0 );
	transform-origin: left center;
	transition: transform 0.7s cubic-bezier( 0.22, 1, 0.36, 1 );
}

.rm-liv-etat--livrable .rm-liv-etat__plein,
.rm-liv-etat--offerte .rm-liv-etat__plein {
	background: var( --rm-succes );
}

.rm-liv-etat__jalon {
	position: absolute;
	top: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 3px solid var( --rm-creme-chaud );
	border-radius: 9999px;
	background-color: color-mix( in srgb, var( --rm-brun ) 30%, var( --rm-creme ) );
	box-sizing: border-box;
}

.rm-liv-etat__jalon--offerte {
	background-color: color-mix( in srgb, var( --rm-succes ) 45%, var( --rm-creme ) );
}

.rm-liv-etat__jalon--atteint {
	background-color: var( --rm-succes );
}

.rm-liv-etat__reperes {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 16px;
	margin-top: 10px;
}

.rm-liv-etat__repere {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var( --rm-texte-doux );
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.rm-liv-etat__repere::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 9999px;
	background-color: color-mix( in srgb, var( --rm-brun ) 30%, var( --rm-creme ) );
}

.rm-liv-etat__repere--offerte {
	color: var( --rm-succes );
	font-weight: 600;
}

.rm-liv-etat__repere--offerte::before {
	background-color: color-mix( in srgb, var( --rm-succes ) 45%, var( --rm-creme ) );
}

.rm-liv-etat__repere--atteint {
	color: var( --rm-succes );
	font-weight: 700;
}

.rm-liv-etat__repere--atteint::before {
	background-color: var( --rm-succes );
}

/* Les trois cases. */
.rm-liv-etat__faits {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 92px, 1fr ) );
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rm-liv-etat__fait {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 12px;
	background-color: var( --rm-creme );
}

.rm-liv-etat__fait-libelle {
	color: var( --rm-texte-doux );
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.rm-liv-etat__fait-valeur {
	font-size: 1.1rem;
	font-variant-numeric: tabular-nums;
}

.rm-liv-etat__fait-note {
	font-size: 0.85rem;
	font-weight: 600;
}

.rm-liv-etat__fait--ok .rm-liv-etat__fait-note,
.rm-liv-etat__fait--offerte .rm-liv-etat__fait-note {
	color: var( --rm-succes );
}

.rm-liv-etat__fait--offerte {
	box-shadow: inset 0 0 0 1px color-mix( in srgb, var( --rm-succes ) 35%, transparent );
}

.rm-liv-etat__fait--manque {
	box-shadow: inset 0 0 0 1px color-mix( in srgb, var( --rm-terracotta ) 45%, transparent );
}

.rm-liv-etat__fait--manque .rm-liv-etat__fait-note {
	color: var( --rm-terracotta-sombre );
}

.rm-liv-etat__detail {
	margin: 0;
	line-height: 1.45;
}

.rm-liv-etat--livrable .rm-liv-etat__detail {
	color: var( --rm-succes );
	font-weight: 600;
}

/* La commune, au panier. */
.rm-liv-etat__commune {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.rm-liv-etat__commune label {
	font-weight: 600;
}

.rm-liv-etat__liste {
	min-height: 48px;
	padding: 0 12px;
	border: 1px solid color-mix( in srgb, var( --rm-brun ) 25%, transparent );
	border-radius: 12px;
	background-color: var( --rm-creme );
	color: var( --rm-brun );
	font: inherit;
}

/* Les actions. */
.rm-liv-etat__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rm-liv-etat__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: 9999px;
	background-color: var( --rm-terracotta );
	color: var( --rm-creme );
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	transition: background-color var( --rm-duree-reponse ) var( --rm-courbe ), transform var( --rm-duree-reponse ) var( --rm-courbe );
}

.rm-liv-etat__action:hover {
	background-color: var( --rm-terracotta-sombre );
	color: var( --rm-creme );
}

.rm-liv-etat__action:active {
	transform: scale( 0.97 );
}

.rm-liv-etat__action:focus-visible {
	outline: var( --rm-focus-epaisseur ) solid var( --rm-brun );
	outline-offset: 2px;
}

.rm-liv-etat__zones {
	min-height: 44px;
	margin: 0;
	font-size: 0.95rem;
}

.rm-liv-etat__rappel {
	margin: 0;
	padding-top: 12px;
	border-top: 1px dashed color-mix( in srgb, var( --rm-brun ) 22%, transparent );
	color: var( --rm-texte-doux );
	font-size: 0.88rem;
}

@media ( max-width: 480px ) {

	.rm-liv-etat__tete {
		flex-wrap: wrap;
	}

	.rm-liv-etat__titres {
		flex-basis: calc( 100% - 120px );
	}

	.rm-liv-etat__action,
	.rm-liv-etat__zones {
		flex: 1 1 100%;
	}
}

/*
 * A LA CAISSE, NOTRE ENCADRE REMPLACE LE MESSAGE DE WOOCOMMERCE quand nous
 * savons pourquoi la livraison manque : « verifiez l'exactitude de
 * l'adresse » est faux quand c'est le minimum qui n'est pas atteint.
 */
body.rm-liv-explique .wc-block-components-shipping-rates-control__no-results-notice {
	display: none;
}

@media ( prefers-reduced-motion: reduce ) {

	.rm-liv-fenetre[ open ] {
		animation: none;
	}

	.rm-liv-etat__plein,
	.rm-liv-etat__action,
	.rm-liv-bandeau__bouton,
	.rm-liv-etat__zones {
		transition: none;
	}
}
