/**
 * Drox Support Bot — widget styles.
 *
 * The accent colour comes from the admin setting as --drox-bot-accent (see
 * Widget::inline_css()); everything else is derived here so the whole widget
 * reskins from one colour. Class names match the footer markup and flows.js.
 */

/* Defaults for the four values the admin controls. They live on :root, not on
   .drox-bot, because Widget::inline_css() sets them on :root too — and a copy
   declared on .drox-bot would sit closer to the element and quietly beat the
   administrator's choice, leaving the settings looking broken. */
:root {
	--drox-bot-accent: #e30613;
	--drox-bot-offset-x: 24px;
	--drox-bot-offset-y: 24px;
	--drox-bot-z: 9992;
}

.drox-bot {
	--db-ink: #14181f;
	--db-muted: #6b7280;
	--db-line: #e7e9ee;
	--db-panel: #ffffff;
	--db-field: #f5f6f9;
	--db-ok: #1a7f37;
	--db-out: #b3261e;
	--db-radius: 20px;

	position: fixed;
	bottom: var(--drox-bot-offset-y);
	z-index: var(--drox-bot-z);
	font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.5;
}

.drox-bot *,
.drox-bot *::before,
.drox-bot *::after {
	box-sizing: border-box;
}

.drox-bot--right { right: var(--drox-bot-offset-x); }
.drox-bot--left  { left: var(--drox-bot-offset-x); }

/* ── Launcher ─────────────────────────────── */

.drox-bot__launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--drox-bot-accent);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 12px 26px -8px rgba(227, 6, 19, .5), 0 4px 10px rgba(16, 20, 26, .18);
	transition: transform .18s ease, box-shadow .18s ease;
}

.drox-bot__launcher:hover,
.drox-bot__launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 16px 32px -8px rgba(227, 6, 19, .55), 0 6px 14px rgba(16, 20, 26, .22);
}

.drox-bot__launcher-icon {
	display: inline-flex;
	align-items: center;
}

.drox-bot__launcher-icon img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.drox-bot.is-open .drox-bot__launcher {
	opacity: 0;
	pointer-events: none;
}

/* ── Overlay ──────────────────────────────── */

.drox-bot__overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 14, 20, .45);
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.drox-bot.is-open .drox-bot__overlay {
	opacity: 1;
	pointer-events: auto;
}

/* ── Panel ────────────────────────────────── */

.drox-bot__panel {
	position: absolute;
	bottom: 0;
	width: 410px;
	max-width: calc(100vw - 32px);
	max-height: min(660px, calc(100vh - 100px));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--db-panel);
	color: var(--db-ink);
	border: 1px solid rgba(20, 24, 31, .08);
	border-radius: var(--db-radius);
	box-shadow: 0 26px 60px -20px rgba(16, 20, 26, .48), 0 8px 20px -10px rgba(16, 20, 26, .3);
}

.drox-bot--right .drox-bot__panel { right: 0; }
.drox-bot--left  .drox-bot__panel { left: 0; }

.drox-bot__panel[hidden] { display: none; }

/* ── Header ───────────────────────────────── */

.drox-bot__header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 15px 16px 16px;
	background: var(--drox-bot-accent);
	background-image: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .14));
	color: #fff;
}

.drox-bot__header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(0, 0, 0, .2);
}

.drox-bot__avatar {
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
}

.drox-bot__avatar img,
.drox-bot__avatar-fallback {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
}

.drox-bot__avatar-fallback {
	background: rgba(255, 255, 255, .16);
	border: 1px solid rgba(255, 255, 255, .28);
	font-family: "Barlow Condensed", sans-serif;
	font-weight: 800;
	font-size: 20px;
	text-transform: uppercase;
}

.drox-bot__titles {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.drox-bot__title {
	font-family: "Barlow Condensed", sans-serif;
	font-weight: 700;
	font-size: 17px;
	letter-spacing: .01em;
}

.drox-bot__subtitle {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	opacity: .9;
}

.drox-bot__subtitle::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #57d47f;
	box-shadow: 0 0 0 3px rgba(87, 212, 127, .25);
	flex: 0 0 auto;
}

.drox-bot__lang {
	appearance: none;
	-webkit-appearance: none;
	background: rgba(255, 255, 255, .15);
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 999px;
	color: #fff;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	padding: 5px 10px;
	cursor: pointer;
}

.drox-bot__lang option {
	color: #14181f;
}

.drox-bot__close,
.drox-bot__restart {
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 9px;
	display: grid;
	place-items: center;
	background: transparent;
	color: #fff;
	cursor: pointer;
	line-height: 0;
	flex: 0 0 auto;
}

