/* SAC Pro - Hero Theme · WhatsApp-like AInnovaLAB
 * Replace the original Hero CSS with this file.
 * Author-message alignment uses the .ainnovalab-author-message class added by
 * functions.php v1.1.12+.
 */

:root {
	--sac-wa-bg: #ebf5f1;
	--sac-wa-panel: #f0f2f5;
	--sac-wa-in: #ffffff;
	--sac-wa-out: #d9fdd3;
	--sac-wa-text: #111b21;
	--sac-wa-muted: #667781;
	--sac-wa-name: #008069;
	--sac-wa-accent: #00a884;
	--sac-wa-accent-hover: #008f72;
	--sac-wa-border: #d8dbdf;
	--sac-wa-error: #d93025;
	--sac-wa-shadow: 0 1px 1px rgba(11,20,26,.13);
}

.sacpro {
	box-sizing: border-box;
	width: 100%;
	overflow: hidden;
	background: var(--sac-wa-panel);
	border: 1px solid var(--sac-wa-border);
	border-radius: 14px;
	box-shadow: 0 2px 10px rgba(11,20,26,.08);
	color: var(--sac-wa-text);
}

.sacpro-box {
	position: relative;
	float: none;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.sacpro-box-inner {
	box-sizing: border-box;
	height: 560px;
	min-height: 320px;
	max-height: 72vh;
	overflow-y: auto;
	overflow-x: hidden;
	resize: vertical;
	border: 0;
	border-radius: 14px 14px 0 0;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: rgba(11,20,26,.22) transparent;
	background-color: var(--sac-wa-bg);
	background-image:
		radial-gradient(circle at 20px 20px, rgba(11,20,26,.025) 1.2px, transparent 1.4px),
		radial-gradient(circle at 52px 46px, rgba(11,20,26,.018) 1.1px, transparent 1.3px);
	background-size: 72px 72px;
}

.sacpro-box-inner::-webkit-scrollbar { width: 8px; }
.sacpro-box-inner::-webkit-scrollbar-thumb {
	background: rgba(11,20,26,.20);
	border-radius: 999px;
}

.sacpro-error {
	display: none;
	position: sticky;
	z-index: 99;
	top: 0;
	left: 0;
	right: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 10px 14px;
	line-height: 20px;
	font-size: 13px;
	background: var(--sac-wa-error);
	color: #fff;
	text-shadow: none;
}

.sacpro-error::before {
	content: '\02757';
	display: inline-block;
	vertical-align: middle;
	margin: -2px 6px 0 0;
	line-height: 12px;
	font-size: 12px;
}

.sacpro-latest-message { display: none !important; }

.sacpro-chats {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 12px 0 18px;
	overflow: visible;
}

.sacpro-chat {
	float: none;
	clear: both;
	position: relative;
	box-sizing: border-box;
	width: fit-content;
	width: -moz-fit-content;
	max-width: min(78%, 720px);
	margin: 7px auto 7px 12px;
	padding: 6px 8px 5px;
	line-height: 1.38;
	font-size: 14px;
	color: var(--sac-wa-text);
	background: var(--sac-wa-in);
	background-image: none !important;
	border: 0;
	border-radius: 8px;
	box-shadow: var(--sac-wa-shadow);
}

.sacpro-chat:not(.ainnovalab-author-message)::before {
	content: "";
	position: absolute;
	top: 0;
	left: -7px;
	width: 10px;
	height: 12px;
	background: var(--sac-wa-in);
	clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.sacpro-chat.ainnovalab-author-message {
	margin-left: auto;
	margin-right: 12px;
	background: var(--sac-wa-out);
}

.sacpro-chat.ainnovalab-author-message::after {
	content: "";
	position: absolute;
	top: 0;
	right: -7px;
	width: 10px;
	height: 12px;
	background: var(--sac-wa-out);
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.sacpro-chat .sacpro-chat-avatar,
.sacpro-chat .sacpro-chat-avatar-placeholder {
	display: none !important;
}

.sacpro-chat .sacpro-chat-name-wrap,
.sacpro-chat .sacpro-chat-text-wrap {
	display: block;
	box-sizing: border-box;
	width: auto;
	max-width: none !important;
	margin: 0;
	background: transparent !important;
	border: 0;
	border-radius: 0;
}

.sacpro-chat .sacpro-chat-name-wrap {
	padding: 0 2px 2px;
	line-height: 1.2;
}

.sacpro-chat .sacpro-chat-text-wrap {
	padding: 0 2px;
	line-height: 1.42;
}

.sacpro-chat .sacpro-chat-name {
	font-size: 12.5px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--sac-wa-name);
	cursor: default;
}

.sacpro-chat.ainnovalab-author-message .sacpro-chat-name {
	color: #1f6f5c;
	font-weight: 800;
}

.sacpro-chat .sacpro-chat-name-meta,
.sacpro-chat .sacpro-chat-sep {
	display: none !important;
}

.sacpro-chat .sacpro-chat-text {
	display: inline;
	color: var(--sac-wa-text);
	font-size: 14.2px;
	line-height: 1.42;
	white-space: pre-wrap !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
	text-overflow: clip !important;
	-webkit-line-clamp: unset !important;
	line-clamp: unset !important;
}

.sacpro-chat .sacpro-chat-date-time {
	display: block;
	margin: 3px 1px 0 28px;
	padding: 0;
	text-align: right;
	font-size: 10px;
	line-height: 1.1;
	font-weight: 400;
	color: var(--sac-wa-muted);
	white-space: nowrap;
}

.sacpro-chats .sacpro-chat a {
	border: 0;
	color: #027eb5;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	box-shadow: none;
}

.sacpro-chats .sacpro-chat a:hover {
	border: 0;
	text-decoration: none;
	box-shadow: none;
}

.sacpro-chat img.sacpro-chat-image {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

#sacpro .sacpro-form {
	float: none;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 9px 10px;
	background: var(--sac-wa-panel);
	border-top: 1px solid rgba(11,20,26,.06);
}

#sacpro .sacpro-form form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: end;
	margin: 0;
}

#sacpro .sacpro-form .sacpro-form-name,
#sacpro .sacpro-form .sacpro-form-url {
	display: none !important;
}

