/* Styles are deliberately scoped to the ECC app documents; WordPress pages remain untouched. */
html:has(body.ecc-app) {
	min-height: 100%;
}

body.ecc-app {
	--ecc-shell-viewport: 100vh;
	min-width: 320px !important;
	min-height: var(--ecc-shell-viewport) !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	font-family: var(--ecc-font-body, Arial, sans-serif) !important;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ecc-page-text, var(--ecc-text, #181818));
	background: var(--ecc-page-background, var(--ecc-surface-alt, #f7f5f0));
	-webkit-text-size-adjust: 100%;
}

body.ecc-app *,
body.ecc-app *::before,
body.ecc-app *::after {
	box-sizing: border-box;
}

body.ecc-app :where(button, input, select, textarea) {
	font: inherit;
}

body.ecc-app :where(img, svg, video, canvas) {
	max-width: 100%;
}

body.ecc-app > .ecc-editor,
body.ecc-app > .ecc-store,
body.ecc-app > .ecc-pos {
	width: 100%;
	min-height: 100vh;
	min-height: 100svh;
	margin: 0;
}

body.ecc-editor-app,
body.ecc-pos-app {
	--ecc-shell-viewport: 100vh;
}

body.ecc-app .ecc-editor,
body.ecc-app .ecc-store,
body.ecc-app .ecc-pos {
	font-family: var(--ecc-font-body, Arial, sans-serif);
	color: var(--ecc-page-text, var(--ecc-text, #181818));
}

body.ecc-app .ecc-editor :where(h1, h2, h3, h4, p, figure),
body.ecc-app .ecc-store :where(h1, h2, h3, h4, p, figure),
body.ecc-app .ecc-pos :where(h1, h2, h3, h4, p, figure) {
	max-width: none;
}

body.ecc-editor-app .ecc-workspace > header > .ecc-logout {
	align-self: flex-start;
	background: #000;
	border: 1px solid #000;
	border-radius: var(--ecc-radius, 8px);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: .65rem 1rem;
	font-family: var(--ecc-font-body, Arial, sans-serif);
	font-weight: 700;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}

body.ecc-editor-app .ecc-workspace > header > .ecc-logout:hover {
	background: #222;
	border-color: #222;
	color: #fff;
}

body.ecc-editor-app .ecc-workspace > header > .ecc-logout:focus-visible {
	outline: 3px solid var(--ecc-accent, #475569);
	outline-offset: 3px;
}

@supports (height: 100dvh) {
	body.ecc-app {
		--ecc-shell-viewport: 100dvh;
	}
}

/* Encabezados del Editor y del POS: texto directo sobre el fondo de la página. */
body.ecc-editor-app .ecc-workspace > header h1,
body.ecc-editor-app .ecc-workspace > header > a,
.ecc-pos > header h1,
.ecc-pos > header > a { color: var(--ecc-on-page-heading, var(--ecc-primary)); }
body.ecc-editor-app .ecc-workspace > header :where(p, .ecc-muted),
.ecc-pos > header :where(p, .ecc-muted) { color: var(--ecc-on-page-text, var(--ecc-muted)); }
body.ecc-editor-app .ecc-workspace > header .ecc-kicker,
.ecc-pos > header .ecc-kicker { color: var(--ecc-on-page-accent, var(--ecc-primary)); }

/* Quién tiene la sesión abierta. */
body.ecc-editor-app .ecc-session-badge { margin: 0 1rem 0 auto; align-self: center; font-size: .85rem; color: var(--ecc-on-page-text, var(--ecc-text)); text-align: right; }
.ecc-pos > header a { color: var(--ecc-on-page-text, var(--ecc-primary)); font-weight: 700; }
