/* Support Copilot for WooCommerce — widget styles. */

.wcsc {
	--wcsc-accent: #7f54b3;
	--wcsc-accent-text: #ffffff;
	--wcsc-bg: #ffffff;
	--wcsc-text: #1e1e1e;
	--wcsc-muted: #757575;
	--wcsc-border: #e0e0e0;
	--wcsc-bubble-user: var(--wcsc-accent);
	--wcsc-bubble-bot: #f2f2f4;
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans,
		Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: var(--wcsc-text);
}

.wcsc--left {
	right: auto;
	left: 20px;
	align-items: flex-start;
}

/* Launcher */
.wcsc-launcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	border-radius: 999px;
	padding: 12px 18px;
	background: var(--wcsc-accent);
	color: var(--wcsc-accent-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.wcsc-launcher:hover,
.wcsc-launcher:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.wcsc-launcher:focus-visible {
	outline: 2px solid var(--wcsc-accent-text);
	outline-offset: 2px;
}

.wcsc-launcher__icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

/* Panel */
.wcsc-panel {
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	background: var(--wcsc-bg);
	border: 1px solid var(--wcsc-border);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
	overflow: hidden;
}

.wcsc-panel[hidden] {
	display: none;
}

.wcsc-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--wcsc-accent);
	color: var(--wcsc-accent-text);
}

.wcsc-panel__title {
	font-weight: 700;
	font-size: 15px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wcsc-panel__close {
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
}

.wcsc-panel__close:hover,
.wcsc-panel__close:focus-visible {
	background: rgba(255, 255, 255, 0.18);
	outline: none;
}

/* Messages */
.wcsc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--wcsc-bg);
	overscroll-behavior: contain;
}

.wcsc-msg {
	display: flex;
}

.wcsc-msg--user {
	justify-content: flex-end;
}

.wcsc-msg--assistant {
	justify-content: flex-start;
}

.wcsc-msg__bubble {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.wcsc-msg--user .wcsc-msg__bubble {
	background: var(--wcsc-bubble-user);
	color: var(--wcsc-accent-text);
	border-bottom-right-radius: 4px;
}

.wcsc-msg--assistant .wcsc-msg__bubble {
	background: var(--wcsc-bubble-bot);
	color: var(--wcsc-text);
	border-bottom-left-radius: 4px;
}

.wcsc-msg__bubble a {
	color: inherit;
	text-decoration: underline;
}

/* Typing dots */
.wcsc-msg--typing .wcsc-msg__bubble {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	padding: 12px 14px;
}

.wcsc-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wcsc-muted);
	animation: wcsc-bounce 1.2s infinite ease-in-out;
}

.wcsc-dot:nth-child(2) {
	animation-delay: 0.15s;
}

.wcsc-dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes wcsc-bounce {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wcsc-dot {
		animation: none;
	}
	.wcsc-launcher {
		transition: none;
	}
}

/* Input row */
.wcsc-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--wcsc-border);
	background: var(--wcsc-bg);
}

.wcsc-input {
	flex: 1;
	resize: none;
	border: 1px solid var(--wcsc-border);
	border-radius: 10px;
	padding: 9px 12px;
	font: inherit;
	color: inherit;
	background: var(--wcsc-bg);
	max-height: 120px;
	min-height: 38px;
}

.wcsc-input:focus {
	outline: 2px solid var(--wcsc-accent);
	outline-offset: -1px;
	border-color: transparent;
}

.wcsc-send {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 10px;
	background: var(--wcsc-accent);
	color: var(--wcsc-accent-text);
	cursor: pointer;
}

.wcsc-send svg {
	width: 18px;
	height: 18px;
}

.wcsc-send:disabled {
	opacity: 0.55;
	cursor: default;
}

.wcsc-send:focus-visible {
	outline: 2px solid var(--wcsc-text);
	outline-offset: 2px;
}

/* Honeypot: keep it out of sight but focusable by bots. */
.wcsc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* Branding */
.wcsc-branding {
	padding: 6px 12px 8px;
	text-align: center;
	font-size: 11px;
	color: var(--wcsc-muted);
	background: var(--wcsc-bg);
}

/* RTL */
.wcsc--rtl {
	direction: rtl;
}

.wcsc--rtl .wcsc-msg--user {
	justify-content: flex-start;
}

.wcsc--rtl .wcsc-msg--assistant {
	justify-content: flex-end;
}

.wcsc--rtl .wcsc-msg__bubble {
	direction: rtl;
	text-align: right;
}

/* Small screens: full-width sheet */
@media (max-width: 480px) {
	.wcsc {
		bottom: 12px;
		right: 12px;
	}

	.wcsc--left {
		left: 12px;
	}

	.wcsc-panel {
		width: calc(100vw - 24px);
		height: 70vh;
		height: 70dvh;
	}
}
