/**
 * Social Contact Dock — public styles.
 *
 * The compact layout is the safe default. The expanding rail is enabled only
 * when the viewport and pointing device can comfortably support hover.
 */

.scd-widget {
	--scd-size: 48px;
	--scd-brand: #1677c8;
	--scd-label-color: #0c568f;
	--scd-surface: rgba(255, 255, 255, 0.97);
	--scd-border: rgba(45, 88, 108, 0.16);
	--scd-shadow: 0 12px 34px rgba(28, 61, 76, 0.18);

	position: fixed;
	z-index: 99990;
	top: 50%;
	right: max(12px, env(safe-area-inset-right));
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	width: max-content;
	max-width: calc(100vw - 24px);
	margin: 0;
	color: #17394a;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.25;
	text-align: start;
	color-scheme: light;
	transform: translateY(-50%);
	isolation: isolate;
}

.scd-widget,
.scd-widget *,
.scd-widget *::before,
.scd-widget *::after {
	box-sizing: border-box;
}

.scd-widget[hidden] {
	display: none !important;
}

/* Page-visibility rules hide only the floating placement. The child theme may
 * still move this same widget into the desktop header contact area. */
.scd-widget.scd-hidden-context:not(.usahryp-header-contact-dock) {
	display: none !important;
}

.scd-widget.scd-position-left {
	right: auto;
	left: max(12px, env(safe-area-inset-left));
	align-items: flex-start;
}

.scd-toggle,
.scd-button,
.scd-qr-close {
	margin: 0;
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
}

.scd-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--scd-size);
	height: var(--scd-size);
	min-width: var(--scd-size);
	padding: 0;
	color: #176c55;
	background: #fff;
	border: 1px solid rgba(30, 96, 78, 0.2);
	border-radius: 15px;
	box-shadow: var(--scd-shadow);
	cursor: pointer;
	transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease,
		transform 180ms ease;
}

.scd-toggle:hover {
	color: #075d3c;
	border-color: rgba(7, 193, 96, 0.46);
	box-shadow: 0 14px 36px rgba(20, 91, 69, 0.22);
	transform: translateY(-1px);
}

.scd-toggle[aria-expanded="true"],
.scd-widget.is-qr-open .scd-toggle {
	color: #04723b;
	border-color: rgba(7, 193, 96, 0.54);
	box-shadow: 0 14px 36px rgba(7, 137, 70, 0.2);
}

.scd-toggle:focus-visible,
.scd-button:focus-visible,
.scd-qr-close:focus-visible {
	outline: 3px solid rgba(7, 193, 96, 0.35);
	outline-offset: 3px;
}

.scd-widget .scd-icon {
	display: inline-flex;
	flex: 0 0 var(--scd-size);
	align-items: center;
	justify-content: center;
	width: var(--scd-size);
	height: var(--scd-size);
	line-height: 0;
}

.scd-widget .scd-icon svg,
.scd-widget .scd-icon img {
	display: block;
	width: 22px;
	height: 22px;
	max-width: 22px;
	max-height: 22px;
	object-fit: contain;
}

.scd-widget .scd-icon svg {
	fill: currentColor;
}

.scd-links {
	display: flex;
	flex-direction: row;
	gap: 6px;
	width: max-content;
	max-width: 0;
	max-height: 0;
	margin-top: 0;
	padding: 0;
	overflow: hidden;
	background: transparent;
	border: 0 solid transparent;
	border-radius: 16px;
	box-shadow: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-6px);
	transition: max-width 220ms ease, max-height 220ms ease, margin 220ms ease,
		padding 220ms ease, opacity 160ms ease, transform 220ms ease,
		visibility 0s linear 220ms;
	scrollbar-width: thin;
	scrollbar-color: rgba(7, 193, 96, 0.4) rgba(218, 233, 228, 0.55);
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
}

.scd-links::-webkit-scrollbar {
	height: 5px;
}

.scd-links::-webkit-scrollbar-track {
	background: rgba(218, 233, 228, 0.55);
	border-radius: 999px;
}

.scd-links::-webkit-scrollbar-thumb {
	background: rgba(7, 193, 96, 0.4);
	border-radius: 999px;
}

.scd-widget.is-open .scd-links {
	max-width: calc(100vw - 24px);
	max-height: 74px;
	margin-top: 8px;
	padding: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	background: var(--scd-surface);
	border-width: 1px;
	border-color: var(--scd-border);
	box-shadow: var(--scd-shadow);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition-delay: 0s;
	scroll-snap-type: inline proximity;
}

