/*
 * Cinderfork Arms demo: the "This is a demo" dialog and panel.
 * Uses the cinderfork-child theme tokens when present (--cf-*), with fallbacks so it looks
 * right without the theme. Contrast (fallback colours): bone on charcoal 14.6:1, ember on
 * charcoal and charcoal on ember 5.2:1, muted on charcoal-2 8.2:1, charcoal on the badges
 * 7.5-9.6:1 (WCAG AA). Ember text is only used on charcoal, never on charcoal-2 (4.45:1).
 */
.cf-demo-dialog {
	--_ink: var(--cf-charcoal, #1c1b1a);
	--_ink-2: var(--cf-charcoal-2, #2a2826);
	--_bone: var(--cf-bone, #f2ece2);
	--_muted: var(--cf-bone-muted, #c9c0b3);
	--_ember: var(--cf-ember, #e8662a);
	--_line: var(--cf-line-dark, rgba(242, 236, 226, 0.16));
	--_pass: var(--cf-pass, #7fd18b);
	--_hold: var(--cf-hold, #f2c14e);
	--_block: var(--cf-block, #ff8a7a);
	--_font-head: var(--cf-font-head, "Big Shoulders Display", "Arial Narrow", system-ui, sans-serif);
	--_font-body: var(--cf-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	box-sizing: border-box;
	width: min(44rem, calc(100vw - 1.5rem));
	max-height: calc(100vh - 1.5rem);
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 1px solid var(--_line);
	border-top: 4px solid var(--_ember);
	border-radius: 12px;
	background: var(--_ink);
	color: var(--_bone);
	font-family: var(--_font-body);
	font-size: 1rem;
	line-height: 1.5;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.cf-demo-dialog::backdrop {
	background: rgba(12, 11, 10, 0.72);
}
.cf-demo-dialog__body {
	padding: 1.5rem 1.5rem 0.5rem;
}
.cf-demo-dialog__actions {
	position: sticky;
	bottom: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-end;
	padding: 1rem 1.5rem 1.25rem;
	background: var(--_ink);
	border-top: 1px solid var(--_line);
}
.cf-demo-dialog__back,
.cf-demo-dialog__close,
.cf-demo-inline__again {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.5rem 1.1rem;
	border-radius: 8px;
	font: 600 1rem/1.2 var(--_font-body, system-ui, sans-serif);
	text-decoration: none;
	cursor: pointer;
}
.cf-demo-dialog__back {
	background: var(--_ember);
	color: #1c1b1a;
	border: 2px solid var(--_ember);
}
.cf-demo-dialog__close {
	background: transparent;
	color: var(--_bone);
	border: 2px solid var(--_line);
}
.cf-demo-dialog__back:hover,
.cf-demo-dialog__back:focus-visible {
	background: var(--_bone);
	border-color: var(--_bone);
	color: #1c1b1a;
}
.cf-demo-dialog__close:hover,
.cf-demo-dialog__close:focus-visible {
	border-color: var(--_bone);
}
.cf-demo-dialog a:focus-visible,
.cf-demo-dialog button:focus-visible,
.cf-demo-panel__title:focus-visible {
	outline: 3px solid var(--_ember);
	outline-offset: 3px;
}
.cf-demo-panel__title:focus {
	outline: none;
}

/* Panel (inside the dialog; in the classic notice it is replaced by .cf-demo-inline). */
.cf-demo-panel {
	text-align: left;
}
.cf-demo-panel__eyebrow {
	margin: 0 0 0.5rem;
	color: var(--_ember, #e8662a);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.cf-demo-panel__title {
	margin: 0 0 0.75rem;
	color: var(--_bone, #f2ece2);
	font-family: var(--_font-head);
	font-size: clamp(1.6rem, 4vw, 2.1rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}
.cf-demo-panel__lead,
.cf-demo-panel__muted {
	margin: 0 0 1rem;
	color: var(--_muted, #c9c0b3);
}
.cf-demo-panel__block {
	margin: 0 0 1rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--_line);
	border-radius: 10px;
	background: var(--_ink-2, #2a2826);
}
.cf-demo-panel__heading {
	margin: 0 0 0.75rem;
	color: var(--_bone, #f2ece2);
	font-family: var(--_font-head);
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.cf-demo-panel__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	gap: 0.5rem 1rem;
	margin: 0;
}
.cf-demo-panel__fact {
	margin: 0;
}
.cf-demo-panel__fact dt {
	margin: 0;
	color: var(--_muted, #c9c0b3);
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.cf-demo-panel__fact dd {
	margin: 0.1rem 0 0;
	color: var(--_bone, #f2ece2);
	font-weight: 600;
	overflow-wrap: anywhere;
}
.cf-demo-panel__lines,
.cf-demo-panel__steps {
	margin: 0;
	padding: 0;
	list-style: none;
}
.cf-demo-panel__line + .cf-demo-panel__line {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--_line);
}
.cf-demo-panel__line-name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.5rem;
}
.cf-demo-panel__steps li {
	position: relative;
	margin: 0 0 0.4rem;
	padding-left: 1.25rem;
	color: var(--_bone, #f2ece2);
}
.cf-demo-panel__steps li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.6em;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 2px;
	background: var(--_ember, #e8662a);
}
.cf-demo-panel__badge {
	display: inline-block;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1c1b1a;
	background: var(--_muted, #c9c0b3);
}
.cf-demo-panel__badge--pass {
	background: var(--_pass, #7fd18b);
}
.cf-demo-panel__badge--hold {
	background: var(--_hold, #f2c14e);
}
.cf-demo-panel__badge--blocked {
	background: var(--_block, #ff8a7a);
}
.cf-demo-panel__cta {
	margin: 1.25rem 0 0.5rem;
}
.cf-demo-panel__cta-link {
	color: var(--_ember, #e8662a);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.cf-demo-panel__cta-link:hover {
	color: var(--_bone, #f2ece2);
}

/* What stays in the classic checkout notice after the panel moves into the dialog. */
.cf-demo-inline__again {
	margin-left: 0.5rem;
	min-height: 36px;
	padding: 0.25rem 0.8rem;
	background: transparent;
	color: inherit;
	border: 2px solid currentColor;
}

@media (max-width: 480px) {
	.cf-demo-dialog__body {
		padding: 1.1rem 1rem 0.25rem;
	}
	.cf-demo-dialog__actions {
		padding: 0.85rem 1rem 1rem;
	}
	.cf-demo-dialog__back,
	.cf-demo-dialog__close {
		flex: 1 1 100%;
		justify-content: center;
	}
}
@media (prefers-reduced-motion: no-preference) {
	.cf-demo-dialog[open] {
		animation: cf-demo-in 160ms ease-out;
	}
	@keyframes cf-demo-in {
		from {
			opacity: 0;
			transform: translateY(8px);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}
