/* Aria: the CRETE skincare advisor chat (aria.js). Cream and gold, glowing like the bag and checkout. */

.aria {
	--aria-ink: #151515;
	--aria-muted: #7b6f63;
	--aria-gold: #c49a5c;
	--aria-cream: #fbf6ef;
	--aria-line: rgb(196 154 92 / 0.24);
	--aria-sale: #b5463d;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 95;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--aria-ink);
}

.aria [hidden] {
	display: none !important;
}

/* ---- Launcher ---- */
.aria-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 5px 18px 5px 5px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--aria-ink);
	cursor: pointer;
	background: linear-gradient(180deg, #fffaf2, #f6e8d2);
	border: 1px solid rgb(196 154 92 / 0.45);
	border-radius: 999px;
	box-shadow: 0 0 0 4px rgb(226 190 130 / 0.16), 0 14px 34px -12px rgb(176 128 66 / 0.8);
	transition: transform 0.2s, box-shadow 0.2s;
}

.aria-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 0 0 5px rgb(226 190 130 / 0.22), 0 18px 40px -12px rgb(176 128 66 / 0.85);
}

.aria.is-open .aria-launcher__label {
	display: none;
}

.aria.is-open .aria-launcher {
	padding-right: 5px;
}

.aria-launcher__face,
.aria-head__face {
	position: relative;
	flex: none;
}

.aria-launcher__face img,
.aria-head__face img,
.aria-row__face img {
	display: block;
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 50%;
	box-shadow: 0 0 0 2px #fff;
}

.aria-online {
	position: absolute;
	right: 1px;
	bottom: 1px;
	width: 11px;
	height: 11px;
	background: #3fae6a;
	border: 2px solid #fff;
	border-radius: 50%;
}

/* ---- Teaser bubble ---- */
.aria-teaser {
	position: relative;
	max-width: 250px;
	padding: 14px 30px 14px 16px;
	font-size: 14px;
	line-height: 1.45;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--aria-line);
	border-radius: 18px 18px 4px 18px;
	box-shadow: 0 18px 40px -18px rgb(120 86 40 / 0.55);
	animation: aria-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.aria-teaser p {
	margin: 0;
}

.aria-teaser strong {
	display: block;
	margin-bottom: 2px;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--aria-gold);
}

.aria-teaser__close {
	position: absolute;
	top: 6px;
	right: 8px;
	padding: 2px 6px;
	font-size: 16px;
	line-height: 1;
	color: var(--aria-muted);
	cursor: pointer;
	background: none;
	border: 0;
}

/* ---- Panel ---- */
.aria-panel {
	order: -1;
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(620px, calc(100vh - 120px));
	overflow: hidden;
	background: linear-gradient(180deg, #fffdf9, var(--aria-cream));
	border: 1px solid var(--aria-line);
	border-radius: 24px;
	box-shadow: 0 0 0 6px rgb(226 190 130 / 0.1), 0 30px 70px -24px rgb(110 76 34 / 0.6);
	animation: aria-rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.aria-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: linear-gradient(180deg, #fffaf2, #f7ead6);
	border-bottom: 1px solid var(--aria-line);
}

.aria-head__text {
	display: grid;
	flex: 1;
	line-height: 1.25;
}

.aria-head__text strong {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.aria-head__text span {
	font-size: 12px;
	color: var(--aria-muted);
}

.aria-close {
	width: 34px;
	height: 34px;
	font-size: 22px;
	line-height: 1;
	color: var(--aria-muted);
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 50%;
}

.aria-close:hover {
	background: rgb(196 154 92 / 0.14);
}

.aria-log {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	padding: 16px 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.aria-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	max-width: 100%;
}

.aria-row__face img {
	width: 28px;
	height: 28px;
	margin-top: 2px;
}

.aria-row__col {
	display: grid;
	gap: 8px;
	min-width: 0;
	max-width: calc(100% - 36px);
}

.aria-msg {
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.5;
	overflow-wrap: anywhere;
	border-radius: 18px;
}

.aria-msg p,
.aria-msg ul {
	margin: 0;
}

.aria-msg p + p,
.aria-msg p + ul,
.aria-msg ul + p {
	margin-top: 8px;
}

.aria-msg ul {
	padding-left: 18px;
}

.aria-msg a {
	color: inherit;
	text-decoration: underline;
}

.aria-msg--aria {
	justify-self: start;
	background: #fff;
	border: 1px solid var(--aria-line);
	border-top-left-radius: 6px;
}

.aria-msg--user {
	align-self: flex-end;
	max-width: 82%;
	color: #fff;
	background: var(--aria-ink);
	border-bottom-right-radius: 6px;
}

/* Typing dots */
.aria-typing .aria-msg {
	display: inline-flex;
	gap: 4px;
	padding: 14px 16px;
}

.aria-typing i {
	width: 6px;
	height: 6px;
	background: var(--aria-gold);
	border-radius: 50%;
	animation: aria-dot 1.2s infinite ease-in-out;
}

.aria-typing i:nth-child(2) { animation-delay: 0.15s; }
.aria-typing i:nth-child(3) { animation-delay: 0.3s; }

/* ---- Product cards ---- */
.aria-card {
	display: flex;
	gap: 12px;
	padding: 10px;
	background: #fff;
	border: 1px solid var(--aria-line);
	border-radius: 16px;
	box-shadow: 0 12px 26px -18px rgb(140 100 50 / 0.7);
}

.aria-card__img {
	flex: none;
}

.aria-card__img img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 12px;
}

.aria-card__body {
	display: grid;
	align-content: start;
	gap: 4px;
	min-width: 0;
}

.aria-card__name {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--aria-ink);
	text-decoration: none;
}

.aria-card__name:hover {
	text-decoration: underline;
}

.aria-card__price {
	font-size: 13px;
}

.aria-card__price s {
	color: var(--aria-muted);
}

.aria-card__price b {
	font-weight: 600;
}

.aria-card__price em {
	margin-left: 6px;
	font-size: 11px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--aria-sale);
}

