/* ==========================================================================
   Assistant virtuel Raypath (IA) — styles isolés (préfixe .rpc-)
   ========================================================================== */
.rpc, .rpc * { box-sizing: border-box; }
.rpc {
	--rpc-aqua: #3fb8d9; --rpc-aqua-soft: #9fdcef; --rpc-ocean: #0b3a5b; --rpc-deep: #0d2236; --rpc-abyss: #021120;
	--rpc-pearl: #f6fafc; --rpc-line: rgba(11, 58, 91, 0.14);
	position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 9990;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; color: var(--rpc-deep);
	text-align: left; letter-spacing: normal; text-transform: none;
}
.rpc[dir="rtl"] { right: auto; left: max(16px, env(safe-area-inset-left)); text-align: right; }
.rpc button, .rpc input { font: inherit; letter-spacing: inherit; text-transform: none; }
.rpc button { cursor: pointer; }
.rpc img { max-width: 100%; height: auto; border: 0; box-shadow: none; }
.rpc a { text-decoration: none; }

/* Bouton flottant */
.rpc__launcher { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--rpc-ocean); transition: transform 0.4s cubic-bezier(.34, 1.56, .64, 1); }
.rpc__launcher:hover { transform: translateY(-4px) scale(1.04); }
.rpc__avatar { position: relative; display: block; width: 68px; height: 68px; border-radius: 50%; overflow: hidden; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--rpc-aqua), 0 18px 40px -12px rgba(2, 17, 32, 0.6); }
.rpc__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rpc__launcher::before { content: ""; position: absolute; top: 0; left: 50%; width: 68px; height: 68px; margin-left: -34px; border-radius: 50%; border: 2px solid var(--rpc-aqua); animation: rpc-ping 2.8s ease-out infinite; pointer-events: none; }
.rpc__label { padding: 3px 12px; border-radius: 999px; background: var(--rpc-ocean); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; box-shadow: 0 8px 20px -8px rgba(2, 17, 32, 0.7); }
.rpc__badge { position: absolute; top: 0; right: -2px; width: 16px; height: 16px; border-radius: 50%; background: #2f9a44; border: 2px solid #fff; }
.rpc.is-open .rpc__launcher { display: none; }
@keyframes rpc-ping { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.7); opacity: 0; } }

/* Fenêtre */
.rpc__panel {
	display: none; flex-direction: column; width: min(392px, calc(100vw - 24px)); height: min(640px, calc(100vh - 32px)); height: min(640px, calc(100dvh - 32px));
	overflow: hidden; border-radius: 28px; background: #fff; border: 1px solid var(--rpc-line);
	box-shadow: 0 40px 90px -30px rgba(2, 17, 32, 0.75), 0 0 0 1px rgba(63, 184, 217, 0.25);
	transform-origin: bottom right;
}
.rpc[dir="rtl"] .rpc__panel { transform-origin: bottom left; }
.rpc.is-open .rpc__panel { display: flex; animation: rpc-in 0.45s cubic-bezier(.34, 1.3, .64, 1); }
@keyframes rpc-in { from { opacity: 0; transform: translateY(18px) scale(0.94); } }
.rpc__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: radial-gradient(70% 120% at 85% 0%, rgba(63, 184, 217, 0.4), transparent 70%), linear-gradient(160deg, var(--rpc-ocean), var(--rpc-abyss)); }
.rpc__head .rpc__avatar { width: 46px; height: 46px; flex: none; border-width: 2px; box-shadow: 0 0 0 2px var(--rpc-aqua-soft); }
.rpc__title { min-width: 0; flex: 1; }
.rpc__title strong { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.35rem; line-height: 1.1; font-weight: 600; }
.rpc__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rpc-aqua-soft); }
.rpc__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc6a; box-shadow: 0 0 0 3px rgba(61, 220, 106, 0.25); }
.rpc__close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 20px; line-height: 1; transition: background 0.3s; }
.rpc__close:hover { background: rgba(255, 255, 255, 0.24); }

