/* ============================================================
   LocalHQ Widget Builder — Frontend Styles
   Version: 1.3.5
   ============================================================ */

:root {
	--lhq-primary: #4F46E5;
	--lhq-primary-hover: #4338ca;
	--lhq-text: #0f172a;
	--lhq-text-secondary: #64748b;
	--lhq-text-muted: #94a3b8;
	--lhq-border-color: #e2e8f0;
	--lhq-border: 1px solid var(--lhq-border-color);
	--lhq-surface: #ffffff;
	--lhq-sidebar-bg: #f8fafc;
	--lhq-star: #fbbf24;
	--lhq-star-empty: #e2e8f0;
	--lhq-success: #22c55e;
	--lhq-code-bg: #0f172a;
	--lhq-code-text: #94a3b8;
	--lhq-code-tag: #f472b6;
	--lhq-code-attr: #38bdf8;
	--lhq-code-val: #a3e635;
	--lhq-radius-lg: 12px;
	--lhq-radius-md: 10px;
	--lhq-radius-sm: 8px;
	--lhq-shadow: 0 1px 3px rgba(0,0,0,0.08);
	--lhq-shadow-md: 0 10px 22px rgba(0,0,0,0.06);
	--lhq-shadow-lg: 0 12px 30px rgba(0,0,0,0.08);
	--lhq-transition: all 0.2s ease;
	--lhq-sidebar-width: 300px;
}

.lhq-wrap *, .lhq-wrap *::before, .lhq-wrap *::after { box-sizing: border-box; }

.lhq-wrap {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	color: var(--lhq-text);
	line-height: 1.5;
	width: 100%;
	max-width: 100%;
}

.lhq-builder { width: 100%; max-width: 100%; }

.lhq-wrap input, .lhq-wrap button, .lhq-wrap select { font-family: inherit; }

/* ---- Search Step ---- */
.lhq-step[data-step="search"] {
	width: 100%;
	padding: 40px 0;
	background: transparent;
}

.lhq-search-hero { width: 100%; }

/* ---- Field / Input ---- */
.lhq-field { position: relative; width: 100%; }

.lhq-input-wrap { position: relative; display: flex; align-items: center; width: 100%; }

.lhq-input {
	width: 100%;
	padding: 14px 18px;
	font-size: 1rem;
	border: 1.5px solid var(--lhq-border-color);
	border-radius: var(--lhq-radius-lg);
	background: var(--lhq-surface);
	color: var(--lhq-text);
	outline: none;
	transition: var(--lhq-transition);
}

.lhq-input:hover { border-color: #cbd5e1; }
.lhq-input:focus { border-color: var(--lhq-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12); }
.lhq-input::placeholder { color: var(--lhq-text-muted); }

/* ---- Dropdown ---- */
.lhq-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: var(--lhq-surface);
	border: 1px solid var(--lhq-border-color);
	border-radius: var(--lhq-radius-md);
	box-shadow: var(--lhq-shadow-lg);
	max-height: 380px;
	overflow-y: auto;
	z-index: 100;
	opacity: 0;
	transform: translateY(-8px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.lhq-dropdown.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.lhq-dd-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid #f1f5f9;
	cursor: pointer;
	transition: var(--lhq-transition);
	outline: none;
}

.lhq-dd-item:last-child { border-bottom: none; }
.lhq-dd-item:hover, .lhq-dd-item:focus { background: #f8fafc; }

.lhq-dd-name {
	font-size: 0.9375rem;
	font-weight: 600;
	margin: 0 0 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--lhq-text);
}

.lhq-dd-address {
	font-size: 0.8125rem;
	color: var(--lhq-text-muted);
	margin: 0 0 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lhq-dd-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.8125rem;
}

.lhq-dd-stars { color: var(--lhq-star); display: inline-flex; gap: 1px; }
.lhq-dd-stars svg { width: 12px; height: 12px; }
.lhq-dd-count { color: var(--lhq-text-muted); }
.lhq-dd-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

/* ---- Search Loading / Empty ---- */
.lhq-search-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--lhq-text-secondary); }
.lhq-search-empty { text-align: center; padding: 40px; color: var(--lhq-text-muted); }