.aria-card__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 2px;
}

.aria-card__add {
	padding: 7px 14px;
	font: inherit;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #fff;
	cursor: pointer;
	background: var(--aria-ink);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 8px 18px -10px rgb(21 21 21 / 0.8);
}

.aria-card__add:hover {
	background: #2d2d2d;
}

.aria-card__add.is-added {
	background: #3fae6a;
}

.aria-card__add:disabled {
	cursor: default;
}

.aria-card__view {
	font-size: 12.5px;
	color: var(--aria-muted);
}

.aria-card__out {
	font-size: 12px;
	color: var(--aria-muted);
}

/* ---- Suggestions, input, note ---- */
.aria-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 14px 10px;
}

.aria-chips:empty {
	display: none;
}

.aria-chip {
	padding: 7px 12px;
	font: inherit;
	font-size: 12.5px;
	color: #6b4f28;
	cursor: pointer;
	background: #fffaf2;
	border: 1px solid rgb(196 154 92 / 0.45);
	border-radius: 999px;
	transition: background-color 0.2s;
}

.aria-chip:hover {
	background: #f6e8d2;
}

.aria-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0 12px;
	padding: 6px 6px 6px 14px;
	background: #fff;
	border: 1px solid var(--aria-line);
	border-radius: 22px;
	box-shadow: 0 0 0 3px rgb(226 190 130 / 0.12);
}

.aria-form textarea {
	flex: 1;
	min-height: 22px;
	max-height: 120px;
	padding: 7px 0;
	font: inherit;
	font-size: 14px;
	line-height: 1.45;
	color: var(--aria-ink);
	resize: none;
	background: none;
	border: 0;
	outline: none;
	box-shadow: none;
}

.aria-form button {
	display: grid;
	flex: none;
	place-items: center;
	width: 36px;
	height: 36px;
	color: #fff;
	cursor: pointer;
	background: var(--aria-ink);
	border: 0;
	border-radius: 50%;
}

.aria-note {
	margin: 0;
	padding: 8px 14px 12px;
	font-size: 11px;
	text-align: center;
	color: var(--aria-muted);
}

@keyframes aria-rise {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

@keyframes aria-dot {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* ---- Phones: the chat fills the screen; the launcher is just Aria's face ---- */
@media (max-width: 600px) {
	.aria {
		right: 14px;
		bottom: 14px;
	}

	.aria-launcher__label {
		display: none;
	}

	.aria-launcher {
		padding: 4px;
	}

	.aria.is-open {
		inset: 0;
		gap: 0;
	}

	.aria.is-open .aria-launcher {
		display: none;
	}

	.aria-panel {
		width: 100%;
		height: 100%;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.aria-form textarea {
		font-size: 16px; /* no zoom on focus in iOS */
	}

	.aria-note {
		padding-bottom: calc(12px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.aria-teaser,
	.aria-panel,
	.aria-typing i {
		animation: none;
	}
}

/* Phones: sit above the theme's sticky Add to cart bar on product pages. */
@media (max-width: 749px) {
	body.has-buybar .aria:not(.is-open) {
		bottom: calc(84px + env(safe-area-inset-bottom));
	}
}
