/* Fides Retail Chat — storefront widget styles. */

.frc-widget {
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}

.frc-pos-right { right: 20px; }
.frc-pos-left { left: 20px; }

/* Bubble */
.frc-bubble {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--frc-accent, #7f54b3);
	color: var(--frc-on-accent, #fff);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.frc-bubble:hover,
.frc-bubble:focus-visible {
	transform: scale(1.06);
}

.frc-bubble svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.frc-bubble-emoji {
	font-size: 27px;
	line-height: 1;
}

/* Panel */
.frc-panel {
	position: absolute;
	bottom: 70px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: var(--frc-bg, #fff);
	border-radius: 14px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.frc-pos-right .frc-panel { right: 0; }
.frc-pos-left .frc-panel { left: 0; }

.frc-panel[hidden] { display: none; }

/* Header */
.frc-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--frc-accent, #7f54b3);
	color: var(--frc-on-accent, #fff);
}

.frc-header img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.frc-header-text {
	flex: 1;
	min-width: 0;
}

.frc-header-title {
	font-weight: 600;
	line-height: 1.2;
}

.frc-header-sub {
	font-size: 12px;
	opacity: 0.85;
	margin-top: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.frc-close {
	background: transparent;
	border: none;
	color: var(--frc-on-accent, #fff);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

/* Log */
.frc-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: var(--frc-bg, #f6f6f7);
}

.frc-msg {
	max-width: 85%;
	margin-bottom: 10px;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.frc-msg-user {
	margin-left: auto;
	background: var(--frc-accent, #7f54b3);
	color: var(--frc-on-accent, #fff);
	border-bottom-right-radius: 4px;
}

.frc-msg-bot {
	margin-right: auto;
	background: #fff;
	color: #1d2327;
	border: 1px solid #e0e0e0;
	border-bottom-left-radius: 4px;
}

.frc-msg-bot a { color: var(--frc-accent, #7f54b3); }

/* Typing indicator */
.frc-typing {
	display: inline-block;
	margin-right: auto;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.frc-typing span {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 1.5px;
	border-radius: 50%;
	background: #999;
	animation: frc-blink 1.2s infinite both;
}

.frc-typing span:nth-child(2) { animation-delay: 0.2s; }
.frc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes frc-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* Input row */
.frc-inputrow {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e0e0e0;
	background: #fff;
}

.frc-input {
	flex: 1;
	border: 1px solid #c3c4c7;
	border-radius: 20px;
	padding: 9px 14px;
	font: inherit;
	resize: none;
	max-height: 90px;
}

.frc-input:focus {
	outline: 2px solid var(--frc-accent, #7f54b3);
	outline-offset: -1px;
	border-color: transparent;
}

.frc-send {
	border: none;
	border-radius: 20px;
	padding: 0 18px;
	background: var(--frc-accent, #7f54b3);
	color: var(--frc-on-accent, #fff);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.frc-send:disabled {
	opacity: 0.55;
	cursor: default;
}

/* Error / notice line */
.frc-notice {
	margin: 0 auto 10px;
	padding: 8px 12px;
	border-radius: 8px;
	background: #fcf0f1;
	color: #8a1f1f;
	font-size: 13px;
	text-align: center;
}

/* Screen-reader only */
.frc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 480px) {
	.frc-panel {
		width: calc(100vw - 24px);
		height: 70vh;
	}
}
