/* Woo AI Chat — estilos del widget flotante */

#wo-ai-chat-root {
	--wo-ai-chat-primary: #7f54b3; /* morado WooCommerce */
	--wo-ai-chat-primary-dark: #654497;
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Burbuja */
.wo-ai-chat__bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border: none;
	border-radius: 50%;
	background: var(--wo-ai-chat-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background 0.15s ease;
}

.wo-ai-chat__bubble:hover {
	background: var(--wo-ai-chat-primary-dark);
	transform: scale(1.06);
}

.wo-ai-chat__bubble--hidden {
	display: none;
}

/* Panel */
.wo-ai-chat__panel {
	display: none;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 480px;
	max-height: calc(100vh - 48px);
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.wo-ai-chat__panel--open {
	display: flex;
}

.wo-ai-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--wo-ai-chat-primary);
	color: #fff;
}

.wo-ai-chat__title {
	font-size: 15px;
	font-weight: 600;
}

.wo-ai-chat__reset {
	border: none;
	background: transparent;
	color: #fff;
	cursor: pointer;
	padding: 2px 4px;
	margin-right: 2px;
	display: inline-flex;
	align-items: center;
	opacity: 0.85;
}

.wo-ai-chat__reset:hover {
	opacity: 1;
}

.wo-ai-chat__close {
	border: none;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.wo-ai-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f7f7f9;
}

.wo-ai-chat__msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.wo-ai-chat__msg--user {
	align-self: flex-end;
	background: var(--wo-ai-chat-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.wo-ai-chat__msg--bot {
	align-self: flex-start;
	background: #fff;
	color: #1f1f1f;
	border: 1px solid #e3e3e8;
	border-bottom-left-radius: 4px;
}

.wo-ai-chat__msg--bot a {
	color: var(--wo-ai-chat-primary);
	text-decoration: underline;
	word-break: break-all;
}

.wo-ai-chat__msg--bot a:hover {
	text-decoration: none;
}

.wo-ai-chat__msg--typing {
	opacity: 0.6;
	animation: wo-ai-chat-pulse 1s ease-in-out infinite;
}

.wo-ai-chat__msg--human {
	align-self: flex-start;
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: #fef7e6;
	color: #1f1f1f;
	border: 1px solid #f0d896;
	border-bottom-left-radius: 4px;
}

.wo-ai-chat__msg-author {
	font-size: 11px;
	font-weight: 600;
	color: #8a6d1a;
}

.wo-ai-chat__msg--error {
	background: #fdecea;
	border-color: #f5c6c1;
	color: #b3261e;
}

/* ---------- tarjetas de producto ---------- */

.wo-ai-chat__cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
}

.wo-ai-chat__card {
	display: flex;
	gap: 10px;
	background: #fff;
	border: 1px solid #e3e3e8;
	border-radius: 12px;
	padding: 10px;
	align-items: center;
}

.wo-ai-chat__card-img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
	background: #f4f4f6;
}

.wo-ai-chat__card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1;
}

.wo-ai-chat__card-name {
	font-size: 14px;
	font-weight: 600;
	color: #1f1f1f;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wo-ai-chat__card-name:hover {
	color: var(--wo-ai-chat-primary);
	text-decoration: underline;
}

.wo-ai-chat__card-price {
	font-size: 13px;
	color: #616161;
}

.wo-ai-chat__card-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}

.wo-ai-chat__card-btn {
	font-size: 12px;
	padding: 5px 10px;
	border-radius: 999px;
	border: 1px solid var(--wo-ai-chat-primary);
	background: var(--wo-ai-chat-primary);
	color: #fff;
	cursor: pointer;
	line-height: 1.2;
}

.wo-ai-chat__card-btn:hover {
	opacity: 0.85;
}

/* ---------- chips de respuesta rápida ---------- */

.wo-ai-chat__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-self: stretch;
	padding: 2px 0;
}

.wo-ai-chat__chip {
	font-size: 13px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--wo-ai-chat-primary);
	background: #fff;
	color: var(--wo-ai-chat-primary);
	cursor: pointer;
	line-height: 1.2;
}

.wo-ai-chat__chip:hover {
	background: var(--wo-ai-chat-primary);
	color: #fff;
}

@keyframes wo-ai-chat-pulse {
	50% {
		opacity: 0.25;
	}
}

/* Formulario */
.wo-ai-chat__form {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e3e3e8;
	background: #fff;
}

.wo-ai-chat__input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font-size: 14px;
}

.wo-ai-chat__input:focus {
	outline: 2px solid var(--wo-ai-chat-primary);
	outline-offset: -1px;
	border-color: transparent;
}

.wo-ai-chat__send {
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	background: var(--wo-ai-chat-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.wo-ai-chat__send:hover {
	background: var(--wo-ai-chat-primary-dark);
}

.wo-ai-chat__send:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
