.wa-mailbot-chat {
	/* Farebnosť webu (Automatic.css), s pôvodnými farbami ako fallback,
	keby --primary z nejakého dôvodu nebolo dostupné. */
	--wa-mailbot-accent: var(--primary, #1e293b);
	--wa-mailbot-accent-hover: var(--primary-hover, #334155);
	position: fixed;
	/* --wa-mailbot-chat-offset: téma ho nastaví, keď má dole pripnutú lištu
	   (napr. „Vložiť do košíka" na mobile), aby spúšťač sedel nad ňou. */
	bottom: calc(20px + var(--wa-mailbot-chat-offset, 0px));
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
}

/* Bez tohto by `display:flex` na paneli/formulári prebilo atribút [hidden]. */
.wa-mailbot-chat [hidden] {
	display: none !important;
}

.wa-mailbot-chat__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.wa-mailbot-chat button:focus-visible,
.wa-mailbot-chat input:focus-visible {
	outline: 2px solid var(--wa-mailbot-accent);
	outline-offset: 2px;
}

.wa-mailbot-chat--right {
	right: 20px;
}

.wa-mailbot-chat--left {
	left: 20px;
}

.wa-mailbot-chat__launcher {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	padding: 0;
	background: var(--wa-mailbot-accent);
	color: #fff;
	border: 2px solid #fff;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.wa-mailbot-chat__launcher[hidden] {
	display: none;
}

.wa-mailbot-chat__launcher svg {
	display: block;
}

.wa-mailbot-chat__panel {
	position: absolute;
	bottom: 68px;
	right: 0;
	width: 320px;
	max-width: calc(100vw - 40px);
	height: 420px;
	max-height: min(70vh, calc(100vh - 108px - var(--wa-mailbot-chat-offset, 0px)));
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wa-mailbot-chat--left .wa-mailbot-chat__panel {
	right: auto;
	left: 0;
}

.wa-mailbot-chat__header {
	background: var(--wa-mailbot-accent);
	color: #fff;
	padding: 10px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wa-mailbot-chat__close {
	background: none;
	border: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.wa-mailbot-chat__header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wa-mailbot-chat__new {
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 4px;
	color: #fff;
	font-size: 12px;
	line-height: 1;
	padding: 4px 8px;
	cursor: pointer;
}

.wa-mailbot-chat__new-inline {
	align-self: center;
	background: var(--wa-mailbot-accent);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 14px;
	cursor: pointer;
}

.wa-mailbot-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wa-mailbot-chat__msg {
	max-width: 85%;
	padding: 8px 12px;
	border-radius: 10px;
	word-break: break-word;
}

.wa-mailbot-chat__msg--user {
	align-self: flex-end;
	background: var(--wa-mailbot-accent);
	color: #fff;
	/* Vlastný text návštevníka (vložený cez textContent) nemá <p>/<br> —
	   riadky drží pohromade len surový znak nového riadku. */
	white-space: pre-wrap;
}

.wa-mailbot-chat__msg--bot {
	align-self: flex-start;
	background: #f1f5f9;
	color: #0f172a;
}

/* Odpoveď bota je teraz skutočné HTML z wpautop() (<p>, <br>) — bez
   pre-wrap, inak by sa surové \n medzi značkami spočítali s okrajmi
   odstavcov a odpoveď by mala zbytočné medzery navyše. */
.wa-mailbot-chat__msg--bot p {
	margin: 0 0 8px;
}

.wa-mailbot-chat__msg--bot p:last-child {
	margin-bottom: 0;
}

.wa-mailbot-chat__msg--bot .wa-mailbot-product {
	margin-top: 8px;
	padding: 8px;
	background: #fff;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
}

.wa-mailbot-chat__msg--bot .wa-mailbot-product img {
	border-radius: 6px;
}

.wa-mailbot-chat__msg--bot a {
	color: var(--wa-mailbot-accent);
}

.wa-mailbot-chat__consent {
	background: #f1f5f9;
	border-radius: 10px;
	padding: 10px 12px;
	text-align: center;
}

.wa-mailbot-chat__consent-text {
	margin: 0 0 8px;
	color: #334155;
}

.wa-mailbot-chat__consent-text p,
.wa-mailbot-chat__consent-text ul,
.wa-mailbot-chat__consent-text ol {
	margin: 0 0 6px;
}

.wa-mailbot-chat__consent-text ul,
.wa-mailbot-chat__consent-text ol {
	padding-left: 20px;
	text-align: left;
}

.wa-mailbot-chat__consent-text a {
	color: var(--wa-mailbot-accent);
	text-decoration: underline;
}

.wa-mailbot-chat__consent-accept {
	background: var(--wa-mailbot-accent);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 6px 12px;
	cursor: pointer;
}

.wa-mailbot-chat__msg--system {
	align-self: center;
	color: #94a3b8;
	font-style: italic;
	white-space: pre-wrap;
	background: none;
	padding: 2px;
}

.wa-mailbot-chat__form {
	display: flex;
	background: #fff;
	border-top: 1px solid #e2e8f0;
}

.wa-mailbot-chat__input {
	flex: 1;
	border: none;
	padding: 10px 12px;
	outline: none;
}

.wa-mailbot-chat__send {
	background: var(--wa-mailbot-accent);
	color: #fff;
	border: none;
	padding: 0 14px;
	cursor: pointer;
}

/* Témy štýlujú odosielacie tlačidlá globálne — mobilky napr. `.woocommerce
   button[type="submit"]` (0,2,1) na tyrkysovo a VEĽKÝMI písmenami, čo na stránkach
   s body.woocommerce (produkt, kategória) prebilo tlačidlá chatu. (0,2,2) vyhrá;
   farbu pozadia a rámik vracia každé tlačidlo samo nižšie. */
.wa-mailbot-chat form button[type="submit"] {
	border: none;
	font: inherit;
	line-height: normal;
	letter-spacing: normal;
	text-transform: none;
}

.wa-mailbot-chat form .wa-mailbot-chat__send {
	background: var(--wa-mailbot-accent);
	border-radius: 0;
	padding: 0 14px;
}

.wa-mailbot-chat form .wa-mailbot-chat__email-send,
.wa-mailbot-chat form .wa-mailbot-chat__verify-send {
	background: var(--wa-mailbot-accent);
	border-radius: 6px;
	padding: 8px 12px;
}

.wa-mailbot-chat form button[type="submit"]:not(:disabled):hover {
	border: none;
	background: var(--wa-mailbot-accent-hover);
}

.wa-mailbot-chat__send:disabled,
.wa-mailbot-chat__email-send:disabled,
.wa-mailbot-chat__verify-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wa-mailbot-chat__email,
.wa-mailbot-chat__verify {
	align-self: stretch;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	background: #f1f5f9;
	border-radius: 10px;
	padding: 10px 12px;
}

.wa-mailbot-chat__email-input,
.wa-mailbot-chat__verify-input {
	flex: 1 1 140px;
	min-width: 0;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 8px;
	font-size: 16px; /* pod 16px iOS pri fokuse približuje stránku */
}

.wa-mailbot-chat__email-send,
.wa-mailbot-chat__verify-send {
	background: var(--wa-mailbot-accent);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 12px;
	cursor: pointer;
}

.wa-mailbot-chat__email-error,
.wa-mailbot-chat__verify-error {
	flex-basis: 100%;
	color: #b91c1c;
	font-size: 13px;
}

.wa-mailbot-chat__email-error:empty,
.wa-mailbot-chat__verify-error:empty {
	display: none;
}

.wa-mailbot-chat__input {
	font-size: 16px;
}

/* Mobil: otvorený chat cez celú obrazovku (dvh = výška bez lišty prehliadača, aj pri klávesnici). */
@media (max-width: 768px) {
	.wa-mailbot-chat {
		bottom: calc(12px + var(--wa-mailbot-chat-offset, 0px));
	}

	.wa-mailbot-chat--right {
		right: 12px;
	}

	.wa-mailbot-chat--left {
		left: 12px;
	}

	/* (0,2,0) — inak by `.wa-mailbot-chat--left .wa-mailbot-chat__panel { right: auto }` panel zúžilo. */
	.wa-mailbot-chat .wa-mailbot-chat__panel {
		position: fixed;
		inset: 0;
		width: auto;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}

	/* Stránka pod fullscreen chatom sa nemá posúvať (trieda z JS pri otvorení). */
	html.wa-mailbot-chat-open,
	html.wa-mailbot-chat-open body {
		overflow: hidden;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.wa-mailbot-chat__launcher {
		transition: transform 0.15s ease;
	}
}

@media (hover: hover) {
	.wa-mailbot-chat__launcher:hover,
	.wa-mailbot-chat__send:not(:disabled):hover,
	.wa-mailbot-chat__new-inline:hover,
	.wa-mailbot-chat__consent-accept:hover,
	.wa-mailbot-chat__email-send:not(:disabled):hover,
	.wa-mailbot-chat__verify-send:not(:disabled):hover {
		background: var(--wa-mailbot-accent-hover);
	}
}

@media (prefers-color-scheme: dark) {
	.wa-mailbot-chat__email,
	.wa-mailbot-chat__verify,
	.wa-mailbot-chat__consent {
		background: #1e293b;
	}

	.wa-mailbot-chat__consent-text {
		color: #e2e8f0;
	}

	.wa-mailbot-chat__email-input,
	.wa-mailbot-chat__verify-input {
		background: #0f172a;
		color: #e2e8f0;
		border-color: #475569;
	}

	.wa-mailbot-chat__email-error,
	.wa-mailbot-chat__verify-error {
		color: #fca5a5;
	}

	.wa-mailbot-chat__panel {
		background: #0f172a;
	}

	.wa-mailbot-chat__msg--bot {
		background: #1e293b;
		color: #e2e8f0;
	}

	.wa-mailbot-chat__input {
		background: #0f172a;
		color: #e2e8f0;
	}
}

/* Produktové karty (search_products v2, Product_Card_Renderer). */
.wa-mailbot-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 8px 0;
}
.wa-mailbot-card {
	display: flex;
	gap: 10px;
	padding: 8px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fff;
	font-size: 13px;
	line-height: 1.35;
}
.wa-mailbot-card__img {
	flex: 0 0 72px;
}
.wa-mailbot-card__img img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	display: block;
}
.wa-mailbot-card__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.wa-mailbot-card__title {
	font-weight: 600;
}
.wa-mailbot-card__now {
	font-weight: 700;
}
.wa-mailbot-card__from,
.wa-mailbot-card__old {
	color: #64748b;
}
.wa-mailbot-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.wa-mailbot-card__badge {
	padding: 1px 6px;
	border-radius: 999px;
	background: #f1f5f9;
	font-size: 11px;
}
.wa-mailbot-card__badge--instock {
	background: #dcfce7;
	color: #166534;
}
.wa-mailbot-card__badge--outofstock {
	background: #fee2e2;
	color: #991b1b;
}
.wa-mailbot-card__params {
	margin: 0;
	padding: 0;
	list-style: none;
	color: #475569;
	font-size: 12px;
}
.wa-mailbot-card__colors {
	display: flex;
	gap: 4px;
}
.wa-mailbot-card__dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid #cbd5e1;
}
.wa-mailbot-card__btn {
	align-self: flex-start;
	padding: 4px 12px;
	border-radius: 6px;
	background: var(--wa-mailbot-accent);
	color: #fff;
	text-decoration: none;
	font-size: 12px;
}
.wa-mailbot-card__btn:hover {
	background: var(--wa-mailbot-accent-hover);
	color: #fff;
}

/* Analytika (§12): palec hore/dole pod odpoveďou bota. */
.wa-mailbot-chat__fb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	font-size: 12px;
	color: #64748b;
}
.wa-mailbot-chat__fb-btn {
	padding: 2px 6px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #fff;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
}
.wa-mailbot-chat__fb-btn:hover:not(:disabled) {
	border-color: var(--wa-mailbot-accent);
}
.wa-mailbot-chat__fb-btn:disabled {
	opacity: 0.5;
	cursor: default;
}
.wa-mailbot-chat__fb-reasons {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	width: 100%;
}
.wa-mailbot-chat__fb-reasons[hidden] {
	display: none;
}
.wa-mailbot-chat__fb-reason {
	padding: 2px 8px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	color: #334155;
	font-size: 12px;
	cursor: pointer;
}
.wa-mailbot-chat__fb-reason:hover {
	border-color: var(--wa-mailbot-accent);
	color: var(--wa-mailbot-accent);
}
.wa-mailbot-chat__fb--done {
	font-style: italic;
}

/* Voliteľný telefón v e-mailovom formulári odovzdania. */
.wa-mailbot-chat__phone-input {
	margin-top: 6px;
}
