/* =====================================================================
   WhatsApp chat widget (inc/whatsapp.php, assets/js/whatsapp.js)
   ---------------------------------------------------------------------
   The round toggle keeps WhatsApp's own green: it is the one colour that
   tells a visitor "this is WhatsApp" at a glance. Everything inside the
   card uses the brand tokens from style.css.
   ===================================================================== */

.pps-wa {
	--pps-wa-green: #25d366;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 400;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
}

.pps-wa__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--pps-wa-green);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 52, 104, .28);
	transition: transform .2s ease, box-shadow .2s ease;
}

.pps-wa__toggle:hover,
.pps-wa__toggle:focus-visible {
	color: #fff;
	transform: scale(1.06);
	box-shadow: 0 10px 26px rgba(0, 52, 104, .34);
}

.pps-wa__toggle:focus-visible {
	outline: 3px solid var(--pps-bright, #1787f3);
	outline-offset: 3px;
}

/* --- chat card ------------------------------------------------------ */

.pps-wa__panel {
	width: 330px;
	max-width: calc(100vw - 40px);
	overflow: hidden;
	border-radius: 14px;
	background: var(--pps-paper, #fcfdfe);
	box-shadow: 0 16px 44px rgba(0, 52, 104, .26);
	animation: pps-wa-in .22s ease both;
}

.pps-wa__panel[hidden] {
	display: none;
}

@keyframes pps-wa-in {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pps-wa__panel,
	.pps-wa__toggle {
		animation: none;
		transition: none;
	}
}

.pps-wa__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: var(--pps-navy, #003468);
	color: #fff;
}

.pps-wa__avatar {
	display: flex;
	flex: 0 0 40px;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 50%;
	background: #fff;
	color: var(--pps-navy, #003468);
	font-size: 12px;
	font-weight: 700;
}

.pps-wa__avatar img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pps-wa__who {
	display: flex;
	flex: 1;
	flex-direction: column;
	line-height: 1.3;
}

.pps-wa__who strong {
	color: #fff;
	font-size: 15px;
}

.pps-wa__who small {
	color: var(--pps-sky, #a1bedc);
	font-size: 12px;
}

.pps-wa__close {
	width: 32px;
	height: 32px;
	min-height: 0;
	padding: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	box-shadow: none;
}

.pps-wa__close:hover,
.pps-wa__close:focus-visible {
	background: rgba(255, 255, 255, .14);
	color: #fff;
}

.pps-wa__body {
	padding: 18px 16px 8px;
	background: var(--pps-tint, #e8eff7);
}

.pps-wa__bubble {
	position: relative;
	max-width: 88%;
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 0 10px 10px 10px;
	background: #fff;
	color: var(--pps-navy, #003468);
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 1px 2px rgba(0, 52, 104, .12);
}

.pps-wa__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px 12px;
	border-top: 1px solid var(--pps-tint, #e8eff7);
	background: var(--pps-paper, #fcfdfe);
}

.pps-wa__form textarea {
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	padding: 10px 14px;
	border: 1px solid var(--pps-sky, #a1bedc);
	border-radius: 21px;
	background: #fff;
	color: var(--pps-navy, #003468);
	font-size: 14px;
	line-height: 1.4;
	resize: none;
	overflow-y: auto;
	box-sizing: border-box;
}

.pps-wa__form textarea:focus {
	border-color: var(--pps-blue, #0152a3);
	outline: none;
}

.pps-wa__send {
	display: flex;
	flex: 0 0 42px;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	min-height: 0;
	padding: 0;
	border-radius: 50%;
	background: var(--pps-blue, #0152a3);
	color: #fff;
}

.pps-wa__send:hover,
.pps-wa__send:focus-visible {
	background: var(--pps-navy, #003468);
	color: #fff;
}

/* --- coexisting with WoodMart's fixed furniture ------------------------ */

/* Scroll-to-top shares the bottom-right corner; stack it above the toggle. */
.scrollToTop {
	bottom: 92px;
}

/* On phones WoodMart pins a 55px toolbar to the bottom of the screen. */
@media (max-width: 1024px) {
	.sticky-toolbar-on .pps-wa {
		bottom: calc(55px + 14px);
	}
}

@media (max-width: 480px) {
	.pps-wa {
		right: 14px;
		bottom: 14px;
	}

	.pps-wa__toggle {
		width: 54px;
		height: 54px;
	}
}
