/**
 * JB IT Solutions — Zwevende reparatieaanvraag
 *
 * Desktop:
 * - JB-stijl reparatieknop;
 * - formulier blijft binnen de website.
 *
 * Mobiel:
 * - ronde WhatsApp-knop;
 * - opent WhatsApp rechtstreeks.
 */

.jb-whatsapp {
	position: relative;
	z-index: 9998;
}


/* ==========================================================
   ZWEVENDE KNOP — BASIS
   ========================================================== */

.jb-whatsapp-button {
	position: fixed;
	right: 24px;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 9998;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;

	min-height: 58px;
	padding: 0 20px 0 16px;

	border: 0;
	border-radius: 999px;
	box-shadow:
		0 12px 30px rgba(32, 36, 40, 0.20),
		0 3px 10px rgba(32, 36, 40, 0.12);

	font: inherit;
	font-size: 15px;
	font-weight: 750;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;

	-webkit-tap-highlight-color: transparent;
	transition:
		background-color 160ms ease,
		box-shadow 160ms ease,
		transform 160ms ease;
}

.jb-whatsapp-button--desktop {
	background: #ff8c00;
	color: #202428 !important;
}

.jb-whatsapp-button--desktop:hover {
	background: #e87f00;
	box-shadow:
		0 15px 34px rgba(32, 36, 40, 0.24),
		0 4px 12px rgba(32, 36, 40, 0.14);
	color: #202428 !important;
	text-decoration: none !important;
	transform: translateY(-2px);
}

.jb-whatsapp-button--desktop:active {
	transform: translateY(0);
}

.jb-whatsapp-button:focus-visible,
.jb-whatsapp-chat button:focus-visible,
.jb-whatsapp-chat input:focus-visible,
.jb-whatsapp-chat textarea:focus-visible {
	outline: 3px solid #ff8c00;
	outline-offset: 3px;
}

.jb-whatsapp-button--desktop:focus-visible {
	outline-color: #383e42;
}

.jb-whatsapp-button__repair-icon,
.jb-whatsapp-button__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 29px;
	width: 29px;
	height: 29px;
}

.jb-whatsapp-button__repair-icon {
	color: #202428;
}

.jb-whatsapp-button__repair-icon svg,
.jb-whatsapp-button__icon svg,
.jb-whatsapp-chat__submit-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.jb-whatsapp-button--mobile {
	display: none;
	background: #25d366;
	color: #ffffff !important;
}

.jb-whatsapp-button--mobile:visited,
.jb-whatsapp-button--mobile:hover {
	color: #ffffff !important;
}


/* ==========================================================
   DESKTOP AANVRAAGVENSTER
   ========================================================== */

.jb-whatsapp-chat {
	position: fixed;
	right: 24px;
	bottom: calc(96px + env(safe-area-inset-bottom, 0px));
	z-index: 9999;

	width: min(430px, calc(100vw - 48px));
	max-height: min(720px, calc(100vh - 125px));
	overflow: hidden;

	border: 1px solid rgba(32, 36, 40, 0.10);
	border-radius: 18px;
	background: #ffffff;
	box-shadow:
		0 24px 60px rgba(32, 36, 40, 0.22),
		0 8px 20px rgba(32, 36, 40, 0.12);
}

.jb-whatsapp-chat[hidden] {
	display: none !important;
}

.jb-whatsapp-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 18px;
	background: #383e42;
	color: #ffffff;
}

.jb-whatsapp-chat__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.jb-whatsapp-chat__brand-logo-wrap {
	display: block;
	position: relative;
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	overflow: hidden;
}

.jb-whatsapp-chat__brand-logo {
	display: block;
	width: auto;
	height: 48px;
	max-width: none;
	object-fit: contain;
	object-position: left center;
}

.jb-whatsapp-chat__brand-copy {
	min-width: 0;
}

.jb-whatsapp-chat__brand strong,
.jb-whatsapp-chat__brand span {
	display: block;
}

.jb-whatsapp-chat__brand strong {
	margin-bottom: 3px;
	font-size: 15px;
	line-height: 1.2;
}

.jb-whatsapp-chat__brand span {
	font-size: 12px;
	line-height: 1.3;
	opacity: 0.84;
}

.jb-whatsapp-chat__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #ffffff;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
}

.jb-whatsapp-chat__close:hover {
	background: rgba(255, 255, 255, 0.10);
}

.jb-whatsapp-chat__body {
	max-height: calc(min(720px, calc(100vh - 125px)) - 72px);
	overflow-y: auto;
	padding: 18px;
	background: #f4f5f6;
}

