/**
 * Camellia LiveChat Consult — front-end styles.
 * Calm, jewelry-boutique palette. The chat window is the one bold element;
 * everything around it stays quiet.
 */

:root {
	--clc-ink: #1a1a1a;
	--clc-ink-soft: #5a5a5a;
	--clc-line: #e4e0d8;
	--clc-bg: #ffffff;
	--clc-canvas: #f7f5f1;
	--clc-accent: #1f3a5f;       /* deep sapphire */
	--clc-accent-ink: #ffffff;
	--clc-secondary: #b08d57;        /* champagne gold — the "Consult" button */
	--clc-secondary-ink: #ffffff;
	--clc-secondary-hover: #9a7943;
	--clc-agent-bubble: #f1efe9;
	--clc-customer-bubble: #1f3a5f;
	--clc-radius: 4px;
	--clc-shadow: 0 18px 48px rgba( 20, 28, 42, 0.22 );
	--clc-font: "Inter", "Helvetica Neue", Arial, sans-serif;
}

/* ----- Trigger button ------------------------------------------------- */
.clc-consult-trigger {
	display: block;
	width: 100%; /* fallback; JS syncs it to the Add to Cart button width */
	box-sizing: border-box;
	margin-top: 12px;
	padding: 14px 26px;
	font-family: var(--clc-font);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	color: var(--clc-secondary);
	background: transparent;
	border: 1px solid var(--clc-secondary);
	border-radius: var(--clc-radius);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.clc-consult-trigger:hover,
.clc-consult-trigger:focus-visible {
	background: var(--clc-secondary);
	border-color: var(--clc-secondary);
	color: var(--clc-secondary-ink);
	outline: none;
}

/* Inline variant used when injected next to the popup's SEND button. */
.clc-consult-trigger--inline {
	display: inline-block;
	width: auto;
	vertical-align: middle;
	margin-top: 0;
	margin-left: 10px;
}
.clc-consult-trigger.is-busy,
.clc-consult-popup-btn.is-busy {
	opacity: 0.55;
	pointer-events: none;
}
/* Theme-styled twin of the popup's SEND button (classes copied from SEND at
   inject time; fill/border/text colors set inline from SEND's border color). */
.clc-consult-popup-btn {
	cursor: pointer;
}
.clc-consult-popup-btn:hover,
.clc-consult-popup-btn:focus-visible {
	filter: brightness( 0.92 );
	outline: none;
}
/* Row that holds the popup's SEND button + our button, side by side. */
.clc-consult-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
}
.clc-consult-row .clc-consult-trigger--inline {
	margin-left: 0;
}
.clc-inline-error {
	width: 100%;
	margin-top: 8px;
	font-family: var(--clc-font);
	font-size: 12px;
	color: #b3261e;
	text-align: center;
}

/* ----- Overlay + modal ------------------------------------------------ */
.clc-no-scroll { overflow: hidden; }

.clc-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483640;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba( 18, 22, 30, 0.5 );
	backdrop-filter: blur( 2px );
}
.clc-overlay.is-open { display: flex; }

.clc-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	background: var(--clc-bg);
	border-radius: var(--clc-radius);
	box-shadow: var(--clc-shadow);
	padding: 36px 34px 32px;
	font-family: var(--clc-font);
	color: var(--clc-ink);
	animation: clc-rise 0.22s ease;
}
@keyframes clc-rise {
	from { opacity: 0; transform: translateY( 10px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

.clc-modal__close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 32px;
	height: 32px;
	font-size: 22px;
	line-height: 1;
	color: var(--clc-ink-soft);
	background: none;
	border: none;
	cursor: pointer;
}
.clc-modal__title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.clc-modal__subtitle {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--clc-ink-soft);
}
.clc-modal__product {
	margin-bottom: 18px;
	padding: 10px 12px;
	font-size: 12.5px;
	letter-spacing: 0.04em;
	color: var(--clc-accent);
	background: var(--clc-canvas);
	border-radius: var(--clc-radius);
}

.clc-field { display: block; margin-bottom: 14px; }
.clc-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--clc-ink-soft);
}
.clc-input {
	width: 100%;
	padding: 11px 13px;
	font-family: var(--clc-font);
	font-size: 15px;
	color: var(--clc-ink);
	background: var(--clc-bg);
	border: 1px solid var(--clc-line);
	border-radius: var(--clc-radius);
	box-sizing: border-box;
	transition: border-color 0.15s ease;
}
.clc-input:focus {
	border-color: var(--clc-accent);
	outline: none;
}
.clc-input--area { resize: vertical; min-height: 64px; }

.clc-modal__error {
	min-height: 18px;
	margin: 4px 0 10px;
	font-size: 13px;
	color: #b3261e;
}
.clc-modal__submit {
	width: 100%;
	padding: 14px;
	font-family: var(--clc-font);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--clc-accent-ink);
	background: var(--clc-accent);
	border: none;
	border-radius: var(--clc-radius);
	cursor: pointer;
	transition: opacity 0.15s ease;
}
.clc-modal__submit:hover { opacity: 0.92; }
.clc-modal__submit:disabled { opacity: 0.6; cursor: default; }

