/* Asistentul virtual al shopului hyllanpharma.ro – fereastra de chat. Referința vizuală: SPEC §15, docs/ui-referinta/. */

.asistent-shop {
	--asistent-primar: #5246ff;
	--asistent-fundal: #f8fafc;
	--asistent-text: #1f2937;
	--asistent-bordura: #e5e7eb;
	--asistent-umbra: 0 18px 45px rgba(0, 0, 0, 0.18);
	--asistent-portocaliu: #f58220;
	font-family: Jost, Arial, Helvetica, sans-serif;
	color: var(--asistent-text);
}

.asistent-shop *,
.asistent-shop *::before,
.asistent-shop *::after {
	box-sizing: border-box;
}

/* Resetări față de stilurile temei pentru butoane și câmpuri. */
.asistent-shop button,
.asistent-shop textarea {
	margin: 0;
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-height: 0;
	min-width: 0;
	line-height: normal;
}

.asistent-shop button {
	cursor: pointer;
	border: 0;
}

.asistent-shop button:disabled {
	cursor: default;
}

.asistent-shop :focus-visible {
	outline: 2px solid var(--asistent-primar);
	outline-offset: 2px;
}

.asistent-shop [hidden] {
	display: none !important;
}

.asistent-shop .asistent-shop-ascuns {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Bula închisă: 54×54, dreapta jos. */
.asistent-shop .asistent-shop-lansator {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99998;
	width: 54px;
	height: 54px;
	padding: 0;
	border-radius: 50%;
	background: var(--asistent-primar);
	color: #fff;
	box-shadow: 0 10px 25px rgba(82, 70, 255, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

.asistent-shop .asistent-shop-lansator:hover {
	transform: scale(1.05);
}

/* Fereastra: 430×650, radius 24. */
.asistent-shop .asistent-shop-fereastra {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	width: 430px;
	height: 650px;
	max-width: calc(100vw - 48px);
	max-height: calc(100vh - 48px);
	display: flex;
	flex-direction: column;
	background: var(--asistent-fundal);
	border: 1px solid var(--asistent-bordura);
	border-radius: 24px;
	box-shadow: var(--asistent-umbra);
	overflow: hidden;
}

/* Antetul: 72 px, cardul asistentului la mijloc. */
.asistent-shop .asistent-shop-antet {
	flex: 0 0 72px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 0 14px;
}

.asistent-shop .asistent-shop-buton-rotund {
	width: 40px;
	height: 42px;
	padding: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, 0.08);
	color: #111827;
	font-size: 22px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
}

.asistent-shop .asistent-shop-nou {
	background: transparent;
	color: var(--asistent-primar);
	border: 1.5px solid var(--asistent-primar);
	width: 34px;
	height: 34px;
}

.asistent-shop .asistent-shop-identitate {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 18px 8px 10px;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.asistent-shop .asistent-shop-avatar-antet {
	position: relative;
	display: inline-flex;
}

.asistent-shop .asistent-shop-online {
	position: absolute;
	top: 0;
	right: 0;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
}

.asistent-shop .asistent-shop-nume {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	white-space: nowrap;
}

.asistent-shop .asistent-shop-avatar {
	display: inline-flex;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.asistent-shop .asistent-shop-avatar-antet .asistent-shop-avatar {
	width: 34px;
	height: 34px;
}

.asistent-shop .asistent-shop-avatar--initiala {
	align-items: center;
	justify-content: center;
	background: var(--asistent-primar);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

/* Mesajele. */
.asistent-shop .asistent-shop-mesaje {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 8px 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	overscroll-behavior: contain;
}

.asistent-shop .asistent-shop-mesaj {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.asistent-shop .asistent-shop-mesaj--client {
	justify-content: flex-end;
}

.asistent-shop .asistent-shop-continut {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 85%;
}

.asistent-shop .asistent-shop-bula {
	padding: 12px 14px;
	border-radius: 14px;
	font-size: 12px;
	line-height: 18px;
	overflow-wrap: anywhere;
}

.asistent-shop .asistent-shop-mesaj--asistent .asistent-shop-bula {
	background: #fff;
	color: #222;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.asistent-shop .asistent-shop-mesaj--client .asistent-shop-bula {
	max-width: 85%;
	background: var(--asistent-primar);
	color: #fff;
	white-space: pre-wrap;
}

.asistent-shop .asistent-shop-bula--notificare {
	background: #fff7ed !important;
	border: 1px solid #fed7aa;
}

.asistent-shop .asistent-shop-bula p,
.asistent-shop .asistent-shop-bula ul {
	margin: 0 0 8px;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.asistent-shop .asistent-shop-bula ul {
	padding-left: 18px;
	list-style: disc;
}

.asistent-shop .asistent-shop-bula li {
	margin: 0 0 2px;
}

.asistent-shop .asistent-shop-bula > :last-child {
	margin-bottom: 0;
}

.asistent-shop .asistent-shop-bula a {
	color: var(--asistent-primar);
	text-decoration: underline;
}

/* Indicatorul „scrie”. */
.asistent-shop .asistent-shop-scrie {
	display: flex;
	gap: 4px;
	padding: 14px;
}

.asistent-shop .asistent-shop-scrie span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9ca3af;
	animation: asistent-shop-puncte 1s infinite ease-in-out;
}

.asistent-shop .asistent-shop-scrie span:nth-child(2) {
	animation-delay: 0.15s;
}

.asistent-shop .asistent-shop-scrie span:nth-child(3) {
	animation-delay: 0.3s;
}

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

/* Feedback. */
.asistent-shop .asistent-shop-feedback {
	display: flex;
	gap: 6px;
}

.asistent-shop .asistent-shop-feedback-buton {
	padding: 2px 8px;
	border-radius: 10px;
	background: transparent;
	border: 1px solid var(--asistent-bordura);
	font-size: 13px;
	line-height: 20px;
	opacity: 0.75;
}

.asistent-shop .asistent-shop-feedback-buton[aria-pressed="true"] {
	opacity: 1;
	border-color: var(--asistent-primar);
	background: #eef0ff;
}

/* Câmpul și butonul de trimitere. */
.asistent-shop .asistent-shop-formular {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 16px 4px;
	margin: 0;
}

/* Cu id: tema (Woodmart) dă textarea-urilor min-height: 190px, cu specificitate mai mare decât o clasă. */
#asistent-shop textarea.asistent-shop-intrebare {
	flex: 1 1 auto;
	box-sizing: border-box;
	min-height: 46px;
	height: auto; /* rows="1": 20 px rând + 2 × 12 px padding + 2 × 1 px bordură = 46 px; JS-ul o crește până la 120 px */
	max-height: 120px;
	margin: 0;
	padding: 12px 14px;
	background: #fff;
	color: var(--asistent-text);
	border: 1px solid #d1d5db;
	border-radius: 14px;
	box-shadow: none;
	font-size: 14px;
	line-height: 20px;
	resize: none;
	overflow-y: auto;
}

.asistent-shop .asistent-shop-intrebare::placeholder {
	color: #6b7280;
}

.asistent-shop .asistent-shop-trimite {
	flex: 0 0 46px;
	width: 46px;
	height: 46px;
	padding: 0;
	border-radius: 14px;
	background: var(--asistent-primar);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.asistent-shop .asistent-shop-trimite:disabled {
	opacity: 0.6;
}

.asistent-shop .asistent-shop-nota {
	flex: 0 0 auto;
	margin: 0;
	padding: 4px 16px 12px;
	font-size: 10.5px;
	line-height: 14px;
	color: #6b7280;
}

.asistent-shop .asistent-shop-nota a {
	color: #6b7280;
	text-decoration: underline;
}

/* Cardul de produs, stil Woodmart (§15). */
.asistent-shop .asistent-shop-card {
	position: relative;
	padding: 15px;
	background: #f4f4f4;
	border-radius: 10px;
	text-align: center;
}

.asistent-shop .asistent-shop-card-reducere {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	padding: 3px 7px;
	background: #a30000;
	color: #fff;
	border-radius: 5px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1.3;
}

.asistent-shop .asistent-shop-card-imagine {
	display: block;
	margin-bottom: 10px;
}

.asistent-shop .asistent-shop-card-imagine img {
	display: block;
	width: 100%;
	height: 160px;
	object-fit: contain;
	border-radius: 8px;
	background: #fff;
}

.asistent-shop .asistent-shop-card-titlu {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	text-transform: none;
}

.asistent-shop .asistent-shop-card-titlu a {
	color: #333;
	text-decoration: none;
}

.asistent-shop .asistent-shop-card-pret {
	margin: 0 0 10px;
	font-size: 16px;
}

.asistent-shop .asistent-shop-card-pret del {
	color: #bbb;
}

.asistent-shop .asistent-shop-card-pret-nou {
	color: var(--asistent-portocaliu);
	font-weight: 600;
}

.asistent-shop .asistent-shop-card-actiuni {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 12px;
}

.asistent-shop .asistent-shop-card-cos {
	padding: 10px 18px;
	background: var(--asistent-portocaliu);
	color: #fff;
	border-radius: 35px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1.2;
}

.asistent-shop .asistent-shop-card-cos:disabled {
	opacity: 0.8;
}

.asistent-shop .asistent-shop-card-detalii,
.asistent-shop .asistent-shop-card-vezi-cos {
	font-size: 13px;
	font-weight: 600;
	color: #333;
	text-decoration: underline;
}

.asistent-shop .asistent-shop-card-eroare {
	flex: 1 0 100%;
	margin: 0;
	font-size: 12px;
	color: #a30000;
}

/* Mobil: fereastra pe tot ecranul; bara de jos Woodmart ascunsă cât e deschisă (§15). */
@media (max-width: 600px) {
	.asistent-shop .asistent-shop-lansator {
		right: 16px;
		bottom: 76px;
	}

	.asistent-shop .asistent-shop-fereastra {
		inset: 0;
		width: 100%;
		height: 100%;
		height: 100dvh;
		max-width: none;
		max-height: none;
		border: 0;
		border-radius: 0;
	}

	#asistent-shop textarea.asistent-shop-intrebare {
		font-size: 16px; /* sub 16 px, iOS mărește pagina la focus */
	}

	html.asistent-shop-deschis,
	html.asistent-shop-deschis body {
		overflow: hidden;
	}

	html.asistent-shop-deschis .wd-toolbar {
		display: none !important;
	}
}

@media print {
	.asistent-shop {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asistent-shop .asistent-shop-scrie span,
	.asistent-shop .asistent-shop-lansator {
		animation: none;
		transition: none;
	}
}
