/* DTN Live Agent Chat v1.0.2 — Styled for difundetunegocio.com */
#dtn-live-chat-root.dtn-chat-hidden {
	display: none !important;
}

#dtn-live-chat-root {
	--dtn-primary: #08278D;
	--dtn-primary-hover: #061e70;
	--dtn-navy: #041544;
	--dtn-blue: #08278D;
	--dtn-orange: #FF7200;
	--dtn-bg: #fafaf9;
	--dtn-surface: #ffffff;
	--dtn-text: #131313;
	--dtn-muted: #6b7280;
	--dtn-border: #e5e7eb;
	--dtn-green: #22c55e;
	font-family: 'Inter', 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	position: fixed;
	z-index: 999990;
	box-sizing: border-box;
	line-height: 1.4;
}

#dtn-live-chat-root *,
#dtn-live-chat-root *::before,
#dtn-live-chat-root *::after {
	box-sizing: border-box;
}

.dtn-launcher-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-direction: row;
}

#dtn-live-chat-root.dtn-pos-left .dtn-launcher-wrap {
	flex-direction: row-reverse;
}

.dtn-tooltip {
	background: var(--dtn-surface);
	color: var(--dtn-navy);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	padding: 10px 14px;
	border-radius: 14px;
	box-shadow: 0 10px 28px rgba(4, 21, 68, 0.16);
	border: 1px solid var(--dtn-border);
	max-width: 240px;
	cursor: pointer;
	position: relative;
	animation: dtnFadeUp 0.35s ease;
}

#dtn-live-chat-root button.dtn-tooltip-close {
	position: absolute;
	top: -7px;
	right: -7px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 1px solid var(--dtn-border);
	background: #ffffff;
	color: var(--dtn-muted);
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	min-height: 0;
}

/* Circular #08278D launcher button with NO border and crisp white chat icon */
#dtn-live-chat-root button.dtn-launcher-btn {
	width: 60px !important;
	height: 60px !important;
	min-width: 60px !important;
	min-height: 60px !important;
	border-radius: 50% !important;
	border: none !important;
	outline: none !important;
	background: #08278D !important;
	background-color: #08278D !important;
	color: #ffffff !important;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(8, 39, 141, 0.40) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	position: relative;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	padding: 0 !important;
	margin: 0 !important;
}

#dtn-live-chat-root button.dtn-launcher-btn:hover,
#dtn-live-chat-root button.dtn-launcher-btn:focus {
	background: #061e70 !important;
	background-color: #061e70 !important;
	border: none !important;
	outline: none !important;
	transform: translateY(-2px) scale(1.04);
	box-shadow: 0 14px 30px rgba(8, 39, 141, 0.50) !important;
}

#dtn-live-chat-root button.dtn-launcher-btn svg {
	display: block;
	color: #ffffff !important;
	stroke: #ffffff !important;
	fill: none;
}

.dtn-online-dot {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--dtn-green);
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.dtn-chat-window {
	width: 375px;
	max-width: calc(100vw - 24px);
	height: 550px;
	max-height: calc(100vh - 110px);
	background: var(--dtn-bg);
	border-radius: 18px;
	box-shadow: 0 20px 50px rgba(4, 21, 68, 0.24);
	border: 1px solid rgba(4, 21, 68, 0.10);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: dtnFadeUp 0.25s ease;
}

.dtn-chat-header {
	background: linear-gradient(135deg, #041544 0%, #08278D 100%);
	color: #ffffff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
}

.dtn-header-info {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	flex: 1;
}

.dtn-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	border: 1.5px solid rgba(255, 255, 255, 0.35);
	color: #ffffff;
	font-weight: 700;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
}

.dtn-avatar-dot {
	position: absolute;
	bottom: -1px;
	right: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--dtn-green);
	border: 2px solid #041544;
}

.dtn-header-title {
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.25;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dtn-header-sub {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.86);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Crisp WHITE X close button (immune to Elementor/theme button overrides) */
#dtn-live-chat-root button.dtn-close-btn {
	background: rgba(255, 255, 255, 0.16) !important;
	background-color: rgba(255, 255, 255, 0.16) !important;
	border: none !important;
	outline: none !important;
	color: #ffffff !important;
	width: 34px !important;
	height: 34px !important;
	min-width: 34px !important;
	min-height: 34px !important;
	border-radius: 50% !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: background-color 0.15s ease, transform 0.15s ease;
	padding: 0 !important;
	margin: 0 !important;
	flex-shrink: 0;
}

#dtn-live-chat-root button.dtn-close-btn:hover,
#dtn-live-chat-root button.dtn-close-btn:focus {
	background: rgba(255, 255, 255, 0.28) !important;
	background-color: rgba(255, 255, 255, 0.28) !important;
	color: #ffffff !important;
	border: none !important;
}

#dtn-live-chat-root button.dtn-close-btn svg {
	display: block;
	stroke: #ffffff !important;
	color: #ffffff !important;
}

