#smba-fab-root {
	position: fixed;
	right: 20px;
	bottom: 72px;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--smba-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--smba-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
	--smba-accent: #2271b1;
}

#smba-fab-root .smba-hidden {
	display: none !important;
}

/* ---------------------------------------------------------------
   FAB button
   --------------------------------------------------------------- */

#smba-fab-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: var(--smba-accent);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	transition: transform 160ms var(--smba-ease-out), box-shadow 160ms var(--smba-ease-out);
}

#smba-fab-toggle:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#smba-fab-toggle:active {
	transform: scale(0.94);
}

#smba-fab-toggle .dashicons {
	font-size: 26px;
	width: 26px;
	height: 26px;
	transition: transform 200ms var(--smba-ease-in-out);
}

#smba-fab-root.smba-chat-is-open #smba-fab-toggle .dashicons {
	transform: rotate(90deg);
}

/* ---------------------------------------------------------------
   Attention tooltip — shown briefly after page load
   --------------------------------------------------------------- */

.smba-fab-tooltip {
	position: absolute;
	right: 0;
	bottom: 68px;
	background: #1d2327;
	color: #fff;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	white-space: nowrap;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	opacity: 0;
	transform: translateY(6px) scale(0.97);
	transition: opacity 220ms var(--smba-ease-out), transform 220ms var(--smba-ease-out);
	pointer-events: none;
}

.smba-fab-tooltip::after {
	content: "";
	position: absolute;
	right: 22px;
	bottom: -5px;
	width: 10px;
	height: 10px;
	background: #1d2327;
	transform: rotate(45deg);
}

.smba-fab-tooltip.smba-tooltip-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Overrides the generic .smba-hidden { display: none } above so the
   tooltip can animate out instead of vanishing instantly — chat.js
   toggles visibility via .smba-tooltip-visible (opacity), and only adds
   .smba-hidden back after that transition has finished. */
.smba-fab-tooltip.smba-hidden {
	display: block !important;
}

/* ---------------------------------------------------------------
   Desktop contact buttons / mobile menu
   --------------------------------------------------------------- */

.smba-fab-desktop-contacts {
	display: none;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 10px;
	align-items: flex-end;
}

.smba-contact-btn {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: transform 140ms var(--smba-ease-out), box-shadow 140ms var(--smba-ease-out);
}

.smba-contact-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.smba-contact-btn:active {
	transform: scale(0.94);
}

.smba-contact-call {
	background: var(--smba-accent);
}

.smba-contact-whatsapp {
	background: #25d366;
}

.smba-fab-mobile-menu {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 10px;
	align-items: flex-end;
	transform-origin: bottom right;
}

.smba-fab-mobile-menu:not(.smba-hidden) {
	animation: smbaPopIn 180ms var(--smba-ease-out) both;
}

.smba-fab-option {
	background: #fff;
	color: #1d2327;
	border: 1px solid #dcdcde;
	border-radius: 24px;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	font-size: 14px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: transform 140ms var(--smba-ease-out), box-shadow 140ms var(--smba-ease-out);
}

.smba-fab-option:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.smba-fab-option:active {
	transform: scale(0.96);
}

@media (min-width: 768px) {
	.smba-fab-desktop-contacts {
		display: flex;
	}
	.smba-fab-mobile-menu {
		display: none !important;
	}
}

@media (max-width: 767.98px) {
	.smba-fab-desktop-contacts {
		display: none !important;
	}
}

@keyframes smbaPopIn {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(6px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* ---------------------------------------------------------------
   Chat panel — scales open from the FAB corner, not centered.
   Two-stage toggle: chat.js removes .smba-hidden then adds
   .smba-panel-open a frame later (a transition can't start from
   display:none), and reverses the order on close so the exit
   animation is visible before display:none is reapplied.
   --------------------------------------------------------------- */

.smba-chat-panel {
	position: fixed;
	right: 20px;
	bottom: 90px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 500px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	opacity: 0;
	transform: scale(0.94) translateY(8px);
	transition: opacity 200ms var(--smba-ease-out), transform 200ms var(--smba-ease-out);
}

.smba-chat-panel.smba-panel-open {
	opacity: 1;
	transform: scale(1) translateY(0);
}

.smba-chat-header {
	background: var(--smba-accent);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.smba-chat-header-titles {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.smba-chat-title {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.01em;
}

.smba-chat-subtitle {
	font-size: 11px;
	opacity: 0.85;
}

.smba-chat-header-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.smba-chat-header-actions button {
	background: none;
	border: none;
	color: #fff;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 6px;
	transition: background-color 140ms var(--smba-ease-out), transform 140ms var(--smba-ease-out);
}

.smba-chat-header-actions button:hover {
	background: rgba(255, 255, 255, 0.15);
}

.smba-chat-header-actions button:active {
	transform: scale(0.9);
}

#smba-chat-close {
	font-size: 20px;
}

#smba-chat-reset .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.smba-chat-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f7f7;
}

/* ---------------------------------------------------------------
   Messages — fade + rise in, never appear instantly
   --------------------------------------------------------------- */

.smba-msg {
	max-width: 85%;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.4;
	animation: smbaMsgIn 220ms var(--smba-ease-out) both;
}

@keyframes smbaMsgIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.smba-msg-bot {
	background: #fff;
	border: 1px solid #e2e2e2;
	align-self: flex-start;
}

.smba-msg-user {
	background: var(--smba-accent);
	color: #fff;
	align-self: flex-end;
}

.smba-msg-error {
	background: #fcf0f1;
	border: 1px solid #f5c6c7;
	color: #8a1f1f;
	align-self: stretch;
}

/* ---------------------------------------------------------------
   Typing indicator — three breathing dots
   --------------------------------------------------------------- */

.smba-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	padding: 10px 14px;
	align-self: flex-start;
	animation: smbaMsgIn 200ms var(--smba-ease-out) both;
}

.smba-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9199a1;
	animation: smbaTypingBounce 1.1s var(--smba-ease-in-out) infinite;
}

