/**
 * Krieger Chatbot — Frontend Styles
 *
 * BEM-like naming prefixed with .kcc- to avoid conflicts.
 *
 * @package CopilotChatWidget
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
	--kcc-z-index: 999999;
	--kcc-bubble-size: 60px;
	--kcc-bubble-size-mobile: 50px;
	--kcc-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	--kcc-shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.2);
	--kcc-radius: 12px;
	--kcc-radius-msg: 18px;
	--kcc-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--kcc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ==========================================================================
   Widget Container
   ========================================================================== */

.kcc-widget {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: var(--kcc-z-index);
	font-family: var(--kcc-font-family);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.kcc-widget--left {
	right: auto;
	left: 20px;
}

/* ==========================================================================
   Chat Bubble
   ========================================================================== */

.kcc-bubble {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--kcc-bubble-size);
	height: var(--kcc-bubble-size);
	border-radius: 50%;
	border: none;
	cursor: pointer;
	color: #fff;
	box-shadow: var(--kcc-shadow-heavy);
	transition: transform var(--kcc-transition), box-shadow var(--kcc-transition);
	animation: kcc-entrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
	outline: none;
}

.kcc-bubble:hover {
	transform: scale(1.08);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.kcc-bubble:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), var(--kcc-shadow-heavy);
}

.kcc-bubble:active {
	transform: scale(0.96);
}

.kcc-bubble__icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.kcc-bubble__icon svg {
	fill: none;
}

/* Badge */
.kcc-bubble__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #e74c3c;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	transition: opacity var(--kcc-transition), transform var(--kcc-transition);
}

.kcc-bubble__badge--hidden {
	opacity: 0;
	transform: scale(0);
}

