/* ==========================================================================
   Flavor WA Chat — Public / Frontend Styles
   ========================================================================== */

/* ── CSS custom properties (set inline per-instance) ──────────────────── */
#fwa-root {
	--fwa-color: #25D366;
	--fwa-size:  60px;
	--fwa-radius: 50%;
	--fwa-z: 9999;
	--fwa-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
	--fwa-popup-w: 340px;
	--fwa-easing: cubic-bezier(0.34, 1.56, 0.64, 1);

	position: fixed;
	z-index: var(--fwa-z);
	bottom: 24px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

#fwa-root.fwa-bottom-left  { left: 24px; align-items: flex-start; }
#fwa-root.fwa-bottom-right { right: 24px; align-items: flex-end; }

/* ── Bubble ───────────────────────────────────────────────────────────── */
.fwa-bubble {
	position: relative;
	width: var(--fwa-size);
	height: var(--fwa-size);
	border-radius: var(--fwa-radius);
	background: var(--fwa-color);
	border: none;
	cursor: pointer;
	box-shadow: var(--fwa-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s var(--fwa-easing), box-shadow 0.2s;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.fwa-bubble:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
}

.fwa-bubble:active {
	transform: scale(0.95);
}

.fwa-bubble__svg {
	width: 60%;
	height: 60%;
	display: block;
	min-width: 24px;
	min-height: 24px;
	flex-shrink: 0;
}

.fwa-bubble__img {
	width: 65%;
	height: 65%;
	object-fit: contain;
	display: block;
	border-radius: 50%;
	flex-shrink: 0;
}

/* ── Pulse ring ───────────────────────────────────────────────────────── */
.fwa-bubble--pulse::before {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	background: var(--fwa-color);
	opacity: 0.3;
	animation: fwa-pulse 2.4s ease-out infinite;
	pointer-events: none;
}

.fwa-bubble--pulse::after {
	content: '';
	position: absolute;
	inset: -12px;
	border-radius: 50%;
	background: var(--fwa-color);
	opacity: 0.15;
	animation: fwa-pulse 2.4s ease-out 0.8s infinite;
	pointer-events: none;
}

@keyframes fwa-pulse {
	0%   { transform: scale(1); opacity: 0.3; }
	100% { transform: scale(1.5); opacity: 0; }
}

/* ── Tooltip ──────────────────────────────────────────────────────────── */
.fwa-tooltip {
	background: #1B2A4A;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 6px;
	white-space: nowrap;
	margin-bottom: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
	animation: fwa-fade-in 0.3s ease forwards;
	position: relative;
}

/* Arrow */
.fwa-tooltip::after {
	content: '';
	position: absolute;
	bottom: -5px;
	border: 5px solid transparent;
	border-bottom: none;
	border-top-color: #1B2A4A;
}

.fwa-bottom-left .fwa-tooltip::after  { left: 16px; }
.fwa-bottom-right .fwa-tooltip::after { right: 16px; }

@keyframes fwa-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Popup ────────────────────────────────────────────────────────────── */
.fwa-popup {
	width: var(--fwa-popup-w);
	z-index: 9999;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.18);
	overflow: hidden;
	margin-bottom: 12px;
	transform-origin: bottom left;
	animation: fwa-popup-in 0.35s var(--fwa-easing) forwards;
}

.fwa-bottom-right .fwa-popup {
	transform-origin: bottom right;
}

@keyframes fwa-popup-in {
	from { opacity: 0; transform: scale(0.85) translateY(12px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

.fwa-popup[hidden] {
	display: none;
}

/* Header */
.fwa-popup__header {
	background: linear-gradient(135deg, #1B2A4A, #0e1d33);
	padding: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 3px solid var(--fwa-color);
}

.fwa-popup__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--fwa-color);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.fwa-popup__avatar svg {
	width: 26px;
	height: 26px;
}

.fwa-popup__info {
	flex: 1;
	min-width: 0;
}

.fwa-popup__title {
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
}

.fwa-popup__subtitle {
	color: rgba(255,255,255,0.7);
	font-size: 12px;
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 5px;
}

.fwa-online-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	display: inline-block;
	box-shadow: 0 0 0 2px rgba(74,222,128,0.3);
	animation: fwa-blink 2s ease-in-out infinite;
}

@keyframes fwa-blink {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.4; }
}

.fwa-popup__close {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.1);
	color: rgba(255,255,255,0.8);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
	flex-shrink: 0;
}