.smba-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.smba-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes smbaTypingBounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* ---------------------------------------------------------------
   Answer chips — staggered entrance
   --------------------------------------------------------------- */

.smba-chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
	align-self: stretch;
}

.smba-chip-row .smba-chip,
.smba-chip-row .smba-chip-contact {
	animation: smbaMsgIn 200ms var(--smba-ease-out) both;
}

.smba-chip-row > *:nth-child(1) { animation-delay: 0ms; }
.smba-chip-row > *:nth-child(2) { animation-delay: 40ms; }
.smba-chip-row > *:nth-child(3) { animation-delay: 80ms; }
.smba-chip-row > *:nth-child(4) { animation-delay: 120ms; }
.smba-chip-row > *:nth-child(5) { animation-delay: 160ms; }
.smba-chip-row > *:nth-child(n+6) { animation-delay: 200ms; }

.smba-chip {
	background: #fff;
	border: 1px solid var(--smba-accent);
	color: var(--smba-accent);
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	transition: background-color 140ms var(--smba-ease-out), color 140ms var(--smba-ease-out), transform 100ms var(--smba-ease-out);
}

.smba-chip:hover {
	background: var(--smba-accent);
	color: #fff;
}

.smba-chip:active {
	transform: scale(0.95);
}

.smba-chip-noidea {
	border-color: #8c8f94;
	color: #50575e;
}

.smba-chip-noidea:hover {
	background: #50575e;
	color: #fff;
}

/* ---------------------------------------------------------------
   Human-contact buttons — real button affordance (icon + fill +
   tactile press), not a plain text link. Used inside error and
   fallback messages.
   --------------------------------------------------------------- */

.smba-chip-contact {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 16px;
	padding: 7px 14px 7px 10px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: none;
	color: #fff;
	transition: transform 120ms var(--smba-ease-out), box-shadow 120ms var(--smba-ease-out), filter 120ms var(--smba-ease-out);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.smba-chip-contact .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

.smba-chip-contact:hover {
	filter: brightness(1.08);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
	transform: translateY(-1px);
}

.smba-chip-contact:active {
	transform: scale(0.95) translateY(0);
}

.smba-chip-contact-call {
	background: var(--smba-accent);
}

.smba-chip-contact-whatsapp {
	background: #25d366;
}

/* ---------------------------------------------------------------
   Chat footer / free-text input
   --------------------------------------------------------------- */

.smba-chat-footer {
	padding: 10px;
	border-top: 1px solid #e2e2e2;
	display: flex;
	gap: 8px;
}

.smba-chat-footer input[type="text"] {
	flex: 1;
	padding: 8px 10px;
	border: 1px solid #dcdcde;
	border-radius: 18px;
	font-size: 13px;
	transition: border-color 140ms var(--smba-ease-out);
}

.smba-chat-footer input[type="text"]:focus {
	border-color: var(--smba-accent);
	outline: none;
}

.smba-chat-footer button {
	background: var(--smba-accent);
	color: #fff;
	border: none;
	border-radius: 18px;
	padding: 0 16px;
	cursor: pointer;
	font-size: 13px;
	transition: transform 120ms var(--smba-ease-out);
}

.smba-chat-footer button:active {
	transform: scale(0.95);
}

/* ---------------------------------------------------------------
   Product recommendation card
   --------------------------------------------------------------- */

.smba-product-card {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 10px;
	align-self: stretch;
	animation: smbaMsgIn 240ms var(--smba-ease-out) both;
}

.smba-product-card img {
	width: 100%;
	max-width: 140px;
	display: block;
	margin: 0 auto 8px;
	border-radius: 6px;
}

.smba-product-card .smba-product-name {
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 4px;
}

.smba-product-card .smba-product-price {
	color: var(--smba-accent);
	font-weight: 600;
	margin-bottom: 8px;
}

.smba-product-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.smba-product-actions a,
.smba-product-actions button {
	flex: 1;
	text-align: center;
	font-size: 12px;
	padding: 8px 6px;
	border-radius: 6px;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid var(--smba-accent);
	background: #fff;
	color: var(--smba-accent);
	transition: transform 120ms var(--smba-ease-out), background-color 120ms var(--smba-ease-out), color 120ms var(--smba-ease-out);
}

.smba-product-actions a:hover,
.smba-product-actions button:hover {
	background: var(--smba-accent);
	color: #fff;
}

.smba-product-actions a:active,
.smba-product-actions button:active {
	transform: scale(0.96);
}

.smba-product-actions .smba-btn-primary {
	background: var(--smba-accent);
	color: #fff;
}

.smba-product-actions .smba-btn-whatsapp {
	background: #25d366;
	color: #fff;
	border-color: #25d366;
}

.smba-product-actions .smba-btn-whatsapp:hover {
	background: #1fb958;
}

/* ---------------------------------------------------------------
   Reduced motion — keep state-indicating fades, drop movement
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.smba-msg,
	.smba-product-card,
	.smba-fab-mobile-menu:not(.smba-hidden) {
		animation-duration: 1ms !important;
		animation-delay: 0ms !important;
	}
	.smba-chat-panel,
	#smba-fab-toggle,
	#smba-fab-toggle .dashicons {
		transition-duration: 1ms !important;
	}
	.smba-typing span {
		animation: none;
		opacity: 0.8;
	}
}