.scd-button {
	--scd-brand: #1677c8;
	--scd-label-color: #0c568f;

	position: relative;
	display: inline-flex;
	flex: 0 0 var(--scd-size);
	align-items: center;
	justify-content: center;
	width: var(--scd-size);
	height: var(--scd-size);
	min-width: var(--scd-size);
	max-width: var(--scd-size);
	padding: 0;
	overflow: hidden;
	color: #fff;
	text-decoration: none;
	background: var(--scd-brand);
	border: 0;
	border-radius: 13px;
	box-shadow: 0 7px 18px rgba(28, 61, 76, 0.16);
	cursor: pointer;
	scroll-snap-align: end;
	transition: box-shadow 180ms ease, filter 180ms ease, transform 180ms ease;
}

.scd-button:hover {
	color: #fff;
	text-decoration: none;
	box-shadow: 0 9px 22px rgba(28, 61, 76, 0.22);
	filter: saturate(1.04) brightness(1.02);
	transform: translateY(-1px);
}

.scd-button:focus {
	color: #fff;
	text-decoration: none;
}

/* Keep theme button states from replacing each platform's brand colour. */
.scd-widget .scd-button,
.scd-widget .scd-button:hover,
.scd-widget .scd-button:focus,
.scd-widget .scd-button:focus-visible,
.scd-widget .scd-button:active,
.scd-widget .scd-button[aria-expanded="true"] {
	background-color: var(--scd-brand) !important;
}

.scd-button .scd-label {
	display: none;
}

.scd-platform-wechat {
	--scd-brand: #07c160;
	--scd-label-color: #04753c;
}

.scd-platform-whatsapp {
	--scd-brand: #25b95c;
	--scd-label-color: #08763a;
}

.scd-platform-telegram {
	--scd-brand: #229ed9;
	--scd-label-color: #0d6287;
}

.scd-platform-phone,
.scd-platform-tel {
	--scd-brand: #2f6fda;
	--scd-label-color: #244e96;
}

.scd-platform-email,
.scd-platform-mail {
	--scd-brand: #6b5bd2;
	--scd-label-color: #4e3fa3;
}

.scd-platform-facebook {
	--scd-brand: #1877d9;
	--scd-label-color: #10549d;
}

.scd-platform-instagram {
	--scd-brand: #c13584;
	--scd-label-color: #922562;
	background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.scd-platform-messenger {
	background: linear-gradient(135deg, #00b2ff 0%, #006aff 43%, #a033ff 74%, #ff5280 100%);
}

.scd-platform-weixin {
	--scd-brand: #07c160;
	--scd-label-color: #047a3b;
}

.scd-platform-linkedin {
	--scd-brand: #0a66c2;
	--scd-label-color: #084d91;
}

.scd-platform-line {
	--scd-brand: #06b954;
	--scd-label-color: #057538;
}

.scd-platform-qq {
	--scd-brand: #159bd1;
	--scd-label-color: #0d6589;
}

.scd-platform-x,
.scd-platform-twitter {
	--scd-brand: #40556a;
	--scd-label-color: #304152;
}

.scd-platform-youtube {
	--scd-brand: #df3026;
	--scd-label-color: #a31e18;
}

.scd-qr-panel {
	position: absolute;
	z-index: 2;
	top: calc(100% + 8px);
	right: 0;
	width: 224px;
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 24px);
	padding: 16px;
	overflow: auto;
	color: #23473e;
	background: #fff;
	border: 1px solid rgba(7, 193, 96, 0.26);
	border-radius: 18px;
	box-shadow: 0 18px 46px rgba(25, 73, 59, 0.22);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-7px) scale(0.98);
	transform-origin: top right;
	transition: opacity 170ms ease, transform 210ms ease, visibility 0s linear 210ms;
}

.scd-position-left .scd-qr-panel {
	right: auto;
	left: 0;
	transform-origin: top left;
}

.scd-qr-panel.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
	transition-delay: 0s;
}

.scd-qr-panel img,
.scd-qr-panel .scd-qr-image {
	display: block;
	width: 156px;
	height: 156px;
	max-width: 100%;
	margin: 4px auto 0;
	padding: 8px;
	object-fit: contain;
	background: #fff;
	border: 1px solid rgba(7, 193, 96, 0.2);
	border-radius: 12px;
}

.scd-qr-kicker {
	display: block;
	margin: 0 42px 4px 0;
	color: #087a42;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.scd-position-left .scd-qr-kicker {
	margin-right: 0;
	margin-left: 34px;
}

.scd-qr-title {
	margin: 0 42px 8px 0;
	color: #076f3b;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.scd-position-left .scd-qr-title {
	margin-right: 0;
	margin-left: 30px;
}

.scd-qr-description {
	margin: 9px 0 0;
	color: #547269;
	font-size: 12px;
	line-height: 1.45;
	text-align: center;
}

