/**
 * Aura by ScentAI — storefront chat styles.
 */

.aura-widget {
	--aura-ink: #1b1f2a;
	--aura-mist: #f7f5f2;
	--aura-sand: #e6ded4;
	--aura-blush: #e9c8c1;
	--aura-sage: #c2d4ce;
	--aura-azure: #5fa8ff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--aura-ink);
	box-sizing: border-box;
}

.aura-widget *,
.aura-widget *::before,
.aura-widget *::after {
	box-sizing: inherit;
}

/* ---------- Bubble ---------- */

.aura-widget--bubble {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
}

.aura-bubble {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 2px solid var(--aura-mist);
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	background: var(--aura-ink);
	box-shadow: 0 16px 40px rgba(27, 31, 42, .28);
	transition: transform .2s ease;
}

.aura-bubble:hover {
	transform: translateY(-2px) scale(1.03);
}

.aura-bubble img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aura-bubble__pulse {
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(95, 168, 255, .45);
	animation: aura-pulse 2.6s ease-out infinite;
	pointer-events: none;
}

@keyframes aura-pulse {
	0% { transform: scale(.9); opacity: .8; }
	100% { transform: scale(1.25); opacity: 0; }
}

/* ---------- Panel ---------- */

.aura-panel-chat {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: 100%;
	background: var(--aura-mist);
	border: 1px solid var(--aura-sand);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(27, 31, 42, .16);
}

.aura-widget--bubble .aura-panel-chat {
	position: absolute;
	right: 0;
	bottom: 82px;
	width: min(400px, calc(100vw - 32px));
	
	/* DESKTOP FIX: Set height to 640px target, and clamp min-height safely */
	height: clamp(480px, 70vh, 640px);
	max-height: calc(100dvh - 120px);

}

@media (max-width: 600px) {
	.aura-widget--bubble .aura-panel-chat {
		position: fixed;
		right: 12px;
		left: 12px;
		bottom: 96px;
		width: auto;
		
		/* MOBILE FIX: Allow flexible height on small viewports without hard min-height conflicts */
		height: clamp(320px, 65dvh, calc(100dvh - 120px));
		max-height: calc(100dvh - 110px);
	}
}


.aura-panel-chat[hidden] {
	display: none;
}

.aura-chat__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--aura-ink);
	color: var(--aura-mist);
}

.aura-chat__avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(247, 245, 242, .35);
}

.aura-chat__id {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.aura-chat__id strong {
	font-size: 15px;
	letter-spacing: .04em;
}

.aura-chat__id span {
	font-size: 11px;
	opacity: .7;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.aura-chat__close {
	margin-left: auto;
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	opacity: .7;
}

.aura-chat__close:hover {
	opacity: 1;
}

.aura-chat__head,
.aura-chat__suggestions,
.aura-chat__form,
.aura-chat__legal {
	flex: 0 0 auto;
}

.aura-chat__log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}


.aura-msg {
	max-width: 86%;
	padding: 11px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	animation: aura-in .24s ease;
}

@keyframes aura-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.aura-msg--aura {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--aura-sand);
	border-bottom-left-radius: 6px;
}

.aura-msg--user {
	align-self: flex-end;
	background: var(--aura-ink);
	color: var(--aura-mist);
	border-bottom-right-radius: 6px;
}

.aura-msg--typing {
	display: flex;
	gap: 5px;
	align-items: center;
}

.aura-msg--typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--aura-azure);
	animation: aura-blink 1.1s infinite ease-in-out;
}

.aura-msg--typing i:nth-child(2) { animation-delay: .18s; }
.aura-msg--typing i:nth-child(3) { animation-delay: .36s; }

@keyframes aura-blink {
	0%, 80%, 100% { opacity: .25; }
	40% { opacity: 1; }
}

/* ---------- Product cards ---------- */

.aura-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-self: stretch;
}

.aura-product {
	display: flex;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--aura-sand);
	border-radius: 16px;
	padding: 12px;
	position: relative;
	animation: aura-in .3s ease;
}

.aura-product__media {
	flex: 0 0 88px;
	width: 88px;
	height: 110px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--aura-sand);
}

.aura-product__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aura-product__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.aura-product__name {
	font-size: 14px;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
}

.aura-product__match {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	background: var(--aura-sage);
	color: var(--aura-ink);
	border-radius: 999px;
	padding: 3px 9px;
}

.aura-product__price {
	font-size: 14px;
	color: var(--aura-ink);
}

.aura-product__price del {
	opacity: .5;
	margin-right: 4px;
}

.aura-product__why {
	font-size: 12.5px;
	line-height: 1.45;
	color: #4b5563;
	margin: 0;
}

.aura-product__notes {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.aura-note {
	font-size: 10.5px;
	letter-spacing: .04em;
	text-transform: uppercase;
	background: var(--aura-mist);
	border: 1px solid var(--aura-sand);
	border-radius: 999px;
	padding: 2px 8px;
	color: #4b5563;
}

.aura-product__actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
	flex-wrap: wrap;
}

.aura-btn {
	appearance: none;
	border: 1px solid var(--aura-ink);
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all .15s ease;
	line-height: 1.2;
}

.aura-btn--ghost {
	background: transparent;
	color: var(--aura-ink);
}

.aura-btn--ghost:hover {
	background: var(--aura-sand);
	color: var(--aura-ink);
}

.aura-btn--solid {
	background: var(--aura-ink);
	color: var(--aura-mist);
}

.aura-btn--solid:hover {
	background: #10131b;
	color: #fff;
}

.aura-btn[disabled] {
	opacity: .55;
	cursor: not-allowed;
}

.aura-btn.is-added {
	background: var(--aura-sage);
	border-color: var(--aura-sage);
	color: var(--aura-ink);
}

/* ---------- Suggestions & form ---------- */

.aura-chat__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 16px 8px;
}

.aura-suggestion {
	background: #fff;
	border: 1px solid var(--aura-sand);
	color: var(--aura-ink);
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12px;
	cursor: pointer;
	transition: all .15s ease;
}

.aura-suggestion:hover {
	border-color: var(--aura-azure);
	background: var(--aura-mist);
}

.aura-chat__form {
	display: flex;
	gap: 8px;
	padding: 12px 16px 6px;
	border-top: 1px solid var(--aura-sand);
	background: #fff;
}

.aura-chat__input {
	flex: 1 1 auto;
	border: 1px solid var(--aura-sand);
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 14px;
	background: var(--aura-mist);
	color: var(--aura-ink);
	outline: none;
	min-width: 0;
}

.aura-chat__input:focus {
	border-color: var(--aura-azure);
	box-shadow: 0 0 0 3px rgba(95, 168, 255, .16);
}

.aura-chat__send {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 0;
	background: var(--aura-ink);
	color: var(--aura-mist);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.aura-chat__send:hover {
	background: #10131b;
}

.aura-chat__legal {
	margin: 0;
	padding: 4px 16px 12px;
	font-size: 10.5px;
	color: #8b8f98;
	background: #fff;
	text-align: center;
}

@media (max-width: 480px) {
	.aura-widget--bubble .aura-panel-chat {
		right: -8px;
		width: calc(100vw - 24px);
		height: calc(100vh - 130px);
	}

	.aura-product {
		flex-direction: column;
	}

	.aura-product__media {
		width: 100%;
		height: 160px;
		flex-basis: auto;
	}
}