.lhq-spinner {
	width: 20px; height: 20px;
	border: 2px solid #e2e8f0;
	border-top-color: var(--lhq-primary);
	border-radius: 50%;
	animation: lhq-spin 0.7s linear infinite;
	display: inline-block;
}

@keyframes lhq-spin { to { transform: rotate(360deg); } }

/* ---- Buttons ---- */
.lhq-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: var(--lhq-radius-sm);
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: var(--lhq-transition);
	outline: none;
}

.lhq-btn-primary { background: var(--lhq-primary); color: #fff; border-color: var(--lhq-primary); }
.lhq-btn-primary:hover { background: var(--lhq-primary-hover); border-color: var(--lhq-primary-hover); }

.lhq-btn-ghost { background: transparent; color: var(--lhq-text-secondary); border-color: var(--lhq-border-color); }
.lhq-btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--lhq-text); }

.lhq-back-text {
	background: none;
	border: none;
	color: var(--lhq-text-secondary);
	font-size: 0.875rem;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: var(--lhq-radius-sm);
	transition: var(--lhq-transition);
}

.lhq-back-text:hover { background: #f1f5f9; color: var(--lhq-text); }

/* ---- Builder Step ---- */
.lhq-step[data-step="builder"] { width: 100%; min-height: 500px; display: flex; flex-direction: column; background: #f1f5f9; }

/* ---- Top Bar ---- */
.lhq-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	background: var(--lhq-surface);
	border-bottom: 1px solid var(--lhq-border-color);
}

.lhq-topbar-left { display: flex; align-items: center; gap: 12px; }

.lhq-topbar-info h2 {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0;
	color: var(--lhq-text);
}

.lhq-topbar-info p { font-size: 0.8125rem; color: var(--lhq-text-muted); margin: 2px 0 0; }

.lhq-topbar-right { display: flex; align-items: center; gap: 10px; }

/* ---- Builder Main ---- */
.lhq-builder { display: flex; flex: 1; position: relative; overflow: hidden; width: 100%; }

/* ---- Sidebar Toggle ---- */
.lhq-sidebar-toggle {
	display: none;
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 60;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: var(--lhq-primary);
	color: #fff;
	box-shadow: var(--lhq-shadow-md);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: var(--lhq-transition);
}

.lhq-sidebar-toggle:hover { background: var(--lhq-primary-hover); transform: scale(1.05); }

/* ---- Sidebar ---- */
.lhq-sidebar {
	width: var(--lhq-sidebar-width);
	min-width: var(--lhq-sidebar-width);
	background: var(--lhq-sidebar-bg);
	border-right: 1px solid var(--lhq-border-color);
	padding: 20px;
	overflow-y: auto;
	overflow-x: hidden;
	transition: var(--lhq-transition);
	flex-shrink: 0;
	max-height: calc(100vh - 61px);
}

.lhq-sidebar.is-collapsed { width: 0; min-width: 0; padding: 0; overflow: hidden; opacity: 0; }

.lhq-sidebar-section { margin-bottom: 20px; }

.lhq-sidebar-label {
	display: block;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lhq-text-muted);
	margin-bottom: 10px;
}

/* ---- Business Card ---- */
.lhq-biz-card {
	background: var(--lhq-surface);
	border: 1px solid var(--lhq-border-color);
	border-radius: var(--lhq-radius-md);
	padding: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.lhq-biz-card-name {
	font-size: 0.875rem;
	font-weight: 600;
	margin: 0 0 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--lhq-text);
}

.lhq-biz-card-status {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--lhq-success);
}

.lhq-biz-card-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lhq-success); }
.lhq-biz-card-icon { width: 24px; height: 24px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

/* ---- Widget Type Grid ---- */
.lhq-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.lhq-type-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 8px;
	background: var(--lhq-surface);
	border: 1.5px solid var(--lhq-border-color);
	border-radius: var(--lhq-radius-sm);
	cursor: pointer;
	transition: var(--lhq-transition);
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--lhq-text-secondary);
}

