/* Kyogo EH WhatsApp 1.0.1: selectors use the #eh-wa id so theme link styles cannot override them.
 * Kyogo EH WhatsApp: floating chat button in Effie Hamzah maroon.
 * Contrast: #f0f0f0 text on #4d1821 = 12.55:1, #d4ba98 icon on #4d1821 = 7.68:1 (WCAG AA).
 * Breakpoints follow Astra: label from 922px up, icon only below.
 * z-index sits under Astra's off-canvas menu and Popup Maker overlays, above page content. */

#eh-wa.eh-wa {
	--eh-wa-bg: #4d1821;
	--eh-wa-bg-hover: #6a242a;
	--eh-wa-text: #f0f0f0;
	--eh-wa-icon: #d4ba98;
	--eh-wa-border: #d4ba98;
	--eh-wa-radius: 2px; /* square, like the site's buttons; set 999px for a pill */
	--eh-wa-gap: 24px;

	position: fixed;
	right: calc(var(--eh-wa-gap) + env(safe-area-inset-right, 0px));
	bottom: calc(var(--eh-wa-gap) + env(safe-area-inset-bottom, 0px));
	z-index: 9990;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 22px 0 18px;
	box-sizing: border-box;
	background: var(--eh-wa-bg);
	color: var(--eh-wa-text);
	border: 1px solid var(--eh-wa-border);
	border-radius: var(--eh-wa-radius);
	box-shadow: 0 6px 20px rgba(77, 24, 33, 0.28), 0 1px 3px rgba(0, 0, 0, 0.12);
	font-family: "Jost", "Futura", system-ui, sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none !important;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.4s ease;
}

#eh-wa.eh-wa:hover {
	background: var(--eh-wa-bg-hover);
	color: var(--eh-wa-text);
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(77, 24, 33, 0.34), 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Double ring: visible on light pages and on maroon sections. */
#eh-wa.eh-wa:focus { outline: none; }
#eh-wa.eh-wa:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--eh-wa-bg);
}

#eh-wa .eh-wa__icon {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	color: var(--eh-wa-icon);
}

/* Theme and Elementor kit link styles (e.g. ".elementor-kit-N a") must not recolour the text. */
#eh-wa.eh-wa,
#eh-wa.eh-wa:visited,
#eh-wa.eh-wa:hover,
#eh-wa.eh-wa:focus,
#eh-wa .eh-wa__label {
	color: var(--eh-wa-text) !important;
}

#eh-wa .eh-wa__label {
	white-space: nowrap;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
}

/* Screen-reader-only text (also used for the label on small screens). */
#eh-wa .eh-wa__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Entrance: JS adds .is-ready shortly after load. Without JS the button just shows. */
#eh-wa.eh-wa.is-pending {
	opacity: 0;
	transform: translateY(12px);
}
#eh-wa.eh-wa.is-ready {
	opacity: 1;
}

/* Tablet and mobile: icon only, 56px square target. */
@media (max-width: 921px) {
	#eh-wa.eh-wa {
		--eh-wa-gap: 16px;
		width: 56px;
		height: 56px;
		min-height: 0;
		padding: 0;
		justify-content: center;
		gap: 0;
	}
	#eh-wa .eh-wa__icon {
		width: 26px;
		height: 26px;
	}
	#eh-wa .eh-wa__label {
		position: absolute !important;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Very small phones (e.g. iPhone SE): slightly smaller and closer to the edge. */
@media (max-width: 360px) {
	#eh-wa.eh-wa {
		--eh-wa-gap: 12px;
		width: 52px;
		height: 52px;
	}
}

/* Hide while the Astra mobile menu drawer is open. */
body.ast-main-header-nav-open #eh-wa.eh-wa,
body.ast-popup-nav-open #eh-wa.eh-wa,
body.ast-off-canvas-active #eh-wa.eh-wa {
	opacity: 0;
	visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
	#eh-wa.eh-wa,
	#eh-wa.eh-wa:hover,
	#eh-wa.eh-wa.is-pending {
		transition: none;
		transform: none;
	}
}

@media print {
	#eh-wa.eh-wa { display: none !important; }
}

/* Windows high contrast mode. */
@media (forced-colors: active) {
	#eh-wa.eh-wa { border: 2px solid ButtonText; }
	#eh-wa .eh-wa__icon { color: ButtonText; }
}
