/* HC Buscador IA — Chatbot. Prefijo .aisc- para no chocar con el tema. */

.aisc-bubble {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 26px rgba(37, 99, 235, .45);
	transition: transform .15s, box-shadow .15s;
}
.aisc-bubble:hover { transform: scale(1.06); }
.aisc-bubble.aisc-open { box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }

.aisc-window {
	position: fixed;
	right: 20px;
	bottom: 90px;
	z-index: 99998;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: aisc-in .18s ease-out;
}
@keyframes aisc-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.aisc-head {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 14px 16px;
	background: linear-gradient(135deg, #2563eb, #3b82f6);
	color: #fff;
}
.aisc-head-dot {
	display: inline-block;
	width: 8px; height: 8px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74, 222, 128, .3);
	margin-right: 6px;
	flex: 0 0 auto;
}
.aisc-avatar {
	width: 40px; height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, .65);
	flex: 0 0 auto;
}
.aisc-head-col { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.aisc-head-title { font-weight: 700; font-size: 15px; }
.aisc-head-sub { font-size: 12px; opacity: .9; display: flex; align-items: center; }

.aisc-wa {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px; height: 30px;
	background: #25D366;          /* verde oficial WhatsApp */
	color: #fff;
	border-radius: 50%;
	margin-right: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	transition: transform .12s, filter .15s;
}
.aisc-wa svg { width: 18px; height: 18px; display: block; }
.aisc-wa:hover { color: #fff; filter: brightness(1.08); transform: scale(1.07); }

/* Enlaces dentro de los mensajes */
.aisc-msg a { color: #2563eb; text-decoration: underline; word-break: break-all; }
.aisc-msg a:hover { opacity: .85; }
.aisc-user a { color: #fff; }

.aisc-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px; height: 30px;
	flex: 0 0 auto;
}
.aisc-close {
	background: none; border: 0; color: #fff;
	font-size: 22px; line-height: 1; cursor: pointer; opacity: .85;
}
.aisc-close:hover { opacity: 1; }

.aisc-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f8fafc;
}

.aisc-msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	margin-bottom: 8px;
	word-wrap: break-word;
}
.aisc-assistant {
	background: #fff;
	color: #111827;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}
.aisc-user {
	background: #2563eb;
	color: #fff;
	margin-left: auto;
	border-bottom-right-radius: 4px;
}

/* Indicador escribiendo */
.aisc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.aisc-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: #9ca3af;
	animation: aisc-b 1.2s infinite;
}
.aisc-typing span:nth-child(2) { animation-delay: .15s; }
.aisc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aisc-b {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Botones rápidos (apilados en columna) */
.aisc-quick { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 4px 0 10px; }
.aisc-quick-btn {
	background: #fff;
	border: 1.5px solid #2563eb;
	color: #2563eb;
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 13px;
	cursor: pointer;
	transition: background .12s, color .12s;
}
.aisc-quick-btn:hover { background: #2563eb; color: #fff; }

/* Tarjetas de producto */
.aisc-products {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 4px 0 10px;
	-webkit-overflow-scrolling: touch;
}
.aisc-card {
	flex: 0 0 130px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 10px;
	text-decoration: none;
	color: #111827;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s;
}
.aisc-card:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, .1); }
.aisc-card img { width: 100%; height: 90px; object-fit: contain; margin-bottom: 6px; }
.aisc-card-name {
	font-size: 12px;
	line-height: 1.3;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.aisc-card-price { font-weight: 700; font-size: 13px; color: #dc2626; }
.aisc-card.aisc-oos { opacity: .55; }

/* Botón WhatsApp */
.aisc-wa { margin: 2px 0 10px; }
.aisc-wa a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #25d366;
	color: #fff;
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.aisc-wa a:hover { background: #1fb457; color: #fff; }

/* Barra de entrada */
.aisc-inputbar {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eef0f4;
	background: #fff;
}
.aisc-input {
	flex: 1;
	height: 42px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	padding: 0 16px;
	font-size: 14px;
	outline: none;
}
.aisc-input:focus { border-color: #2563eb; }
.aisc-send {
	width: 42px; height: 42px;
	border: 0;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.aisc-send:hover { background: #1d4ed8; }

@media (max-width: 480px) {
	.aisc-window { right: 8px; bottom: 84px; height: 70vh; }
	.aisc-bubble { right: 14px; bottom: 14px; }
}
