/* Neutral fallbacks only. The active ECC Design Manifest overrides these tokens per installation. */
.ecc-editor,
.ecc-store,
.ecc-pos,
.ecc-login {
	--ecc-primary: #374151;
	--ecc-secondary: #111827;
	--ecc-accent: #64748b;
	--ecc-surface: #fff;
	--ecc-surface-alt: #f3f4f6;
	--ecc-text: #171717;
	--ecc-page-text: var(--ecc-text);
	--ecc-page-background: var(--ecc-surface-alt);
	--ecc-muted: #6b7280;
	--ecc-border: rgba(17, 24, 39, .14);
	--ecc-success: #26734d;
	--ecc-warning: #8a6200;
	--ecc-error: #b42318;
	--ecc-radius: 8px;
	--ecc-font-heading: Georgia, serif;
	--ecc-font-body: Arial, sans-serif;
	--ecc-font-identity: var(--ecc-font-heading);
	--ecc-font-interface: var(--ecc-font-body);
	color: var(--ecc-page-text);
	font-family: var(--ecc-font-body);
	box-sizing: border-box;
}

.ecc-editor *,
.ecc-store *,
.ecc-pos *,
.ecc-login * {
	box-sizing: border-box;
}

.ecc-editor button,
.ecc-store button,
.ecc-pos button,
.ecc-login button {
	cursor: pointer;
	border: 0;
	border-radius: var(--ecc-radius);
	background: var(--ecc-primary);
	color: var(--ecc-primary-contrast, #fff);
	padding: .7rem 1rem;
	font-weight: 700;
}

.ecc-editor input,
.ecc-editor select,
.ecc-editor textarea,
.ecc-store input,
.ecc-store select,
.ecc-store textarea,
.ecc-pos input,
.ecc-pos select,
.ecc-pos textarea,
.ecc-login input {
	display: block;
	width: 100%;
	min-height: 44px;
	margin-top: .3rem;
	padding: .65rem;
	border: 1px solid var(--ecc-border);
	border-radius: var(--ecc-radius);
	background: var(--ecc-surface);
	color: var(--ecc-text);
	font: inherit;
}

.ecc-editor :where(button, input, select, textarea):focus-visible,
.ecc-store :where(button, input, select, textarea):focus-visible,
.ecc-pos :where(button, input, select, textarea):focus-visible,
.ecc-login :where(button, input):focus-visible {
	outline: 3px solid var(--ecc-accent);
	outline-offset: 2px;
}

.ecc-editor h1,
.ecc-store h1,
.ecc-pos h1,
.ecc-login h1 {
	margin: .2rem 0;
	color: var(--ecc-primary);
	font-family: var(--ecc-font-identity);
	font-size: clamp(2.1rem, 5vw, 4rem);
	font-weight: 400;
	line-height: .98;
}

.ecc-editor h2,
.ecc-store h2,
.ecc-pos h2 {
	margin: .3rem 0 1rem;
}

.ecc-kicker {
	margin: 0;
	color: var(--ecc-primary);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .18em;
}

.ecc-muted,
.ecc-empty {
	color: var(--ecc-muted);
}

.ecc-auth {
	display: grid;
	min-height: 100vh;
	place-items: center;
	background: linear-gradient(135deg, var(--ecc-primary), var(--ecc-secondary));
}

.ecc-auth__card {
	width: min(420px, calc(100% - 2rem));
	padding: 2rem;
	border-radius: var(--ecc-radius);
	background: var(--ecc-surface);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

.ecc-auth label,
.ecc-store label,
.ecc-pos label,
.ecc-panel label {
	display: block;
	margin: .8rem 0;
	font-weight: 700;
}

.ecc-check {
	display: flex !important;
	align-items: center;
	gap: .5rem;
	font-weight: 400 !important;
}

.ecc-check input {
	width: auto;
}

.ecc-notice {
	margin: .7rem 0;
	padding: .8rem;
	border-radius: var(--ecc-radius);
}

.ecc-notice--error {
	background: color-mix(in srgb, var(--ecc-error) 10%, var(--ecc-surface));
	color: var(--ecc-error);
}

.ecc-editor {
	display: grid;
	min-height: 100vh;
	grid-template-columns: 240px 1fr;
	background: var(--ecc-page-background);
	color: var(--ecc-page-text);
}

.ecc-nav {
	padding: 1.4rem;
	background: var(--ecc-secondary);
	color: var(--ecc-secondary-contrast, #fff);
}

.ecc-brand {
	display: block;
	margin-bottom: 2rem;
	color: var(--ecc-accent);
	font-family: var(--ecc-font-identity);
	font-size: 2rem;
	text-decoration: none;
}

.ecc-nav nav {
	display: grid;
	gap: .25rem;
}

.ecc-nav button,
.ecc-nav a {
	border-radius: var(--ecc-radius);
	background: transparent;
	color: var(--ecc-secondary-contrast, #fff);
	text-align: left;
	text-decoration: none;
}

.ecc-nav button:hover,
.ecc-nav a:hover {
	background: color-mix(in srgb, var(--ecc-accent) 18%, transparent);
}

.ecc-workspace {
	width: 100%;
	max-width: 1400px;
	padding: clamp(1rem, 3vw, 3rem);
}

.ecc-workspace > header,
.ecc-store__head,
.ecc-pos > header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.ecc-workspace > header > a,
.ecc-pos > header > a {
	color: var(--ecc-primary);
}

.ecc-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}

.ecc-stats article,
.ecc-panel {
	margin-bottom: 1rem;
	padding: 1.2rem;
	border: 1px solid var(--ecc-border);
	border-radius: var(--ecc-radius);
	background: var(--ecc-surface);
	color: var(--ecc-text);
}

.ecc-stats b {
	display: block;
	color: var(--ecc-primary);
	font-size: 2rem;
}

.ecc-stats span {
	color: var(--ecc-muted);
}

.ecc-table article {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	align-items: center;
	gap: .5rem;
	padding: .9rem 0;
	border-bottom: 1px solid var(--ecc-border);
}

.ecc-table article:last-child {
	border-bottom: 0;
}

.ecc-add {
	margin-bottom: 1rem;
}

.ecc-store {
	width: 100%;
	min-height: 100vh;
	padding: clamp(1rem, 4vw, 4rem);
	background: var(--ecc-page-background);
	color: var(--ecc-page-text);
}

.ecc-store__head {
	padding-bottom: 1rem;
	border-bottom: 2px solid var(--ecc-accent);
}

.ecc-store__tools {
	display: flex;
	align-items: end;
	gap: 1rem;
	margin: 1.5rem 0;
}

.ecc-store__tools label {
	min-width: min(100%, 360px);
}

.ecc-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1rem;
}

.ecc-product {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .6rem;
	padding: 1rem;
	border: 1px solid var(--ecc-border);
	border-radius: var(--ecc-radius);
	background: var(--ecc-surface);
	color: var(--ecc-text);
}

.ecc-product img {
	width: 100%;
	aspect-ratio: 4 / 5;
	border-radius: var(--ecc-radius);
	background: var(--ecc-surface-alt);
	object-fit: cover;
}

.ecc-product h2,
.ecc-product p {
	margin: 0;
}

.ecc-product strong {
	color: var(--ecc-primary);
	font-size: 1.1rem;
}

.ecc-cart {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 10;
	width: min(440px, 100%);
	height: 100dvh;
	padding: 1.25rem;
	background: var(--ecc-surface);
	color: var(--ecc-text);
	box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
	overflow: auto;
}

.ecc-cart > button {
	float: right;
	background: var(--ecc-secondary);
}

.ecc-cart article,
.ecc-pos__cart article {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .7rem;
	padding: .8rem 0;
	border-bottom: 1px solid var(--ecc-border);
}

.ecc-cart article button,
.ecc-pos__cart article button {
	padding: .3rem .6rem;
	background: var(--ecc-secondary);
}

.ecc-pos {
	display: grid;
	min-height: 100vh;
	grid-template-columns: 1fr 360px;
	gap: 2rem;
	padding: clamp(1rem, 3vw, 2rem);
	background: var(--ecc-page-background);
	color: var(--ecc-page-text);
}

.ecc-pos > header {
	grid-column: 1 / -1;
}

.ecc-pos__cart {
	position: sticky;
	top: 1rem;
	height: max-content;
	padding: 1rem;
	border: 1px solid var(--ecc-border);
	border-radius: var(--ecc-radius);
	background: var(--ecc-surface);
	color: var(--ecc-text);
}

@media (max-width: 800px) {
	.ecc-editor {
		grid-template-columns: 1fr;
	}

	.ecc-nav {
		padding: 1rem;
	}

	.ecc-nav nav {
		display: flex;
		overflow: auto;
	}

	.ecc-nav button,
	.ecc-nav a {
		white-space: nowrap;
	}

	.ecc-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.ecc-pos {
		grid-template-columns: 1fr;
	}

	.ecc-pos__cart {
		position: static;
	}

	.ecc-store__tools {
		display: block;
	}

	.ecc-table article {
		grid-template-columns: 1fr;
	}
}

/* Casillas y opciones con tamaño normal en todas las apps ECC (la regla general de campos las hacía gigantes). */
body.ecc-app input[type="checkbox"],
body.ecc-app input[type="radio"] {
	display: inline-block;
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	min-height: 0;
	margin: 0;
	padding: 0;
	accent-color: var(--ecc-primary);
	vertical-align: middle;
}
body.ecc-app label:has(> input[type="checkbox"]),
body.ecc-app label:has(> input[type="radio"]) {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: .6rem;
	text-align: left;
}

/* Superficies blancas: el texto vuelve a ser el de superficie aunque el fondo de la página sea de color. */
.ecc-editor-section,
.ecc-choice-card,
.ecc-catalog-card,
.ecc-preview-overlay > section,
.ecc-modal > section,
.ecc-ri-metrics article,
.ecc-ri-cost-cards article,
.ecc-ri-table,
.ecc-vendor .ecc-vendor-panel,
.ecc-auth__card,
.ecc-login__card {
	color: var(--ecc-text, #171717);
}

/* Texto solo para lectores de pantalla. */
.ecc-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
