/* ==========================================================================
   Filago — conversion pack (inc/engage.php, inc/relances.php, assets/js/engage.js)
   Offer countdown, live line, low stock, back-in-stock box, delivery line and
   welcome code (product page), card extras, social-proof toasts.
   Calm and editorial: thin lines, small type, the burgundy accent only on labels.
   ========================================================================== */

/* ---------- Product page: offer countdown (under the price) ---------- */
.offer-timer {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
	margin-top: 14px; padding: 11px 14px;
	border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft);
	font-size: 13px; line-height: 1.35; color: var(--ink-2);
}
.offer-timer__label { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.offer-timer em { font-family: var(--serif); font-size: 17px; font-style: italic; line-height: 1; color: var(--accent); }
.offer-timer__clock { display: inline-flex; gap: 10px; font-variant-numeric: tabular-nums; }
.offer-timer__clock > span { display: inline-flex; align-items: baseline; gap: 2px; }
.offer-timer__clock b { font-size: 15px; font-weight: 500; color: var(--ink); letter-spacing: .01em; }
.offer-timer__clock small { font-size: 11px; color: var(--muted); }
.offer-timer.is-urgent .offer-timer__clock b { color: var(--accent); }
.offer-timer--date { justify-content: flex-start; }

/* ---------- Product page: live line (viewers, units sold) ---------- */
.pdp-live { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.pdp-live__line { display: flex; align-items: center; gap: 8px; }
.pdp-live__line svg { flex: none; color: var(--muted); }
.pdp-live__line b { font-weight: 500; color: var(--ink); }
.pdp-live__line.is-live { position: relative; }
.pdp-live__line.is-live::after {
	content: ""; order: -1; flex: none; width: 6px; height: 6px; margin: 0 -2px 0 5px; border-radius: 50%;
	background: var(--accent); box-shadow: 0 0 0 0 rgba(122, 31, 43, .35);
	animation: filago-live 2.4s ease-out infinite;
}
.pdp-live__line.is-live svg { display: none; }
@keyframes filago-live { 0% { box-shadow: 0 0 0 0 rgba(122, 31, 43, .35); } 70%, 100% { box-shadow: 0 0 0 6px rgba(122, 31, 43, 0); } }

/* ---------- Low stock (WooCommerce availability line under the size buttons) ---------- */
.stock.low-stock { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; }
.stock.low-stock::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.woocommerce-variation-availability .stock.out-of-stock, .pdp .stock.out-of-stock { font-weight: 500; }

/* ---------- Sold-out choice: the alert box replaces the buy buttons ---------- */
.pdp.is-variation-oos .single_add_to_cart_button,
.pdp.is-variation-oos .fc-wrap,
.pdp.is-variation-oos [data-wa-order],
.pdp.outofstock .single_add_to_cart_button { display: none !important; }

.notify {
	container-type: inline-size;
	margin-top: 16px; padding: 18px;
	border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--soft);
}
.notify__title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.notify__title svg { flex: none; }
.notify__text { margin: 6px 0 0 28px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.notify__fields { display: grid; gap: 10px; margin-top: 14px; }
.notify__field { display: block; min-width: 0; }
.notify__field input {
	width: 100%; height: 48px; margin: 0; padding: 0 14px;
	border: 1px solid var(--line-strong); border-radius: 4px; background: var(--white);
	font: 400 16px/1.2 var(--font); color: var(--ink);
	-webkit-appearance: none; appearance: none; outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.notify__field input::placeholder { color: var(--muted); }
.notify__field input:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.notify__btn { width: 100%; min-height: 48px; font-size: 15px; }
.notify__btn:disabled { opacity: .5; cursor: progress; }
@container (min-width: 400px) {
	.notify__fields { grid-template-columns: 1fr 1fr; }
	.notify__btn { grid-column: 1 / -1; }
}
.notify__msg { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 13px; line-height: 1.45; color: #1d6b3a; }
.notify__msg svg { flex: none; margin-top: 1px; }
.notify__msg.is-error { color: var(--sale); }
.notify__fields[hidden] + input + .notify__msg { margin-top: 14px; }

/* ---------- Perks under the buy button: dated delivery line, welcome code ---------- */
.pdp__perks [data-eta] strong { font-weight: 500; color: var(--ink); white-space: nowrap; }
.pdp__perk-offer { align-items: center !important; }
/* The express form's summary already carries the code just above: no second chip then. */
.pdp:has(#fast-checkout-form) .pdp__perk-offer { display: none; }
.pdp__perk-offer > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pdp__perks .code-chip {
	display: inline-flex; align-items: center; height: 26px; padding: 0 9px;
	border: 1px dashed var(--ink); border-radius: 4px; background: var(--white);
	font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--ink);
	transition: background-color .15s, color .15s;
}
.pdp__perks .code-chip:hover, .pdp__perks .code-chip.is-copied { background: var(--ink); color: var(--white); border-style: solid; }

/* ---------- Product cards: sale ending soon, stars ---------- */
.badge--timer {
	top: 42px; display: inline-flex; align-items: center; gap: 4px;
	padding: 3px 8px; border-radius: 4px;
	font-size: 11px; font-weight: 500; letter-spacing: .01em; color: var(--accent);
	font-variant-numeric: tabular-nums;
}
.badge--timer svg { flex: none; }
.product-card__rating { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0 4px; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.product-card__rating em { font-style: normal; color: var(--muted); }
.product-card__rating .stars { vertical-align: 0; }
@media (min-width: 1024px) {
	.product-card__rating { padding: 0 20px; } /* Same inset as the title and meta line (carousels, related). */
	.plp__grid .product-card__rating { padding: 0; } /* The shop grid sets them flush. */
}

/* ---------- Social-proof toast (bottom left, real orders) ---------- */
.proof {
	position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 44;
	width: min(340px, calc(100vw - 96px));
	display: flex; align-items: center;
	border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
	box-shadow: 0 12px 32px rgba(20, 15, 15, .12);
	opacity: 0; transform: translateY(14px); pointer-events: none;
	transition: opacity .35s var(--ease), transform .35s var(--ease), bottom .35s var(--ease);
}
.proof.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.has-buybar .proof { bottom: calc(88px + env(safe-area-inset-bottom)); }
.is-locked .proof { opacity: 0; pointer-events: none; }
.proof__link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 10px 40px 10px 10px; }
.proof__img { flex: none; width: 52px; height: 64px; border-radius: 4px; object-fit: cover; background: var(--card); }
.proof__text { display: grid; gap: 3px; min-width: 0; }
.proof__text small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.proof__text strong {
	font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--ink);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.proof__close {
	position: absolute; top: 6px; right: 6px;
	display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
	color: var(--muted); transition: background-color .15s, color .15s;
}
.proof__close:hover { background: var(--soft); color: var(--ink); }
@media (min-width: 1024px) {
	.proof { left: 24px; bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.pdp-live__line.is-live::after { animation: none; }
	.proof { transition: opacity .01ms; transform: none; }
}
