/* ──────────────────────────────────────────────────────────────────
   Inmoblao · Design tokens + atoms reusables
   Portado del handoff del diseñador (src/styles.css).
   Negro/grafito + acento cálido. Premium minimal SaaS.
   ──────────────────────────────────────────────────────────────────
   Este archivo se carga en TODAS las pantallas del plugin (admin y
   frontend). Los estilos específicos de cada vista viven en sus
   propios archivos (admin-editor.css, archive.css, single.css, ...).
   ────────────────────────────────────────────────────────────────── */

:root {
	/* Surfaces (cool-warm neutrals) */
	--bg:         #fafaf9;
	--surface:    #ffffff;
	--surface-2:  #f5f5f4;
	--surface-3:  #ebebea;
	--hover:      #f5f5f4;

	/* Borders */
	--border:        #e7e7e5;
	--border-strong: #d6d6d3;
	--border-subtle: #f1f1ef;

	/* Text */
	--fg:           #0a0a0a;
	--fg-2:         #3f3f3e;
	--fg-3:         #6b6b69;
	--fg-4:         #a3a3a0;
	--fg-on-accent: #ffffff;

	/* Accent (warm terracotta) */
	--accent:        #e2562b;
	--accent-soft:   #fdeee7;
	--accent-strong: #c44520;

	/* Semantic */
	--success:      #1f8a5b;
	--success-soft: #e6f4ed;
	--warning:      #c08712;
	--warning-soft: #fbf2dc;
	--danger:       #b3261e;
	--danger-soft:  #fbe7e6;
	--info:         #2563eb;
	--info-soft:    #e6efff;

	/* Radii */
	--r-xs: 6px;
	--r-sm: 8px;
	--r-md: 10px;
	--r-lg: 12px;
	--r-xl: 16px;
	--r-2xl: 20px;
	--r-full: 999px;

	/* Shadows (subtle, multi-layer) */
	--shadow-xs:  0 1px 0 rgba(15, 15, 15, .04);
	--shadow-sm:  0 1px 2px rgba(15, 15, 15, .06), 0 1px 1px rgba(15, 15, 15, .04);
	--shadow-md:  0 2px 4px rgba(15, 15, 15, .04), 0 6px 14px rgba(15, 15, 15, .06);
	--shadow-lg:  0 4px 8px rgba(15, 15, 15, .06), 0 18px 40px rgba(15, 15, 15, .10);
	--shadow-pop: 0 8px 28px rgba(15, 15, 15, .14), 0 1px 2px rgba(15, 15, 15, .06);
	--ring-focus: 0 0 0 3px rgba(226, 86, 43, .18);

	/* Spacing scale */
	--space-0: 0;
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 20px;
	--space-6: 24px;
	--space-8: 32px;
	--space-10: 40px;
	--space-12: 48px;
	--space-16: 64px;

	/* Type */
	--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
	--t-11: 11px;
	--t-12: 12px;
	--t-13: 13px;
	--t-14: 14px;
	--t-15: 15px;
	--t-16: 16px;
	--t-18: 18px;
	--t-20: 20px;
	--t-24: 24px;
	--t-28: 28px;
	--t-32: 32px;
	--t-40: 40px;

	/* WP chrome colors (los respeta el plugin solo en su scope) */
	--wp-bg:     #1c1f24;
	--wp-bg-2:   #14171b;
	--wp-fg:     #c9cdd3;
	--wp-fg-2:   #8a929e;
	--wp-accent: #e2562b;
}

/* Density modifiers (futuro: toggle desde Ajustes técnicos) */
body[data-inmo-density="compact"] {
	--space-2: 6px;
	--space-3: 8px;
	--space-4: 12px;
	--space-5: 16px;
	--space-6: 20px;
	--space-8: 28px;
	--t-13: 12px;
	--t-14: 13px;
}
body[data-inmo-density="comfy"] {
	--space-2: 10px;
	--space-3: 14px;
	--space-4: 18px;
	--space-5: 24px;
	--space-6: 28px;
	--space-8: 36px;
	--t-13: 14px;
	--t-14: 15px;
}

/* ── Scope del plugin ─────────────────────────────────────────────
   Todo lo siguiente se aplica dentro de wrappers `.inmo-app` (admin)
   o `.inmo-public` (frontend), para no contaminar el resto de WP.
   ────────────────────────────────────────────────────────────────── */