#sacpro .sacpro-form fieldset {
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	padding: 0;
	outline: none;
	border: 0;
}

#sacpro .sacpro-form .sacpro-form-text {
	grid-column: 1;
}

#sacpro .sacpro-form .sacpro-form-submit {
	grid-column: 2;
	position: relative;
	align-self: end;
}

#sacpro .sacpro-form .sacpro-form-label {
	display: none !important;
}

#sacpro .sacpro-form .sacpro-form-textarea-wrap {
	display: block;
	width: 100%;
}

#sacpro .sacpro-form .sacpro-form-textarea,
#sacpro .sacpro-form .sacpro-form-input-text {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 46px;
	min-height: 46px;
	max-height: 150px;
	margin: 0;
	padding: 12px 16px;
	resize: vertical;
	border: 1px solid transparent;
	border-radius: 23px;
	outline: none;
	background: #fff;
	color: var(--sac-wa-text);
	line-height: 20px;
	font-size: 14px;
	font-weight: 400;
	font-family: inherit;
	box-shadow: none;
}

#sacpro .sacpro-form .sacpro-form-textarea:focus,
#sacpro .sacpro-form .sacpro-form-input-text:focus {
	border-color: rgba(0,168,132,.35);
	box-shadow: 0 0 0 2px rgba(0,168,132,.08);
}

#sacpro .sacpro-form .sacpro-form-textarea::placeholder,
#sacpro .sacpro-form .sacpro-form-input-text::placeholder {
	color: #8696a0;
	opacity: 1;
}

#sacpro .sacpro-form .sacpro-form-submit-button {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;

	min-width: 108px !important;
	width: auto !important;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 18px 0 42px !important;

	border: 0 !important;
	border-radius: 23px !important;
	outline: 0 !important;
	cursor: pointer !important;

	background-color: var(--sac-wa-accent) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M21 3L10.4 13.6M21 3l-6.6 18-4-7.4L3 9.6 21 3z' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: 14px center !important;
	background-size: 21px 21px !important;

	color: #fff !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 46px !important;
	text-indent: 0 !important;
	text-shadow: none !important;
	box-shadow: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: background-color .15s ease, transform .15s ease, opacity .15s ease;
}