/* Entrance Animation */
@keyframes kcc-entrance {
	0% {
		opacity: 0;
		transform: scale(0.3) translateY(20px);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* Pulse Animation */
.kcc-bubble--pulse {
	animation: kcc-pulse 2s ease-in-out;
}

@keyframes kcc-pulse {
	0%, 100% {
		box-shadow: var(--kcc-shadow-heavy);
	}
	50% {
		box-shadow: 0 0 0 12px rgba(0, 120, 212, 0.2), var(--kcc-shadow-heavy);
	}
}

/* Hidden state */
.kcc-bubble--hidden {
	opacity: 0;
	transform: scale(0);
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
}

/* ==========================================================================
   Chat Window
   ========================================================================== */

.kcc-window {
	position: absolute;
	bottom: calc(var(--kcc-bubble-size) + 16px);
	right: 0;
	width: 440px;
	height: 620px;
	border-radius: var(--kcc-radius);
	background: #fff;
	box-shadow: var(--kcc-shadow-heavy);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transform-origin: bottom right;
	transition: opacity var(--kcc-transition), transform var(--kcc-transition);
}

.kcc-widget--left .kcc-window {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

/* Open/Close Animations */
.kcc-window--opening {
	animation: kcc-window-open 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.kcc-window--closing {
	animation: kcc-window-close 0.25s ease-in forwards;
}

@keyframes kcc-window-open {
	0% {
		opacity: 0;
		transform: scale(0.85) translateY(20px);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@keyframes kcc-window-close {
	0% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
	100% {
		opacity: 0;
		transform: scale(0.85) translateY(20px);
	}
}

/* Resize Handle (top-left corner — opposite the bottom-right anchor).
   Hidden by default via the [hidden] attribute set in PHP; the JS removes
   the attribute when resize is enabled and the viewport is desktop-sized. */
.kcc-window__resize-handle {
	position: absolute;
	top: 0;
	left: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.55);
	cursor: nw-resize;
	z-index: 5;
	user-select: none;
	-webkit-user-select: none;
	transition: color 0.15s ease, background 0.15s ease;
	border-top-left-radius: var(--kcc-radius);
}

.kcc-window__resize-handle[hidden] {
	display: none;
}

/* When the widget is anchored bottom-left, the opposite corner (and so
   the resize handle) lives at the top-right and the cursor flips. */
.kcc-widget--left .kcc-window__resize-handle {
	left: auto;
	right: 0;
	cursor: ne-resize;
	border-top-left-radius: 0;
	border-top-right-radius: var(--kcc-radius);
}

.kcc-widget--left .kcc-window__resize-handle svg {
	transform: scaleX(-1);
}

.kcc-window__resize-handle:hover,
.kcc-window__resize-handle--active {
	color: rgba(255, 255, 255, 0.95);
	background: rgba(0, 0, 0, 0.08);
}

.kcc-window__resize-handle svg {
	pointer-events: none;
}

/* While dragging: kill all transitions/animations on the window so resize
   feels instant, and disable text selection/iframe interaction globally. */
.kcc-window--resizing,
.kcc-window--resizing * {
	transition: none !important;
	animation: none !important;
}

body.kcc-resizing,
body.kcc-resizing * {
	user-select: none !important;
	-webkit-user-select: none !important;
	cursor: nw-resize !important;
}

body.kcc-resizing--ne,
body.kcc-resizing--ne * {
	cursor: ne-resize !important;
}

/* Header */
.kcc-window__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	color: #fff;
	flex-shrink: 0;
}

.kcc-window__header-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.kcc-window__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.kcc-window__title {
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kcc-window__header-right {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.kcc-window__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
}

.kcc-window__btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

.kcc-window__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Messages Area */
.kcc-window__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f5f5f5;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.kcc-window__messages::-webkit-scrollbar {
	width: 4px;
}

.kcc-window__messages::-webkit-scrollbar-track {
	background: transparent;
}

.kcc-window__messages::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 2px;
}

/* GDPR Notice */
.kcc-gdpr-notice {
	text-align: center;
	font-size: 11px;
	color: #999;
	padding: 4px 8px;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 8px;
	margin-bottom: 4px;
}

/* Message Bubbles */
.kcc-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: var(--kcc-radius-msg);
	word-wrap: break-word;
	animation: kcc-msg-in 0.3s ease-out;
	position: relative;
}

@keyframes kcc-msg-in {
	0% {
		opacity: 0;
		transform: translateY(8px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

.kcc-msg--bot {
	align-self: flex-start;
	background: #fff;
	color: #333;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.kcc-msg--user {
	align-self: flex-end;
	color: #fff;
	border-bottom-right-radius: 4px;
	white-space: pre-wrap;
}

.kcc-msg__text {
	margin: 0;
}

.kcc-msg-break {
	height: 10px;
}

.kcc-msg__text strong {
	font-weight: 700;
}

.kcc-msg__text em {
	font-style: italic;
}

.kcc-msg__text ul,
.kcc-msg__text ol {
	margin: 4px 0;
	padding-left: 18px;
}

.kcc-msg__text li {
	margin-bottom: 2px;
}

.kcc-msg__text a {
	color: #2E75B6;
	text-decoration: underline;
}

.kcc-msg--user .kcc-msg__text a {
	color: #fff;
}

.kcc-msg__text hr {
	border: none;
	border-top: 1px solid #ddd;
	margin: 8px 0;
}

/* ==========================================================================
   Product Cards (Table → Card Conversion)
   ========================================================================== */

.kcc-product-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 8px 0;
}

/* Variant header (blue left border + subtle background) */
.kcc-variant-header {
	font-weight: 600;
	font-size: 13px;
	color: var(--kcc-accent-color, #2E75B6);
	background: rgba(46, 117, 182, 0.08);
	padding: 6px 10px;
	border-radius: 6px;
	margin: 10px 0 6px;
	border-left: 3px solid var(--kcc-accent-color, #2E75B6);
	align-self: stretch;
}

.kcc-variant-header + .kcc-product-list {
	margin-top: 4px;
}

.kcc-order-products-readonly .kcc-variant-header {
	margin: 6px -10px 4px;
	padding: 4px 10px;
	font-size: 12px;
	border-radius: 0;
}

.kcc-order-products-readonly .kcc-variant-header:first-child {
	margin-top: 0;
	border-radius: 6px 6px 0 0;
}

/* Variant picker (in form flow) */
.kcc-variant-picker {
	align-self: stretch;
	margin: 8px 0;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-variant-select {
	background: rgba(0, 0, 0, 0.02);
	border-radius: 8px;
	padding: 8px 10px;
	margin-bottom: 6px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.kcc-variant-select--unchecked {
	opacity: 0.5;
}

.kcc-variant-select--unchecked .kcc-variant-products {
	text-decoration: line-through;
	color: #bbb;
}

.kcc-variant-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	margin-bottom: 4px;
}

.kcc-variant-checkbox input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--kcc-accent-color, #2E75B6);
	cursor: pointer;
	flex-shrink: 0;
}

.kcc-variant-check-label {
	font-weight: 600;
	font-size: 13px;
	color: var(--kcc-accent-color, #2E75B6);
}

.kcc-variant-products {
	margin-top: 4px;
	padding-left: 24px;
}

.kcc-variant-products .kcc-order-product-line {
	font-size: 12px;
	line-height: 1.5;
	color: #444;
}

.kcc-variant-products .kcc-order-product-location {
	font-size: 11px;
	color: #888;
	margin-left: 18px;
}

.kcc-product-card {
	background: rgba(255, 255, 255, 0.7);
	border-radius: 8px;
	padding: 8px 10px;
	border-left: 3px solid var(--kcc-accent-color, #2E75B6);
}

.kcc-product-name {
	font-weight: 600;
	font-size: 13px;
	line-height: 1.4;
	margin-bottom: 2px;
}

.kcc-product-details {
	font-size: 12px;
	color: #555;
	line-height: 1.4;
}

.kcc-product-nr {
	color: #777;
}

.kcc-product-qty strong {
	color: #1a1a1a;
}

.kcc-product-location {
	font-size: 11px;
	color: #888;
	margin-top: 2px;
}

.kcc-total-box {
	background: rgba(46, 117, 182, 0.1);
	border-radius: 8px;
	padding: 8px 10px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	margin-top: 8px;
}

.kcc-disclaimer {
	font-size: 11px;
	color: #999;
	font-style: italic;
	text-align: center;
	margin-top: 2px;
}

.kcc-cta {
	font-size: 12px;
	color: #555;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Order Summary Styles
   ========================================================================== */

.kcc-order-header {
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 8px;
	line-height: 1.3;
}

.kcc-order-section-label {
	font-size: 10px;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
	margin-top: 4px;
}

.kcc-order-divider {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	margin: 8px 0 6px;
}

.kcc-customer-data {
	display: grid;
	grid-template-columns: 1fr;
	gap: 3px;
}

.kcc-customer-row {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 12px;
	line-height: 1.4;
}

.kcc-customer-icon {
	font-size: 12px;
	flex-shrink: 0;
	width: 16px;
	text-align: center;
}

.kcc-customer-value {
	color: #333;
	word-break: break-word;
}

.kcc-msg-text {
	font-size: 12px;
	line-height: 1.5;
	margin-bottom: 4px;
}

/* ==========================================================================
   Read-Only Product Summary (Order Form Header)
   ========================================================================== */

.kcc-order-products-readonly {
	background: rgba(0, 0, 0, 0.03);
	border-radius: 8px;
	padding: 10px 12px;
	margin: 8px 0;
	align-self: stretch;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-order-product-line {
	font-size: 12px;
	line-height: 1.5;
	color: #444;
	padding: 2px 0;
}

.kcc-order-product-total {
	font-size: 12px;
	font-weight: 600;
	color: #333;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Success Message (After Order Submission)
   ========================================================================== */

.kcc-success-message {
	text-align: center;
	padding: 20px 12px;
	align-self: stretch;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-success-icon {
	font-size: 36px;
	margin-bottom: 8px;
}

.kcc-success-title {
	font-weight: 600;
	font-size: 15px;
	color: #1E8449;
	margin-bottom: 6px;
}

.kcc-success-text {
	font-size: 12px;
	color: #666;
	line-height: 1.5;
}

/* Prevent long words from breaking layout in bot messages */
.kcc-msg--bot .kcc-msg__text {
	word-break: break-word;
	overflow-wrap: break-word;
}

.kcc-msg__time {
	display: block;
	font-size: 10px;
	margin-top: 4px;
	opacity: 0.6;
}

.kcc-msg--bot .kcc-msg__time {
	text-align: left;
}

.kcc-msg--user .kcc-msg__time {
	text-align: right;
}

/* Thinking Indicator (Progressive) */
.kcc-thinking-bubble {
	align-self: flex-start;
	background: #fff;
	border-radius: var(--kcc-radius-msg);
	border-bottom-left-radius: 4px;
	padding: 12px 16px;
	max-width: 85%;
	min-width: 200px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	animation: kcc-fadeIn 0.3s ease;
}

.kcc-thinking-header {
	display: flex;
	align-items: center;
	gap: 10px;
}

.kcc-dots {
	display: flex;
	gap: 4px;
	align-items: center;
	flex-shrink: 0;
}

.kcc-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #2E75B6;
	opacity: 0.4;
	animation: kcc-dotPulse 1.4s infinite ease-in-out;
}

.kcc-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.kcc-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes kcc-dotPulse {
	0%, 80%, 100% {
		opacity: 0.3;
		transform: scale(0.8);
	}
	40% {
		opacity: 1;
		transform: scale(1.1);
	}
}

.kcc-thinking-text {
	font-size: 12px;
	color: #888;
	font-style: italic;
	opacity: 0;
	transition: opacity 0.3s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kcc-thinking-text--visible {
	opacity: 1;
}

.kcc-progress-track {
	width: 100%;
	height: 3px;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 2px;
	overflow: hidden;
	margin-top: 8px;
}

.kcc-progress-fill {
	height: 100%;
	width: 0%;
	background: #2E75B6;
	border-radius: 2px;
	transition: width 0.8s ease-out;
}

.kcc-fade-out {
	animation: kcc-fadeOut 0.3s ease forwards;
}

@keyframes kcc-fadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes kcc-fadeOut {
	from { opacity: 1; }
	to { opacity: 0; transform: translateY(-4px); }
}

/* Error Message */
.kcc-error {
	text-align: center;
	padding: 16px;
	align-self: center;
}

.kcc-error__text {
	color: #e74c3c;
	font-size: 13px;
	margin: 0 0 8px;
}

.kcc-error__retry {
	background: none;
	border: 1px solid #e74c3c;
	color: #e74c3c;
	padding: 6px 16px;
	border-radius: 20px;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.2s, color 0.2s;
}

.kcc-error__retry:hover {
	background: #e74c3c;
	color: #fff;
}

/* Input Area */
.kcc-window__input-area {
	display: flex;
	align-items: flex-end;
	padding: 8px 12px;
	border-top: 1px solid #e5e5e5;
	background: #fff;
	gap: 8px;
	flex-shrink: 0;
}

.kcc-window__input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	resize: none;
	outline: none;
	max-height: 100px;
	overflow-y: auto;
	transition: border-color 0.2s;
}

.kcc-window__input:focus {
	border-color: #0078D4;
}

.kcc-window__input::placeholder {
	color: #aaa;
}

.kcc-window__send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity 0.2s, transform 0.2s;
}

.kcc-window__send:hover {
	opacity: 0.85;
}

.kcc-window__send:active {
	transform: scale(0.92);
}

.kcc-window__send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Footer */
.kcc-window__footer {
	text-align: center;
	padding: 6px;
	font-size: 10px;
	color: #bbb;
	background: #fff;
	border-top: 1px solid #f0f0f0;
	flex-shrink: 0;
}

/* ==========================================================================
   Order Form (In-Chat)
   ========================================================================== */

.kcc-order-form {
	background: #fff;
	border-radius: var(--kcc-radius);
	padding: 16px;
	margin: 8px 0;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	align-self: stretch;
	max-width: 100%;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-order-form__title {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #333;
}

.kcc-order-form__group {
	margin-bottom: 10px;
}

.kcc-order-form__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #555;
	margin-bottom: 3px;
}

.kcc-order-form__label--required::after {
	content: " *";
	color: #e74c3c;
}

.kcc-order-form__input,
.kcc-order-form__select,
.kcc-order-form__textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-family: inherit;
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.kcc-order-form__input:focus,
.kcc-order-form__select:focus,
.kcc-order-form__textarea:focus {
	border-color: #0078D4;
}

.kcc-order-form__row {
	display: flex;
	gap: 8px;
}

.kcc-order-form__row .kcc-order-form__group {
	flex: 1;
}

.kcc-order-form__textarea {
	resize: vertical;
	min-height: 50px;
}

.kcc-order-form__actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.kcc-order-form__btn {
	flex: 1;
	padding: 10px 12px;
	border: none;
	border-radius: 8px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.15s;
	text-align: center;
}

.kcc-order-form__btn:hover {
	opacity: 0.9;
}

.kcc-order-form__btn:active {
	transform: scale(0.97);
}

.kcc-order-form__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.kcc-order-form__btn--email {
	background: #0078D4;
	color: #fff;
}

.kcc-order-form__btn--whatsapp {
	background: #25D366;
	color: #fff;
}

.kcc-order-form__status {
	text-align: center;
	font-size: 12px;
	margin-top: 8px;
	padding: 6px;
	border-radius: 6px;
}

.kcc-order-form__status--success {
	background: #d4edda;
	color: #155724;
}

.kcc-order-form__status--error {
	background: #f8d7da;
	color: #721c24;
}

/* ==========================================================================
   Form Prefill (Conversational Flow)
   ========================================================================== */

.kcc-form-prefill {
	align-self: flex-start;
	max-width: 85%;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-form-prefill__value {
	background: #e8f4fd;
	color: #1a5a96;
	padding: 8px 14px;
	border-radius: var(--kcc-radius-msg);
	border-bottom-left-radius: 4px;
	font-size: 13px;
	margin-bottom: 4px;
	word-wrap: break-word;
	white-space: pre-wrap;
}

/* ==========================================================================
   Action Buttons (Post-Consultation)
   ========================================================================== */

.kcc-action-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 0;
	margin-top: 8px;
	align-self: flex-start;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-action-buttons--wrap {
	max-width: 100%;
}

.kcc-action-btn {
	border: none;
	border-radius: 20px;
	padding: 8px 16px;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	transition: all 0.2s;
}

.kcc-action-btn:focus-visible {
	outline: 2px solid #2E75B6;
	outline-offset: 2px;
}

.kcc-action-btn--primary {
	background: #2E75B6;
	color: #fff;
}

.kcc-action-btn--primary:hover {
	background: #1a5a96;
}

.kcc-action-btn--secondary {
	background: #f0f0f0;
	color: #333;
	border: 1px solid #ddd;
}

.kcc-action-btn--secondary:hover {
	background: #e0e0e0;
}

/* Used/disabled state — buttons stay visible after click */
/* Cancel button during form flow */
.kcc-form-cancel-row {
	align-self: flex-start;
	margin-top: 4px;
	animation: kcc-msg-in 0.3s ease-out;
}

.kcc-action-btn--cancel {
	background: transparent;
	color: #999;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 6px 14px;
	cursor: pointer;
	font-family: inherit;
	font-size: 12px;
	transition: all 0.2s;
}

.kcc-action-btn--cancel:hover {
	color: #e74c3c;
	border-color: #e74c3c;
}

/* Used/disabled state — buttons stay visible after click */
.kcc-action-btn--used {
	opacity: 0.5;
	cursor: default;
	pointer-events: none;
}

.kcc-action-btn--selected {
	opacity: 0.8;
	outline: 2px solid var(--kcc-accent-color, #2E75B6);
	outline-offset: -2px;
}

.kcc-action-btn--whatsapp {
	background: #25D366;
	color: #fff;
}

.kcc-action-btn--whatsapp:hover {
	background: #1da851;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 480px) {
	.kcc-window__input {
		font-size: 16px !important;
	}

	.kcc-bubble {
		width: var(--kcc-bubble-size-mobile);
		height: var(--kcc-bubble-size-mobile);
	}

	.kcc-window {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100vw !important;
		height: 100vh !important;
		border-radius: 0;
		z-index: calc(var(--kcc-z-index) + 1);
	}

	/* Resize is desktop-only — never show the handle on phones. */
	.kcc-window__resize-handle {
		display: none !important;
	}

	.kcc-window--opening {
		animation: kcc-window-open-mobile 0.3s ease-out forwards;
	}

	@keyframes kcc-window-open-mobile {
		0% {
			opacity: 0;
			transform: translateY(100%);
		}
		100% {
			opacity: 1;
			transform: translateY(0);
		}
	}

	.kcc-window--closing {
		animation: kcc-window-close-mobile 0.25s ease-in forwards;
	}

	@keyframes kcc-window-close-mobile {
		0% {
			opacity: 1;
			transform: translateY(0);
		}
		100% {
			opacity: 0;
			transform: translateY(100%);
		}
	}
}

/* Hide on mobile if configured */
.kcc-widget--no-mobile {
	/* JS handles the actual hide, this is a fallback via media query */
}

@media (max-width: 480px) {
	.kcc-widget--no-mobile {
		display: none !important;
	}
}

/* ==========================================================================
   WebChat Overrides (when embedded)
   ========================================================================== */

.kcc-webchat-container {
	flex: 1;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* Hide WebChat's built-in send box when we use our own */
.kcc-webchat-container .webchat__send-box {
	display: none !important;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.kcc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Toggle buttons (customer type / delivery method)
   Inherits .kcc-action-btn — just a slightly bigger tap target.
   ========================================================================== */

.kcc-toggle-group {
	gap: 10px;
}

.kcc-action-btn--toggle {
	flex: 1 1 140px;
	min-height: 44px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
}

/* ==========================================================================
   Date picker (delivery / pickup date)
   ========================================================================== */

.kcc-date-picker-wrapper {
	margin: 10px 16px 14px;
	padding: 14px;
	background: #f7f9fc;
	border: 1px solid #e0e6ef;
	border-radius: 10px;
}

/* Stacks the visual display under a transparent native date input so the
   browser's own click handler opens the calendar in every browser. */
.kcc-date-picker-control {
	position: relative;
	width: 100%;
}

.kcc-date-picker-display {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid #c4cbd6;
	border-radius: 6px;
	background: #fff;
	color: #888;
	font-family: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kcc-date-picker-display:hover {
	border-color: var(--kcc-accent-color, #2E75B6);
}

.kcc-date-picker-display--has-value {
	color: #1a1a1a;
	font-weight: 500;
}

.kcc-date-picker-display__icon {
	font-size: 16px;
	line-height: 1;
}

.kcc-date-picker-display__text {
	flex: 1;
}

.kcc-date-picker-display__chevron {
	font-size: 12px;
	color: #999;
	margin-left: auto;
}

/* Custom calendar popup — replaces the native <input type="date"> so we
   get a German Mo-first calendar regardless of browser locale. */
.kcc-date-picker-display {
	width: 100%;
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.kcc-date-picker-display:focus {
	outline: none;
	border-color: var(--kcc-accent-color, #2E75B6);
	box-shadow: 0 0 0 2px rgba(46, 117, 182, 0.18);
}

.kcc-calendar {
	position: absolute;
	z-index: 10;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #c4cbd6;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	padding: 10px;
	font-family: inherit;
	user-select: none;
	-webkit-user-select: none;
}

.kcc-calendar__header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.kcc-calendar__month {
	flex: 1;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
	color: #1a1a1a;
}

.kcc-calendar__nav {
	width: 28px;
	height: 28px;
	border: 1px solid #ddd;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: #444;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.kcc-calendar__nav:hover {
	background: #f3f6fb;
	border-color: var(--kcc-accent-color, #2E75B6);
	color: var(--kcc-accent-color, #2E75B6);
}

.kcc-calendar__weekdays,
.kcc-calendar__days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.kcc-calendar__weekday {
	text-align: center;
	font-size: 11px;
	color: #888;
	font-weight: 600;
	padding: 4px 0;
}

.kcc-calendar__day {
	all: unset;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 32px;
	border-radius: 6px;
	font-size: 13px;
	color: #1a1a1a;
	cursor: pointer;
	background: transparent;
	transition: background 0.12s ease, color 0.12s ease;
	box-sizing: border-box;
}

.kcc-calendar__day:hover:not(.kcc-calendar__day--disabled):not(.kcc-calendar__day--placeholder) {
	background: var(--kcc-accent-color, #2E75B6);
	color: #fff;
}

.kcc-calendar__day--today {
	border: 1px solid var(--kcc-accent-color, #2E75B6);
}

.kcc-calendar__day--disabled {
	color: #c8c8c8;
	cursor: not-allowed;
	background: repeating-linear-gradient(
		45deg,
		transparent 0,
		transparent 4px,
		rgba(0, 0, 0, 0.05) 4px,
		rgba(0, 0, 0, 0.05) 5px
	);
}

.kcc-calendar__day--placeholder {
	cursor: default;
	background: transparent;
}

.kcc-date-helper-text {
	margin-top: 8px;
	font-size: 12px;
	color: #666;
}

.kcc-date-error {
	margin-top: 8px;
	padding: 8px 10px;
	background: #fdecea;
	color: #a12d22;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.4;
}

.kcc-date-picker-wrapper .kcc-action-buttons {
	margin-top: 12px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.kcc-bubble,
	.kcc-window,
	.kcc-msg,
	.kcc-order-form {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}

	.kcc-typing__dot {
		animation: none;
		opacity: 0.6;
	}
}
