/* ==========================================================================
   左下角联系入口（模块 10-inquiry/14-contact-buttons.php）
   - WhatsApp：直接跳转
   - 微信：点击弹出二维码卡片
   - 竖向堆叠：微信在上、WhatsApp 在下
   - 独立文件，不并入 design-v2.css（设计层改动风险高）
   ========================================================================== */
.gpwa,
.gpwc,
.gpwa *,
.gpwc * { box-sizing: border-box; }

.gpwa,
.gpwc {
	--gp-contact-bottom: max(18px, env(safe-area-inset-bottom, 0px));
	position: fixed;
	left: max(18px, env(safe-area-inset-left, 0px));
	bottom: var(--gp-contact-bottom);
	transform: translateY(calc(-1 * var(--gp-contact-lift, 0px)));
	z-index: 100000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	box-shadow: 0 6px 18px rgba(11, 34, 57, .18);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.gpwa { background: #25d366; }
.gpwc { bottom: calc(var(--gp-contact-bottom) + 62px); background: #07c160; }

.gpwa svg { width: 28px; height: 28px; fill: currentColor; }
.gpwc svg { width: 30px; height: 30px; fill: currentColor; }

.gpwa:hover,
.gpwc:hover {
	transform: translateY(calc(-1 * var(--gp-contact-lift, 0px) - 2px));
	box-shadow: 0 10px 22px rgba(11, 34, 57, .24);
}

.gpwa:focus-visible,
.gpwc:focus-visible,
.gpwc-modal__close:focus-visible {
	outline: 3px solid #0c1c2a;
	outline-offset: 2px;
}

/* ---------- 微信二维码弹层 ---------- */
.gpwc-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.gpwc-modal[hidden] { display: none !important; }

.gpwc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 20, 32, .58);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.gpwc-modal__card {
	position: relative;
	width: min(340px, calc(100vw - 32px));
	padding: 26px 24px 24px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(6, 20, 32, .28);
	text-align: center;
}

.gpwc-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #5a7180;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.gpwc-modal__close:hover { background: rgba(12, 28, 42, .06); color: #0c1c2a; }

.gpwc-modal__title {
	margin: 2px 0 6px;
	color: #0c1c2a;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 600;
}

.gpwc-modal__sub {
	margin: 0 0 18px;
	color: #5a7180;
	font-size: 13.5px;
	line-height: 1.5;
}

.gpwc-modal__qr img {
	display: block;
	width: min(260px, 68vw);
	height: auto;
	margin: 0 auto;
	border-radius: 10px;
}

body.gpwc-lock { overflow: hidden; }

@media (max-width: 900px) {
	.gpwa,
	.gpwc {
		--gp-contact-bottom: max(14px, env(safe-area-inset-bottom, 0px));
		left: max(14px, env(safe-area-inset-left, 0px));
		width: 48px;
		height: 48px;
	}
	.gpwc { bottom: calc(var(--gp-contact-bottom) + 58px); }
	.gpwa svg { width: 26px; height: 26px; }
	.gpwc svg { width: 27px; height: 27px; }
}

@media (max-width: 640px) {
	.gpwc-modal {
		align-items: flex-end;
		padding: 0;
	}
	.gpwc-modal__card {
		width: 100%;
		padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
		border-radius: 20px 20px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gpwa,
	.gpwc { transition: none; }
	.gpwa:hover,
	.gpwc:hover { transform: translateY(calc(-1 * var(--gp-contact-lift, 0px))); }
}

/* --------------------------------------------------------------------------
   2026-11-23 — 首屏不再闪现左下角联系球
   搬移脚本（14-contact-buttons.php）把按钮放进页头之前，桌面端不显示浮动版。
   1.8s 兜底：脚本万一没跑，入口仍然会出现（只是晚一点），不会永久消失。
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
	html:not(.gpuloom-contacts-moved) .gpwa,
	html:not(.gpuloom-contacts-moved) .gpwc {
		visibility: hidden;
		-webkit-animation: gpuloom-contact-reveal .01s linear 1.8s forwards;
		animation: gpuloom-contact-reveal .01s linear 1.8s forwards;
	}
}

@-webkit-keyframes gpuloom-contact-reveal { to { visibility: visible; } }
@keyframes gpuloom-contact-reveal { to { visibility: visible; } }

/* 搬进页头后淡入，避免"啪"地出现 */
@-webkit-keyframes gpuloom-contact-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes gpuloom-contact-in { from { opacity: 0; } to { opacity: 1; } }

html.gpuloom-contacts-moved .gpuloom-contact-head {
	-webkit-animation: gpuloom-contact-in .18s ease-out both;
	animation: gpuloom-contact-in .18s ease-out both;
}

/* --------------------------------------------------------------------------
   2026-11-23 — 微信二维码兜底
   contact-buttons.js 曾经因为占位 src 而不加载二维码；即使 JS 再次出问题，
   这里也让弹层用背景图显示同一张图（wechat-qr.png 是不带哈希的稳定路径）。
   -------------------------------------------------------------------------- */
.gpwc-modal__qr img {
	background-image: url("https://gpuloom.com/wp-content/plugins/gpuloom-core/assets/wechat-qr.png");
	background-position: center center;
	background-repeat: no-repeat;
	background-size: contain;
}