#sacpro .sacpro-form .sacpro-form-submit-button:hover:not(:disabled) {
	background-color: var(--sac-wa-accent-hover) !important;
	color: #fff !important;
}

#sacpro .sacpro-form .sacpro-form-submit-button:active:not(:disabled) {
	transform: scale(.98);
}

#sacpro .sacpro-form .sacpro-form-submit-button:disabled {
	opacity: .42;
	cursor: default !important;
}

.sacpro-count-chars,
.sacpro-form-name-static {
	display: none !important;
}

.sacpro-chatbox-before,
.sacpro-chatbox-after,
.sacpro-chatform-before,
.sacpro-chatform-after {
	margin: 0;
}

#sacpro.sacpro-classic-narrow .sacpro-box,
#sacpro.sacpro-classic-narrow .sacpro-form {
	float: none;
	width: 100%;
	min-width: 0;
	padding-left: 10px;
	padding-right: 10px;
}

@media (max-width: 640px) {
	.sacpro { border-radius: 10px; }

	.sacpro-box-inner {
		height: 62vh;
		min-height: 360px;
		max-height: 72vh;
		border-radius: 10px 10px 0 0;
	}

	.sacpro-chat {
		max-width: 88%;
		margin-left: 9px;
	}

	.sacpro-chat.ainnovalab-author-message {
		margin-left: auto;
		margin-right: 9px;
	}

	#sacpro .sacpro-form { padding: 8px; }

	#sacpro .sacpro-form .sacpro-form-textarea,
	#sacpro .sacpro-form .sacpro-form-input-text {
		height: 44px;
		min-height: 44px;
		border-radius: 22px;
	}

	#sacpro .sacpro-form .sacpro-form-submit-button {
		height: 44px !important;
		min-width: 104px !important;
		border-radius: 22px !important;
		line-height: 44px !important;
	}
}


/* ==========================================================
   AInnovaLAB · Replies / respuestas vinculadas
   ========================================================== */

/* "Responder" visible tanto arriba como abajo del bocadillo */
.sacpro-chat .sacpro-chat-date-time {
	display: flex !important;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 7px;
}

/* Dejamos sitio para el botón superior para que no tape el nombre */
.sacpro-chat .sacpro-chat-name-wrap {
	padding-right: 102px !important;
	min-height: 23px;
}

.ainnovalab-reply-button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 5px !important;

	margin: 0 !important;
	border: 1px solid rgba(0, 128, 105, .30) !important;
	border-radius: 999px !important;

	background: #e7f7f1 !important;
	color: #007a65 !important;

	font-family: inherit !important;
	font-weight: 700 !important;
	line-height: 1 !important;

	cursor: pointer !important;
	opacity: 1 !important;
	box-shadow: 0 1px 2px rgba(11,20,26,.08) !important;
	text-decoration: none !important;

	transition:
		background-color .15s ease,
		border-color .15s ease,
		color .15s ease,
		transform .15s ease,
		box-shadow .15s ease;
}

.ainnovalab-reply-button:hover,
.ainnovalab-reply-button:focus {
	background: #d4f2e7 !important;
	border-color: rgba(0, 128, 105, .55) !important;
	color: #005f50 !important;
	outline: none !important;
	box-shadow: 0 2px 5px rgba(11,20,26,.13) !important;
}

.ainnovalab-reply-button:active {
	transform: scale(.97);
}

.ainnovalab-reply-icon {
	font-size: 14px;
	line-height: 1;
	font-weight: 800;
}

/* Botón principal: siempre visible arriba a la derecha */
.ainnovalab-reply-button-top {
	position: absolute !important;
	z-index: 4;
	top: 6px;
	right: 7px;

	padding: 6px 10px !important;
	font-size: 11px !important;

	background: #00a884 !important;
	border-color: #00a884 !important;
	color: #fff !important;

	box-shadow: 0 2px 5px rgba(0, 100, 80, .20) !important;
}

.ainnovalab-reply-button-top:hover,
.ainnovalab-reply-button-top:focus {
	background: #008f72 !important;
	border-color: #008f72 !important;
	color: #fff !important;
}

