/**
 * Sticky floating actions — WhatsApp (right) + back to top (left), separate.
 */

.peng-sticky,
.peng-sticky.peng-framework {
	--peng-sticky-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--peng-sticky-size: 56px;
	position: fixed;
	bottom: max(18px, env(safe-area-inset-bottom, 0px));
	z-index: 9998;
	display: block;
	width: var(--peng-sticky-size);
	height: var(--peng-sticky-size);
	margin: 0;
	padding: 0;
	pointer-events: none;
	font-family: var(--peng-font);
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* WhatsApp alone — physical right */
.peng-sticky--wa {
	right: max(18px, env(safe-area-inset-right, 0px));
	left: auto;
	overflow: visible;
	width: auto;
	height: auto;
	min-width: var(--peng-sticky-size);
	min-height: var(--peng-sticky-size);
}

/* Back to top alone — physical left */
.peng-sticky--top {
	left: max(18px, env(safe-area-inset-left, 0px));
	right: auto;
}

.peng-sticky *,
.peng-sticky *::before,
.peng-sticky *::after {
	box-sizing: border-box;
}

/* Beat theme / Elementor button styles — always a perfect circle */
.peng-sticky .peng-sticky__btn,
.peng-sticky a.peng-sticky__btn,
.peng-sticky button.peng-sticky__btn,
.peng-framework.peng-sticky .peng-sticky__btn,
.peng-framework.peng-sticky button.peng-sticky__btn {
	pointer-events: auto;
	position: relative;
	display: grid !important;
	place-items: center !important;
	gap: 0 !important;
	width: var(--peng-sticky-size) !important;
	height: var(--peng-sticky-size) !important;
	min-width: var(--peng-sticky-size) !important;
	min-height: var(--peng-sticky-size) !important;
	max-width: var(--peng-sticky-size) !important;
	max-height: var(--peng-sticky-size) !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 50% !important;
	aspect-ratio: 1 / 1 !important;
	line-height: 0 !important;
	font-size: 0 !important;
	text-align: center !important;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	cursor: pointer;
	appearance: none !important;
	-webkit-appearance: none !important;
	-webkit-tap-highlight-color: transparent;
	isolation: isolate;
	overflow: visible;
	transition:
		transform 280ms var(--peng-sticky-ease),
		box-shadow 280ms var(--peng-sticky-ease),
		background-color 220ms ease,
		border-color 220ms ease,
		opacity 280ms var(--peng-sticky-ease),
		visibility 280ms var(--peng-sticky-ease);
}

.peng-sticky .peng-sticky__btn:focus-visible {
	outline: 2px solid #ffffff !important;
	outline-offset: 3px;
}

.peng-sticky .peng-sticky__icon {
	position: relative;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.peng-sticky .peng-sticky__icon svg {
	display: block;
	width: 24px;
	height: 24px;
}

/* ——— WhatsApp (right) ——— */

.peng-sticky .peng-sticky__btn--whatsapp {
	color: #ffffff !important;
	background: linear-gradient(160deg, #2fe26d 0%, #25d366 42%, #128c7e 100%) !important;
	border: 0 !important;
	box-shadow:
		0 0 0 3px rgba(255, 255, 255, 0.92),
		0 12px 30px rgba(18, 140, 126, 0.38),
		0 4px 10px rgba(0, 0, 0, 0.14) !important;
}

.peng-sticky .peng-sticky__btn--whatsapp .peng-sticky__icon svg {
	width: 26px;
	height: 26px;
	/* Optical center — WA glyph sits slightly high in its viewBox */
	transform: translateY(1px);
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.peng-sticky .peng-sticky__pulse {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgba(37, 211, 102, 0.35);
	z-index: 0;
	animation: peng-sticky-pulse 2.6s var(--peng-sticky-ease) infinite;
	pointer-events: none;
}

.peng-sticky .peng-sticky__pulse--delay {
	animation-delay: 1.2s;
}

.peng-sticky .peng-sticky__btn--whatsapp:hover,
.peng-sticky .peng-sticky__btn--whatsapp:focus-visible {
	transform: translateY(-3px) scale(1.05);
	box-shadow:
		0 0 0 3px rgba(255, 255, 255, 0.95),
		0 18px 40px rgba(18, 140, 126, 0.48),
		0 6px 14px rgba(0, 0, 0, 0.16) !important;
}

.peng-sticky .peng-sticky__btn--whatsapp:active {
	transform: translateY(-1px) scale(0.97);
}

/* ——— Book now message bubble ——— */

.peng-sticky .peng-sticky__bubble {
	pointer-events: none;
	position: absolute;
	/* Physical right: WA is always bottom-right (don’t flip in RTL). */
	right: calc(100% + 16px);
	left: auto;
	top: 50%;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: min(240px, 62vw);
	min-height: 2.35rem;
	padding: 0.55rem 1.05rem;
	border-radius: 999px;
	background: #0b0b0b;
	color: #ffffff;
	font-family: var(--peng-font);
	font-size: 0.84rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.25;
	white-space: nowrap;
	box-shadow:
		0 10px 28px rgba(0, 0, 0, 0.22),
		0 2px 6px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translate3d(14px, -50%, 0) scale(0.96);
	transform-origin: right center;
	animation:
		peng-sticky-bubble-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards,
		peng-sticky-bubble-float 4s ease-in-out 1.9s infinite;
}

/* Triangle tip pointing toward the WhatsApp button (physical right). */
.peng-sticky .peng-sticky__bubble::after {
	content: "";
	position: absolute;
	right: -7px;
	left: auto;
	top: 50%;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 7px 0 7px 8px;
	border-color: transparent transparent transparent #0b0b0b;
	transform: translateY(-50%);
	filter: drop-shadow(2px 1px 2px rgba(0, 0, 0, 0.08));
	background: none;
	box-shadow: none;
}

.peng-sticky .peng-sticky__bubble-text {
	position: relative;
	z-index: 1;
	display: block;
}

.peng-sticky .peng-sticky__btn--whatsapp:hover .peng-sticky__bubble,
.peng-sticky .peng-sticky__btn--whatsapp:focus-visible .peng-sticky__bubble {
	animation: none;
	opacity: 1;
	visibility: visible;
	transform: translate3d(0, -50%, 0) scale(1);
	transition:
		transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
		opacity 260ms ease;
}

@keyframes peng-sticky-bubble-in {
	0% {
		opacity: 0;
		visibility: hidden;
		transform: translate3d(18px, -50%, 0) scale(0.92);
	}
	100% {
		opacity: 1;
		visibility: visible;
		transform: translate3d(0, -50%, 0) scale(1);
	}
}

@keyframes peng-sticky-bubble-float {
	0%,
	100% {
		transform: translate3d(0, -50%, 0);
	}
	50% {
		transform: translate3d(0, calc(-50% - 3px), 0);
	}
}

/* ——— Back to top (left) ——— */

.peng-sticky .peng-sticky__btn--top,
.peng-sticky button.peng-sticky__btn--top {
	color: #ffffff !important;
	background: #0a0a0a !important;
	background-color: #0a0a0a !important;
	background-image: none !important;
	border: 1.5px solid rgba(255, 1, 0, 0.55) !important;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28) !important;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(0.9);
}

.peng-sticky .peng-sticky__btn--top .peng-sticky__icon svg {
	/* Optical center — chevron path sits slightly high in 24 viewBox */
	transform: translateY(1px);
}

.peng-sticky .peng-sticky__btn--top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.peng-sticky .peng-sticky__btn--top[hidden] {
	display: none !important;
}

.peng-sticky .peng-sticky__btn--top:hover,
.peng-sticky .peng-sticky__btn--top:focus-visible {
	color: #ffffff !important;
	background: var(--peng-primary, #ff0100) !important;
	background-color: var(--peng-primary, #ff0100) !important;
	border-color: var(--peng-primary, #ff0100) !important;
	transform: translateY(-3px) scale(1.06);
	box-shadow: 0 14px 30px rgba(255, 1, 0, 0.35) !important;
}

.peng-sticky .peng-sticky__btn--top:active {
	transform: translateY(-1px) scale(0.97);
}

@keyframes peng-sticky-pulse {
	0% {
		transform: scale(1);
		opacity: 0.55;
	}
	70% {
		transform: scale(1.55);
		opacity: 0;
	}
	100% {
		transform: scale(1.55);
		opacity: 0;
	}
}

@media (max-width: 640px) {
	.peng-sticky {
		--peng-sticky-size: 52px;
		bottom: max(14px, env(safe-area-inset-bottom, 0px));
	}

	.peng-sticky--wa {
		right: max(14px, env(safe-area-inset-right, 0px));
	}

	.peng-sticky--top {
		left: max(14px, env(safe-area-inset-left, 0px));
	}

	.peng-sticky .peng-sticky__bubble {
		font-size: 0.76rem;
		min-height: 2.1rem;
		padding: 0.45rem 0.85rem;
		right: calc(100% + 12px);
	}

	.peng-sticky .peng-sticky__bubble::after {
		right: -6px;
		border-width: 6px 0 6px 7px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.peng-sticky .peng-sticky__pulse {
		animation: none;
		opacity: 0;
	}

	.peng-sticky .peng-sticky__btn {
		transition: none;
	}

	.peng-sticky .peng-sticky__bubble {
		animation: none;
		opacity: 1;
		visibility: visible;
		transform: translate3d(0, -50%, 0) scale(1);
	}
}

/* Hide floating actions while the mobile nav drawer is open */
body.peng-menu-open .peng-sticky,
body.peng-menu-open .peng-sticky.peng-framework {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	z-index: -1 !important;
}

/* Child visibility:visible can escape a hidden parent — force buttons off too */
body.peng-menu-open .peng-sticky .peng-sticky__btn,
body.peng-menu-open .peng-sticky .peng-sticky__btn.is-visible,
body.peng-menu-open .peng-sticky button.peng-sticky__btn--top,
body.peng-menu-open .peng-sticky a.peng-sticky__btn--whatsapp {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}