.lhq-type-card:hover { border-color: #cbd5e1; box-shadow: var(--lhq-shadow); }

.lhq-type-card.is-active {
	border-color: var(--lhq-primary);
	color: var(--lhq-primary);
	background: rgba(79, 70, 229, 0.04);
	box-shadow: 0 0 0 1px var(--lhq-primary);
}

.lhq-type-card svg { width: 24px; height: 24px; }

/* ---- Segmented Control ---- */
.lhq-segmented {
	display: flex;
	gap: 4px;
	background: #f1f5f9;
	border-radius: var(--lhq-radius-sm);
	padding: 3px;
}

.lhq-segmented button {
	flex: 1;
	padding: 8px 10px;
	font-size: 0.8125rem;
	font-weight: 500;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--lhq-text-muted);
	cursor: pointer;
	transition: var(--lhq-transition);
}

.lhq-segmented button:hover { color: var(--lhq-text-secondary); }
.lhq-segmented button.is-active { background: var(--lhq-surface); color: var(--lhq-text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ---- Toggle Switch ---- */
.lhq-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--lhq-border-color);
	font-size: 0.875rem;
	color: var(--lhq-text-secondary);
	cursor: pointer;
}

.lhq-toggle:last-child { border-bottom: none; }

.lhq-toggle-switch {
	position: relative;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
	cursor: pointer;
}

.lhq-toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.lhq-toggle-slider {
	position: absolute;
	inset: 0;
	background: #cbd5e1;
	border-radius: 999px;
	transition: background 0.2s ease;
}

.lhq-toggle-slider::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	left: 2px;
	top: 2px;
	background: white;
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.lhq-toggle-switch input:checked + .lhq-toggle-slider { background: var(--lhq-primary); }
.lhq-toggle-switch input:checked + .lhq-toggle-slider::after { transform: translateX(16px); }

/* ---- Color Row ---- */
.lhq-color-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--lhq-border-color);
}

.lhq-color-row:last-child { border-bottom: none; }

.lhq-color-row > span:first-child { font-size: 0.875rem; color: var(--lhq-text-secondary); }

.lhq-color-wrap { display: flex; align-items: center; gap: 8px; }

.lhq-color-input {
	width: 28px; height: 28px; padding: 0;
	border: 1.5px solid var(--lhq-border-color);
	border-radius: 6px; cursor: pointer; overflow: hidden; background: none;
}

.lhq-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.lhq-color-input::-webkit-color-swatch { border: none; border-radius: 3px; }

.lhq-color-hex {
	font-size: 0.8125rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: var(--lhq-text-muted);
	min-width: 60px;
	text-align: right;
}

/* ---- Range Slider ---- */
.lhq-range-wrap { padding: 8px 0; border-bottom: 1px solid var(--lhq-border-color); }
.lhq-range-wrap:last-child { border-bottom: none; }

.lhq-range-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; color: var(--lhq-text-secondary); margin-bottom: 6px; }
.lhq-range-value { font-weight: 600; color: var(--lhq-text); }

.lhq-range {
	width: 100%;
	-webkit-appearance: none;
	appearance: none;
	height: 5px;
	border-radius: 999px;
	background: #e2e8f0;
	outline: none;
	cursor: pointer;
}

.lhq-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px; height: 18px; border-radius: 50%;
	background: var(--lhq-primary); cursor: pointer;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.lhq-range-labels { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--lhq-text-muted); margin-top: 4px; }

/* ---- Select ---- */
.lhq-select {
	width: 100%; padding: 10px 14px; font-size: 0.875rem;
	border: 1.5px solid var(--lhq-border-color); border-radius: var(--lhq-radius-sm);
	background: white; color: var(--lhq-text); cursor: pointer; outline: none;
	transition: var(--lhq-transition);
}

.lhq-select:hover, .lhq-select:focus { border-color: var(--lhq-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); }

/* ---- Preview Panel ---- */
.lhq-preview { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.lhq-preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	background: var(--lhq-surface);
	border-bottom: 1px solid var(--lhq-border-color);
}

.lhq-live-label { display: flex; align-items: center; gap: 8px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lhq-success); }

.lhq-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lhq-success); animation: lhq-pulse 2s ease infinite; }

