/* Cooriya Helper — on-site chat widget (v1.4.0; moved bottom-right
   in v1.27.1 at David's request). The install-app card also uses
   bottom-right, so while it is showing the helper moves to the
   centre above it (see the bar-centre rules below). Bold + dynamic, matching the
   Cooriya Rebuild style. 17px+ text, weight 600+, dark high-contrast
   colour throughout — no thin grey text. */

.crc-helper {
	font-family: var(--cr-font, 'Archivo', sans-serif);
}

/* --- floating button, bottom-right --- */
.crc-helper-btn {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 9999;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 60px;
	padding: 10px 18px 10px 14px;
	border: 3px solid var(--cr-gold, #f2b01e);
	border-radius: 999px;
	background: var(--cr-green, #0c3b2e);
	color: #fff;
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
	transition: bottom .35s ease, left .35s ease, transform .35s ease;
}
.crc-helper-btn:hover,
.crc-helper-btn:focus-visible {
	background: #14543f;
	outline: 3px solid var(--cr-gold, #f2b01e);
	outline-offset: 2px;
}
.crc-helper-btn-icon {
	flex: 0 0 auto;
	color: var(--cr-gold, #f2b01e);
}
.crc-helper-btn-text {
	white-space: nowrap;
}

/* --- chat panel --- */
.crc-helper-panel {
	position: fixed;
	right: 16px;
	bottom: 88px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: min(70vh, 560px);
	background: #fff;
	border: 2px solid var(--cr-green, #0c3b2e);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
	transition: bottom .35s ease;
}
.crc-helper-panel[hidden] {
	display: none;
}

/* v1.27.1 — collision guards for the bottom-right corner.
   (a) The install-app card (Coupons plugin, #cr-install-banner)
   also sits bottom-right (right:20px; bottom:20px; 217px tall on
   desktop (border-box), a full-width bottom sheet (~173px) on
   mobile) and shows at most once per visitor. While it is showing,
   ride the helper above it so the two never overlap. :has() is supported in all current
   browsers; where it is not, the rule is ignored and the two may
   overlap once for a first-time visitor.
   (b) While the mobile menu overlay is open, the Rebuild menu JS
   sets html.cr2-menu-open — hide the helper then, or the button
   would float over the overlay's bottom corner (the overlay is a
   full-height right-side panel). */
body:has(#cr-install-banner.cr-install-banner--show) .crc-helper-btn { bottom: 255px; }
body:has(#cr-install-banner.cr-install-banner--show) .crc-helper-panel { bottom: 327px; }

/* v1.28.15 — David (2026-11-24) still saw the button crowding the
   Install button after the v1.28.14 ride-up, and asked for it in
   the CENTRE instead: while the bar shows, the Coupons JS adds
   body.cr-install-bar--on — the helper moves to the horizontal
   centre, just above the bar (bar ~56px + safe-area), where no
   other button lives. The gold Install button stays at the bar's
   right end, fully clear. Same rule covers the iOS variant (same
   bar, same class). When the bar is hidden or dismissed the class
   is gone and the button returns to its normal bottom-right spot. */
body.cr-install-bar--on .crc-helper-btn { left: 50%; right: auto; bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px); transform: translateX(-50%); }
body.cr-install-bar--on .crc-helper-panel { bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 88px); }
html.cr2-menu-open .crc-helper { display: none; }

/* v1.27.1 — pin the install card to border-box so its height is
   deterministic whatever the theme does (its own inline style sets
   width:360px with no box-sizing; under content-box it renders
   402px wide and the ride-up offset above would be wrong). The
   card keeps its designed 360px width either way; this only fixes
   its box model. The ride-up offsets were tuned against the
   border-box height measured in the preview probe. */
.cr-install-banner { box-sizing: border-box; }

.crc-helper-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	background: var(--cr-green, #0c3b2e);
	color: #fff;
	padding: 14px 16px;
}
.crc-helper-head-text strong {
	display: block;
	font-size: 1.15rem;
	font-weight: 900;
	letter-spacing: .02em;
}
.crc-helper-head-text span {
	display: block;
	font-size: .92rem;
	font-weight: 600;
	color: var(--cr-gold, #f2b01e);
	margin-top: 2px;
}
.crc-helper-close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 1.8rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}
.crc-helper-close:hover,
.crc-helper-close:focus-visible {
	background: rgba(255, 255, 255, .18);
	outline: 2px solid var(--cr-gold, #f2b01e);
}

/* --- message log --- */
.crc-helper-log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px 14px 6px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.crc-helper-msg {
	max-width: 92%;
	padding: 12px 14px;
	border-radius: 14px;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.5;
	color: #1f2937;
	word-wrap: break-word;
}
.crc-helper-msg p {
	margin: 0 0 8px;
}
.crc-helper-msg p:last-child {
	margin-bottom: 0;
}
.crc-helper-msg a {
	font-weight: 800;
	color: var(--cr-green, #0c3b2e);
	text-decoration: underline;
}
.crc-helper-msg ul {
	margin: 0 0 8px;
	padding-left: 20px;
}
.crc-helper-msg ul:last-child {
	margin-bottom: 0;
}
.crc-helper-bot {
	align-self: flex-start;
	background: var(--cr-light, #f4f1ea);
	border: 2px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}
.crc-helper-user {
	align-self: flex-end;
	background: var(--cr-green, #0c3b2e);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.crc-helper-user p {
	color: #fff;
}
.crc-helper-addr {
	font-weight: 700;
}
.crc-helper-note {
	font-size: .95rem;
	color: #374151;
}
.crc-helper-rates {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}
.crc-helper-rates li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px solid #e5e7eb;
}
.crc-helper-rates li:last-child {
	border-bottom: 0;
}
.crc-helper-rates strong {
	color: var(--cr-green, #0c3b2e);
}
.crc-helper-quote {
	margin: 4px 0 8px;
}
.crc-helper-quote > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px solid #e5e7eb;
	font-size: 1rem;
}
.crc-helper-quote > div:last-child {
	border-bottom: 0;
}
.crc-helper-quote strong {
	color: var(--cr-green, #0c3b2e);
}
.crc-helper-quote .crc-helper-total {
	font-size: 1.1rem;
}
.crc-helper-quote .crc-helper-discount strong {
	color: #15803d;
}

/* --- quick replies + category chips --- */
.crc-helper-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 14px 0;
}
.crc-helper-chips button,
.crc-helper-cats button {
	border: 2px solid var(--cr-green, #0c3b2e);
	border-radius: 999px;
	background: #fff;
	color: var(--cr-green, #0c3b2e);
	font-family: inherit;
	font-size: .98rem;
	font-weight: 800;
	line-height: 1.3;
	padding: 8px 12px;
	cursor: pointer;
}
.crc-helper-chips button:hover,
.crc-helper-chips button:focus-visible,
.crc-helper-cats button:hover,
.crc-helper-cats button:focus-visible {
	background: var(--cr-green, #0c3b2e);
	color: #fff;
	outline: none;
}
.crc-helper-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

/* --- input row --- */
.crc-helper-form {
	display: flex;
	gap: 8px;
	padding: 12px 14px 8px;
}
.crc-helper-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.crc-helper-form input[type="text"] {
	flex: 1 1 auto;
	min-width: 0;
	border: 2px solid var(--cr-green, #0c3b2e);
	border-radius: 12px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 600;
	color: #1f2937;
	background: #fff;
}
.crc-helper-form input[type="text"]:focus {
	outline: 3px solid var(--cr-gold, #f2b01e);
	outline-offset: 1px;
}
.crc-helper-send {
	flex: 0 0 auto;
	border: 0;
	border-radius: 12px;
	background: var(--cr-green, #0c3b2e);
	color: #fff;
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 800;
	padding: 12px 18px;
	cursor: pointer;
}
.crc-helper-send:hover,
.crc-helper-send:focus-visible {
	background: #14543f;
	outline: 3px solid var(--cr-gold, #f2b01e);
	outline-offset: 1px;
}
.crc-helper-foot {
	margin: 0;
	padding: 0 14px 12px;
	font-size: .95rem;
	font-weight: 600;
	color: #374151;
	text-align: center;
}
.crc-helper-foot a {
	font-weight: 800;
	color: var(--cr-green, #0c3b2e);
}

@media (max-width: 480px) {
	.crc-helper-btn-text {
		display: none;
	}
	.crc-helper-btn {
		min-height: 56px;
		padding: 10px 14px;
		border-radius: 50%;
	}
	.crc-helper-panel {
		bottom: 84px;
		max-height: min(72vh, 560px);
	}
	/* v1.27.1 — on mobile the install card is a full-width bottom
	   sheet (~173px tall, measured), so ride the helper higher while it shows. */
	body:has(#cr-install-banner.cr-install-banner--show) .crc-helper-btn { bottom: 216px; }
	body:has(#cr-install-banner.cr-install-banner--show) .crc-helper-panel { bottom: 288px; }
	/* v1.28.15 — same centre move on phones (button is a 56px circle):
	   panel sits above the centred button. */
	body.cr-install-bar--on .crc-helper-panel { bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 84px); }
}
