/**
 * Listalyst — front-end styles.
 *
 * Everything is namespaced .lsty-* and every value is a custom property, so a
 * buyer's theme or style variation can restyle the lot without touching CSS
 * that ships with the plugin.
 */

:root {
	--lsty-wa-green: #25d366;
	--lsty-wa-green-dark: #1da851;
	--lsty-radius: 8px;
	--lsty-ink: #1a1a1a;
	--lsty-ink-soft: #5c5c5c;
	--lsty-surface: #fff;
	--lsty-border: #e2e2e2;
	--lsty-danger: #b32d2e;
	--lsty-shadow: 0 10px 34px rgba( 0, 0, 0, 0.18 );
}

/* ------------------------------------------------------------ the button */

.lsty-wa {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	min-height: 52px;
	padding: 0.85em 1.5em;
	border: 0;
	border-radius: var(--lsty-radius);
	background: var(--lsty-wa-green);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.005em;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba( 37, 211, 102, 0.3 );
	transition: background-color 0.18s ease, transform 0.12s ease;
}

.lsty-wa:active { transform: translateY( 1px ); }

.lsty-wa:hover,
.lsty-wa:focus-visible {
	background: var(--lsty-wa-green-dark);
	color: #fff;
	text-decoration: none;
}

.lsty-wa-icon {
	width: 1.3em;
	height: 1.3em;
	fill: currentColor;
	flex: none;
}

/* Outline variant, for placing on a photo or a coloured panel. */
.lsty-wa-style-outline {
	background: transparent;
	border: 2px solid var(--lsty-wa-green);
	color: var(--lsty-wa-green);
}

.lsty-wa-style-outline:hover,
.lsty-wa-style-outline:focus-visible {
	background: var(--lsty-wa-green);
	color: #fff;
}

/* Icon-only, for a listing card where space is tight. */
.lsty-wa-style-icon {
	width: 44px;
	height: 44px;
	min-height: 0;
	padding: 0;
	border-radius: 50%;
}

.lsty-wa-style-icon .lsty-wa-icon { width: 21px; height: 21px; }

.lsty-wa-style-icon span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

/* Floating bubble. */
.lsty-wa-style-float {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 9990;
	padding: 0.85em;
	border-radius: 50%;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.22 );
}

.lsty-wa-style-float span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
}

.lsty-wa-style-float .lsty-wa-icon {
	width: 1.6em;
	height: 1.6em;
}

/* ------------------------------------------------------- capture modal */

.lsty-wa-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

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

.lsty-wa-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
}

.lsty-wa-modal-box {
	position: relative;
	width: 100%;
	max-width: 400px;
	max-height: calc( 100vh - 32px );
	overflow-y: auto;
	padding: 26px 24px 24px;
	border-radius: 14px;
	background: var(--lsty-surface);
	box-shadow: var(--lsty-shadow);
	color: var(--lsty-ink);
}

.lsty-wa-modal-x {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--lsty-ink-soft);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.lsty-wa-modal-title {
	margin: 0 0 7px;
	font-size: 1.35rem;
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

.lsty-wa-modal-intro {
	margin: 0 0 20px;
	color: var(--lsty-ink-soft);
	font-size: 0.95rem;
	line-height: 1.45;
}

.lsty-wa-label {
	display: block;
	margin-bottom: 5px;
	font-size: 0.82rem;
	font-weight: 600;
}

.lsty-wa-form input[type="text"],
.lsty-wa-form input[type="tel"] {
	width: 100%;
	min-height: 50px;
	margin-bottom: 15px;
	padding: 0.75em 0.9em;
	border: 1px solid var(--lsty-border);
	border-radius: var(--lsty-radius);
	background: #fff;
	color: var(--lsty-ink);
	font: inherit;
	font-size: 1rem;
	box-sizing: border-box;
}

.lsty-wa-form input:focus-visible {
	outline: 2px solid var(--lsty-wa-green);
	outline-offset: 1px;
	border-color: var(--lsty-wa-green);
}

/*
 * Honeypot. Hidden from people without display:none, because some bots skip
 * fields that are display:none and this one needs to look fillable.
 */
.lsty-wa-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lsty-wa-error {
	margin: 0 0 12px;
	color: var(--lsty-danger);
	font-size: 0.85rem;
}

.lsty-wa-error[hidden] {
	display: none !important;
}

.lsty-wa-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lsty-wa-submit {
	flex: 1;
	min-height: 52px;
	padding: 0.85em 1em;
	font-size: 1rem;
	border: 0;
	border-radius: var(--lsty-radius);
	background: var(--lsty-wa-green);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.lsty-wa-submit:hover:not( :disabled ) {
	background: var(--lsty-wa-green-dark);
}

.lsty-wa-submit:disabled {
	opacity: 0.65;
	cursor: default;
}

.lsty-wa-skip {
	padding: 0.75em 0.5em;
	border: 0;
	background: none;
	color: var(--lsty-ink-soft);
	font: inherit;
	font-size: 0.88rem;
	text-decoration: underline;
	cursor: pointer;
}

/* Stop the page scrolling behind the open modal. */
.lsty-modal-open,
.lsty-modal-open body {
	overflow: hidden;
}

@media screen and ( max-width: 480px ) {
	.lsty-wa-modal {
		align-items: flex-end;
		padding: 0;
	}

	.lsty-wa-modal-box {
		max-width: none;
		border-radius: 14px 14px 0 0;
	}
}

@media ( prefers-color-scheme: dark ) {
	.lsty-wa-modal-box {
		--lsty-surface: #1e1e1e;
		--lsty-ink: #f0f0f0;
		--lsty-ink-soft: #b0b0b0;
		--lsty-border: #3a3a3a;
	}

	.lsty-wa-form input[type="text"],
	.lsty-wa-form input[type="tel"] {
		background: #2a2a2a;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.lsty-wa {
		transition: none;
	}
}