.drox-bot__close:hover,
.drox-bot__close:focus-visible,
.drox-bot__restart:hover,
.drox-bot__restart:focus-visible {
	background: rgba(255, 255, 255, .18);
}

/* ── Messages ─────────────────────────────── */

.drox-bot__messages {
	flex: 1;
	min-height: 200px;
	overflow-y: auto;
	padding: 16px 15px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--db-field);
}

/* A single message may carry a text bubble AND a rendered payload (options,
   cards, a form). They must stack, never sit side by side — a row layout here
   squeezes the bubble into a vertical sliver. */
.drox-bot__message {
	display: flex;
	flex-direction: column;
	gap: 7px;
	align-items: flex-start;
	max-width: 100%;
}

.drox-bot__message--user {
	align-self: flex-end;
	align-items: flex-end;
}

.drox-bot__bubble {
	padding: 11px 13px;
	border-radius: 15px 15px 15px 6px;
	font-size: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: #fff;
	border: 1px solid var(--db-line);
	box-shadow: 0 1px 2px rgba(16, 20, 26, .04);
}

.drox-bot__message--user .drox-bot__bubble {
	border-radius: 15px 15px 6px 15px;
	background: var(--drox-bot-accent);
	border-color: transparent;
	color: #fff;
}

.drox-bot__message--system .drox-bot__bubble {
	background: transparent;
	border-style: dashed;
	color: var(--db-muted);
	font-size: 13px;
}

.drox-bot__notice {
	margin: 0;
	padding: 10px 16px;
	font-size: 13px;
	color: #8a1f1f;
	background: #fdecec;
}

.drox-bot__notice[hidden] { display: none; }

/* ── Prompt line (a question above choices) ── */

.drox-bot__prompt,
.drox-bot .prompt {
	font-family: "Barlow Condensed", sans-serif;
	font-weight: 600;
	font-size: 15px;
	letter-spacing: .01em;
}

/* ── Options ──────────────────────────────── */

.drox-bot__options,
.drox-bot__cats,
.drox-bot__cards,
.drox-bot__vin,
.drox-bot__lead {
	width: min(330px, 100%);
	max-width: 100%;
}

.drox-bot__options.is-busy,
.drox-bot__cats.is-busy,
.drox-bot__cards.is-busy,
.drox-bot__vin.is-busy,
.drox-bot__lead.is-busy {
	opacity: .55;
	pointer-events: none;
}

.drox-bot__options-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 300px;
	overflow-y: auto;
}

.drox-bot__options--two .drox-bot__options-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.drox-bot__option {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-width: 0; /* lets a grid cell shrink instead of forcing overflow */
	text-align: left;
	text-decoration: none;
	font: inherit;
	font-size: 13.5px;
	color: var(--db-ink);
	background: #fff;
	border: 1px solid var(--db-line);
	border-radius: 13px;
	padding: 11px 12px;
	cursor: pointer;
	transition: border-color .15s, transform .15s, box-shadow .15s;
}

.drox-bot__option:hover:not([disabled]),
.drox-bot__option:focus-visible {
	border-color: var(--drox-bot-accent);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px -10px rgba(227, 6, 19, .5);
}

.drox-bot__option[disabled] {
	opacity: .6;
	cursor: default;
}

/* The live filter hides non-matches with the [hidden] attribute. Our own
   display:flex/grid on these tiles outranks the browser's [hidden] rule, so
   without this the filter would run but nothing would disappear. */
.drox-bot__option[hidden],
.drox-bot__cat[hidden] {
	display: none;
}

.drox-bot__option-icon {
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	border-radius: 9px;
	background: var(--db-field);
	object-fit: contain;
	padding: 3px;
}

.drox-bot__option-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.drox-bot__option-label {
	font-weight: 600;
	line-height: 1.15;
	min-width: 0;
	/* break only a word too long for the cell (SSANGYONG), never a normal one */
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: none;
}

.drox-bot__option-sub {
	font-size: 11.5px;
	color: var(--db-muted);
}

/* The two starter buttons open with more presence than a grid cell. */
.drox-bot__options .drox-bot__option:only-child,
.drox-bot__options-list > .drox-bot__option {
	min-height: 46px;
}

.drox-bot__filter {
	width: 100%;
	margin-bottom: 8px;
	padding: 9px 12px;
	font: inherit;
	font-size: 13px;
	color: var(--db-ink);
	background: #fff;
	border: 1px solid var(--db-line);
	border-radius: 10px;
}

