/**
 * QuheNet Theme Demo Bar - front-end styles.
 *
 * All selectors use the qtdb- prefix to avoid collisions with themes.
 */

.qtdb-demo-bar {
	--qtdb-bar-height: 56px;
	--qtdb-bar-height-mobile: 96px;
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 9990;
	box-sizing: border-box;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--qtdb-bg, #111827);
	color: var(--qtdb-text, #f3f4f6);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	text-align: start;
}

.qtdb-demo-bar *,
.qtdb-demo-bar *::before,
.qtdb-demo-bar *::after {
	box-sizing: inherit;
}

.qtdb-demo-bar[hidden],
.qtdb-demo-bar [hidden] {
	display: none !important;
}

.qtdb-demo-bar--height-compact {
	--qtdb-bar-height: 48px;
	--qtdb-bar-height-mobile: 88px;
}

.qtdb-demo-bar--height-standard {
	--qtdb-bar-height: 56px;
	--qtdb-bar-height-mobile: 96px;
}

.qtdb-demo-bar--height-comfortable {
	--qtdb-bar-height: 64px;
	--qtdb-bar-height-mobile: 104px;
}

.qtdb-demo-bar--edge-border {
	border-top: 1px solid rgba(148, 163, 184, 0.45);
}

.qtdb-demo-bar--edge-shadow {
	box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.22);
}

.qtdb-demo-bar--edge-both {
	border-top: 1px solid rgba(148, 163, 184, 0.45);
	box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.22);
}

/* Reserve room for the fixed bar without accumulating padding on each load. */
body.qtdb-bar-active {
	padding-bottom: calc(var(--qtdb-bar-height, 56px) + env(safe-area-inset-bottom, 0px));
}

body.qtdb-bar-height-compact {
	--qtdb-bar-height: 48px;
	--qtdb-bar-height-mobile: 88px;
}

body.qtdb-bar-height-standard {
	--qtdb-bar-height: 56px;
	--qtdb-bar-height-mobile: 96px;
}

body.qtdb-bar-height-comfortable {
	--qtdb-bar-height: 64px;
	--qtdb-bar-height-mobile: 104px;
}

