/**
 * LLARS COMPARTIR V1 — estilos del botón flotante y el menú de canales.
 * Identidad LLARS MEDITERRÀNIES: primario #222983.
 * Todos los selectores llevan el prefijo #llars-compartir para ganar con
 * determinismo a las reglas globales del kit de Elementor (.elementor-kit-7 button).
 * Convive con el botón de WhatsApp (Click to Chat #ht-ctc-chat: bottom 15px, right 15px, 50px):
 * este botón se sitúa justo encima (bottom 77px) y baja a 15px si CTC no está visible.
 * Accesible: objetivos táctiles >= 44px, anillo de foco visible, respeta prefers-reduced-motion.
 */

#llars-compartir {
	position: fixed;
	right: 15px;
	bottom: 77px; /* sobre el botón de WhatsApp (15px + 50px + 12px de aire) */
	z-index: 99990;
	font-family: inherit;
	line-height: 1;
}

/* Ajuste: si Click to Chat no está presente o permanece oculto, ocupa su sitio */
#llars-compartir.llars-share--no-ctc { bottom: 15px; }

/* ---------- Botón principal ---------- */

#llars-compartir .llars-share-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background-color: #ffffff;
	color: #222983;
	box-shadow: 0 3px 14px rgba(16, 21, 67, 0.22);
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}

#llars-compartir .llars-share-btn svg {
	display: block;
	width: 24px;
	height: 24px;
	pointer-events: none;
}

#llars-compartir .llars-share-btn:hover,
#llars-compartir .llars-share-btn:focus-visible {
	background-color: #222983;
	color: #ffffff;
	transform: translateY(-1px);
}

#llars-compartir .llars-share-btn:focus-visible,
#llars-compartir .llars-share-item:focus-visible {
	outline: 3px solid #222983;
	outline-offset: 2px;
}

#llars-compartir.is-open .llars-share-btn {
	background-color: #222983;
	color: #ffffff;
}

/* ---------- Menú de canales ---------- */

#llars-compartir .llars-share-menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 12px);
	width: min(280px, calc(100vw - 30px));
	margin: 0;
	padding: 8px;
	list-style: none;
	background-color: #ffffff;
	border-radius: 16px;
	border: 1px solid rgba(34, 41, 131, 0.08);
	box-shadow: 0 12px 40px rgba(16, 21, 67, 0.28);
	opacity: 0;
	visibility: hidden; /* sin foco alcanzable mientras está cerrado */
	transform: translateY(8px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
	pointer-events: none;
}

#llars-compartir.is-open .llars-share-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
	pointer-events: auto;
}

#llars-compartir .llars-share-title {
	padding: 8px 12px 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a90b8;
	user-select: none;
}

#llars-compartir .llars-share-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	margin: 0;
	border: 0;
	border-radius: 10px;
	background-color: transparent;
	color: #1d2430;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

#llars-compartir .llars-share-item:hover {
	background-color: #f1f3fd;
	color: #222983;
}

#llars-compartir .llars-share-item svg {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

#llars-compartir .llars-share-item .llars-share-item-note {
	margin-left: auto;
	font-size: 12px;
	font-weight: 400;
	color: #9aa0c3;
}

/* ---------- Aviso «Enlace copiado» ---------- */

#llars-compartir .llars-share-toast {
	position: absolute;
	right: 4px;
	bottom: calc(100% + 14px);
	padding: 10px 16px;
	border-radius: 999px;
	background-color: #1d2430;
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	box-shadow: 0 8px 24px rgba(16, 21, 67, 0.35);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}

#llars-compartir .llars-share-toast.is-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Movimiento reducido e impresión ---------- */

@media (prefers-reduced-motion: reduce) {
	#llars-compartir .llars-share-btn,
	#llars-compartir .llars-share-menu,
	#llars-compartir .llars-share-toast { transition: none; }
}

@media print {
	#llars-compartir { display: none !important; }
}