.drox-bot__filter::placeholder { color: #9aa1ac; }

.drox-bot__filter:focus {
	outline: 2px solid var(--drox-bot-accent);
	outline-offset: 1px;
}

.drox-bot__back,
.drox-bot__more {
	margin-top: 8px;
	padding: 8px 14px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--drox-bot-accent);
	background: transparent;
	border: 1px solid var(--db-line);
	border-radius: 999px;
	cursor: pointer;
}

.drox-bot__back:hover,
.drox-bot__more:hover {
	border-color: var(--drox-bot-accent);
}

/* ── Category cards (theme-style) ─────────── */

.drox-bot__cats-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 340px;
	overflow-y: auto;
}

.drox-bot__cat {
	display: flex;
	align-items: center;
	gap: 11px;
	width: 100%;
	text-align: left;
	text-decoration: none;
	font: inherit;
	color: var(--db-ink);
	background: #fff;
	border: 1px solid var(--db-line);
	border-radius: 14px;
	padding: 9px 11px 9px 9px;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}

.drox-bot__cat:hover,
.drox-bot__cat:focus-visible {
	border-color: var(--drox-bot-accent);
	box-shadow: 0 8px 20px -12px rgba(16, 20, 26, .35);
}

.drox-bot__cat-img {
	width: 52px;
	height: 52px;
	flex: 0 0 auto;
	border-radius: 11px;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #f0f2f6, #e7eaf0);
	color: var(--db-muted);
	font-size: 22px;
}

.drox-bot__cat-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.drox-bot__cat-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.drox-bot__cat-name {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.2;
}

.drox-bot__cat-count {
	font-size: 11.5px;
	color: var(--db-muted);
}

.drox-bot__cat-arrow {
	flex: 0 0 auto;
	color: var(--drox-bot-accent);
	font-size: 18px;
	font-weight: 700;
}

/* ── Product cards ────────────────────────── */

.drox-bot__cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.drox-bot__card {
	display: flex;
	gap: 11px;
	padding: 9px;
	text-decoration: none;
	color: var(--db-ink);
	background: #fff;
	border: 1px solid var(--db-line);
	border-radius: 14px;
	transition: border-color .15s, box-shadow .15s;
}

.drox-bot__card:hover,
.drox-bot__card:focus-visible {
	border-color: var(--drox-bot-accent);
	box-shadow: 0 8px 20px -12px rgba(16, 20, 26, .35);
}

.drox-bot__card-image {
	width: 62px;
	height: 62px;
	flex: 0 0 auto;
	border-radius: 10px;
	object-fit: contain;
	background: var(--db-field);
	padding: 4px;
}

.drox-bot__card-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.drox-bot__card-title {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.drox-bot__card-price {
	font-family: "Barlow Condensed", sans-serif;
	font-weight: 800;
	font-size: 16px;
	color: var(--drox-bot-accent);
}

.drox-bot__card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	font-size: 11px;
	color: var(--db-muted);
}

.drox-bot__card-stock { color: var(--db-ok); font-weight: 600; }
.drox-bot__card-stock.is-out { color: var(--db-out); }

.drox-bot__card-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.drox-bot__vehicle-chip {
	align-self: flex-start;
	display: inline-block;
	margin-bottom: 2px;
	padding: 5px 11px;
	font-size: 12px;
	font-weight: 600;
	color: var(--db-ink);
	background: #eef1f5;
	border-radius: 999px;
}

/* ── VIN ──────────────────────────────────── */

.drox-bot__vin-form {
	display: flex;
	gap: 6px;
}

.drox-bot__vin-input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--db-ink);
	background: #fff;
	border: 1px solid var(--db-line);
	border-radius: 11px;
}

.drox-bot__vin-input:focus {
	outline: 2px solid var(--drox-bot-accent);
	outline-offset: 1px;
}

.drox-bot__vin-submit {
	padding: 10px 15px;
	font: inherit;
	font-family: "Barlow Condensed", sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: .03em;
	color: #fff;
	background: var(--drox-bot-accent);
	border: 0;
	border-radius: 11px;
	cursor: pointer;
}

.drox-bot__vin-submit[disabled] {
	opacity: .5;
	cursor: default;
}

/* ── Lead form ────────────────────────────── */

.drox-bot__lead {
	padding: 12px;
	background: #fff;
	border: 1px solid var(--db-line);
	border-radius: 14px;
}

.drox-bot__lead-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.drox-bot__lead-field {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.drox-bot__lead-label {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--db-muted);
}

.drox-bot__lead-input {
	padding: 9px 11px;
	font: inherit;
	font-size: 13.5px;
	border: 1px solid var(--db-line);
	border-radius: 9px;
}