/* While our chat window is open, hide the standard LiveChat widget bubble
   (#chat-widget-container) so it can't sit on top of the composer/send area,
   especially on mobile where the docked window reaches the bottom corner. */
body.clc-chat-open #chat-widget-container {
	display: none !important;
}

/* ----- Chat window --------------------------------------------------- */

/* Desktop centered overlay */
.clc-chat-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483641;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba( 18, 22, 30, 0.55 );
	backdrop-filter: blur( 2px );
}
.clc-chat-overlay.is-open { display: flex; }

/* The chat container in both modes. Column layout is the default (docked). */
.clc-chat {
	display: none;
	flex-direction: column;
	background: var(--clc-bg);
	box-shadow: var(--clc-shadow);
	font-family: var(--clc-font);
	overflow: hidden;
}
.clc-chat.is-open { display: flex; }

/* Docked window (mobile / no image) — bottom-right, like a chat widget. */
.clc-chat--docked {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 2147483641;
	width: 380px;
	max-width: calc( 100vw - 32px );
	height: 560px;
	max-height: calc( 100vh - 48px );
	border-radius: 8px;
	animation: clc-rise 0.22s ease;
}
[dir="rtl"] .clc-chat--docked { right: auto; left: 24px; }

/* Split modal (desktop) — product image left, chat right. */
.clc-chat--split {
	flex-direction: row;
	width: 880px;
	max-width: calc( 100vw - 48px );
	height: 600px;
	max-height: calc( 100vh - 48px );
	border-radius: 8px;
	animation: clc-rise 0.22s ease;
}

/* The chat column inside either layout. */
.clc-chat__column {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
}
.clc-chat--split .clc-chat__column {
	flex: 1 1 50%;
	border-left: 1px solid var(--clc-line);
}
[dir="rtl"] .clc-chat--split .clc-chat__column {
	border-left: none;
	border-right: 1px solid var(--clc-line);
}

/* Product panel (desktop split only). */
.clc-product {
	flex: 1 1 50%;
	display: flex;
	flex-direction: column;
	background: var(--clc-canvas);
	min-width: 0;
}
.clc-product__media {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px;
}
.clc-product__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
}
.clc-product__info {
	padding: 20px 26px 26px;
	border-top: 1px solid var(--clc-line);
}
.clc-product__name {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--clc-ink);
}
.clc-product__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	align-items: baseline;
}
.clc-product__price {
	font-size: 16px;
	font-weight: 600;
	color: var(--clc-accent);
}
.clc-product__sku {
	font-size: 12px;
	letter-spacing: 0.04em;
	color: var(--clc-ink-soft);
}

/* Sale pricing: "$1,838  $2,625(struck)  -30%" — like the storefront. */
.clc-product__pricing {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.clc-product__price--sale {
	font-size: 17px;
	font-weight: 700;
	color: var(--clc-ink);
}
.clc-product__price--orig {
	font-size: 14px;
	color: #9a9a9a;
	text-decoration: line-through;
}
.clc-product__discount {
	padding: 2px 7px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	color: #ffffff;
	background: #e5453d;
	border-radius: 4px;
}

/* Star rating + review count — shown only when reviews > 1. */
.clc-product__reviews {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-top: 8px;
}
.clc-star {
	font-size: 15px;
	line-height: 1;
	color: #ddd6c9;
}
.clc-star--full {
	color: #c79d63;
}
.clc-product__reviews-count {
	margin-left: 7px;
	font-size: 13px;
	color: var(--clc-ink-soft);
}
[dir="rtl"] .clc-product__reviews-count {
	margin-left: 0;
	margin-right: 7px;
}


.clc-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	background: var(--clc-accent);
	color: var(--clc-accent-ink);
}
.clc-chat__heading { display: flex; flex-direction: column; gap: 2px; }
.clc-chat__title {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
}
.clc-chat__agent {
	font-size: 12px;
	font-weight: 600;
	opacity: 0.95;
}
.clc-chat__agent:empty {
	display: none;
}
.clc-chat__status {
	font-size: 12px;
	opacity: 0.85;
	min-height: 14px;
}
.clc-chat__close {
	font-size: 24px;
	line-height: 1;
	color: var(--clc-accent-ink);
	background: none;
	border: none;
	cursor: pointer;
	opacity: 0.85;
}
.clc-chat__close:hover { opacity: 1; }

.clc-chat__messages {
	flex: 1 1 auto;
	min-height: 0;
	padding: 18px;
	overflow-y: auto;
	background: var(--clc-canvas);
	display: flex;
	flex-direction: column;
	gap: 10px;
	scrollbar-width: thin;
	scrollbar-color: var(--clc-line) transparent;
}
.clc-chat__messages::-webkit-scrollbar { width: 6px; }
.clc-chat__messages::-webkit-scrollbar-thumb {
	background: var(--clc-line);
	border-radius: 3px;
}
.clc-chat__messages::-webkit-scrollbar-track { background: transparent; }