body.qtdb-bar-collapsed {
	padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.qtdb-demo-bar__inner {
	display: flex;
	align-items: center;
	gap: 20px;
	width: 100%;
	max-width: 1440px;
	min-height: var(--qtdb-bar-height);
	margin: 0 auto;
	padding: 8px 20px;
}

.qtdb-demo-bar__main {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.qtdb-demo-bar__message {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	color: inherit;
	font: inherit;
}

.qtdb-demo-bar__product {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.qtdb-demo-bar__product:hover,
.qtdb-demo-bar__product:focus {
	color: inherit;
}

.qtdb-demo-bar__prefix {
	font-weight: 700;
}

.qtdb-demo-bar__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
}

.qtdb-demo-bar__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 38px;
	padding: 8px 16px;
	border: 1px solid rgba(148, 163, 184, 0.55);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.qtdb-demo-bar__button:hover {
	border-color: currentColor;
}

.qtdb-demo-bar__button--primary {
	border-color: var(--qtdb-primary, #2563eb);
	background: var(--qtdb-primary, #2563eb);
	color: var(--qtdb-primary-text, #ffffff);
}

.qtdb-demo-bar__button--primary:hover,
.qtdb-demo-bar__button--primary:focus {
	border-color: var(--qtdb-primary, #2563eb);
	background: var(--qtdb-primary, #2563eb);
	color: var(--qtdb-primary-text, #ffffff);
	opacity: 0.92;
}

.qtdb-demo-bar__switcher {
	position: relative;
}

.qtdb-demo-bar__toggle[aria-expanded="true"] .qtdb-demo-bar__caret {
	transform: rotate(180deg);
}

.qtdb-demo-bar__caret {
	display: inline-block;
	width: 0;
	height: 0;
	border-inline-start: 4px solid transparent;
	border-inline-end: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.15s ease;
}

.qtdb-demo-bar__menu {
	position: absolute;
	inset-inline-end: 0;
	bottom: calc(100% + 10px);
	width: 320px;
	max-width: calc(100vw - 24px);
	max-height: min(60vh, 340px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px;
	border-radius: 10px;
	background: #ffffff;
	color: #1f2937;
	box-shadow: 0 16px 44px rgba(15, 23, 42, 0.28);
	text-align: start;
}

.qtdb-demo-bar__menu-heading {
	margin: 4px 8px 8px;
	color: #64748b;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.qtdb-demo-bar__menu-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.qtdb-demo-bar__menu-list > li {
	margin: 0;
}

.qtdb-demo-bar__menu-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 6px;
	color: #1f2937;
	text-decoration: none;
}

.qtdb-demo-bar__menu-link:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.qtdb-demo-bar__menu-link.is-current {
	background: #eff6ff;
	color: #1d4ed8;
	font-weight: 700;
}

.qtdb-demo-bar__menu-label {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.qtdb-demo-bar__menu-name {
	font-size: 14px;
	line-height: 1.35;
}

.qtdb-demo-bar__menu-desc {
	color: #64748b;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.35;
}

.qtdb-demo-bar__menu-check {
	flex: 0 0 auto;
	color: #1d4ed8;
	font-size: 14px;
}

.qtdb-demo-bar__collapse {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
}

.qtdb-demo-bar__collapse:hover,
.qtdb-demo-bar__collapse:focus {
	opacity: 1;
}

.qtdb-demo-bar--collapsed {
	padding-bottom: 0;
	background: transparent;
	box-shadow: none;
	border-top: 0;
	pointer-events: none;
}

.qtdb-demo-bar--collapsed .qtdb-demo-bar__inner {
	display: none;
}

.qtdb-demo-bar__restore {
	position: fixed;
	inset-inline-end: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 9991;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--qtdb-primary, #2563eb);
	border-radius: 999px;
	background: var(--qtdb-primary, #2563eb);
	color: var(--qtdb-primary-text, #ffffff);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
	cursor: pointer;
	pointer-events: auto;
}

.qtdb-demo-bar__button:focus-visible,
.qtdb-demo-bar__collapse:focus-visible,
.qtdb-demo-bar__restore:focus-visible {
	outline: 3px solid #fbbf24;
	outline-offset: 2px;
}

.qtdb-demo-bar__menu-link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: -2px;
}

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

@media (max-width: 782px) {
	body.qtdb-bar-active {
		padding-bottom: calc(var(--qtdb-bar-height-mobile, 96px) + env(safe-area-inset-bottom, 0px));
	}

	.qtdb-demo-bar__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 8px 12px;
		min-height: 0;
	}

	.qtdb-demo-bar__main {
		width: 100%;
		align-items: flex-start;
	}

	.qtdb-demo-bar__message {
		display: -webkit-box;
		overflow: hidden;
		font-size: 12.5px;
		line-height: 1.4;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.qtdb-demo-bar__actions {
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: 1fr;
		width: 100%;
		gap: 8px;
	}

	.qtdb-demo-bar__actions > *,
	.qtdb-demo-bar__switcher {
		min-width: 0;
	}

	.qtdb-demo-bar__switcher .qtdb-demo-bar__button {
		width: 100%;
	}

	.qtdb-demo-bar__button {
		min-height: 44px;
		padding: 10px 12px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.qtdb-demo-bar__menu {
		inset-inline-end: 0;
		width: min(320px, calc(100vw - 24px));
		max-height: min(50vh, 300px);
	}

	.qtdb-demo-bar__collapse {
		width: 28px;
		height: 28px;
		margin-top: 1px;
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qtdb-demo-bar__button,
	.qtdb-demo-bar__caret {
		transition: none;
	}
}
