/* ==========================================================================
   re-panier.css — Panier de véhicules flottant (Royal Event)
   --------------------------------------------------------------------------
   Desktop : pastille en bas à GAUCHE (la barre de contact occupe le rail droit).
   Mobile  : barre basse placée AU-DESSUS de la barre de contact (qui passe
             en bas d'écran sous 768px) pour qu'elles ne se recouvrent pas.
   ========================================================================== */

.rep, .rep * { box-sizing: border-box; }

.rep {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 9990;                      /* sous la navbar (9999) et la barre de contact (9998) */
	font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	/* Assez large pour que la pastille et le CTA tiennent cote a cote sans que
	   le libelle ne deborde de son fond arrondi. */
	max-width: 420px;
}
.rep[hidden] { display: none; }

/* ---------------- Barre repliée ---------------- */
.rep-bar {
	display: flex;
	align-items: stretch;
	gap: 8px;
}
.rep .rep-toggle,
.rep .rep-toggle:hover,
.rep .rep-toggle:focus,
.rep .rep-toggle:active {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 12px 16px;
	min-width: 0;
	background: #FFFCF2;
	border: 1px solid #DDD9BF;
	border-radius: 999px;
	box-shadow: 0 10px 26px rgba(41, 26, 3, .16);
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
	color: #2F1D02;
	text-transform: none;      /* le theme met tous les boutons en majuscules */
	letter-spacing: normal;    /* ... avec 2px d'interlettrage */
	overflow: hidden;          /* filet de securite : jamais de texte hors du fond */
	cursor: pointer;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.rep .rep-toggle:hover,
.rep .rep-toggle:focus {
	border-color: #B08D57;
	box-shadow: 0 12px 30px rgba(41, 26, 3, .22);
}

.rep-toggle-txt {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.rep-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 7px;
	border-radius: 999px;
	background: #B08D57;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	flex: 0 0 auto;
}

.rep .rep-cta,
.rep .rep-cta:hover,
.rep .rep-cta:focus {
	flex: 0 0 auto;            /* c'est la pastille qui se comprime, pas le CTA */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 18px;
	background: #2F1D02;
	color: #F0EAD6;
	border-radius: 999px;
	box-shadow: 0 10px 26px rgba(41, 26, 3, .18);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
	transition: background .18s ease;
}
.rep .rep-cta:hover, .rep .rep-cta:focus { background: #4a3210; color: #F0EAD6; }

/* ---------------- Panneau déplié ---------------- */
.rep-panel {
	background: #fff;
	border: 1px solid #DDD9BF;
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(41, 26, 3, .20);
	padding: 14px 16px 12px;
	max-height: min(58vh, 430px);
	overflow-y: auto;
	animation: rep-in .22s ease;
}
.rep-panel[hidden] { display: none; }
@keyframes rep-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.rep-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}
.rep-panel-title {
	font-family: 'Cormorant Garamond', 'STIX Two Text', Georgia, serif;
	font-size: 21px;
	font-weight: 600;
	color: #2F1D02;
}
.rep .rep-close,
.rep .rep-close:hover,
.rep .rep-close:focus {
	background: none;
	border: 0;
	padding: 0 2px;
	min-width: 0;
	line-height: 1;
	font-size: 26px;
	line-height: 1;
	color: #938F8F;
	cursor: pointer;
	padding: 0 2px;
}
.rep .rep-close:hover { color: #2F1D02; }

.rep-list { list-style: none; margin: 0; padding: 0; }
.rep-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 0;
	border-bottom: 1px solid #F0EDE4;
}
.rep-item:last-child { border-bottom: 0; }

.rep-thumb {
	flex: 0 0 auto;
	width: 54px;
	height: 40px;
	border-radius: 5px;
	overflow: hidden;
	background: #F5F4ED;
	display: block;
}
.rep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rep-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rep-item-title {
	font-size: 15px;
	line-height: 1.25;
	color: #2F1D02;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.rep-item-ref { font-size: 13px; color: #938F8F; }

.rep .rep-del,
.rep .rep-del:hover,
.rep .rep-del:focus {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	/* padding/min-width remis a zero : certains themes imposent un padding
	   genereux a tous les <button>, ce qui deformerait la pastille. */
	padding: 0;
	min-width: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid #E2DED3;
	background: #fff;
	color: #6A4A1A;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.rep .rep-del:hover { background: #F5F4ED; border-color: #B08D57; }

.rep-note { margin: 10px 0 0; font-size: 13px; color: #938F8F; font-style: italic; }

/* ---------------- Mobile ----------------
   La barre de contact passe en bas d'écran sous 768px : on remonte le panier
   au-dessus d'elle (≈64px + encoche) pour éviter tout recouvrement. */
@media (max-width: 768px) {
	.rep {
		left: 10px;
		/* Valeurs calculees par re-panier.js a partir de la position reelle de
		   la barre de contact (.re-fab) ; les valeurs par defaut ci-dessous
		   supposent une barre basse, le cas le plus genant. */
		right: var(--rep-right, 10px);
		max-width: none;
		bottom: calc(var(--rep-bottom, 68px) + env(safe-area-inset-bottom, 0px));
	}
	.rep-bar { gap: 8px; }
	.rep .rep-toggle { flex: 1 1 auto; justify-content: center; padding: 12px 10px; font-size: 14px; }
	.rep .rep-cta { flex: 0 0 auto; padding: 12px 14px; font-size: 14px; }
	/* Ouvert par defaut, il ne doit pas manger l'ecran : au-dela de 4 vehicules
	   la liste defile a l'interieur du panneau. */
	.rep-panel { max-height: 36vh; padding: 12px 14px 10px; }
	.rep-panel-title { font-size: 19px; }
	.rep-item { padding: 7px 0; }
	.rep-note { margin-top: 8px; }
}

@media (max-width: 380px) {
	.rep .rep-toggle-txt { display: none; }  /* on garde la pastille chiffrée seule */
	.rep .rep-toggle::after { content: 'véhicules'; font-size: 14px; }
}
