/* MyFisio WhatsApp Multi-Centro */

.mfwa {
	--mfwa-green: #25d366;
	--mfwa-green-dark: #128c7e;
	--mfwa-text: #1f2933;
	--mfwa-muted: #667085;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	font-family: inherit;
	line-height: 1.4;
}

/* ---------- Botón flotante ---------- */

/* Selectores reforzados: el tema resetea button/a y repinta color y fondo. */
.mfwa .mfwa-btn,
.mfwa button.mfwa-btn,
.mfwa a.mfwa-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 56px !important;
	min-width: 56px;
	max-width: 56px;
	height: 56px !important;
	min-height: 56px;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--mfwa-green) !important;
	background-image: none !important;
	color: #fff !important;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
	-webkit-tap-highlight-color: transparent;
}

.mfwa .mfwa-btn:hover,
.mfwa .mfwa-btn:focus-visible {
	background: var(--mfwa-green-dark) !important;
	color: #fff !important;
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
	outline: none;
}

.mfwa .mfwa-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(37, 211, 102, .45), 0 6px 18px rgba(0, 0, 0, .3);
}

.mfwa .mfwa-btn__ico {
	width: 32px !important;
	height: 32px !important;
	fill: #fff !important;
	transition: transform .25s ease, opacity .2s ease;
}

.mfwa.is-open .mfwa-btn__ico {
	transform: rotate(90deg) scale(.85);
	opacity: .85;
}

/* Pulso sutil de llamada de atención */
.mfwa-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--mfwa-green);
	animation: mfwa-pulse 2.6s ease-out infinite;
	pointer-events: none;
}

.mfwa.is-open .mfwa-btn::after,
.mfwa-btn:hover::after {
	animation: none;
	opacity: 0;
}

@keyframes mfwa-pulse {
	0%   { transform: scale(1);   opacity: .7; }
	70%  { transform: scale(1.5); opacity: 0; }
	100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Globo de bienvenida ---------- */

.mfwa-bubble {
	position: absolute;
	right: 4px;
	bottom: 72px;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	/* El contenedor .mfwa mide lo que el botón: sin width:max-content el texto se parte. */
	width: max-content;
	max-width: min(260px, calc(100vw - 60px));
	padding: 12px 14px;
	border-radius: 16px 16px 4px 16px;
	background: #fff;
	color: var(--mfwa-text);
	font-size: 14px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}

.mfwa-bubble.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.mfwa-bubble__close {
	flex: 0 0 auto;
	padding: 0;
	border: 0;
	background: none;
	color: var(--mfwa-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

/* ---------- Panel de centros ---------- */

.mfwa-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: min(340px, calc(100vw - 40px));
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	color: var(--mfwa-text);
	box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
	opacity: 0;
	transform: translateY(12px) scale(.97);
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .22s ease;
}

.mfwa.is-open .mfwa-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.mfwa-panel__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 18px 16px;
	background: var(--mfwa-green-dark);
	color: #fff;
}

.mfwa-panel__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
}

.mfwa-panel__sub {
	margin: 4px 0 0;
	font-size: 13px;
	color: rgba(255, 255, 255, .85);
}

.mfwa .mfwa-close,
.mfwa button.mfwa-close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px !important;
	min-width: 28px;
	height: 28px !important;
	min-height: 28px;
	margin: 0 0 0 auto;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, .15) !important;
	color: #fff !important;
	cursor: pointer;
	transition: background-color .2s ease;
}

.mfwa .mfwa-close:hover,
.mfwa .mfwa-close:focus-visible {
	background: rgba(255, 255, 255, .3) !important;
	outline: none;
}

.mfwa .mfwa-close svg {
	width: 14px !important;
	height: 14px !important;
	fill: #fff !important;
}

.mfwa-list {
	max-height: min(60vh, 420px);
	margin: 0;
	padding: 8px;
	overflow-y: auto;
	list-style: none;
}

.mfwa-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mfwa-item + .mfwa-item {
	border-top: 1px solid #eef0f3;
}

.mfwa .mfwa-item__link,
.mfwa a.mfwa-item__link {
	color: var(--mfwa-text) !important;
	text-decoration: none !important;
	box-shadow: none !important;
}

.mfwa .mfwa-item__name {
	color: var(--mfwa-text) !important;
}

.mfwa .mfwa-item__cta {
	background: var(--mfwa-green) !important;
	color: #fff !important;
}

.mfwa .mfwa-item__link:hover .mfwa-item__cta,
.mfwa .mfwa-item__link:focus-visible .mfwa-item__cta {
	background: var(--mfwa-green-dark) !important;
}

.mfwa .mfwa-bubble {
	color: var(--mfwa-text);
}

.mfwa .mfwa-bubble__close,
.mfwa button.mfwa-bubble__close {
	width: auto !important;
	height: auto !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	color: var(--mfwa-muted) !important;
}

.mfwa-item__link {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-areas:
		"pin body"
		"cta cta";
	gap: 4px 12px;
	padding: 14px 12px;
	border-radius: 12px;
	color: inherit;
	text-decoration: none;
	transition: background-color .18s ease;
}

.mfwa-item__link:hover,
.mfwa-item__link:focus-visible {
	background: #f2fbf5;
	outline: none;
}

.mfwa-item__pin {
	grid-area: pin;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(37, 211, 102, .14);
	color: var(--mfwa-green-dark);
}

.mfwa-item__pin svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.mfwa-item__body {
	grid-area: body;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.mfwa-item__name {
	font-size: 15px;
	font-weight: 700;
}

.mfwa-item__addr,
.mfwa-item__hours {
	font-size: 13px;
	color: var(--mfwa-muted);
}

.mfwa-item__cta {
	grid-area: cta;
	justify-self: start;
	margin-top: 8px;
	margin-left: 46px;
	padding: 7px 16px;
	border-radius: 999px;
	background: var(--mfwa-green);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
}

.mfwa-item__link:hover .mfwa-item__cta,
.mfwa-item__link:focus-visible .mfwa-item__cta {
	background: var(--mfwa-green-dark);
}

/* ---------- Fondo oscuro (móvil) ---------- */

.mfwa-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 32, .45);
	opacity: 0;
	transition: opacity .22s ease;
	pointer-events: none;
}

@media (max-width: 600px) {
	.mfwa-backdrop {
		display: block;
	}

	.mfwa.is-open .mfwa-backdrop {
		opacity: 1;
		pointer-events: auto;
	}
}

/* ---------- Móvil: hoja inferior ---------- */

@media (max-width: 600px) {
	.mfwa-panel {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
		transform-origin: bottom center;
	}

	.mfwa.is-open .mfwa-panel {
		transform: translateY(0);
	}

	.mfwa-list {
		max-height: 55vh;
		padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.mfwa-btn,
	.mfwa-btn__ico,
	.mfwa-panel,
	.mfwa-bubble,
	.mfwa-backdrop {
		transition: none;
	}

	.mfwa-btn::after {
		animation: none;
	}
}

/* No tapar el botón "volver arriba" u otros widgets con print */
@media print {
	.mfwa {
		display: none;
	}
}