/* Langues */
.rpc__langs { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; background: var(--rpc-pearl); border-bottom: 1px solid var(--rpc-line); scrollbar-width: none; }
.rpc__langs::-webkit-scrollbar { display: none; }
.rpc__lang { flex: none; display: grid; place-items: center; width: 44px; height: 32px; padding: 0; border-radius: 10px; border: 2px solid transparent; background: #fff; overflow: hidden; opacity: 0.7; transition: all 0.25s; }
.rpc__lang svg { width: 100%; height: 100%; display: block; }
.rpc__lang:hover { opacity: 1; }
.rpc__lang.is-active { opacity: 1; border-color: var(--rpc-aqua); box-shadow: 0 0 0 3px rgba(63, 184, 217, 0.25); }

/* Messages */
.rpc__log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #fff, var(--rpc-pearl)); scroll-behavior: smooth; }
.rpc__msg { max-width: 88%; padding: 11px 15px; border-radius: 20px; word-wrap: break-word; overflow-wrap: anywhere; animation: rpc-msg 0.35s ease both; }
@keyframes rpc-msg { from { opacity: 0; transform: translateY(8px); } }
.rpc__msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--rpc-line); border-top-left-radius: 6px; box-shadow: 0 10px 24px -20px rgba(11, 58, 91, 0.6); }
.rpc[dir="rtl"] .rpc__msg--bot { border-top-left-radius: 20px; border-top-right-radius: 6px; }
.rpc__msg--me { align-self: flex-end; color: #fff; background: linear-gradient(160deg, var(--rpc-ocean), #0e5a85); border-top-right-radius: 6px; }
.rpc[dir="rtl"] .rpc__msg--me { border-top-right-radius: 20px; border-top-left-radius: 6px; }
.rpc__msg a { color: var(--rpc-ocean); font-weight: 600; text-decoration: underline; text-decoration-color: var(--rpc-aqua); text-underline-offset: 3px; }
.rpc__msg--me a { color: #fff; }
.rpc__msg p { margin: 0 0 8px; } .rpc__msg p:last-child { margin: 0; }
.rpc__typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--rpc-line); }
.rpc__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--rpc-aqua); animation: rpc-dot 1s ease-in-out infinite; }
.rpc__typing i:nth-child(2) { animation-delay: 0.15s; } .rpc__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes rpc-dot { 50% { transform: translateY(-5px); opacity: 0.5; } }

/* Cartes produit */
.rpc__cards { align-self: stretch; display: grid; gap: 8px; }
.rpc__card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: #fff; border: 1px solid var(--rpc-line); animation: rpc-msg 0.35s ease both; }
.rpc__card-img { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: #fff; border: 1px solid var(--rpc-line); overflow: hidden; }
.rpc__card-img img { width: 100%; height: 100%; object-fit: contain; }
.rpc__card strong { display: block; font-size: 14px; line-height: 1.25; }
.rpc__card small { display: block; margin: 2px 0 6px; color: #5a6b7b; font-size: 12px; }
.rpc__card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rpc__btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rpc-ocean); background: var(--rpc-ocean); color: #fff !important; font-size: 12px; font-weight: 600; text-decoration: none !important; transition: transform 0.25s, background 0.25s; }
.rpc__btn:hover { transform: translateY(-2px); background: #0e5a85; }
.rpc__btn--line { background: transparent; color: var(--rpc-ocean) !important; border-color: rgba(11, 58, 91, 0.3); }
.rpc__actions { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }

/* Suggestions + saisie */
.rpc__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; background: var(--rpc-pearl); }
.rpc__chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--rpc-aqua); background: #fff; color: var(--rpc-ocean); font-size: 13px; font-weight: 600; transition: all 0.25s; }
.rpc__chip:hover { background: var(--rpc-ocean); border-color: var(--rpc-ocean); color: #fff; transform: translateY(-2px); }
.rpc__form { display: flex; align-items: center; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid var(--rpc-line); }
.rpc__input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1.5px solid var(--rpc-line); background: var(--rpc-pearl); color: var(--rpc-deep); font-size: 15px; }
.rpc__input:focus { outline: none; border-color: var(--rpc-aqua); box-shadow: 0 0 0 4px rgba(63, 184, 217, 0.2); background: #fff; }
.rpc__send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(160deg, var(--rpc-aqua), var(--rpc-ocean)); box-shadow: 0 10px 24px -10px rgba(63, 184, 217, 0.9); transition: transform 0.25s; }
.rpc__send:hover { transform: scale(1.08); }
.rpc__send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rpc[dir="rtl"] .rpc__send svg { transform: scaleX(-1); }
.rpc__note { margin: 0; padding: 0 14px 10px; background: #fff; color: #6b7c8c; font-size: 11px; text-align: center; }

@media (max-width: 520px) {
	.rpc.is-open { right: 0; left: 0; bottom: 0; }
	.rpc.is-open .rpc__panel { width: 100%; height: min(86vh, 640px); height: min(86dvh, 640px); border-radius: 26px 26px 0 0; }
	.rpc__avatar { width: 60px; height: 60px; }
	.rpc__launcher::before { width: 60px; height: 60px; margin-left: -30px; }
}
@media (prefers-reduced-motion: reduce) { .rpc__launcher::before, .rpc__typing i { animation: none; } .rpc.is-open .rpc__panel, .rpc__msg, .rpc__card { animation: none; } .rpc__log { scroll-behavior: auto; } }