/* New messages ease in gently. */
@keyframes clc-msg-in {
	from { opacity: 0; transform: translateY( 6px ); }
	to   { opacity: 1; transform: none; }
}
.clc-msg { animation: clc-msg-in 0.22s ease both; }

.clc-msg { display: flex; flex-direction: column; max-width: 80%; }
.clc-msg--customer { align-self: flex-end; align-items: flex-end; }
.clc-msg--agent { align-self: flex-start; align-items: flex-start; }
.clc-msg__author {
	margin: 0 4px 3px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--clc-ink-soft);
}
.clc-msg__bubble {
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.45;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.clc-msg--agent .clc-msg__bubble {
	background: var(--clc-agent-bubble);
	color: var(--clc-ink);
	border-bottom-left-radius: 4px;
}
.clc-msg--customer .clc-msg__bubble {
	background: var(--clc-customer-bubble);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.clc-msg--system {
	align-self: center;
	max-width: 90%;
	font-size: 12px;
	color: var(--clc-ink-soft);
	text-align: center;
	font-style: italic;
}

/* Inline images / file attachments sent by an agent. */
.clc-msg__filelink {
	display: inline-block;
	max-width: 220px;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
	overflow: hidden;
	line-height: 0;
}
.clc-msg__image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 280px;
	object-fit: cover;
	cursor: pointer;
}
.clc-msg__file {
	display: inline-block;
	text-decoration: none;
	color: var(--clc-ink);
	background: var(--clc-agent-bubble);
	border-bottom-left-radius: 4px;
}
.clc-msg__file::before {
	content: '\1F4CE\00A0'; /* paperclip */
}
.clc-msg--customer .clc-msg__file {
	background: var(--clc-customer-bubble);
	color: #fff;
}

.clc-diagnostic {
	align-self: stretch;
	margin: 4px 0;
	padding: 12px 14px;
	background: #fcecec;
	border: 1px solid #e7b4b0;
	border-radius: 4px;
	color: #8a2018;
}
.clc-diagnostic__code {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	margin-bottom: 4px;
}
.clc-diagnostic__msg {
	font-size: 13px;
	line-height: 1.45;
}

/* Typing dots */
.clc-chat__typing {
	display: none;
	gap: 4px;
	padding: 0 18px 6px;
	background: var(--clc-canvas);
}
.clc-chat__typing.is-visible { display: flex; }
.clc-chat__dot {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--clc-ink-soft);
	opacity: 0.5;
	animation: clc-bounce 1.2s infinite ease-in-out;
}
.clc-chat__dot:nth-child(2) { animation-delay: 0.15s; }
.clc-chat__dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes clc-bounce {
	0%, 80%, 100% { transform: translateY( 0 ); opacity: 0.4; }
	40% { transform: translateY( -4px ); opacity: 0.9; }
}

.clc-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--clc-line);
	background: var(--clc-bg);
}
.clc-chat__input {
	flex: 1;
	max-height: 96px;
	padding: 10px 12px;
	font-family: var(--clc-font);
	font-size: 14px;
	line-height: 1.4;
	color: var(--clc-ink);
	border: 1px solid var(--clc-line);
	border-radius: var(--clc-radius);
	resize: none;
	box-sizing: border-box;
}
.clc-chat__input:focus { border-color: var(--clc-accent); outline: none; }
.clc-chat__send {
	padding: 10px 16px;
	font-family: var(--clc-font);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--clc-accent-ink);
	background: var(--clc-accent);
	border: none;
	border-radius: var(--clc-radius);
	cursor: pointer;
}
.clc-chat__send:hover { opacity: 0.92; }

/* RTL support (Hebrew store) */
[dir="rtl"] .clc-msg--customer { align-self: flex-start; align-items: flex-start; }
[dir="rtl"] .clc-msg--agent { align-self: flex-end; align-items: flex-end; }

/* Tablet down: a split modal becomes a fullscreen single column. */
@media ( max-width: 768px ) {
	.clc-chat-overlay { padding: 0; }
	.clc-chat--split {
		flex-direction: column;
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}
	/* Hide the product panel on small screens, per spec. */
	.clc-chat--split .clc-product { display: none; }
	.clc-chat--split .clc-chat__column { border: none; }
}

@media ( max-width: 480px ) {
	.clc-chat--docked {
		bottom: 0; right: 0; left: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}
	[dir="rtl"] .clc-chat--docked { left: 0; }
}

@media ( prefers-reduced-motion: reduce ) {
	.clc-modal, .clc-chat { animation: none; }
	.clc-chat__dot { animation: none; }
	.clc-msg { animation: none; }
}