.fwa-popup__close:hover {
	background: rgba(255,255,255,0.2);
	color: #fff;
}

/* Body */
.fwa-popup__body {
	padding: 16px;
	background: #f0f2f5;
	min-height: 80px;
}

.fwa-popup__chat-bubble {
	background: #fff;
	border-radius: 0 12px 12px 12px;
	padding: 10px 14px;
	display: inline-block;
	max-width: 90%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	margin-bottom: 12px;
	font-size: 13px;
	color: #374151;
	line-height: 1.5;
	position: relative;
}

.fwa-popup__chat-bubble p {
	margin: 0;
}

/* Direct CTA button */
.fwa-popup__direct {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.fwa-popup__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--fwa-color);
	color: #fff !important;
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 24px;
	font-size: 13px;
	font-weight: 600;
	box-shadow: 0 2px 10px rgba(37,211,102,0.35);
	transition: transform 0.15s, box-shadow 0.15s;
	margin-top: 4px;
}

.fwa-popup__cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(37,211,102,0.5);
	color: #fff !important;
}

/* CF7 form inside popup */
.fwa-popup__cf7 {
	font-size: 13px;
}

.fwa-popup__cf7 .wpcf7-form p {
	margin: 0 0 10px;
}

.fwa-popup__cf7 .wpcf7-form input[type="text"],
.fwa-popup__cf7 .wpcf7-form input[type="email"],
.fwa-popup__cf7 .wpcf7-form input[type="tel"],
.fwa-popup__cf7 .wpcf7-form textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	font-size: 13px;
	background: #fff;
	transition: border-color 0.15s;
	box-sizing: border-box;
	font-family: inherit;
}

.fwa-popup__cf7 .wpcf7-form input:focus,
.fwa-popup__cf7 .wpcf7-form textarea:focus {
	border-color: var(--fwa-color);
	outline: none;
}

.fwa-popup__cf7 .wpcf7-form input[type="submit"] {
	background: var(--fwa-color);
	color: #fff;
	border: none;
	padding: 10px 20px;
	border-radius: 24px;
	font-weight: 600;
	cursor: pointer;
	font-size: 13px;
	width: 100%;
	transition: opacity 0.15s;
}

.fwa-popup__cf7 .wpcf7-form input[type="submit"]:hover {
	opacity: 0.9;
}

.fwa-popup__cf7 .wpcf7-not-valid-tip {
	color: #ef4444;
	font-size: 11px;
}

.fwa-popup__cf7 .wpcf7-response-output {
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 12px;
	margin-top: 8px;
}

/* Footer */
.fwa-popup__footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 8px 16px;
	background: #f8f9fa;
	font-size: 11px;
	color: #9ca3af;
	border-top: 1px solid #f0f2f5;
}

/* ── Overlay ──────────────────────────────────────────────────────────── */
.fwa-overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: rgba(0,0,0,0.25);
	/* backdrop-filter: blur(2px); */
	animation: fwa-fade-in 0.2s ease;
}
.custom-error{
	color:red;
	font-size:12px;
	display:block;
	margin-top:5px;
}

.fwa-overlay[hidden] {
	display: none;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	#fwa-root {
		bottom: 16px;
	}

	#fwa-root.fwa-bottom-left  { left: 16px; }
	#fwa-root.fwa-bottom-right { right: 16px; }

	.fwa-popup {
		--fwa-popup-w: calc(100vw - 32px);
	}
}