/* Robomap AI Chat for WooCommerce — call-panel inspired widget */

.rmv-root {
	--rmv-primary: #0b6e4f;
	--rmv-accent: #f4a261;
	--rmv-ink: #14213d;
	--rmv-paper: #f7f3ec;
	--rmv-panel: rgba(247, 243, 236, 0.96);
	--rmv-line: rgba(20, 33, 61, 0.12);
	--rmv-shadow: 0 18px 50px rgba(20, 33, 61, 0.18);
	position: fixed;
	z-index: 99999;
	font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	color: var(--rmv-ink);
}

.rmv-pos-bottom-right {
	right: 1.25rem;
	bottom: 1.25rem;
}

.rmv-pos-bottom-left {
	left: 1.25rem;
	bottom: 1.25rem;
}

.rmv-launcher {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	border: 0;
	border-radius: 999px;
	padding: 0.85rem 1.15rem;
	background: linear-gradient(135deg, var(--rmv-primary), #083d2c);
	color: #fff;
	font: 600 0.95rem/1 "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
	letter-spacing: 0.02em;
	box-shadow: var(--rmv-shadow);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rmv-launcher:hover,
.rmv-launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 22px 40px rgba(11, 110, 79, 0.28);
	outline: none;
}

.rmv-launcher-dot {
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: var(--rmv-accent);
	box-shadow: 0 0 0 0 rgba(244, 162, 97, 0.6);
	animation: rmv-pulse 2.2s ease-out infinite;
}

.rmv-panel {
	width: min(380px, calc(100vw - 2rem));
	max-height: min(640px, calc(100vh - 2rem));
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(120% 80% at 0% 0%, rgba(244, 162, 97, 0.18), transparent 55%),
		radial-gradient(100% 70% at 100% 100%, rgba(11, 110, 79, 0.14), transparent 50%),
		linear-gradient(var(--rmv-panel), var(--rmv-panel)),
		#fffdf9;
	border: 1px solid var(--rmv-line);
	border-radius: 1.35rem;
	box-shadow: var(--rmv-shadow);
	overflow: hidden;
	animation: rmv-rise 0.28s ease;
}

.rmv-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1rem 0.75rem;
	border-bottom: 1px solid var(--rmv-line);
}

.rmv-brand {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.rmv-brand strong {
	font-family: "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
	font-size: 1rem;
	font-weight: 700;
}

.rmv-brand span {
	font-size: 0.78rem;
	opacity: 0.72;
}

.rmv-header-actions {
	display: flex;
	gap: 0.35rem;
}

.rmv-icon-btn {
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--rmv-line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.55);
	color: var(--rmv-ink);
	cursor: pointer;
	display: inline-grid;
	place-items: center;
	transition: background 0.15s ease;
}

.rmv-icon-btn:hover,
.rmv-icon-btn:focus-visible {
	background: #fff;
	outline: none;
}

.rmv-icon-btn.is-active {
	background: var(--rmv-primary);
	border-color: var(--rmv-primary);
	color: #fff;
}

.rmv-icon-btn.is-live {
	background: #c1121f;
	border-color: #c1121f;
	color: #fff;
	animation: rmv-pulse 1.4s ease-out infinite;
}

.rmv-status {
	padding: 0.45rem 1rem;
	font-family: "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
	font-size: 0.78rem;
	color: var(--rmv-primary);
	background: rgba(11, 110, 79, 0.08);
	min-height: 1.6rem;
}

.rmv-status.is-error {
	color: #9b2226;
	background: rgba(155, 34, 38, 0.08);
}

.rmv-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.85rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	min-height: 220px;
}

.rmv-msg {
	max-width: 92%;
	padding: 0.7rem 0.85rem;
	border-radius: 1rem;
	font-size: 0.95rem;
	line-height: 1.45;
	animation: rmv-fade 0.2s ease;
}

.rmv-msg-user {
	align-self: flex-end;
	background: var(--rmv-primary);
	color: #fff;
	border-bottom-right-radius: 0.3rem;
}

.rmv-msg-assistant {
	align-self: flex-start;
	background: rgba(255, 255, 255, 0.78);
	border: 1px solid var(--rmv-line);
	border-bottom-left-radius: 0.3rem;
}

.rmv-products {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	margin-top: 0.45rem;
}

.rmv-product {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.45rem 0.55rem;
	background: rgba(11, 110, 79, 0.06);
	border-radius: 0.65rem;
	font-family: "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
	font-size: 0.82rem;
}

.rmv-product a {
	color: var(--rmv-primary);
	font-weight: 600;
	text-decoration: none;
}

.rmv-product a:hover {
	text-decoration: underline;
}

.rmv-composer {
	display: flex;
	gap: 0.45rem;
	padding: 0.75rem 1rem 1rem;
	border-top: 1px solid var(--rmv-line);
	background: rgba(255, 255, 255, 0.35);
}

.rmv-composer input[type="text"] {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--rmv-line);
	border-radius: 999px;
	padding: 0.7rem 0.95rem;
	background: #fff;
	font: 0.92rem/1.2 "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
	color: var(--rmv-ink);
}

.rmv-composer input[type="text"]:focus {
	outline: 2px solid rgba(11, 110, 79, 0.35);
	outline-offset: 1px;
}

.rmv-send {
	border: 0;
	border-radius: 999px;
	padding: 0 1rem;
	background: var(--rmv-accent);
	color: #1b1b1b;
	font: 700 0.85rem/1 "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
	cursor: pointer;
}

.rmv-send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.rmv-empty {
	opacity: 0.55;
	font-size: 0.9rem;
	text-align: center;
	padding: 1.5rem 0.5rem;
}

@keyframes rmv-rise {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes rmv-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes rmv-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(244, 162, 97, 0.55);
	}
	70% {
		box-shadow: 0 0 0 12px rgba(244, 162, 97, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(244, 162, 97, 0);
	}
}

@media (max-width: 480px) {
	.rmv-pos-bottom-right,
	.rmv-pos-bottom-left {
		right: 0.75rem;
		left: 0.75rem;
		bottom: 0.75rem;
	}

	.rmv-panel {
		width: 100%;
	}
}

/* Keep widget typography independent from the active theme. */
#robomap-voice-woo-root,
#robomap-voice-woo-root button,
#robomap-voice-woo-root input,
#robomap-voice-woo-root textarea {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Robomap inbox: human agent replies + takeover note. */
.rmv-msg-agent {
	align-self: flex-start;
	background: #eef4ff;
	border: 1px solid rgba(37, 99, 235, 0.18);
	color: #1e293b;
}

.rmv-agent-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	color: #1d4ed8;
	margin-bottom: 0.2rem;
}

.rmv-takeover {
	margin: 0.4rem 0.9rem 0;
	padding: 0.35rem 0.6rem;
	font-size: 0.78rem;
	border-radius: 0.6rem;
	background: rgba(37, 99, 235, 0.08);
	color: #1d4ed8;
}

.rmv-icon-btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}