/* Admin (.inmo-app): usa la fuente del plugin (Inter). */
.inmo-app {
	font-family: var(--font-sans);
	font-size: var(--t-13);
	line-height: 1.5;
	color: var(--fg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
/* Frontend (.inmo-public): NO forzamos tipografía — se respeta la del tema del
   cliente. Solo fijamos color/altura de línea y suavizado. Los presets estéticos
   (inmo-theme-*) cambian color/formas/sombras, nunca la fuente. */
.inmo-public {
	font-size: var(--t-13);
	line-height: 1.5;
	color: var(--fg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
.inmo-app *,
.inmo-app *::before,
.inmo-app *::after,
.inmo-public *,
.inmo-public *::before,
.inmo-public *::after { box-sizing: border-box; }

.inmo-app a,
.inmo-public a { color: inherit; text-decoration: none; }
.inmo-app img,
.inmo-public img { display: block; max-width: 100%; }

.inmo-app ::selection,
.inmo-public ::selection { background: var(--accent-soft); color: var(--accent-strong); }

/* ── Atoms ───────────────────────────────────────────────────────── */

/* Card */
.inmo-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-xs);
}
.inmo-card-pad { padding: var(--space-5); }
.inmo-card-hd {
	padding: var(--space-4) var(--space-5);
	border-bottom: 1px solid var(--border-subtle);
	display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.inmo-card-hd h3 { margin: 0; font-size: var(--t-14); font-weight: 600; letter-spacing: -0.005em; }
.inmo-card-hd p  { margin: 2px 0 0; font-size: var(--t-12); color: var(--fg-3); }

/* Button */
.inmo-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--fg);
	border-radius: var(--r-sm);
	font-size: var(--t-13);
	font-weight: 500;
	line-height: 1;
	height: 32px;
	box-shadow: var(--shadow-xs);
	transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease;
	white-space: nowrap;
	cursor: pointer;
	text-decoration: none;
}
.inmo-btn:hover { background: var(--hover); }
.inmo-btn:active { transform: translateY(0.5px); }
.inmo-btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.inmo-btn .inmo-ico { color: var(--fg-3); }

.inmo-btn-primary { background: var(--fg); color: #fff; border-color: var(--fg); }
.inmo-btn-primary:hover { background: #1f1f1f; }
.inmo-btn-primary .inmo-ico { color: rgba(255, 255, 255, .7); }

.inmo-btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.inmo-btn-accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.inmo-btn-accent .inmo-ico { color: rgba(255, 255, 255, .85); }

.inmo-btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.inmo-btn-ghost:hover { background: var(--hover); }

.inmo-btn-sm   { height: 28px; padding: 5px 10px; font-size: var(--t-12); border-radius: var(--r-xs); }
.inmo-btn-lg   { height: 40px; padding: 0 18px; font-size: var(--t-14); border-radius: var(--r-md); }
.inmo-btn-icon { width: 32px; padding: 0; justify-content: center; }
.inmo-btn-icon.inmo-btn-sm { width: 28px; }
.inmo-btn-icon.inmo-btn-lg { width: 40px; }

/* Field */
.inmo-field { display: flex; flex-direction: column; gap: 6px; }
.inmo-field-label {
	font-size: var(--t-12);
	font-weight: 500;
	color: var(--fg-2);
	display: flex; align-items: center; gap: 4px;
}
.inmo-field-label .inmo-req  { color: var(--accent); }
.inmo-field-hint  { font-size: var(--t-12); color: var(--fg-3); }
.inmo-field-error { font-size: var(--t-12); color: var(--danger); display: flex; gap: 4px; align-items: center; }

.inmo-input, .inmo-textarea, .inmo-select {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--r-sm);
	padding: 8px 10px;
	font: inherit;
	font-size: var(--t-13);
	color: var(--fg);
	outline: none;
	box-shadow: var(--shadow-xs);
	transition: border-color .12s, box-shadow .12s;
}
.inmo-input:hover, .inmo-textarea:hover, .inmo-select:hover { border-color: var(--fg-4); }
.inmo-input:focus, .inmo-textarea:focus, .inmo-select:focus { border-color: var(--fg); box-shadow: var(--ring-focus); }
.inmo-input[disabled], .inmo-textarea[disabled], .inmo-select[disabled] {
	background: var(--surface-2); color: var(--fg-4); cursor: not-allowed;
}

.inmo-input-group {
	display: flex; align-items: stretch;
	border: 1px solid var(--border-strong);
	border-radius: var(--r-sm);
	background: var(--surface);
	box-shadow: var(--shadow-xs);
	overflow: hidden;
}
.inmo-input-group:focus-within { border-color: var(--fg); box-shadow: var(--ring-focus); }
.inmo-input-group .inmo-input { border: 0; box-shadow: none; }
.inmo-input-group .inmo-input:focus { box-shadow: none; }
.inmo-input-group-suffix, .inmo-input-group-prefix {
	display: flex; align-items: center; padding: 0 10px;
	color: var(--fg-3); font-size: var(--t-12);
	background: var(--surface-2);
	border-left: 1px solid var(--border-subtle);
}
.inmo-input-group-prefix { border-left: 0; border-right: 1px solid var(--border-subtle); }

/* Badge */
.inmo-badge {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 2px 8px;
	border-radius: var(--r-full);
	font-size: var(--t-11);
	font-weight: 500;
	line-height: 1.5;
	background: var(--surface-2);
	color: var(--fg-2);
	border: 1px solid transparent;
	white-space: nowrap;
}
.inmo-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.inmo-badge-success { background: var(--success-soft); color: var(--success); }
.inmo-badge-warning { background: var(--warning-soft); color: var(--warning); }
.inmo-badge-danger  { background: var(--danger-soft); color: var(--danger); }
.inmo-badge-info    { background: var(--info-soft); color: var(--info); }
.inmo-badge-accent  { background: var(--accent-soft); color: var(--accent-strong); }
.inmo-badge-outline { background: var(--surface); border-color: var(--border-strong); color: var(--fg-2); }
.inmo-badge-solid   { background: var(--fg); color: #fff; }

/* Switch */
.inmo-switch {
	position: relative; width: 32px; height: 18px;
	background: var(--border-strong);
	border-radius: 999px; border: 0; padding: 0;
	cursor: pointer;
	transition: background .15s;
	flex-shrink: 0;
}
.inmo-switch::after {
	content: ""; position: absolute; top: 2px; left: 2px;
	width: 14px; height: 14px; background: #fff;
	border-radius: 50%; box-shadow: var(--shadow-sm);
	transition: transform .15s cubic-bezier(.3, .7, .4, 1);
}
.inmo-switch[data-on="true"] { background: var(--fg); }
.inmo-switch[data-on="true"]::after { transform: translateX(14px); }
.inmo-switch-lg { width: 38px; height: 22px; }
.inmo-switch-lg::after { width: 18px; height: 18px; }
.inmo-switch-lg[data-on="true"]::after { transform: translateX(16px); }

/* Check */
.inmo-check {
	width: 16px; height: 16px; border-radius: 4px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer; flex-shrink: 0;
	transition: all .12s;
}
.inmo-check[data-on="true"] { background: var(--fg); border-color: var(--fg); color: #fff; }
.inmo-check[data-on="true"] svg { display: block; }
.inmo-check svg { display: none; width: 11px; height: 11px; }

/* Segmented control */
.inmo-segmented {
	display: inline-flex; padding: 3px;
	background: var(--surface-2);
	border-radius: var(--r-sm);
	border: 1px solid var(--border);
}
.inmo-segmented button {
	display: inline-flex; align-items: center; gap: 6px;
	border: 0; background: transparent;
	padding: 5px 12px;
	border-radius: 6px;
	font-size: var(--t-12);
	font-weight: 500;
	color: var(--fg-3);
	cursor: pointer;
	transition: background .12s, color .12s;
}
.inmo-segmented button:hover { color: var(--fg-2); }
.inmo-segmented button[data-on="true"] {
	background: var(--surface);
	color: var(--fg);
	box-shadow: var(--shadow-xs);
}

/* Divider */
.inmo-divider { height: 1px; background: var(--border-subtle); border: 0; margin: var(--space-4) 0; }
.inmo-divider-strong { background: var(--border); }

/* Helpers */
.inmo-row { display: flex; align-items: center; }
.inmo-gap-1 { gap: 4px; }
.inmo-gap-2 { gap: 8px; }
.inmo-gap-3 { gap: 12px; }
.inmo-gap-4 { gap: 16px; }
.inmo-gap-6 { gap: 24px; }
.inmo-stack { display: flex; flex-direction: column; }
.inmo-grow  { flex: 1; }
.inmo-muted { color: var(--fg-3); }
.inmo-dim   { color: var(--fg-4); }
.inmo-mono  { font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.inmo-tnum  { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }
.inmo-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inmo-sr-only {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

/* ── Filter drop (botón estilo "Tipo: Todos ▾") ──────────────────── */
.inmo-filter-drop {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--r-sm);
	padding: 6px 10px;
	font-size: 12.5px;
	height: 32px;
	box-shadow: var(--shadow-xs);
	color: var(--fg-2);
	cursor: pointer;
}
.inmo-filter-drop:hover { border-color: var(--fg-4); }
.inmo-filter-drop-l { color: var(--fg-3); font-weight: 400; }
.inmo-filter-drop-v { font-weight: 500; color: var(--fg); }
.inmo-filter-drop svg { color: var(--fg-4); }

/* ── Bulk bar (acciones masivas reactivas) ──────────────────────── */
.inmo-bulk-bar {
	display: none;
	align-items: center; gap: 10px;
	padding: 10px 14px;
	background: var(--accent-soft);
	border-top: 1px solid var(--border-subtle);
	font-size: 13px;
	color: var(--accent-strong);
}
.inmo-bulk-bar[data-active="true"] { display: flex; }
.inmo-bulk-bar-sep { width: 1px; height: 18px; background: var(--border); }
.inmo-bulk-bar-count { font-weight: 600; }

/* ── Pager (paginación de tablas) ───────────────────────────────── */
.inmo-pager {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 16px;
	border-top: 1px solid var(--border-subtle);
}

/* ── Mod grid + mod card (pantalla "Módulos") ───────────────────── */
.inmo-mod-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}
.inmo-mod-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-xs);
	display: flex; flex-direction: column;
	padding: 18px;
	gap: 14px;
	transition: border-color .15s, box-shadow .15s;
}
.inmo-mod-card[data-on="true"] {
	border-color: var(--border-strong);
	box-shadow: var(--shadow-sm);
}
.inmo-mod-card-hd {
	display: flex; align-items: center; justify-content: space-between;
}
.inmo-mod-icon {
	width: 36px; height: 36px;
	background: var(--surface-2);
	border: 1px solid var(--border-subtle);
	border-radius: var(--r-sm);
	display: inline-flex; align-items: center; justify-content: center;
	color: var(--fg-2);
}
.inmo-mod-card[data-on="true"] .inmo-mod-icon {
	background: var(--accent-soft);
	color: var(--accent-strong);
	border-color: transparent;
}
.inmo-mod-name { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; color: var(--fg); }
.inmo-mod-desc { margin: 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
.inmo-mod-card-body { flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.inmo-mod-card-foot {
	display: flex; align-items: center; gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--border-subtle);
}
.inmo-mod-alert {
	display: flex; align-items: flex-start; gap: 8px;
	padding: 8px 10px;
	border-radius: var(--r-sm);
	font-size: 12px;
	line-height: 1.4;
}
.inmo-mod-alert-danger  { background: var(--danger-soft);  color: var(--danger); }
.inmo-mod-alert-warning { background: var(--warning-soft); color: var(--warning); }
.inmo-mod-alert svg { flex-shrink: 0; margin-top: 1px; }

/* ── Page header con título + sub + acciones a la derecha ────────── */
.inmo-page-hd {
	display: flex; align-items: flex-end; justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.inmo-page-hd h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.inmo-page-hd-sub { font-size: 13px; color: var(--fg-3); }
.inmo-page-hd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Table */
.inmo-table {
	width: 100%; border-collapse: separate; border-spacing: 0;
	font-size: var(--t-13);
}
.inmo-table thead th {
	text-align: left;
	font-size: var(--t-11);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--fg-3);
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}
.inmo-table tbody td {
	padding: 12px;
	border-bottom: 1px solid var(--border-subtle);
	vertical-align: middle;
}
.inmo-table tbody tr:hover td { background: var(--surface-2); }
.inmo-table tbody tr:last-child td { border-bottom: 0; }

/* Scrollbar subtle */
.inmo-scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.inmo-scroll-y::-webkit-scrollbar { width: 8px; height: 8px; }
.inmo-scroll-y::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
.inmo-scroll-y::-webkit-scrollbar-thumb:hover { background: var(--fg-4); border: 2px solid transparent; background-clip: content-box; }

/* ════════════════════════════════════════════════════════════════════
   PRESETS DE APARIENCIA DEL FRONTEND ("Apariencia")
   El <body> lleva la clase `inmo-theme-<slug>` (la añade Frontend\Theme).
   Cada preset cambia la DISTRIBUCIÓN y la estética de las tarjetas del
   listado y de la ficha individual, SOBRE el mismo HTML (cero cambios en
   plantillas → robusto). NUNCA tocan la tipografía (la pone el tema).
   "original" = look por defecto, sin overrides.
   Los layouts viven principalmente en modules/properties/.../frontend.css
   (que conoce las clases de tarjeta/ficha). Aquí solo van ajustes de tokens
   compartidos si hicieran falta.
   ════════════════════════════════════════════════════════════════════ */