.dtn-messages {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.dtn-msg-row {
	display: flex;
	flex-direction: column;
	max-width: 85%;
	animation: dtnFadeUp 0.22s ease;
}

.dtn-msg-row.dtn-agent {
	align-self: flex-start;
}

.dtn-msg-row.dtn-visitor {
	align-self: flex-end;
}

.dtn-bubble {
	padding: 10px 13px;
	border-radius: 15px;
	font-size: 14px;
	line-height: 1.45;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.dtn-agent .dtn-bubble {
	background: var(--dtn-surface);
	color: var(--dtn-text);
	border: 1px solid var(--dtn-border);
	border-bottom-left-radius: 4px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.dtn-visitor .dtn-bubble {
	background: #08278D;
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.dtn-bubble a {
	color: #08278D;
	font-weight: 600;
	text-decoration: underline;
}

.dtn-visitor .dtn-bubble a {
	color: #ffffff;
}

.dtn-meet-card {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding: 9px 13px;
	background: linear-gradient(135deg, #0b57d0 0%, #1a73e8 100%);
	color: #ffffff !important;
	text-decoration: none !important;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.dtn-meet-card:hover {
	filter: brightness(1.06);
}

.dtn-typing {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	background: var(--dtn-surface);
	border: 1px solid var(--dtn-border);
	border-radius: 15px;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
	animation: dtnFadeUp 0.2s ease;
}

.dtn-typing-label {
	font-size: 12px;
	color: var(--dtn-muted);
	margin-right: 2px;
}

.dtn-typing span.dtn-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #08278D;
	opacity: 0.65;
	animation: dtnBounce 1.2s infinite ease-in-out;
}

.dtn-typing span.dtn-dot:nth-of-type(2) {
	animation-delay: 0.2s;
}

.dtn-typing span.dtn-dot:nth-of-type(3) {
	animation-delay: 0.4s;
}

.dtn-input-area {
	background: var(--dtn-surface);
	border-top: 1px solid var(--dtn-border);
	padding: 10px 12px;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	flex-shrink: 0;
}

#dtn-live-chat-root textarea.dtn-input {
	flex: 1;
	border: 1px solid var(--dtn-border) !important;
	border-radius: 12px !important;
	padding: 9px 12px !important;
	font-size: 14px !important;
	line-height: 1.35;
	color: var(--dtn-text) !important;
	background: #f9fafb !important;
	resize: none;
	max-height: 96px;
	min-height: 42px;
	outline: none !important;
	font-family: inherit;
	margin: 0 !important;
}

#dtn-live-chat-root textarea.dtn-input:focus {
	border-color: #08278D !important;
	background: #ffffff !important;
}

#dtn-live-chat-root button.dtn-send-btn {
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	min-height: 42px !important;
	border-radius: 12px !important;
	border: none !important;
	outline: none !important;
	background: #08278D !important;
	background-color: #08278D !important;
	color: #ffffff !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0;
	transition: background-color 0.15s ease, opacity 0.15s ease;
	padding: 0 !important;
	margin: 0 !important;
}

#dtn-live-chat-root button.dtn-send-btn:hover:not(:disabled) {
	background: #061e70 !important;
	background-color: #061e70 !important;
}

#dtn-live-chat-root button.dtn-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#dtn-live-chat-root button.dtn-send-btn svg {
	stroke: #ffffff !important;
	color: #ffffff !important;
}

.dtn-system-notice {
	text-align: center;
	font-size: 12px;
	color: var(--dtn-muted);
	padding: 6px 10px;
	background: #f3f4f6;
	border-radius: 8px;
}

@keyframes dtnFadeUp {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes dtnBounce {
	0%, 80%, 100% {
		transform: translateY(0);
		opacity: 0.4;
	}
	40% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* Mobile Responsive Layout (<= 768px):
   - Floating launcher sits at BOTTOM-LEFT
   - Open chat fills the mobile viewport cleanly without clipping or iOS zoom */
@media (max-width: 768px) {
	#dtn-live-chat-root:not(.dtn-is-open) {
		left: 16px !important;
		right: auto !important;
		bottom: 20px !important;
		top: auto !important;
	}

	#dtn-live-chat-root:not(.dtn-is-open) .dtn-launcher-wrap {
		flex-direction: row-reverse;
	}

	#dtn-live-chat-root:not(.dtn-is-open) .dtn-tooltip {
		display: none;
	}

	#dtn-live-chat-root.dtn-is-open {
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: 100vh !important;
		height: 100dvh !important;
		z-index: 999999 !important;
	}

	#dtn-live-chat-root.dtn-is-open .dtn-chat-window {
		width: 100% !important;
		max-width: 100% !important;
		height: 100% !important;
		max-height: 100% !important;
		border-radius: 0 !important;
		border: none !important;
		box-shadow: none !important;
	}

	#dtn-live-chat-root.dtn-is-open .dtn-chat-header {
		padding: max(14px, env(safe-area-inset-top)) 16px 14px 16px;
	}

	#dtn-live-chat-root.dtn-is-open .dtn-messages {
		padding: 14px 12px;
	}

	#dtn-live-chat-root.dtn-is-open .dtn-msg-row {
		max-width: 88%;
	}

	#dtn-live-chat-root.dtn-is-open .dtn-input-area {
		padding: 10px 12px max(12px, env(safe-area-inset-bottom)) 12px;
	}

	/* 16px font prevents iOS Safari automatic page zoom when focusing input */
	#dtn-live-chat-root.dtn-is-open textarea.dtn-input {
		font-size: 16px !important;
	}
}
