/* Fotoprint чат */
.fp-chat {
	--fp-y: #f7b311;
	--fp-y2: #e5a300;
	--fp-d: #424242;
	--fp-bg: #fafafa;
	--fp-line: #e6e6e6;
	position: fixed;
	bottom: calc(var(--fp-chat-bottom, 20px) + env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--fp-d);
}
.fp-chat--right { right: 20px; }
.fp-chat--left { left: 20px; }
.fp-chat *, .fp-chat *::before, .fp-chat *::after { box-sizing: border-box; }
.fp-chat [hidden] { display: none !important; }

.fp-chat__btn {
	position: relative;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--fp-y);
	color: var(--fp-d);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	transition: transform .15s, background .15s;
}
.fp-chat__btn:hover { background: var(--fp-y2); transform: scale(1.05); }
.fp-chat__btn:focus-visible { outline: 3px solid var(--fp-d); outline-offset: 2px; }
.fp-chat--left .fp-chat__btn { margin-right: auto; }
.fp-chat--right .fp-chat__btn { margin-left: auto; }
.fp-chat__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #d63638;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.fp-chat__panel {
	position: absolute;
	bottom: 72px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - var(--fp-chat-bottom, 20px) - 100px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.fp-chat--right .fp-chat__panel { right: 0; }
.fp-chat--left .fp-chat__panel { left: 0; }

