/* ==========================================================================
   BOTÓN FLOTANTE DE WHATSAPP, versión 2 (doc: desarrollo/web/boton-whatsapp.md)
   El panel se abre ANCLADO al botón, abajo a la derecha, sin oscurecer ni trabar la página
   (como el de la web de Zytrox). Lo imprime includes/lead-cta/boton-wa.php con el interruptor
   hda_boton_wa_v2_enabled.

   - El contenedor conserva .hda-wa: megamenu.css, megamenu-overlay.css y la barra fúnebre de
     móvil (sticky-funebre.php) lo bajan o lo esconden por esa clase.
   - Dos juegos de colores, como el header: el de la marca (carmesí) y, con
     body.hda-funeral-theme, el fúnebre (gris pizarra). Todo lo demás usa var(--wa2-*).
   - Especificidad >= (0,2,0) y reset propio: el sitio pinta a, button y p (Astra: fondo beige en
     button:hover/:focus; kit de Elementor: text-shadow en los botones; gotchas 34 y 54).
   ========================================================================== */

@font-face {
	/* La misma fuente y el mismo archivo de las secciones de la home: se declara acá porque el
	   botón sale en todo el sitio. El navegador la baja recién cuando el panel se abre. */
	font-family: "HDA Founders Bold";
	src: url("../ocasiones-v2/founders-grotesk-bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

.hda-wa.hda-wa2 {
	--wa2-panel: #7A0D13;                    /* fondo del panel: el carmesí del header */
	--wa2-texto: #FEF3E7;                    /* título */
	--wa2-suave: #F1E0E6;                    /* texto de apoyo: 9,5:1 sobre el carmesí */
	--wa2-boton: #FEF3E7;                    /* "Abrir en este computador" */
	--wa2-boton-texto: #7A0D13;
	--wa2-qr: #2B1520;                       /* módulos del QR, sobre blanco */
	--wa2-linea: rgba(254, 243, 231, .16);
	--wa2-sombra: 0 18px 44px rgba(43, 21, 32, .30), 0 2px 8px rgba(43, 21, 32, .20);
	--wa2-verde: #25D366;

	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99990;
	box-sizing: border-box;
	font-family: "Founders Grotesk Official", Arial, sans-serif;
	font-size: 15px;
	line-height: 24px;
	letter-spacing: normal;
	text-align: left;
}

/* Páginas y fichas fúnebres: los mismos tonos del header fúnebre. */
body.hda-funeral-theme .hda-wa.hda-wa2 {
	--wa2-panel: #4B5568;
	--wa2-texto: #FEF3E7;
	--wa2-suave: #E8EAEE;                    /* 6,2:1 sobre el gris pizarra */
	--wa2-boton: #FEF3E7;
	--wa2-boton-texto: #2E3440;
	--wa2-qr: #2E3440;
	--wa2-linea: rgba(254, 243, 231, .18);
	--wa2-sombra: 0 18px 44px rgba(30, 34, 44, .34), 0 2px 8px rgba(30, 34, 44, .22);
}

.hda-wa2 *,
.hda-wa2 *::before,
.hda-wa2 *::after { box-sizing: border-box; }

/* ---------- El botón ---------- */
.hda-wa2 .hda-wa2__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wa2-verde);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
	text-shadow: none;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	line-height: 0;
	color: #fff;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease;
}

.hda-wa2 .hda-wa2__btn:hover,
.hda-wa2 .hda-wa2__btn:focus { background: var(--wa2-verde); color: #fff; text-decoration: none; }
.hda-wa2 .hda-wa2__btn:focus:not(:focus-visible) { outline: none; }
/* Anillo de dos tonos (blanco por dentro, oscuro por fuera): el botón es fijo y pasa por encima de
   fondos claros y del footer negro; un anillo de un solo color se perdía sobre uno de los dos. */
.hda-wa2 .hda-wa2__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.hda-wa2 .hda-wa2__ic { display: block; width: 30px; height: 30px; }

@media (hover: hover) and (pointer: fine) {
	.hda-wa2 .hda-wa2__btn:hover { transform: scale(1.06); box-shadow: 0 8px 26px rgba(0, 0, 0, .3); }
}

/* La parte oscura del anillo va DESPUÉS del hover: con el mouse encima y el foco puesto, manda el anillo. */
.hda-wa2 .hda-wa2__btn:focus-visible { box-shadow: 0 0 0 8px #2B1520, 0 6px 20px rgba(0, 0, 0, .25); }

/* ---------- El panel, anclado arriba del botón ---------- */
.hda-wa2 .hda-wa2__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 14px);
	width: 300px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 116px);   /* pantallas bajas: el panel desliza por dentro */
	overflow-y: auto;
	margin: 0;
	padding: 26px 22px 20px;
	border-radius: 20px;
	background: var(--wa2-panel);
	box-shadow: var(--wa2-sombra), inset 0 0 0 1px var(--wa2-linea);
	color: var(--wa2-texto);
	text-align: center;
}

