/* Divine Aura AI Chatbot — widget styles */

:root {
	--dac-primary: #c2a269;
}

#dac-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

#dac-root, #dac-root * {
	box-sizing: border-box;
}

/* Launcher button */
#dac-launcher {
	width: 60px;
	height: 60px;
	border-radius: 16px;
	border: none;
	cursor: pointer;
	background: var(--dac-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

#dac-launcher:hover {
	transform: scale(1.07);
}

/* Chat window */
#dac-window {
	position: fixed;
	right: 20px;
	bottom: 90px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#dac-window.dac-hidden {
	display: none;
}

/* Header */
#dac-header {
	background: var(--dac-primary);
	color: #fff;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#dac-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

#dac-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

#dac-title {
	font-weight: 600;
	font-size: 15px;
}

#dac-status {
	font-size: 12px;
	opacity: 0.85;
}

#dac-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.85;
}

#dac-close:hover {
	opacity: 1;
}

/* Messages */
#dac-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #faf8f4;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.dac-msg {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.dac-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #eee2c8;
	color: #333;
	border-bottom-left-radius: 4px;
}

.dac-user {
	align-self: flex-end;
	background: var(--dac-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.dac-msg a {
	color: var(--dac-primary);
	text-decoration: underline;
	word-break: break-all;
}

.dac-user a {
	color: #fff;
}

/* Typing indicator */
.dac-typing {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 12px 14px;
}

.dac-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #c9b077;
	animation: dac-bounce 1.2s infinite;
}

.dac-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.dac-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes dac-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* Input */
#dac-form {
	display: flex;
	border-top: 1px solid #eee;
	background: #fff;
}

#dac-input {
	flex: 1;
	border: none;
	outline: none;
	padding: 13px 14px;
	font-size: 15px;
	font-family: inherit;
	background: transparent;
	color: #333;
}

#dac-send {
	border: none;
	background: none;
	color: var(--dac-primary);
	cursor: pointer;
	padding: 0 16px;
	display: flex;
	align-items: center;
}

#dac-send:hover {
	opacity: 0.8;
}

/* Footer */
#dac-footer {
	font-size: 10.5px;
	color: #999;
	text-align: center;
	padding: 5px 8px 7px;
	background: #fff;
}

/* Mobile */
@media (max-width: 480px) {
	/* Launcher raised ABOVE the theme's sticky bottom nav (Home/Shop/Cart bar)
	   so nothing sits underneath it. */
	#dac-root {
		right: 12px;
		bottom: calc(76px + env(safe-area-inset-bottom, 0px));
	}

	#dac-launcher {
		width: 48px;
		height: 48px;
		border-radius: 14px;
		box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
	}

	#dac-launcher svg {
		width: 23px;
		height: 23px;
	}

	/* Product pages have a sticky Add-to-Cart bar — keep the icon smaller
	   and a little higher so it never blocks the buy buttons. */
	body.single-product #dac-launcher {
		width: 40px;
		height: 40px;
		border-radius: 12px;
	}

	body.single-product #dac-launcher svg {
		width: 19px;
		height: 19px;
	}

	body.single-product #dac-root {
		bottom: calc(132px + env(safe-area-inset-bottom, 0px));
	}

	#dac-window {
		right: 10px;
		bottom: calc(134px + env(safe-area-inset-bottom, 0px));
		width: calc(100vw - 20px);
		height: min(58dvh, 440px);
		max-height: calc(100dvh - 210px);
		border-radius: 14px;
	}

	body.single-product #dac-window {
		bottom: calc(182px + env(safe-area-inset-bottom, 0px));
		max-height: calc(100dvh - 250px);
	}

	#dac-messages {
		padding: 10px;
		font-size: 14px;
	}

	.dac-msg {
		max-width: 88%;
		padding: 8px 11px;
	}

	/* 16px input font prevents iOS auto-zoom on focus */
	#dac-input {
		font-size: 16px;
		padding: 11px 12px;
	}

	#dac-header {
		padding: 10px 12px;
	}

	#dac-avatar {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}
}