/* Segundo botón: junto a la fecha, también claramente visible */
.ainnovalab-reply-button-bottom {
	padding: 4px 8px !important;
	font-size: 10.5px !important;
}

.ainnovalab-reply-bottom-fallback {
	display: flex;
	justify-content: flex-end;
	margin-top: 7px;
}

/* Cita del mensaje al que se responde */
.ainnovalab-reply-quote {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 1px 0 7px;
	padding: 7px 9px 7px 11px;
	border: 0;
	border-left: 3px solid #00a884;
	border-radius: 6px;
	background: rgba(11, 20, 26, .055);
	color: var(--sac-wa-text);
	text-align: left;
	font-family: inherit;
	cursor: pointer;
	box-shadow: none;
}

.sacpro-chat.ainnovalab-author-message .ainnovalab-reply-quote {
	background: rgba(255, 255, 255, .48);
}

.ainnovalab-reply-quote:hover,
.ainnovalab-reply-quote:focus {
	background: rgba(11, 20, 26, .085);
	outline: none;
}

.sacpro-chat.ainnovalab-author-message .ainnovalab-reply-quote:hover,
.sacpro-chat.ainnovalab-author-message .ainnovalab-reply-quote:focus {
	background: rgba(255, 255, 255, .68);
}

.ainnovalab-reply-quote-author {
	display: block;
	margin: 0 0 2px;
	color: #008069;
	font-size: 11.5px;
	line-height: 1.25;
	font-weight: 700;
}

.ainnovalab-reply-quote-text {
	display: -webkit-box;
	max-height: 2.7em;
	overflow: hidden;
	color: #54656f;
	font-size: 11.5px;
	line-height: 1.35;
	font-weight: 400;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* Barra "Respondiendo a..." encima del cuadro de escritura */
.ainnovalab-reply-composer {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: -1px 0 8px;
	padding: 8px 10px 8px 12px;
	border-left: 4px solid #00a884;
	border-radius: 7px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(11,20,26,.08);
}

.ainnovalab-reply-composer[hidden] {
	display: none !important;
}

.ainnovalab-reply-composer-copy {
	display: block;
	min-width: 0;
	flex: 1 1 auto;
}

.ainnovalab-reply-composer-label {
	display: block;
	margin-bottom: 2px;
	color: #008069;
	font-size: 12px;
	line-height: 1.25;
}

.ainnovalab-reply-composer-text {
	display: block;
	overflow: hidden;
	color: #667781;
	font-size: 12px;
	line-height: 1.3;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ainnovalab-reply-cancel {
	flex: 0 0 auto;
	margin: 0;
	padding: 5px 7px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #667781;
	font-family: inherit;
	font-size: 11.5px;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
}

.ainnovalab-reply-cancel:hover,
.ainnovalab-reply-cancel:focus {
	background: rgba(11,20,26,.06);
	color: #111b21;
	outline: none;
}

/* Destello al pulsar una cita y saltar al mensaje original */
.sacpro-chat.ainnovalab-reply-target-highlight {
	animation: innovalab-reply-highlight 1.8s ease-out;
}

@keyframes innovalab-reply-highlight {
	0%   { box-shadow: 0 0 0 3px rgba(0,168,132,.48), var(--sac-wa-shadow); }
	35%  { box-shadow: 0 0 0 5px rgba(0,168,132,.20), var(--sac-wa-shadow); }
	100% { box-shadow: var(--sac-wa-shadow); }
}

@media (max-width: 640px) {
	.ainnovalab-reply-button-top {
		top: 5px;
		right: 6px;
		padding: 5px 8px !important;
		font-size: 10px !important;
	}

	.ainnovalab-reply-button-bottom {
		padding: 4px 7px !important;
		font-size: 10px !important;
	}

	.sacpro-chat .sacpro-chat-name-wrap {
		padding-right: 90px !important;
	}

	.ainnovalab-reply-composer {
		padding: 8px 9px 8px 10px;
	}

	.ainnovalab-reply-cancel {
		font-size: 0;
		width: 30px;
		height: 30px;
		padding: 0;
	}

	.ainnovalab-reply-cancel::after {
		content: "×";
		font-size: 22px;
		line-height: 30px;
	}
}
