/* Artware Chat Bot — Widget styles
   All sizing and color vars are set via JS from awcbConfig. */

:root {
	--awcb-primary: #2f7df6;
	--awcb-radius:  14px;
	--awcb-shadow:  0 8px 32px rgba(0,0,0,.18);
	--awcb-z:       999999;
}

/* ── Launcher button ──────────────────────────────────────────────────────── */
#awcb-launcher {
	position: fixed;
	bottom: 24px;
	width:  56px;
	height: 56px;
	border-radius: 50%;
	background: var(--awcb-primary);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: var(--awcb-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: var(--awcb-z);
	transition: transform .15s, box-shadow .15s;
}
#awcb-launcher:hover {
	transform: scale(1.08);
	box-shadow: 0 10px 36px rgba(0,0,0,.22);
}
#awcb-launcher[data-position="right"] { right: 24px; }
#awcb-launcher[data-position="left"]  { left:  24px; }

#awcb-launcher svg { width: 26px; height: 26px; fill: currentColor; }

/* ── Widget panel ─────────────────────────────────────────────────────────── */
#awcb-panel {
	position: fixed;
	bottom: 92px;
	width:  370px;
	max-width: calc(100vw - 24px);
	height: 520px;
	max-height: calc(100vh - 110px);
	background: #fff;
	border-radius: var(--awcb-radius);
	box-shadow: var(--awcb-shadow);
	display: flex;
	flex-direction: column;
	z-index: var(--awcb-z);
	overflow: hidden;
	transition: opacity .2s, transform .2s;
}
#awcb-panel[data-position="right"] { right: 24px; }
#awcb-panel[data-position="left"]  { left:  24px; }
#awcb-panel.awcb-hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px) scale(.98);
}

/* ── Header ──────────────────────────────────────────────────────────────────*/
#awcb-header {
	background: var(--awcb-primary);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	border-radius: var(--awcb-radius) var(--awcb-radius) 0 0;
}
#awcb-header-name {
	font-size: 15px;
	font-weight: 600;
}
#awcb-close-btn {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	opacity: .8;
	line-height: 1;
	font-size: 20px;
}
#awcb-close-btn:hover { opacity: 1; }

/* ── Messages ────────────────────────────────────────────────────────────────*/
#awcb-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.awcb-msg {
	max-width: 88%;
	font-size: 14px;
	line-height: 1.55;
	border-radius: 10px;
	padding: 9px 13px;
	word-wrap: break-word;
}
.awcb-msg.awcb-msg-user {
	background: var(--awcb-primary);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 3px;
}
.awcb-msg.awcb-msg-bot {
	background: #f3f4f6;
	color: #111;
	align-self: flex-start;
	border-bottom-left-radius: 3px;
}

/* Typing indicator */
.awcb-typing {
	display: flex;
	gap: 5px;
	align-items: center;
	padding: 10px 14px;
	background: #f3f4f6;
	border-radius: 10px;
	border-bottom-left-radius: 3px;
	align-self: flex-start;
	width: fit-content;
}
.awcb-typing span {
	width:  8px;
	height: 8px;
	border-radius: 50%;
	background: #9ca3af;
	animation: awcb-bounce .9s infinite;
}
.awcb-typing span:nth-child(2) { animation-delay: .15s; }
.awcb-typing span:nth-child(3) { animation-delay: .30s; }

@keyframes awcb-bounce {
	0%, 80%, 100% { transform: scale(.7); opacity: .5; }
	40%           { transform: scale(1);  opacity: 1;  }
}

/* ── Product cards ───────────────────────────────────────────────────────────*/
.awcb-cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-self: stretch;
	max-width: 100%;
}

.awcb-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.awcb-card-img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	display: block;
	background: #f9f9f9;
}
.awcb-card-body {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.awcb-card-name {
	font-size: 13px;
	font-weight: 600;
	color: #111;
	text-decoration: none;
}
.awcb-card-name:hover { text-decoration: underline; }
.awcb-card-price {
	font-size: 13px;
	color: #374151;
}
.awcb-card-btn {
	margin-top: 4px;
	padding: 7px 12px;
	background: var(--awcb-primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	text-align: center;
	width: 100%;
}
.awcb-card-btn:hover { filter: brightness(1.1); }

/* Variation select */
.awcb-variation-select {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
	margin-bottom: 4px;
}

/* ── Lead form ───────────────────────────────────────────────────────────────*/
.awcb-lead-form {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
}
.awcb-lead-form input {
	width: 100%;
	box-sizing: border-box;
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
}
.awcb-lead-form button {
	padding: 8px;
	background: var(--awcb-primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
}
.awcb-lead-form button:hover { filter: brightness(1.1); }
.awcb-lead-error {
	color: #dc2626;
	font-size: 12px;
}

/* ── Input bar ───────────────────────────────────────────────────────────────*/
#awcb-input-bar {
	padding: 10px 12px;
	border-top: 1px solid #e5e7eb;
	display: flex;
	gap: 8px;
	align-items: flex-end;
	flex-shrink: 0;
	background: #fff;
}
#awcb-input {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	resize: none;
	max-height: 100px;
	overflow-y: auto;
	line-height: 1.4;
	font-family: inherit;
	color: #111;
}
#awcb-input:focus { outline: none; border-color: var(--awcb-primary); }
#awcb-send-btn {
	padding: 8px 14px;
	background: var(--awcb-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	flex-shrink: 0;
	align-self: flex-end;
}
#awcb-send-btn:hover { filter: brightness(1.1); }
#awcb-send-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Mobile ──────────────────────────────────────────────────────────────────*/
@media (max-width: 480px) {
	#awcb-panel {
		bottom: 0;
		right: 0 !important;
		left: 0 !important;
		width: 100%;
		max-width: 100%;
		border-radius: 14px 14px 0 0;
		height: 75vh;
	}
	#awcb-launcher {
		bottom: 16px;
	}
}
