/* Armenius Live Chat storefront widget (floating launcher + panel).
   Sits below the cart drawer layers (650/660). */

.armenius-livechat {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 640;
	font-family: var(--font-body, "Open Sans", system-ui, sans-serif);
}

/* The [hidden] attribute must always win over the display rules below
   (author display:flex would otherwise override the UA's [hidden] style). */
.armenius-livechat[hidden],
.armenius-livechat [hidden] {
	display: none !important;
}

body.admin-bar .armenius-livechat {
	bottom: 18px;
}

/* Launcher pill */
.armenius-livechat__launcher {
	position: relative;
	border: 0;
	border-radius: 999px;
	background: var(--color-accent, #fc0);
	color: var(--color-dark-2, #2e2e2e);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 22px 12px 16px;
	min-height: 64px;
	box-shadow: var(--shadow-md, 0 4px 14px rgba(0, 0, 0, 0.22));
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
}

.armenius-livechat__launcher:hover,
.armenius-livechat__launcher:focus-visible {
	transform: scale(1.04);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.armenius-livechat__icon {
	flex: 0 0 auto;
	display: block;
}

.armenius-livechat__launcher-label {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	text-align: left;
	line-height: 1.15;
}

.armenius-livechat__launcher-title {
	font-size: 16px;
	font-weight: 700;
}

.armenius-livechat__launcher-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #1d5c1f;
}

.armenius-livechat__online-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #2e9d36;
	animation: armenius-livechat-dot 1.6s ease-in-out infinite;
}

.armenius-livechat.is-open .armenius-livechat__online-dot {
	animation: none;
}

@keyframes armenius-livechat-dot {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.45); opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
	.armenius-livechat__online-dot {
		animation: none;
	}
}

.armenius-livechat__launcher-badge {
	position: absolute;
	top: -6px;
	right: -2px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 0;
	background: #d63638;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

/* Panel */
.armenius-livechat__panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: 340px;
	max-width: calc(100vw - 36px);
	background: var(--color-bg, #fff);
	border-radius: 0;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.armenius-livechat__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: var(--color-dark-2, #2e2e2e);
	color: #fff;
}

.armenius-livechat__header-title {
	font-weight: 700;
	font-size: 15px;
}

.armenius-livechat__header-agent {
	flex: 1 1 auto;
	font-size: 12px;
	color: var(--color-accent, #fc0);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.armenius-livechat__header-close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}

.armenius-livechat__body {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* Pre-chat form */
.armenius-livechat__prechat {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
}

.armenius-livechat__intro {
	margin: 0;
	font-size: 13px;
	color: var(--color-text, #454444);
}

.armenius-livechat__prechat input,
.armenius-livechat__prechat textarea,
.armenius-livechat__composer textarea {
	width: 100%;
	min-height: 0;
	border: 1px solid #ccc;
	border-radius: 0;
	padding: 9px 10px;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: var(--color-text, #454444);
	background: #fff;
	resize: none;
	box-sizing: border-box;
}

.armenius-livechat__prechat textarea {
	height: 76px;
}

.armenius-livechat__prechat input:focus,
.armenius-livechat__prechat textarea:focus,
.armenius-livechat__composer textarea:focus {
	outline: none;
	border-color: var(--color-dark-2, #2e2e2e);
	box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.35);
}

.armenius-livechat__btn {
	border: 0;
	border-radius: 0;
	padding: 10px 14px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.armenius-livechat__btn--primary {
	background: var(--color-accent, #fc0);
	color: var(--color-dark-2, #2e2e2e);
}

.armenius-livechat__btn--primary:hover {
	filter: brightness(0.95);
}

.armenius-livechat__btn--primary:disabled {
	opacity: 0.55;
	cursor: default;
}

.armenius-livechat__btn--link {
	background: transparent;
	color: #757575;
	font-weight: 400;
	font-size: 12px;
	text-decoration: underline;
	padding: 6px;
}

.armenius-livechat__notice {
	margin: 0;
	font-size: 12px;
	color: #b32d2e;
}

/* Thread */
.armenius-livechat__thread-wrap {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.armenius-livechat__thread {
	height: 300px;
	max-height: 45vh;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f7f7f7;
}

.armenius-livechat__message {
	max-width: 82%;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.armenius-livechat__message--customer {
	align-self: flex-end;
	text-align: right;
}

.armenius-livechat__message--agent,
.armenius-livechat__message--bot {
	align-self: flex-start;
}

.armenius-livechat__message--notice {
	align-self: center;
	max-width: 100%;
	font-size: 12px;
	font-style: italic;
	color: #757575;
	text-align: center;
	padding: 2px 0;
}

.armenius-livechat__message-meta {
	font-size: 11px;
	color: #8a8a8a;
}

.armenius-livechat__message-bubble {
	display: inline-block;
	padding: 8px 11px;
	border-radius: 0;
	background: #fff;
	border: 1px solid #e4e4e4;
	color: var(--color-text, #454444);
	font-size: 14px;
	white-space: pre-wrap;
	word-break: break-word;
	text-align: left;
}

.armenius-livechat__message--customer .armenius-livechat__message-bubble {
	background: var(--color-dark-2, #2e2e2e);
	border-color: var(--color-dark-2, #2e2e2e);
	color: #fff;
}

.armenius-livechat__message--bot .armenius-livechat__message-bubble {
	border-color: var(--color-accent, #fc0);
}

/* Composer */
.armenius-livechat__composer {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e4e4e4;
	background: #fff;
	align-items: flex-end;
}

.armenius-livechat__composer textarea {
	flex: 1 1 auto;
	height: 40px;
	max-height: 90px;
	overflow-y: auto;
}

.armenius-livechat__thread-actions {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 4px 12px 10px;
	background: #fff;
}

/* Mobile */
@media (max-width: 1024px) {
	.armenius-livechat {
		right: 12px;
		bottom: 12px;
	}

	.armenius-livechat__launcher {
		min-height: 58px;
		padding: 10px 18px 10px 14px;
	}

	.armenius-livechat__launcher-title {
		font-size: 14px;
	}

	.armenius-livechat__panel {
		position: fixed;
		left: 10px;
		right: 10px;
		bottom: 84px;
		width: auto;
	}

	.armenius-livechat__thread {
		max-height: 50vh;
	}
}
