/* GorillaGear Rentals: the AI kit helper on the booking page.
   Uses the booking page's own colours (--ggr-*), and the theme's surfaces
   (--gg-*) when the GorillaGear theme is active, so light and dark both work. */

/* ---------- switching between the chat and the kit list ---------- */

.ggr-book .ggr-chat[hidden] {
	display: none;
}

.ggr-book.is-chat [data-ggr-list],
.ggr-book.is-chat .ggr-book__tools,
.ggr-book.is-chat .ggr-chip--new {
	display: none;
}

/* The helper's button: first in the row, marked with the brand yellow. */
.ggr-book .ggr-chip--chat {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	border-color: var(--ggr-purple);
	font-weight: 600;
}

.ggr-book .ggr-chip--chat::before {
	content: "";
	width: 0.55em;
	height: 0.55em;
	background: var(--ggr-yellow);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

/* ---------- the chat ---------- */

.ggr-book .ggr-chat {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--ggr-line);
	border-radius: 8px;
	background: var(--gg-surface, #fff);
	color: var(--ggr-ink);
	overflow: hidden;
}

.ggr-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.ggr-chat__log {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.9em;
	min-height: 200px;
	max-height: 60vh;
	max-height: clamp(300px, 60dvh, 620px);
	padding: 1.3em 1.3em 1em;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ggr-chat__log:focus-visible {
	outline: 2px solid var(--ggr-purple);
	outline-offset: -2px;
}

.ggr-chat__msg {
	max-width: 42em;
	overflow-wrap: anywhere;
}

.ggr-book .ggr-chat__msg p {
	margin: 0 0 0.55em;
}

.ggr-book .ggr-chat__msg p:last-child {
	margin-bottom: 0;
}

.ggr-book .ggr-chat__msg a {
	color: var(--ggr-purple);
	text-decoration: underline;
}

/* What the helper says: plain text with a yellow rule, like a note in the margin. */
.ggr-chat__msg--bot {
	align-self: flex-start;
	padding-left: 0.9em;
	border-left: 3px solid var(--ggr-yellow);
}

/* The opening line is the heading of the whole view. */
.ggr-chat__msg--first {
	padding-left: 0;
	border-left: 0;
	font-family: var(--gg-font-head, inherit);
	font-size: 1.5em;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

/* What the customer said. */
.ggr-chat__msg--me {
	align-self: flex-end;
	max-width: min(85%, 34em);
	padding: 0.55em 0.95em;
	border-radius: 14px 14px 3px 14px;
	background: var(--ggr-purple-pale);
}

.ggr-chat__starters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45em;
}

/* Kit cards are rows from the kit list, so they pick up the list's own styling. */
.ggr-book ul.ggr-chat__kit {
	align-self: stretch;
	flex: none;
}

.ggr-book .ggr-chat__remove {
	margin-left: 0.6em;
	font-size: 0.85em;
}

.ggr-chat__next {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
}

.ggr-chat__next:empty {
	display: none;
}

.ggr-chat__status {
	display: flex;
	align-items: center;
	gap: 0.6em;
	color: var(--ggr-soft);
	font-size: 0.9em;
}

.ggr-chat__status[hidden] {
	display: none;
}

.ggr-chat__dots {
	display: inline-flex;
	gap: 4px;
}

.ggr-chat__dots i {
	width: 6px;
	height: 6px;
	background: var(--ggr-yellow);
	animation: ggr-chat-dot 1.1s infinite ease-in-out;
}

.ggr-chat__dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.ggr-chat__dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes ggr-chat-dot {
	0%, 70%, 100% {
		opacity: 0.25;
		transform: translateY(0);
	}
	35% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

.ggr-chat__error {
	align-self: flex-start;
	padding: 0.55em 0.9em;
	border-radius: 6px;
	background: var(--gg-warn-bg, #fffbe8);
	color: var(--gg-warn, #5c4400);
	font-size: 0.92em;
}

/* ---------- typing a message ---------- */

.ggr-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 0.6em;
	margin: 0;
	padding: 0.9em 1.3em 0.5em;
	border-top: 1px solid var(--ggr-line);
}

.ggr-book .ggr-chat__input {
	flex: 1;
	min-width: 0;
	min-height: 2.75em;
	max-height: 140px;
	margin: 0;
	padding: 0.65em 0.85em;
	border: 1px solid var(--gg-line-strong, var(--ggr-line));
	border-radius: 6px;
	background: var(--gg-bg, #fff);
	color: var(--ggr-ink);
	font: inherit;
	/* 16px stops phones zooming in when the box is tapped. */
	font-size: 16px;
	line-height: 1.4;
	resize: none;
	box-shadow: none;
}

.ggr-book .ggr-chat__input::placeholder {
	color: var(--ggr-soft);
	opacity: 1;
}

.ggr-book .ggr-chat__input:focus {
	border-color: var(--ggr-purple);
	outline: 2px solid var(--ggr-purple);
	outline-offset: 0;
}

.ggr-book .ggr-chat__send {
	flex: none;
	min-height: 2.75em;
}

.ggr-book .ggr-chat__send:disabled {
	opacity: 0.55;
	cursor: default;
}

.ggr-book .ggr-chat__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.3em 1em;
	margin: 0;
	padding: 0 1.3em 0.9em;
	color: var(--ggr-soft);
	font-size: 0.8em;
}

/* ---------- phones ---------- */

@media (max-width: 860px) {
	.ggr-chat__log {
		padding: 1.1em 1em 0.9em;
		max-height: 48vh;
		max-height: clamp(260px, 48dvh, 520px);
	}

	.ggr-chat__msg--first {
		font-size: 1.3em;
	}

	.ggr-chat__form {
		padding: 0.8em 1em 0.5em;
	}

	.ggr-book .ggr-chat__foot {
		padding: 0 1em 0.8em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ggr-chat__dots i {
		animation: none;
		opacity: 0.7;
	}
}

/* ---------- pointers to the helper around the page ---------- */

/* The "New" tag on the helper's button. */
.ggr-book .ggr-chip__new {
	margin-left: 0.1em;
	padding: 0.05em 0.45em;
	border-radius: 999px;
	background: var(--ggr-yellow);
	color: #111;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* The strip above the kit list, and the empty search. */
.ggr-book .ggr-hint {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6em 0.9em;
	padding: 0.75em 1em;
	border-bottom: 1px solid var(--ggr-line);
	border-left: 3px solid var(--ggr-yellow);
	background: var(--gg-yellow-bg, #fffbe8);
	color: var(--ggr-ink);
	list-style: none;
}

.ggr-book .ggr-hint__text {
	flex: 1 1 16em;
	min-width: 0;
}

.ggr-book .ggr-hint--empty {
	border-bottom: 0;
	color: var(--ggr-ink);
}

.ggr-book .ggr-btn--small {
	padding: 0.35em 0.95em;
	font-size: 0.9em;
}

.ggr-book .ggr-hint__close {
	flex: none;
	width: 2em;
	height: 2em;
	margin: -0.3em -0.4em -0.3em 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--ggr-soft);
	font-size: 1.2em;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
}

.ggr-book .ggr-hint__close:hover {
	background: rgba(127, 127, 127, 0.15);
	color: var(--ggr-ink);
}

/* "Ask the kit helper this" under Search kit. */
.ggr-book .ggr-asksearch {
	flex-basis: 100%;
	margin-top: 0.4em;
	text-align: right;
	font-size: 0.9em;
}

.ggr-book .ggr-asksearch[hidden] {
	display: none;
}

.ggr-book .ggr-asksearch .ggr-link::before,
.ggr-book .ggr-cart__ask::before,
.ggr-book .ggr-modal__ask::before {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-right: 0.45em;
	background: var(--ggr-yellow);
	vertical-align: 0.08em;
}

/* In Your booking and the item pop-up. */
.ggr-book .ggr-cart__ask {
	display: block;
	margin: 0.6em 0 0.2em;
	text-align: left;
	font-size: 0.92em;
}

.ggr-book .ggr-modal__ask {
	margin-left: 1em;
}

/* On item pages: "Questions about this? Ask the kit helper". */
.ggr-askbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3em 0.6em;
	margin: 1em 0;
	padding: 0.7em 0.95em;
	border-left: 3px solid var(--gg-yellow, #FFD93D);
	border-radius: 6px;
	background: var(--gg-surface-2, rgba(72, 52, 225, 0.08));
	color: var(--gg-ink, inherit);
	font-size: 0.95em;
	line-height: 1.4;
}

.ggr-askbar__dot {
	width: 0.55em;
	height: 0.55em;
	background: var(--gg-yellow, #FFD93D);
}

.ggr-askbar a {
	color: var(--gg-purple, #4834e1);
	font-weight: 600;
	text-decoration: underline;
}
