/* ── CSS custom properties (values injected via wp_add_inline_style) ─── */
:root {
	--bpop-accent: #6d8c7d;
	--bpop-dark:   #5a7668;
	--bpop-light:  #8aaa9a;
}

/* ═══════════════════════════════════════════════════════════════
   WIDGET — the fixed stack in the bottom-right corner
   ═══════════════════════════════════════════════════════════════ */
.bpop-widget {
	position: fixed;
	bottom: 0;
	right: 24px;
	z-index: 9998;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

/* ── Trigger button ─────────────────────────────────────────── */
.bpop-trigger-btn {
	display: block;
	background-color: var(--bpop-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	padding: 15px 28px;
	border: none;
	/* Only round the top corners — bottom sits flush with the viewport */
	border-radius: 8px 8px 0 0;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease;
	font-family: inherit;
	line-height: 1.3;
}

.bpop-trigger-btn:hover,
.bpop-trigger-btn:focus {
	background-color: var(--bpop-dark);
	outline: none;
}

/* ── Panel — slides up directly above the button ────────────── */
.bpop-panel {
	width: 360px;
	background: #fff;
	border-radius: 10px 10px 0 0;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	/* Slide-up entrance */
	transform-origin: bottom center;
	animation: none;
}

/* hidden attribute hides it; when JS removes hidden we add the animation */
.bpop-panel:not([hidden]) {
	animation: bpop-slide-up 0.25s ease;
}

@keyframes bpop-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Top bar (title + minimise button) ──────────────────────── */
.bpop-panel-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: var(--bpop-accent);
	color: #fff;
	padding: 10px 16px;
}

.bpop-panel-title-small {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding-right: 8px;
}

.bpop-minimise {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 7px 4px;
	border-radius: 4px;
	flex-shrink: 0;
	transition: background 0.15s;
}

.bpop-minimise:hover,
.bpop-minimise:focus {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

/* ── Main content area ──────────────────────────────────────── */
.bpop-content {
	padding: 24px 24px 20px;
}

.bpop-title {
	font-size: 22px;
	font-weight: 400;
	color: #333;
	margin: 0 0 14px;
	line-height: 1.25;
}

.bpop-body {
	font-size: 15px;
	color: #555;
	line-height: 1.6;
	margin: 0 0 10px;
}

.bpop-body:last-of-type {
	margin-bottom: 0;
}

/* ── Button group ───────────────────────────────────────────── */
.bpop-btn-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 18px;
}

.bpop-schedule-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background-color: var(--bpop-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	padding: 14px 20px;
	border: none;
	border-radius: 6px;
	text-decoration: none;
	transition: background-color 0.2s ease;
	box-sizing: border-box;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.3;
}

.bpop-schedule-btn:hover,
.bpop-schedule-btn:focus {
	background-color: var(--bpop-dark);
	color: #fff;
	text-decoration: none;
	outline: none;
}

.bpop-btn-secondary {
	background-color: var(--bpop-light);
}

.bpop-btn-secondary:hover,
.bpop-btn-secondary:focus {
	background-color: var(--bpop-accent);
}

.bpop-arrow {
	font-size: 20px;
	line-height: 1;
}

/* ── Icon footer ────────────────────────────────────────────── */
.bpop-footer {
	background-color: #e8e8e8;
	display: flex;
	justify-content: space-around;
	align-items: flex-start;
	padding: 16px 12px;
	gap: 6px;
}

.bpop-icon-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: #555;
	flex: 1;
	min-width: 0;
}

.bpop-icon-btn:hover .bpop-icon-circle,
.bpop-icon-btn:focus .bpop-icon-circle {
	background-color: var(--bpop-accent);
	color: #fff;
}

.bpop-icon-btn:hover,
.bpop-icon-btn:focus {
	outline: none;
	text-decoration: none;
	color: #333;
}

.bpop-icon-circle {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background-color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #555;
	transition: background-color 0.2s, color 0.2s;
	flex-shrink: 0;
}

.bpop-icon-circle svg {
	width: 20px;
	height: 20px;
}

.bpop-icon-label {
	font-size: 11px;
	text-align: center;
	line-height: 1.3;
	word-break: break-word;
	color: #555;
}

/* ═══════════════════════════════════════════════════════════════
   CHATBOT — full-screen dimmed overlay, centred modal
   ═══════════════════════════════════════════════════════════════ */
.bpop-chatbot-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 10000;
	justify-content: center;
	align-items: center;
	padding: 16px;
}

.bpop-chatbot-overlay.bpop-open {
	display: flex;
}

.bpop-chatbot-modal {
	background: #fff;
	border-radius: 10px;
	max-width: 560px;
	width: 100%;
	max-height: 88vh;
	position: relative;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	animation: bpop-fade-in 0.22s ease;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

@keyframes bpop-fade-in {
	from { opacity: 0; transform: scale(0.96) translateY(10px); }
	to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.bpop-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: #f0f0f0;
	border: none;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: #555;
	cursor: pointer;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
	transition: background 0.15s, color 0.15s;
}

.bpop-close:hover,
.bpop-close:focus {
	background: #e0e0e0;
	color: #111;
	outline: none;
}

.bpop-chatbot-inner {
	flex: 1;
	overflow-y: auto;
	padding: 48px 24px 24px;
	min-height: 320px;
}

.bpop-chatbot-inner #chat_form {
	width: 100%;
	height: 100%;
	min-height: 300px;
}

/* ── Shortcode variant (inline button) ──────────────────────── */
.bpop-shortcode-btn {
	display: inline-block;
	border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Chatbot modal on small screens */
@media (max-width: 600px) {
	.bpop-chatbot-modal {
		max-height: 94vh;
		border-radius: 8px;
	}
}

/* Widget on mobile: full-width, centred */
@media (max-width: 520px) {
	.bpop-widget {
		right: 0;
		left: 0;
		align-items: stretch;
	}

	.bpop-trigger-btn {
		border-radius: 0;
		text-align: center;
		width: 100%;
	}

	.bpop-panel {
		width: 100%;
		border-radius: 0;
	}
}
