/* =========================================================
   WA Link Generator - estilos
   Todo está aislado bajo la clase .walg para no chocar
   con el tema de WordPress.
   ========================================================= */

.walg {
	--walg-accent: #3f8f7c;
	--walg-accent-dark: color-mix(in srgb, var(--walg-accent) 80%, #000);
	--walg-text: #2f4550;
	--walg-muted: #7b8a92;
	--walg-border: #cfd6d9;
	--walg-bg: #f3f4f4;

	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px 40px;
	color: var(--walg-text);
	font-family: inherit;
}

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

/* ---------- Aviso superior ---------- */
.walg__notice {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 20px;
	margin-bottom: 40px;
	background: #ededee;
	border-radius: 999px;
	font-size: 1rem;
	text-align: center;
}

/* ---------- Layout de dos columnas ---------- */
.walg__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

/* ---------- Marca WhatsApp ---------- */
.walg__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 32px;
	color: var(--walg-text);
}

.walg__brand-text {
	font-size: 3rem;
	font-weight: 700;
	letter-spacing: -1px;
	line-height: 1;
}

/* ---------- Formulario ---------- */
.walg__label {
	display: block;
	margin: 0 0 10px;
	font-size: 1.15rem;
	font-weight: 600;
}

.walg__input {
	display: block;
	width: 100%;
	padding: 18px 16px;
	font-size: 1.15rem;
	font-family: inherit;
	color: var(--walg-text);
	background: #fafbfc;
	border: 2px solid var(--walg-border);
	border-radius: 4px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.walg__input:focus {
	border-color: var(--walg-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--walg-accent) 25%, transparent);
}

.walg__input.is-invalid {
	border-color: #c0392b;
}

.walg__textarea {
	resize: vertical;
	min-height: 96px;
}

.walg__hint {
	margin: 12px 0 28px;
	font-size: 1rem;
	color: var(--walg-muted);
}

.walg__error {
	margin: -16px 0 24px;
	color: #c0392b;
	font-size: 0.95rem;
	font-weight: 600;
}

.walg__error[hidden],
.walg__result[hidden],
.walg__copied[hidden] {
	display: none;
}

.walg__button {
	display: block;
	width: 100%;
	margin-top: 24px;
	padding: 18px 20px;
	font-family: inherit;
	font-size: 1.25rem;
	color: #fff;
	background: var(--walg-accent);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.walg__button:hover {
	background: var(--walg-accent-dark);
}

.walg__button:active {
	transform: translateY(1px);
}

.walg__button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--walg-accent) 40%, transparent);
	outline-offset: 2px;
}

.walg__button--secondary {
	width: auto;
	margin-top: 0;
	padding: 0 24px;
	font-size: 1rem;
	white-space: nowrap;
}

/* ---------- Resultado ---------- */
.walg__result {
	margin-top: 32px;
	padding-top: 28px;
	border-top: 1px dashed var(--walg-border);
}

.walg__result-row {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.walg__result-row .walg__input {
	font-size: 1rem;
}

.walg__result-actions {
	margin-top: 14px;
}

.walg__link-btn {
	color: var(--walg-accent);
	font-weight: 600;
	text-decoration: none;
}

.walg__link-btn:hover {
	text-decoration: underline;
}

.walg__copied {
	margin: 12px 0 0;
	color: var(--walg-accent);
	font-weight: 600;
}

/* =========================================================
   MOCKUP DEL CELULAR
   ========================================================= */
.walg__preview-col {
	display: flex;
	justify-content: center;
}

.walg__phone {
	position: relative;
	width: 100%;
	max-width: 340px;
	padding: 14px;
	background: #111;
	border-radius: 44px;
	box-shadow:
		0 30px 60px rgba(0, 0, 0, 0.25),
		inset 0 0 0 2px #333;
}

.walg__phone-notch {
	position: absolute;
	top: 14px;
	left: 50%;
	z-index: 3;
	width: 110px;
	height: 22px;
	background: #111;
	border-radius: 0 0 16px 16px;
	transform: translateX(-50%);
}

.walg__phone-screen {
	display: flex;
	flex-direction: column;
	height: 560px;
	overflow: hidden;
	background: #efeae2;
	border-radius: 32px;
}

/* Cabecera de WhatsApp */
.walg__wa-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 34px 14px 12px;
	color: #fff;
	background: #075e54;
}

.walg__wa-back {
	font-size: 1.3rem;
	line-height: 1;
}

.walg__wa-avatar {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	background: #dfe5e7;
	border-radius: 50%;
}

.walg__wa-contact {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}

.walg__wa-contact strong {
	overflow: hidden;
	font-size: 0.95rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.walg__wa-contact small {
	font-size: 0.72rem;
	opacity: 0.85;
}

.walg__wa-icons {
	display: flex;
	gap: 14px;
	align-items: center;
}

/* Zona de chat con patrón sutil */
.walg__wa-chat {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 16px 12px;
	overflow-y: auto;
	background-color: #efeae2;
	background-image:
		radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.035) 2px, transparent 3px),
		radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.035) 2px, transparent 3px),
		radial-gradient(circle at 45% 85%, rgba(0, 0, 0, 0.035) 2px, transparent 3px);
	background-size: 60px 60px, 80px 80px, 70px 70px;
}

.walg__wa-bubble-wrap {
	display: flex;
	justify-content: flex-end;
}

.walg__wa-bubble {
	position: relative;
	max-width: 85%;
	padding: 8px 10px 6px 12px;
	font-size: 0.95rem;
	line-height: 1.35;
	color: #111;
	background: #d9fdd3;
	border-radius: 10px 0 10px 10px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.13);
	word-wrap: break-word;
	overflow-wrap: anywhere;
	animation: walg-pop 0.25s ease;
}

/* pre-wrap SOLO en el texto: respeta los saltos de linea del usuario
   sin heredar los espacios/sangria del HTML de la plantilla */
.walg__wa-text {
	white-space: pre-wrap;
}

.walg__wa-bubble::after {
	content: "";
	position: absolute;
	top: 0;
	right: -8px;
	border-top: 10px solid #d9fdd3;
	border-right: 8px solid transparent;
}

.walg__wa-meta {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	float: right;
	margin: 6px 0 0 12px;
	font-size: 0.68rem;
	color: #667781;
}

@keyframes walg-pop {
	from { transform: scale(0.92); opacity: 0.4; }
	to   { transform: scale(1);    opacity: 1; }
}

/* Barra inferior de entrada */
.walg__wa-inputbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px 14px;
	background: #efeae2;
}

.walg__wa-field {
	flex: 1 1 auto;
	padding: 10px 14px;
	font-size: 0.85rem;
	color: #8a969c;
	background: #fff;
	border-radius: 999px;
}

.walg__wa-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	background: #128c7e;
	border-radius: 50%;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
	.walg__layout {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.walg__brand-text {
		font-size: 2.4rem;
	}

	.walg__phone-screen {
		height: 500px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.walg__wa-bubble {
		animation: none;
	}
}