@keyframes lhq-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.lhq-viewport-toggle { display: flex; gap: 4px; background: #f1f5f9; border-radius: var(--lhq-radius-sm); padding: 3px; }

.lhq-viewport-toggle button {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 6px 14px; font-size: 0.8125rem; font-weight: 500;
	border: none; border-radius: 6px; background: transparent;
	color: var(--lhq-text-muted); cursor: pointer;
	transition: var(--lhq-transition);
}

.lhq-viewport-toggle button:hover { color: var(--lhq-text-secondary); }
.lhq-viewport-toggle button.is-active { background: var(--lhq-surface); color: var(--lhq-text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.lhq-preview-body { flex: 1; padding: 24px; overflow-y: auto; background: #f8fafc; }
.lhq-preview-body.is-mobile .lhq-widget-wrap { max-width: 375px; margin: 0 auto; }

.lhq-preview-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--lhq-text-muted); font-size: 0.9375rem; }
.lhq-preview-render { display: none; }
.lhq-preview-render.is-active { display: block; }

/* ---- Embed Code ---- */
.lhq-embed { background: var(--lhq-surface); border-top: 1px solid var(--lhq-border-color); padding: 20px 24px; }

.lhq-embed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lhq-embed-header > span:first-child { font-size: 0.8125rem; font-weight: 600; color: var(--lhq-text-secondary); }

.lhq-embed-code {
	background: var(--lhq-code-bg); border-radius: var(--lhq-radius-md);
	padding: 20px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.8125rem; line-height: 1.8; color: var(--lhq-code-text);
	overflow-x: auto; position: relative; min-height: 80px;
}

.lhq-embed-code .lhq-code-tag { color: var(--lhq-code-tag); }
.lhq-embed-code .lhq-code-attr { color: var(--lhq-code-attr); }
.lhq-embed-code .lhq-code-val { color: var(--lhq-code-val); }
.lhq-embed-code .lhq-code-comment { color: #475569; font-style: italic; }

.lhq-embed-hint { font-size: 0.75rem; color: var(--lhq-text-muted); margin: 10px 0 0; }

/* ============================================================
   WIDGET STYLES
   ============================================================ */

.lhq-widget-wrap {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--lhq-surface);
	border: var(--lhq-border);
	border-color: var(--lhq-border-color);
	border-radius: var(--lhq-radius-md);
	padding: 24px;
}

/* Dark mode - common */
.lhq-widget-wrap[data-bg="dark"] { background: #1e293b; border-color: #334155; }
.lhq-widget-wrap[data-bg="dark"] .lhq-review-card { background: #283548; border-color: #334155; }
.lhq-widget-wrap[data-bg="dark"] .lhq-review-name { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-review-text { color: #94a3b8; }
.lhq-widget-wrap[data-bg="dark"] .lhq-review-date { color: #94a3b8; }
.lhq-widget-wrap[data-bg="dark"] .lhq-widget-header-name { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-widget-header-rating { color: #cbd5e1; }
.lhq-widget-wrap[data-bg="dark"] .lhq-attribution a { color: #94a3b8; }

/* Dark mode - floating */
.lhq-widget-wrap[data-bg="dark"] .lhq-floating-bar { background: #1e293b; border-color: #334155; }
.lhq-widget-wrap[data-bg="dark"] .lhq-floating-name { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-floating-meta { color: #94a3b8; }
.lhq-widget-wrap[data-bg="dark"] .lhq-floating-rating { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-floating-count { color: #94a3b8; }

/* Dark mode - mini */
.lhq-widget-wrap[data-bg="dark"] .lhq-mini-bar { background: #1e293b; border-color: #334155; }
.lhq-widget-wrap[data-bg="dark"] .lhq-mini-rating { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-mini-count { color: #94a3b8; }
.lhq-widget-wrap[data-bg="dark"] .lhq-mini-attribution { color: #94a3b8; border-color: #334155; }
.lhq-widget-wrap[data-bg="dark"] .lhq-mini-attribution a { color: #94a3b8; }

/* Dark mode - badge */
.lhq-widget-wrap[data-bg="dark"] .lhq-badge-rating-number { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-badge-count { color: #94a3b8; }

/* Dark mode - CTA box */
.lhq-widget-wrap[data-bg="dark"] .lhq-cta-name { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-cta-rating { color: #f1f5f9; }
.lhq-widget-wrap[data-bg="dark"] .lhq-cta-count { color: #94a3b8; }
.lhq-widget-wrap[data-bg="dark"] .lhq-cta-message { color: #94a3b8; }

.lhq-widget-wrap[data-bg="transparent"] { background: transparent; border-color: transparent; }

/* ---- Widget Header ---- */
.lhq-widget-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.lhq-widget-header-g { width: 32px; height: 32px; flex-shrink: 0; }
.lhq-widget-header-info { flex: 1; min-width: 0; }
.lhq-widget-header-name { font-size: 1rem; font-weight: 600; color: var(--lhq-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lhq-widget-header-rating { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--lhq-text-secondary); margin-top: 4px; }
.lhq-widget-header-stars { color: var(--lhq-star); display: inline-flex; gap: 1px; }
.lhq-widget-header-stars svg { width: 16px; height: 16px; }

/* ---- Review Card ---- */
.lhq-review-card { position: relative; background: var(--lhq-surface); border: 1px solid var(--lhq-border-color); border-radius: var(--lhq-radius-md); padding: 16px; transition: var(--lhq-transition); }
.lhq-review-card:hover { border-color: #cbd5e1; box-shadow: var(--lhq-shadow); }

.lhq-review-card-g { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; opacity: 0.5; }

.lhq-review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.lhq-review-avatar {
	width: 40px; height: 40px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 1rem; font-weight: 600; color: #fff; flex-shrink: 0;
}

.lhq-review-avatar-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.lhq-review-name { font-size: 0.875rem; font-weight: 600; color: var(--lhq-text); margin: 0; }
.lhq-review-date { font-size: 0.75rem; color: var(--lhq-text-muted); margin: 2px 0 0; }
.lhq-review-stars { color: var(--lhq-star); display: inline-flex; gap: 1px; margin-bottom: 8px; }
.lhq-review-stars svg { width: 14px; height: 14px; }
.lhq-review-text { font-size: 0.875rem; line-height: 1.6; color: var(--lhq-text-secondary); margin: 0; }

/* ---- Carousel ---- */
.lhq-widget-carousel { position: relative; }
.lhq-carousel-track-wrap { overflow: hidden; }
.lhq-carousel-track { display: flex; transition: transform 0.5s ease; gap: 16px; }
.lhq-carousel-card { flex: 0 0 calc(20% - 13px); min-width: 0; } /* 5 cards default */
.lhq-preview-body.is-mobile .lhq-carousel-card { flex: 0 0 100%; }

/* Carousel CTA */
.lhq-carousel-cta { text-align: center; margin-top: 16px; }
.lhq-carousel-cta a {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 10px 20px; font-size: 0.875rem; font-weight: 500;
	color: #fff; border: none; border-radius: var(--lhq-radius-sm);
	text-decoration: none; cursor: pointer; transition: var(--lhq-transition);
}

/* ---- Badge ---- */
.lhq-widget-badge { text-align: center; max-width: 260px; margin: 0 auto; padding: 12px 16px; }
.lhq-widget-badge .lhq-attribution { text-align: center; margin-top: 8px; }

.lhq-badge-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lhq-badge-rating-number { font-size: 1.25rem; font-weight: 700; color: var(--lhq-text); line-height: 1; }
.lhq-badge-stars { color: var(--lhq-star); display: inline-flex; gap: 2px; }
.lhq-badge-stars svg { width: 16px; height: 16px; }
.lhq-badge-count { font-size: 0.8125rem; color: var(--lhq-text-muted); }

/* ---- Floating ---- */
.lhq-widget-floating { max-width: 340px; margin: 0 auto; }

.lhq-floating-bar {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 16px; background: var(--lhq-surface);
	border: 1px solid var(--lhq-border-color);
	border-radius: 999px;
	box-shadow: var(--lhq-shadow-md);
}

.lhq-floating-g { width: 20px; height: 20px; flex-shrink: 0; }

.lhq-floating-info { flex: 1; min-width: 0; }
.lhq-floating-name { font-size: 0.8125rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--lhq-text); }
.lhq-floating-meta { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--lhq-text-muted); margin-top: 2px; }
.lhq-floating-rating { font-weight: 600; color: var(--lhq-text); }
.lhq-floating-stars { color: var(--lhq-star); display: inline-flex; gap: 1px; align-items: center; vertical-align: middle; }
.lhq-floating-stars svg { width: 14px; height: 14px; }
.lhq-floating-count { white-space: nowrap; }

/* Circular + button on floating widget */
.lhq-floating-add-btn {
	display: flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; min-width: 28px;
	border-radius: 50%;
	background: var(--lhq-primary);
	color: #fff;
	font-size: 18px;
	font-weight: 300;
	line-height: 1;
	text-decoration: none;
	transition: var(--lhq-transition);
	flex-shrink: 0;
}
.lhq-floating-add-btn:hover { background: var(--lhq-primary-hover); transform: scale(1.1); }

/* ---- Grid ---- */
.lhq-widget-grid { max-width: 720px; margin: 0 auto; }
.lhq-grid-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lhq-preview-body.is-mobile .lhq-grid-list { grid-template-columns: 1fr; }

/* ---- CTA Box ---- */
.lhq-widget-cta { max-width: 420px; margin: 0 auto; text-align: center; padding: 32px; }
.lhq-cta-g { width: 40px; height: 40px; margin: 0 auto 12px; }
.lhq-cta-name { font-size: 1rem; font-weight: 600; color: var(--lhq-text); margin: 0 0 8px; }
.lhq-cta-rating { font-size: 3rem; font-weight: 700; color: var(--lhq-text); margin: 0; line-height: 1; }
.lhq-cta-stars { color: var(--lhq-star); display: inline-flex; gap: 3px; margin: 12px 0; }
.lhq-cta-stars svg { width: 22px; height: 22px; }
.lhq-cta-count { font-size: 0.875rem; color: var(--lhq-text-secondary); margin: 0 0 16px; }
.lhq-cta-message { font-size: 0.9375rem; color: var(--lhq-text-secondary); line-height: 1.6; margin: 0 0 24px; }
.lhq-cta-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 14px 28px; font-size: 1rem; font-weight: 600;
	color: #fff; background: var(--lhq-primary);
	border: none; border-radius: var(--lhq-radius-sm);
	cursor: pointer; transition: var(--lhq-transition);
	width: 100%; justify-content: center; text-decoration: none;
}
.lhq-cta-btn:hover { background: var(--lhq-primary-hover); }

/* ---- Mini ---- */
.lhq-mini-bar {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: var(--lhq-surface);
	border: 1px solid var(--lhq-border-color);
	border-radius: var(--lhq-radius-sm);
}

.lhq-mini-rating { font-size: 0.875rem; font-weight: 700; color: var(--lhq-text); line-height: 1; }

.lhq-mini-stars { color: var(--lhq-star); display: inline-flex; gap: 1px; align-items: center; vertical-align: middle; margin-top: -1px; }
.lhq-mini-stars svg { width: 15px; height: 15px; }

.lhq-mini-count { font-size: 0.6875rem; color: var(--lhq-text-muted); white-space: nowrap; }

.lhq-mini-attribution {
	font-size: 0.625rem;
	color: var(--lhq-text-muted);
	margin-left: 2px;
	padding-left: 6px;
	border-left: 1px solid var(--lhq-border-color);
	white-space: nowrap;
}

.lhq-mini-attribution a { color: var(--lhq-text-muted); text-decoration: none; }
.lhq-mini-attribution a:hover { color: var(--lhq-text-secondary); }

/* ---- Attribution ---- */
.lhq-attribution { text-align: right; margin-top: 12px; }
.lhq-attribution a { font-size: 0.6875rem; color: var(--lhq-text-muted); text-decoration: none; transition: var(--lhq-transition); }
.lhq-attribution a:hover { color: var(--lhq-text-secondary); }

/* ---- CTA Button (shared) ---- */
.lhq-widget-cta-btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 24px; font-size: 0.9375rem; font-weight: 500;
	color: #fff; border: none; border-radius: var(--lhq-radius-sm);
	cursor: pointer; transition: var(--lhq-transition); text-decoration: none;
}
.lhq-widget-cta-btn:hover { opacity: 0.9; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Carousel responsive: 3 on tablet, 2 on small tablet, 1 on mobile */
@media (max-width: 1200px) {
	.lhq-carousel-card { flex: 0 0 calc(33.333% - 11px); }
}
@media (max-width: 768px) {
	/* Stack sidebar above preview, no overlay */
	.lhq-builder { flex-direction: column; min-height: auto; overflow: visible; }

	/* Sidebar stacks above preview */
	.lhq-sidebar-toggle { display: none; } /* No toggle button */
	.lhq-sidebar {
		position: static;
		width: 100%;
		min-width: 100%;
		max-height: none;
		border-right: none;
		border-bottom: 1px solid var(--lhq-border-color);
		box-shadow: none;
		padding: 16px;
		max-height: 50vh; /* Half viewport, scrollable */
	}
	.lhq-sidebar.is-collapsed {
		/* Keep sidebar visible on mobile */
		width: 100%;
		min-width: 100%;
		padding: 16px;
		opacity: 1;
		overflow: hidden;
		max-height: 50vh;
	}

	/* Preview fills width */
	.lhq-preview { width: 100%; min-height: 350px; }
	.lhq-preview-body { padding: 16px; }

	/* Topbar - mobile: back+title on row 1, button on row 2 */
	.lhq-topbar {
		padding: 10px 14px;
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}
	.lhq-topbar-left {
		justify-content: space-between;
		gap: 8px;
	}
	.lhq-topbar-right {
		justify-content: stretch;
	}
	.lhq-topbar-right .lhq-btn-primary {
		width: 100%;
		justify-content: center;
	}

	/* Widget types */
	.lhq-grid-list { grid-template-columns: 1fr; }
	.lhq-carousel-card { flex: 0 0 calc(50% - 8px); }

	/* Search */
	.lhq-search-hero { padding: 0 16px; }
	.lhq-search-bar { max-width: 100%; }
}

@media (max-width: 480px) {
	.lhq-topbar-info h2 { font-size: 1rem; }
	.lhq-topbar-info p { display: none; }
	.lhq-widget-wrap { padding: 16px; }
	.lhq-carousel-card { flex: 0 0 100%; }
	.lhq-type-grid { grid-template-columns: repeat(3, 1fr); }
	.lhq-modal-box { margin: 10px; }
}

/* ============================================================
   EMAIL MODAL
   ============================================================ */
.lhq-modal {
	position: fixed; inset: 0; z-index: 9999;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
}

.lhq-modal-overlay {
	position: absolute; inset: 0;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(4px);
}

.lhq-modal-box {
	position: relative; z-index: 1;
	background: #fff; border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	width: 100%; max-width: 420px;
	animation: lhq-modal-in 0.3s ease;
}

@keyframes lhq-modal-in {
	from { opacity: 0; transform: translateY(20px) scale(0.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lhq-modal-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 20px 24px 0;
}

.lhq-modal-title {
	font-size: 1.125rem; font-weight: 600; color: var(--lhq-text);
	margin: 0;
}

.lhq-modal-close {
	width: 32px; height: 32px; border-radius: 8px;
	border: 1px solid var(--lhq-border-color); background: #fff;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; color: var(--lhq-text-muted);
	transition: var(--lhq-transition); padding: 0;
	font-size: 22px; line-height: 1; font-weight: 300;
	font-family: system-ui, -apple-system, sans-serif;
}

.lhq-modal-close:hover { background: var(--lhq-surface); color: var(--lhq-text); }

.lhq-modal-body { padding: 16px 24px 24px; }

.lhq-modal-icon {
	width: 64px; height: 64px; border-radius: 50%;
	background: #eef2ff;
	display: flex; align-items: center; justify-content: center;
	margin: 0 auto 16px;
}

.lhq-modal-desc {
	text-align: center; color: var(--lhq-text-secondary);
	font-size: 0.9375rem; line-height: 1.6;
	margin: 0 0 20px;
}

.lhq-modal-field { margin-bottom: 16px; }

.lhq-input-lg {
	padding: 12px 16px; font-size: 1rem;
	width: 100%; box-sizing: border-box;
}

.lhq-modal-error {
	color: #dc2626; font-size: 0.8125rem;
	margin: 6px 0 0;
}

.lhq-btn-block {
	width: 100%; justify-content: center;
	padding: 12px 20px; font-size: 0.9375rem;
}

.lhq-modal-footer {
	text-align: center; color: var(--lhq-text-muted);
	font-size: 0.75rem; margin: 14px 0 0;
}