.jb-whatsapp-chat__message {
	position: relative;
	max-width: 92%;
	margin: 0 0 14px;
	padding: 12px 14px;
	border: 1px solid rgba(32, 36, 40, 0.08);
	border-radius: 5px 13px 13px 13px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(32, 36, 40, 0.06);
	color: #202428;
	font-size: 14px;
	line-height: 1.55;
}

.jb-whatsapp-chat__message p {
	margin: 0;
}

.jb-whatsapp-chat__form {
	position: relative;
	padding: 15px;
	border: 1px solid rgba(32, 36, 40, 0.08);
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 3px 12px rgba(32, 36, 40, 0.06);
}

.jb-whatsapp-chat__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.jb-whatsapp-chat__field {
	min-width: 0;
}

.jb-whatsapp-chat__field--full {
	grid-column: 1 / -1;
}

.jb-whatsapp-chat__field label {
	display: block;
	margin: 0 0 6px;
	color: #383e42;
	font-size: 12px;
	font-weight: 750;
	line-height: 1.3;
}

.jb-whatsapp-chat__optional {
	font-size: 10px;
	font-weight: 500;
	color: #727a80;
}

.jb-whatsapp-chat__field input,
.jb-whatsapp-chat__field textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: 10px 11px;
	border: 1px solid #cfd5d9;
	border-radius: 9px;
	background: #ffffff;
	box-shadow: none;
	color: #202428;
	font: inherit;
	font-size: 13px;
	line-height: 1.45;
}

.jb-whatsapp-chat__field input {
	min-height: 42px;
}

.jb-whatsapp-chat__field textarea {
	min-height: 100px;
	resize: vertical;
}

.jb-whatsapp-chat__field input:hover,
.jb-whatsapp-chat__field textarea:hover {
	border-color: #aeb7bd;
}

.jb-whatsapp-chat__field input:focus,
.jb-whatsapp-chat__field textarea:focus {
	border-color: #ff8c00;
}

.jb-whatsapp-chat__honeypot {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.jb-whatsapp-chat__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 48px;
	margin-top: 14px;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background: #ff8c00;
	color: #202428;
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	transition:
		background-color 160ms ease,
		transform 160ms ease,
		opacity 160ms ease;
}

.jb-whatsapp-chat__submit:hover {
	background: #e87f00;
}

.jb-whatsapp-chat__submit:active {
	transform: translateY(1px);
}

.jb-whatsapp-chat__submit:disabled {
	cursor: wait;
	opacity: 0.65;
}

.jb-whatsapp-chat__submit-icon {
	display: inline-flex;
	flex: 0 0 21px;
	width: 21px;
	height: 21px;
	color: #202428;
}

.jb-whatsapp-chat__status {
	display: none;
	margin-top: 12px;
	padding: 10px 11px;
	border-radius: 9px;
	font-size: 12px;
	font-weight: 650;
	line-height: 1.45;
}

.jb-whatsapp-chat__status:not(:empty) {
	display: block;
}

.jb-whatsapp-chat__status--success {
	border: 1px solid #b8dfc5;
	background: #edf8f0;
	color: #175c2b;
}

.jb-whatsapp-chat__status--error {
	border: 1px solid #efc5c5;
	background: #fff1f1;
	color: #8a2020;
}

.jb-whatsapp-chat__note {
	margin: 10px 2px 0;
	color: #6c747a;
	font-size: 10.5px;
	line-height: 1.45;
	text-align: center;
}


/* ==========================================================
   MOBIEL — DIRECT WHATSAPP
   ========================================================== */

@media (max-width: 767px) {
	.jb-whatsapp-button--desktop,
	.jb-whatsapp-chat {
		display: none !important;
	}

	.jb-whatsapp-button--mobile {
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		display: inline-flex;
		width: 58px;
		height: 58px;
		min-height: 58px;
		padding: 0;
		border-radius: 50%;
	}

	.jb-whatsapp-button--mobile:hover {
		background: #1fbd5a;
		transform: none;
	}

	.jb-whatsapp-button--mobile .jb-whatsapp-button__icon {
		flex-basis: 32px;
		width: 32px;
		height: 32px;
		color: #ffffff;
	}
}

@media (max-width: 360px) {
	.jb-whatsapp-button--mobile {
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.jb-whatsapp-button,
	.jb-whatsapp-chat__submit {
		transition: none;
	}
}

@media print {
	.jb-whatsapp {
		display: none !important;
	}
}
