/*
 * The chat (geris-core ChatWidget, chat.js). The site's orange and dark, with fallbacks for another theme. Text on
 * orange is dark, not white: white on #f49819 is too faint to read (contrast 2.2:1).
 */

.geris-chat {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 9990;
	font-family: var(--global-body-font-family, Arial, sans-serif);
	font-size: 15px;
	line-height: 1.45;
	color: var(--geris-text, #333);
}

.geris-chat__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 52px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 26px;
	background: var(--geris-orange, #f49819);
	color: var(--geris-dark, #1f1f1f);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	cursor: pointer;
}
.geris-chat__toggle:hover,
.geris-chat__toggle:focus-visible {
	background: var(--geris-orange-dark, #e8921b);
	color: var(--geris-dark, #1f1f1f);
}
.geris-chat__toggle svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}
.geris-chat--open .geris-chat__toggle {
	display: none;
}

.geris-chat__panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 32px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
	overflow: hidden;
}
.geris-chat__panel[hidden],
.geris-chat__panel [hidden] {
	display: none !important;
}

.geris-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 8px 10px 16px;
	background: var(--geris-dark, #1f1f1f);
	color: #fff;
}
.geris-chat__head strong {
	display: block;
	font-family: var(--global-heading-font-family, inherit);
	font-size: 17px;
	letter-spacing: .5px;
	text-transform: uppercase;
}
.geris-chat__head span {
	display: block;
	font-size: 13px;
	color: #d0d0d0;
}
.geris-chat__close {
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.geris-chat__close:hover,
.geris-chat__close:focus-visible {
	background: rgba(255, 255, 255, .15);
	color: #fff;
}

.geris-chat__log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 12px;
	background: #f7f5f2;
}
.geris-chat__msg {
	max-width: 88%;
	margin: 0 0 8px;
	padding: 8px 12px;
	border-radius: 10px;
	white-space: pre-line;
	overflow-wrap: anywhere;
}
.geris-chat__msg--bot {
	background: #fff;
	border: 1px solid #e3e0dc;
	border-bottom-left-radius: 2px;
}
.geris-chat__msg--visitor {
	margin-left: auto;
	background: #fde3bd;
	color: var(--geris-dark, #1f1f1f);
	border-bottom-right-radius: 2px;
}
.geris-chat__link {
	display: inline-block;
	margin-top: 4px;
	color: #8a4b00;
	font-weight: 700;
	text-decoration: underline;
}

.geris-chat__replies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-height: 40%;
	overflow-y: auto;
	padding: 8px 12px;
	border-top: 1px solid #eee;
}
.geris-chat__reply {
	padding: 6px 12px;
	border: 1px solid var(--geris-orange, #f49819);
	border-radius: 16px;
	background: #fff;
	color: var(--geris-dark, #1f1f1f);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.3;
	cursor: pointer;
}
.geris-chat__reply:hover,
.geris-chat__reply:focus-visible {
	background: #fde3bd;
	color: var(--geris-dark, #1f1f1f);
}

.geris-chat__compose {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	padding: 8px 12px 12px;
	border-top: 1px solid #eee;
}
.geris-chat__compose textarea {
	flex: 1;
	min-width: 0;
	min-height: 40px;
	max-height: 120px;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: inherit;
	font-size: 16px; /* under 16px iOS zooms the page in when the field is focused */
	resize: none;
}
.geris-chat__send,
.geris-chat__submit,
.geris-chat__restart {
	padding: 9px 16px;
	border: 0;
	border-radius: 4px;
	background: var(--geris-orange, #f49819);
	color: var(--geris-dark, #1f1f1f);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.geris-chat__send:hover,
.geris-chat__submit:hover,
.geris-chat__restart:hover,
.geris-chat__send:focus-visible,
.geris-chat__submit:focus-visible,
.geris-chat__restart:focus-visible {
	background: var(--geris-orange-dark, #e8921b);
	color: var(--geris-dark, #1f1f1f);
}
.geris-chat__submit:disabled {
	opacity: .6;
	cursor: default;
}

.geris-chat__contact {
	flex: none;
	max-height: 60%;
	overflow-y: auto;
	padding: 10px 12px 12px;
	border-top: 1px solid #eee;
	font-size: 14px;
}
.geris-chat__field {
	margin: 0 0 8px;
}
.geris-chat__field label {
	display: block;
	font-weight: 600;
}
.geris-chat__field input[type="text"],
.geris-chat__field input[type="tel"],
.geris-chat__field input[type="email"],
.geris-chat__field textarea {
	display: block;
	width: 100%;
	margin-top: 2px;
	padding: 7px 9px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: inherit;
	font-size: 16px;
}
.geris-chat__field [aria-invalid="true"] {
	border-color: var(--geris-error, #b82105);
}
.geris-chat__consent label {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-weight: 400;
}
.geris-chat__consent input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
}
.geris-chat__consent a {
	color: #8a4b00;
}
.geris-chat__hint {
	margin: -4px 0 8px;
	color: #666;
	font-size: 13px;
}
.geris-chat__error,
.geris-chat__errors {
	display: block;
	margin: 2px 0 0;
	color: var(--geris-error, #b82105);
	font-size: 13px;
}
.geris-chat__errors {
	margin: 0 0 8px;
	font-weight: 600;
}
.geris-chat__submit {
	width: 100%;
}
.geris-chat__back {
	display: block;
	margin: 8px auto 0;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: #8a4b00;
	font-family: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

.geris-chat__end {
	padding: 10px 12px 12px;
	border-top: 1px solid #eee;
	text-align: center;
}

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

/* Phones: the button's label goes, and the chat opens as a sheet over the lower part of the screen. */
@media (max-width: 600px) {
	.geris-chat {
		right: 12px;
		bottom: 12px;
	}
	.geris-chat__toggle {
		width: 52px;
		padding: 0;
		justify-content: center;
	}
	.geris-chat__toggle-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}
	.geris-chat--open {
		left: 0;
		right: 0;
		bottom: 0;
	}
	.geris-chat__panel {
		width: 100%;
		max-width: none;
		height: 85vh;
		height: 85dvh;
		max-height: none;
		border-radius: 12px 12px 0 0;
	}
}

@media print {
	.geris-chat {
		display: none;
	}
}
