/* ==========================================================================
   Filago — cart drawer contents (woocommerce/cart/mini-cart.php, inc/cart.php,
   assets/js/mini-cart.js). The drawer shell (#drawer-cart: panel, head, focus
   trap) is in theme.css; Cozy pop extras are in the 4f block of cozy.css.
   Loaded on every page but the cart and checkout.
   ========================================================================== */

/* The body scrolls; the contents fill it so the foot sits at the bottom. */
#drawer-cart .drawer__body { display: flex; flex-direction: column; padding: 0; }
#drawer-cart .widget_shopping_cart_content { flex: 1 0 auto; display: flex; flex-direction: column; }
.mcart { flex: 1 0 auto; display: flex; flex-direction: column; }

/* Title count: "Votre panier (2)" */
.drawer__count { color: var(--muted); font-weight: 400; }

/* ---------- Lines ---------- */
.mcart__list { padding: 4px 20px 0; }
.mcart__item {
	position: relative;
	display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px;
	padding: 16px 0; border-bottom: 1px solid var(--line);
	transition: opacity .25s var(--ease);
}
.mcart__item.is-removing { opacity: .35; pointer-events: none; }
.mcart__item.is-loading .mcart__price { opacity: .45; }
.mcart__thumb { display: block; align-self: start; overflow: hidden; border-radius: 4px; background: var(--card); }
.mcart__thumb img { display: block; width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: center 20%; }
.mcart__info { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; }
.mcart__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mcart__id { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.mcart__name { font-size: 15px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
a.mcart__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.mcart__attrs { font-size: 13px; line-height: 1.35; color: var(--muted); }
.mcart__pack {
	margin-top: 3px; padding: 2px 9px; border-radius: 999px;
	background: var(--ink); color: var(--white); font-size: 11.5px; font-weight: 600; line-height: 1.5;
}
.mcart__remove {
	display: grid; place-items: center; flex: none;
	width: 40px; height: 40px; margin: -10px -10px 0 0; border-radius: 50%;
	color: var(--muted); transition: background-color .2s, color .2s;
}
.mcart__remove:hover { background: var(--soft); color: var(--ink); }
.mcart__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.mcart__qty {
	display: inline-flex; align-items: center; height: 38px;
	border: 1px solid var(--line-strong); border-radius: 999px;
}
.mcart__qty button { display: grid; place-items: center; width: 38px; height: 100%; border-radius: 999px; color: var(--ink); transition: background-color .15s, transform .12s; }
.mcart__qty button:hover:not(:disabled) { background: var(--soft); }
.mcart__qty button:active:not(:disabled) { transform: scale(.9); }
.mcart__qty button:disabled { color: var(--line-strong); cursor: not-allowed; }
.mcart__qty button:focus-visible { outline-offset: -2px; }
.mcart__n { min-width: 22px; text-align: center; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mcart__item.is-bump .mcart__n { animation: mcart-bump .26s var(--ease); }
@keyframes mcart-bump { 45% { transform: scale(1.28); } }

.mcart__price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; text-align: right; }
.mcart__price strong { font-size: 15px; font-weight: 500; white-space: nowrap; transition: opacity .2s; }
.mcart__price strong.is-sale { color: var(--sale); }
.mcart__price del { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mcart__error { margin: 0; font-size: 12.5px; color: var(--sale); }

/* ---------- Promises (compact reassurance bar) ---------- */
.mcart__promises { padding: 20px 20px 24px; }
.mcart__promises .reassure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.mcart__promises .reassure li {
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	padding: 12px 6px; border-radius: var(--radius); background: var(--soft); text-align: center;
}
.mcart__promises .reassure .icon { flex: none; color: var(--ink); }
.mcart__promises .reassure span { display: block; font-size: 12px; line-height: 1.3; text-wrap: balance; }
.mcart__promises .reassure strong { font-weight: 500; color: var(--ink); }

/* ---------- Foot: total + actions, pinned to the bottom ---------- */
.mcart__foot {
	position: sticky; bottom: 0; z-index: 1; margin-top: auto;
	display: grid; gap: 8px;
	padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--line); background: var(--white);
}
.mcart__total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--ink-2); }
.mcart__total strong { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.mcart__savings { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ink-2); }
.mcart__savings .icon { flex: none; color: var(--sale); }
.mcart__savings strong { font-weight: 600; color: var(--ink); }
.mcart__note { margin: 0 0 4px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.mcart__actions { display: grid; gap: 8px; }
.mcart__actions .btn { width: 100%; }
.mcart__checkout .icon { transition: transform .2s var(--ease); }
.mcart__checkout:hover .icon { transform: translateX(3px); }

/* ---------- Empty ---------- */
.mcart__empty {
	flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	padding: 40px 24px calc(48px + env(safe-area-inset-bottom)); text-align: center;
}
.mcart__empty-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--soft); color: var(--ink); }
.mcart__empty-title { margin-top: 4px; font-size: 32px; }
.mcart__empty-text { max-width: 30ch; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.mcart__empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 320px; margin-top: 8px; }
.mcart__empty-actions .btn--dark { flex-basis: 100%; }
.mcart__empty-actions .btn--outline { flex: 1 1 0; }

/* ---------- Returning-visitor toast (.proof styles are in engage.css) ---------- */
.proof--cart .proof__icon {
	flex: none; display: grid; place-items: center; width: 52px; height: 52px;
	border-radius: 14px; background: var(--soft); color: var(--ink);
}
.proof--cart .proof__cta { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	.mcart__item.is-bump .mcart__n { animation: none; }
}