.scd-qr-fallback {
	display: inline-flex;
	justify-content: center;
	width: 100%;
	margin-top: 10px;
	color: #087a42;
	font-size: 12px;
	font-weight: 650;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
}

.scd-qr-fallback:hover,
.scd-qr-fallback:focus-visible {
	color: #056233;
	text-decoration: underline;
}

.scd-qr-close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	max-width: 36px !important;
	max-height: 36px !important;
	padding: 0 !important;
	color: #087a42;
	line-height: 1 !important;
	background: #effaf4 !important;
	border: 1px solid rgba(7, 193, 96, 0.2);
	border-radius: 999px;
	cursor: pointer;
	transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.scd-qr-close:hover {
	color: #056233;
	background: #ddf6e8;
	transform: rotate(4deg);
}

.scd-position-left .scd-qr-close {
	right: auto;
	left: 8px;
}

/* Wide, pointer-precise viewports use the expanding vertical brand rail. */
@media (min-width: 1340px) and (min-height: 800px) and (hover: hover) and (pointer: fine) {
	.scd-widget {
		right: max(20px, env(safe-area-inset-right));
		max-width: 224px;
	}

	.scd-widget.scd-position-left {
		right: auto;
		left: max(20px, env(safe-area-inset-left));
	}

	.scd-toggle {
		display: none;
	}

	.scd-links,
	.scd-widget.is-open .scd-links {
		flex-direction: column;
		align-items: flex-end;
		gap: 8px;
		width: max-content;
		max-width: none;
		max-height: none;
		margin: 0;
		padding: 0;
		overflow: visible;
		background: transparent;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
		transition: none;
		scroll-snap-type: none;
	}

	.scd-position-left .scd-links,
	.scd-position-left.is-open .scd-links {
		align-items: flex-start;
	}

	.scd-button {
		flex: 0 0 var(--scd-size);
		flex-direction: row-reverse;
		justify-content: flex-start;
		width: var(--scd-size);
		max-width: 160px;
		border-radius: 24px;
		transform: none;
		transition: width 220ms cubic-bezier(0.2, 0.72, 0.25, 1),
			box-shadow 180ms ease, filter 180ms ease;
	}

	.scd-position-left .scd-button {
		flex-direction: row;
	}

	.scd-button:hover,
	.scd-button:focus-visible,
	.scd-button:focus-within,
	.scd-button[aria-expanded="true"] {
		width: 160px;
	}

	.scd-button:hover {
		transform: none;
	}

	.scd-button .scd-label {
		display: inline-flex;
		flex: 1 1 auto;
		align-items: center;
		align-self: stretch;
		min-width: 0;
		padding: 0 14px;
		overflow: hidden;
		color: var(--scd-label-color);
		font-size: 13px;
		font-weight: 650;
		line-height: 1;
		white-space: nowrap;
		text-overflow: ellipsis;
		background: rgba(255, 255, 255, 0.94);
		opacity: 0;
		visibility: hidden;
		transform: translateX(7px);
		transition: opacity 140ms ease 30ms, transform 180ms ease 20ms,
			visibility 0s linear 180ms;
	}

	.scd-position-left .scd-button .scd-label {
		transform: translateX(-7px);
	}

	.scd-button:hover .scd-label,
	.scd-button:focus-visible .scd-label,
	.scd-button:focus-within .scd-label,
	.scd-button[aria-expanded="true"] .scd-label {
		opacity: 1;
		visibility: visible;
		transform: translateX(0);
		transition-delay: 30ms, 20ms, 0s;
	}
}

/* Keep the full QR card visible on narrow phone viewports. */
@media (max-width: 480px) {
	.scd-qr-panel {
		top: calc(100% + 2px);
	}

	.scd-qr-panel img,
	.scd-qr-panel .scd-qr-image {
		width: 148px;
		height: 148px;
	}
}

/* Short landscape screens keep the compact rail low enough for an upward QR card. */
@media (max-height: 520px) {
	.scd-widget {
		top: auto;
		bottom: max(12px, env(safe-area-inset-bottom));
		transform: none;
	}

	.scd-qr-panel {
		top: auto;
		bottom: calc(100% + 8px);
		transform: translateY(7px) scale(0.98);
		transform-origin: bottom right;
	}

	.scd-position-left .scd-qr-panel {
		transform-origin: bottom left;
	}

	.scd-qr-panel.is-active {
		transform: translateY(0) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.scd-toggle,
	.scd-button,
	.scd-button .scd-label,
	.scd-links,
	.scd-qr-panel,
	.scd-qr-close {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}

	.scd-links {
		scroll-behavior: auto;
	}
}