.fp-chat__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 12px 12px 16px;
	background: var(--fp-d);
	color: #fff;
}
.fp-chat__headtext { flex: 1; min-width: 0; }
.fp-chat__title { font-weight: 700; font-size: 16px; }
.fp-chat__status { font-size: 12.5px; opacity: .85; min-height: 17px; }
.fp-chat__status::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 6px;
	vertical-align: 1px;
	background: transparent;
}
.fp-chat__status.is-online::before { background: #4ade80; }
.fp-chat__status.is-away::before { background: #a3a3a3; }
.fp-chat__close {
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	padding: 6px;
	margin: 0;
	border-radius: 8px;
	display: flex;
}
.fp-chat__close:hover { background: rgba(255, 255, 255, .12); }

.fp-chat__body {
	flex: 1;
	overflow-y: auto;
	padding: 14px 12px;
	background: var(--fp-bg);
	overscroll-behavior: contain;
}
.fp-chat__msg { display: flex; flex-direction: column; margin: 0 0 10px; }
.fp-chat__msg--me { align-items: flex-end; }
.fp-chat__msg--op { align-items: flex-start; }
.fp-chat__bubble {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.fp-chat__msg--op .fp-chat__bubble { background: #fff; border: 1px solid var(--fp-line); border-bottom-left-radius: 4px; }
.fp-chat__msg--me .fp-chat__bubble { background: #fdeec4; border-bottom-right-radius: 4px; }
.fp-chat__msg.is-pending { opacity: .55; }
.fp-chat__bubble a { color: inherit; text-decoration: underline; }
.fp-chat__meta { font-size: 11.5px; color: #787878; margin-top: 3px; padding: 0 4px; }
.fp-chat__note {
	font-size: 13px;
	color: #6b6b6b;
	background: #fff8e6;
	border: 1px solid #f5dc9c;
	border-radius: 10px;
	padding: 8px 10px;
	margin: 0 0 10px;
}
.fp-chat__links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.fp-chat__links-label { font-size: 12.5px; color: #787878; width: 100%; }
.fp-chat__link {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 999px;
	border: 1px solid var(--fp-line);
	background: #fff;
	color: var(--fp-d) !important;
	font-size: 13px;
	text-decoration: none !important;
}
.fp-chat__link:hover { border-color: var(--fp-y); }
.fp-chat__link--viber { border-color: #c9b6f5; }
.fp-chat__link--telegram { border-color: #a9d6f2; }
.fp-chat__link--whatsapp { border-color: #a7e4bb; }

.fp-chat__contact { padding: 8px 10px 10px; border-top: 1px solid var(--fp-line); background: #fffaf0; }
.fp-chat__contact-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.fp-chat__contact-text { font-size: 13.5px; font-weight: 600; }
.fp-chat__contact-x { flex: 0 0 28px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #787878; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.fp-chat__contact-x:hover { background: #f0f0f0; color: var(--fp-d); }
.fp-chat__contact-x svg { width: 14px; height: 14px; }
.fp-chat__input {
	display: block;
	width: 100%;
	margin: 0 0 6px;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font: inherit;
	font-size: 15px;
	background: #fff;
	color: var(--fp-d);
	height: auto;
}
.fp-chat__contact-row { display: flex; align-items: center; gap: 6px; }
.fp-chat__contact-row .fp-chat__input { flex: 1; min-width: 0; margin: 0; height: 40px; }
.fp-chat__req { resize: vertical; min-height: 54px; }
.fp-chat__contact-btns { display: flex; gap: 6px; }
.fp-chat__small {
	border: 1px solid var(--fp-line);
	background: #fff;
	color: var(--fp-d);
	border-radius: 8px;
	padding: 6px 12px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.fp-chat__small--main { background: var(--fp-y); border-color: var(--fp-y); font-weight: 600; }

.fp-chat__error { padding: 6px 12px; font-size: 13px; color: #b32d2e; background: #fcf0f1; }

.fp-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 10px 10px 10px 6px;
	border-top: 1px solid var(--fp-line);
	background: #fff;
	margin: 0;
}
.fp-chat__text {
	flex: 1;
	resize: none;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 20px;
	font: inherit;
	font-size: 15px;
	line-height: 1.35;
	color: var(--fp-d);
	background: #fff;
	margin: 0;
	box-shadow: none;
}
.fp-chat__text:focus, .fp-chat__input:focus { outline: none; border-color: var(--fp-y2); }
.fp-chat__send {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--fp-y);
	color: var(--fp-d);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
}
.fp-chat__send:disabled { opacity: .5; cursor: default; }
.fp-chat__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.fp-chat__msg.is-bot .fp-chat__bubble { background: #f3f6fb; }
.fp-chat__typing .fp-chat__bubble { letter-spacing: 3px; color: #8a8a8a; animation: fp-chat-blink 1.2s infinite; }
@keyframes fp-chat-blink { 50% { opacity: .35; } }
.fp-chat__link--contact { cursor: pointer; font: inherit; font-size: 13px; border-style: dashed; text-transform: none; letter-spacing: 0; background: #fff !important; color: var(--fp-d) !important; }
.fp-chat__file-link { display: block; margin-top: 4px; color: inherit !important; text-decoration: none !important; }
.fp-chat__file-link.is-img img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; }
.fp-chat__file-name { display: block; word-break: break-all; text-decoration: underline; }
.fp-chat__file-size { font-size: 12px; color: #787878; }
.fp-chat__progress { display: block; height: 4px; margin-top: 6px; background: #eee; border-radius: 2px; overflow: hidden; width: 160px; max-width: 100%; }
.fp-chat__progress span { display: block; height: 100%; width: 0; background: var(--fp-y2); transition: width .2s; }
.fp-chat__file { display: none !important; }
.fp-chat__clip {
	flex: 0 0 36px;
	width: 36px;
	height: 40px;
	border: 0;
	background: transparent;
	color: #787878;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
}
.fp-chat__clip:hover { color: var(--fp-d); }
.fp-chat__ctypes { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.fp-chat__ctype {
	border: 1px solid var(--fp-line);
	background: #fff;
	color: var(--fp-d);
	border-radius: 999px;
	padding: 4px 10px;
	font: inherit;
	font-size: 12.5px;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.fp-chat__ctype.is-on { background: var(--fp-y); border-color: var(--fp-y); font-weight: 600; }

@media (max-width: 480px) {
	.fp-chat--right { right: 14px; }
	.fp-chat--left { left: 14px; }
	.fp-chat__btn { width: 54px; height: 54px; }
	.fp-chat.is-open { left: 0; right: 0; top: 0; bottom: 0; }
	.fp-chat.is-open .fp-chat__btn { display: none; }
	.fp-chat.is-open .fp-chat__panel {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	.fp-chat__text, .fp-chat__input { font-size: 16px; }
}
@media print { .fp-chat { display: none; } }

/* Защита от стилей темы (она красит все кнопки в жёлтый и пишет заглавными) */
.fp-chat button { text-transform: none !important; letter-spacing: normal !important; box-shadow: none; min-height: 0; line-height: 1.3; }
.fp-chat .fp-chat__ctype,
.fp-chat .fp-chat__ctype:hover,
.fp-chat .fp-chat__ctype:focus { background: #fff !important; border: 1px solid var(--fp-line) !important; color: var(--fp-d) !important; font-weight: 400 !important; }
.fp-chat .fp-chat__ctype.is-on,
.fp-chat .fp-chat__ctype.is-on:hover { background: var(--fp-y) !important; border-color: var(--fp-y) !important; font-weight: 600 !important; }
.fp-chat .fp-chat__link--contact,
.fp-chat .fp-chat__link--contact:hover { background: #fff !important; color: var(--fp-d) !important; }
.fp-chat .fp-chat__contact-x,
.fp-chat .fp-chat__clip { background: transparent !important; color: #787878 !important; border: 0 !important; }
.fp-chat .fp-chat__contact-x:hover { background: #f0f0f0 !important; color: var(--fp-d) !important; }
.fp-chat .fp-chat__ctype::before, .fp-chat .fp-chat__ctype::after,
.fp-chat .fp-chat__link--contact::before, .fp-chat .fp-chat__link--contact::after { display: none !important; }

.fp-chat__reqbar { padding: 6px 10px 0; background: #fff; border-top: 1px solid var(--fp-line); }
.fp-chat .fp-chat__reqbtn,
.fp-chat .fp-chat__reqbtn:hover,
.fp-chat .fp-chat__reqbtn:focus { display: block; width: 100%; border: 1px dashed var(--fp-y2) !important; border-radius: 8px !important; background: #fffaf0 !important; color: var(--fp-d) !important; font: inherit; font-size: 13.5px; font-weight: 600 !important; padding: 7px 10px !important; margin: 0; cursor: pointer; text-align: center; }
.fp-chat .fp-chat__reqbtn:hover { background: #fdeec4 !important; }
.fp-chat__reqbar + .fp-chat__form { border-top: 0; }

.fp-chat .fp-chat__reqbtn.is-hint { background: var(--fp-y) !important; border-style: solid !important; animation: fp-chat-hint 1.6s ease-in-out 3; }
@keyframes fp-chat-hint { 50% { transform: scale(1.03); } }

/* Крестик строки заявки: заметный тёмный круг */
.fp-chat .fp-chat__contact-x,
.fp-chat .fp-chat__contact-x:focus { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50% !important; background: var(--fp-d) !important; color: #fff !important; border: 0 !important; padding: 0 !important; }
.fp-chat .fp-chat__contact-x:hover { background: #000 !important; color: var(--fp-y) !important; }
.fp-chat .fp-chat__contact-x svg { width: 14px; height: 14px; stroke-width: 3; }