.drox-bot__lead-input:focus {
	outline: 2px solid var(--drox-bot-accent);
	outline-offset: 1px;
}

.drox-bot__lead-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.drox-bot__lead-submit {
	padding: 9px 15px;
	font: inherit;
	font-weight: 700;
	font-size: 13.5px;
	color: #fff;
	background: var(--drox-bot-accent);
	border: 0;
	border-radius: 9px;
	cursor: pointer;
}

.drox-bot__lead-skip {
	padding: 9px 4px;
	font: inherit;
	font-size: 12.5px;
	color: var(--db-muted);
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.drox-bot__lead-consent {
	font-size: 11px;
	color: var(--db-muted);
}

/* ── Composer ─────────────────────────────── */

.drox-bot__composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--db-line);
	background: #fff;
}

.drox-bot__input {
	flex: 1;
	resize: none;
	min-height: 42px;
	max-height: 120px;
	padding: 11px 12px;
	font: inherit;
	font-size: 14px;
	color: var(--db-ink);
	background: var(--db-field);
	border: 1px solid var(--db-line);
	border-radius: 12px;
}

.drox-bot__input:focus {
	outline: 2px solid var(--drox-bot-accent);
	outline-offset: 1px;
}

.drox-bot__send {
	padding: 11px 17px;
	border: 0;
	border-radius: 12px;
	background: var(--drox-bot-accent);
	color: #fff;
	font-family: "Barlow Condensed", sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .03em;
	cursor: pointer;
}

.drox-bot__send[disabled] {
	opacity: .6;
	cursor: default;
}

.drox-bot.is-working .drox-bot__send { opacity: .6; }

.drox-bot__consent {
	margin: 0;
	padding: 0 14px 12px;
	font-size: 11px;
	color: var(--db-muted);
	background: #fff;
}

.drox-bot .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* ── Narrow screens: brand grid to one column ── */

@media (max-width: 430px) {
	.drox-bot__options--two .drox-bot__options-list {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.drox-bot__launcher,
	.drox-bot__overlay,
	.drox-bot__option,
	.drox-bot__cat,
	.drox-bot__card {
		transition: none;
	}
}

/* ── Message motion ───────────────────────── */

/* Every message rises in rather than snapping into place. Kept short: this is
   a shop, not a toy, and a slow animation makes a fast reply feel slower. */
@keyframes drox-bot-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

.drox-bot__message {
	animation: drox-bot-rise .22s cubic-bezier(.22, .9, .3, 1) both;
}

/* Sent, not yet confirmed by the server. */
.drox-bot__message--user.is-pending .drox-bot__bubble {
	opacity: .72;
}

/* The send failed: the text stays put so it can be retried. */
.drox-bot__message--user.is-failed .drox-bot__bubble {
	opacity: 1;
	background: #fff;
	color: var(--db-out);
	border: 1px solid #f2c7c3;
}

/* ── Typing indicator ─────────────────────── */

.drox-bot__typing-bubble {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 13px 14px;
	min-height: 40px;
}

.drox-bot__typing-bubble span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--db-muted);
	opacity: .45;
	animation: drox-bot-dot 1.25s infinite ease-in-out;
}

.drox-bot__typing-bubble span:nth-child(2) { animation-delay: .16s; }
.drox-bot__typing-bubble span:nth-child(3) { animation-delay: .32s; }

@keyframes drox-bot-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: .35; }
	30%           { transform: translateY(-4px); opacity: .9; }
}

/* Motion is decoration here: without it the chat still reads correctly. */
@media (prefers-reduced-motion: reduce) {
	.drox-bot__message { animation: none; }
	.drox-bot__typing-bubble span { animation: none; opacity: .5; }
}

/* The vehicle pill carries its own way out: the × clears the car here and the
   cookie the rest of the site reads, so a second car can be looked up. */
.drox-bot__vehicle-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding-right: 5px;
}

.drox-bot__vehicle-clear {
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 24, 31, .1);
	color: var(--db-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.drox-bot__vehicle-clear:hover,
.drox-bot__vehicle-clear:focus-visible {
	background: var(--drox-bot-accent);
	color: #fff;
}

.drox-bot__vehicle-clear[disabled] {
	opacity: .5;
	cursor: default;
}

.drox-bot__card-quality {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	font-size: 10px;
	padding: 1px 6px;
	border-radius: 999px;
	background: #eef1f5;
	color: var(--db-muted);
}

/* Genuine is the stronger claim, so it is the one that carries the accent. */
.drox-bot__card-quality.is-origine {
	background: rgba(227, 6, 19, .1);
	color: var(--drox-bot-accent);
}