.hda-wa2 .hda-wa2__panel[hidden] { display: none; }

.hda-wa2 .hda-wa2__t {
	margin: 0;
	padding: 0 30px 8px;
	font-family: "Qalogre fit", Georgia, serif;
	font-weight: 400;
	font-size: 26px;
	line-height: 1.15;
	letter-spacing: normal;
	text-transform: none;
	text-wrap: balance;
	color: var(--wa2-texto);
}

.hda-wa2 .hda-wa2__hint {
	margin: 0;
	padding: 0 0 18px;
	font-family: "Founders Grotesk Official", Arial, sans-serif;
	font-weight: 400;
	font-size: 15px;
	line-height: 22px;
	text-wrap: balance;
	color: var(--wa2-suave);
}

/* El QR va sobre blanco, con su margen de silencio adentro del dibujo (4 módulos). */
.hda-wa2 .hda-wa2__qr {
	width: 200px;
	height: 200px;
	margin: 0 auto 18px;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	color: var(--wa2-qr);
	line-height: 0;
}

.hda-wa2 .hda-wa2__qr svg { display: block; width: 200px; height: 200px; max-width: none; }

/* Si el QR no se puede dibujar (el número del sitio cambió y el dibujo es del anterior), el panel
   queda con el botón y el número: mejor sin QR que con uno que lleve a otro lado. */
.hda-wa2.hda-wa2--sin-qr .hda-wa2__qr,
.hda-wa2.hda-wa2--sin-qr .hda-wa2__hint { display: none; }
.hda-wa2.hda-wa2--sin-qr .hda-wa2__t { padding-bottom: 18px; }

.hda-wa2 a.hda-wa2__abrir {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 10px 18px;
	border-radius: 60px;
	background: var(--wa2-boton);
	font-family: "HDA Founders Bold", "Founders Grotesk Official", Arial, sans-serif;
	font-weight: 700;
	font-size: 15px;
	line-height: 24px;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	color: var(--wa2-boton-texto);
	transition: background-color .25s;
}

.hda-wa2 a.hda-wa2__abrir:hover,
.hda-wa2 a.hda-wa2__abrir:focus { background: #fff; color: var(--wa2-boton-texto); text-decoration: none; }
.hda-wa2 a.hda-wa2__abrir:focus:not(:focus-visible) { outline: none; }
.hda-wa2 a.hda-wa2__abrir:focus-visible { outline: 3px solid var(--wa2-texto); outline-offset: 3px; }

.hda-wa2 .hda-wa2__num {
	margin: 0;
	padding: 12px 0 0;
	font-family: "Founders Grotesk Official", Arial, sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: .02em;
	color: var(--wa2-suave);
}

.hda-wa2 button.hda-wa2__x {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	text-shadow: none;
	line-height: 0;
	color: var(--wa2-suave);
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.hda-wa2 button.hda-wa2__x:hover,
.hda-wa2 button.hda-wa2__x:focus { background: rgba(254, 243, 231, .14); color: var(--wa2-texto); }
.hda-wa2 button.hda-wa2__x:focus:not(:focus-visible) { outline: none; }
.hda-wa2 button.hda-wa2__x:focus-visible { outline: 3px solid var(--wa2-texto); outline-offset: 2px; }

/* Entrada corta desde el botón. */
@media (prefers-reduced-motion: no-preference) {
	.hda-wa2 .hda-wa2__panel { animation: hda-wa2-entra .2s cubic-bezier(.22, 1, .36, 1); transform-origin: 100% 100%; }
}

@keyframes hda-wa2-entra {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hda-wa2 .hda-wa2__btn { transition: none; }
	.hda-wa2 .hda-wa2__btn:hover { transform: none; }
}

/* Alto contraste de Windows: el panel pierde su fondo, así que se le da un borde. */
@media (forced-colors: active) {
	.hda-wa2 .hda-wa2__panel { border: 1px solid CanvasText; }
	.hda-wa2 .hda-wa2__btn { border: 1px solid ButtonText; }
	.hda-wa2 .hda-wa2__qr { forced-color-adjust: none; }
}

/* Ventanas bajas (un portátil con la ventana a medio alto): el panel se compacta para caber entero. */
@media (max-height: 640px) {
	.hda-wa2 .hda-wa2__panel { padding: 20px 20px 16px; }
	.hda-wa2 .hda-wa2__t { font-size: 23px; padding-bottom: 6px; }
	.hda-wa2 .hda-wa2__hint { padding-bottom: 12px; }
	.hda-wa2 .hda-wa2__qr,
	.hda-wa2 .hda-wa2__qr svg { width: 156px; height: 156px; }
	.hda-wa2 .hda-wa2__qr { margin-bottom: 12px; }
	.hda-wa2 a.hda-wa2__abrir { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
	.hda-wa2 .hda-wa2__num { padding-top: 8px; }
}

@media (max-width: 600px) {
	.hda-wa.hda-wa2 { right: 16px; bottom: 16px; }
}

@media print {
	.hda-wa.hda-wa2 { display: none; }
}
