/**
 * Interfaz Hogar Feliz.
 * Sirve para los paneles de administración y para el modal de zona / catálogo público.
 * Tokens cálidos, tarjetas planas y controles en píldora. Sin recargar la página.
 */

:root {
	--hf-ink: #1a1814;
	--hf-muted: #6f6a62;
	--hf-line: #e4dfd6;
	--hf-paper: #f3f0ea;
	--hf-white: #fffcf8;
	--hf-green: #1f6b4a;
	--hf-green-ink: #114833;
	--hf-sand: #efeae2;
	--hf-warn: #8a5a12;
	--hf-danger: #9f2d2d;
	--hf-shadow: 0 1px 2px rgba(26, 24, 20, 0.04), 0 16px 40px rgba(26, 24, 20, 0.06);
	--hf-radius: 16px;
	--hf-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body.hf-screen #wpcontent {
	background: var(--hf-paper);
}

body.hf-screen #wpbody-content {
	padding-bottom: 48px;
}

body.hf-zona-activa {
	padding-top: 64px;
}

.hf-app,
.hf-dock,
.hf-modal,
.hf-catalog,
.hf-toast {
	font-family: var(--hf-font);
	color: var(--hf-ink);
}

.hf-app *,
.hf-modal *,
.hf-dock *,
.hf-catalog * {
	box-sizing: border-box;
}

.hf-modal[hidden],
.hf-toast[hidden],
.hf-form-error[hidden],
.hf-card[hidden],
.hf-vendor[hidden],
.hf-colonia-field[hidden] {
	display: none !important;
}

.hf-app {
	margin: 12px 20px 0 2px;
}

.hf-app h1,
.hf-modal h2,
.hf-panel h2,
.hf-callout h3,
.hf-card h3,
.hf-section-title {
	font-weight: 600;
	letter-spacing: -0.03em;
	color: var(--hf-ink);
}

.hf-app h1 {
	margin: 4px 0 0;
	font-size: 1.75rem;
	line-height: 1.15;
}

.hf-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.hf-top__actions,
.hf-actions,
.hf-pills,
.hf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.hf-kicker {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hf-green);
	font-weight: 700;
}

.hf-mark {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 7px;
	background: var(--hf-green);
	color: #fff;
	font-size: 10px;
	letter-spacing: 0;
}

.hf-lead,
.hf-muted {
	color: var(--hf-muted);
	line-height: 1.5;
}

.hf-lead {
	max-width: 68ch;
	margin: 8px 0 0;
}

.hf-muted {
	margin: 0;
	font-size: 13px;
}

.hf-kpis {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin: 18px 0;
}

.hf-kpi,
.hf-panel,
.hf-callout,
.hf-card {
	background: var(--hf-white);
	border: 1px solid var(--hf-line);
	border-radius: var(--hf-radius);
	box-shadow: var(--hf-shadow);
}

.hf-kpi {
	padding: 16px 16px 14px;
}

.hf-kpi--warn {
	background: #fbf6ee;
}

.hf-kpi__label {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hf-muted);
	font-weight: 700;
}

.hf-kpi__value {
	margin: 10px 0 4px;
	font-size: clamp(1.45rem, 2vw, 2rem);
	line-height: 1.05;
	font-weight: 600;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
}

.hf-kpi__note {
	margin: 0;
	color: var(--hf-muted);
	font-size: 13px;
}

.hf-panel {
	padding: 16px;
	margin-top: 16px;
}

.hf-panel__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.hf-panel h2,
.hf-section-title {
	margin: 0;
	font-size: 1.12rem;
}

.hf-section-title {
	margin: 22px 0 12px;
}

.hf-status {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
	padding: 14px 16px;
	border-radius: var(--hf-radius);
	background: #e7f4ee;
	color: var(--hf-green-ink);
}

.hf-status--off {
	background: #f8efe3;
	color: var(--hf-warn);
}

.hf-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.hf-toolbar .hf-input {
	width: min(340px, 100%);
}

.hf-table-wrap {
	overflow-x: auto;
}

.hf-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

.hf-table th {
	text-align: left;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hf-muted);
	font-weight: 700;
	padding: 8px 10px 10px;
	border-bottom: 1px solid var(--hf-line);
}

.hf-table td {
	padding: 12px 10px;
	border-bottom: 1px solid #f0ece6;
	vertical-align: middle;
}

.hf-table tr:last-child td {
	border-bottom: 0;
}

.hf-table tbody tr:hover td {
	background: #fbfaf7;
}

.hf-num {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.hf-bar {
	height: 6px;
	min-width: 88px;
	background: var(--hf-sand);
	border-radius: 99px;
	overflow: hidden;
}

.hf-bar > span {
	display: block;
	height: 100%;
	background: var(--hf-green);
	border-radius: inherit;
}

.hf-btn,
.hf-icon-btn,
.hf-vendor,
.hf-chip,
.hf-opcion {
	font: inherit;
	cursor: pointer;
}

.hf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 999px;
	padding: 9px 14px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--hf-ink);
	text-decoration: none;
	line-height: 1.2;
}

.hf-btn--primary {
	background: var(--hf-green);
	color: #fff;
}

.hf-btn--primary:hover,
.hf-btn--primary:focus {
	background: var(--hf-green-ink);
	color: #fff;
}

.hf-btn--ghost {
	border-color: var(--hf-line);
	background: #fff;
	color: var(--hf-ink);
}

.hf-btn--danger {
	color: var(--hf-danger);
	background: transparent;
}

.hf-btn--light {
	background: #fff;
	color: var(--hf-ink);
}

.hf-btn--small {
	padding: 6px 10px;
	font-size: 13px;
}

.hf-btn[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.hf-icon-btn {
	border: 0;
	background: transparent;
	color: var(--hf-muted);
	font-size: 22px;
	line-height: 1;
	padding: 0 4px;
}

.hf-btn:focus-visible,
.hf-input:focus-visible,
.hf-chip:focus-visible,
.hf-vendor:focus-visible,
.hf-icon-btn:focus-visible {
	outline: 2px solid var(--hf-green);
	outline-offset: 2px;
}

.hf-input,
body.hf-screen .hf-app input.hf-input,
body.hf-screen .hf-app input.hf-input[type="text"],
body.hf-screen .hf-app input.hf-input[type="search"],
body.hf-screen .hf-app input.hf-input[type="email"],
body.hf-screen .hf-app input.hf-input[type="number"],
body.hf-screen .hf-app input.hf-input[type="file"],
body.hf-screen .hf-app select.hf-input {
	width: 100%;
	max-width: none;
	min-height: 42px;
	border: 1px solid var(--hf-line);
	border-radius: 12px;
	padding: 10px 12px;
	background: #fff;
	box-shadow: none;
	color: var(--hf-ink);
}

.hf-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.hf-cp-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin-bottom: 12px;
}

.hf-cp-row .hf-field {
	flex: 1;
	margin: 0;
}

.hf-cp-row .hf-btn {
	min-height: 42px;
}

select.hf-input {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--hf-muted) 50%), linear-gradient(135deg, var(--hf-muted) 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 36px;
}

.hf-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 12px;
}

.hf-field--full {
	grid-column: 1 / -1;
}

.hf-label {
	font-size: 13px;
	color: var(--hf-muted);
}

.hf-form-error {
	color: var(--hf-danger);
	margin: 0 0 8px;
}

.hf-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: grid;
	place-items: center;
	padding: 20px;
}

.hf-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 24, 20, 0.46);
}

.hf-modal__dialog {
	position: relative;
	width: min(520px, 100%);
	max-height: min(86vh, 760px);
	overflow: auto;
	background: #fff;
	border-radius: 20px;
	padding: 22px;
	box-shadow: var(--hf-shadow);
}

.hf-modal__dialog--wide {
	width: min(680px, 100%);
}

.hf-modal__head,
.hf-modal__foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.hf-modal__head {
	margin-bottom: 8px;
}

.hf-modal__foot {
	justify-content: flex-end;
	margin-top: 8px;
}

.hf-modal h2 {
	margin: 0;
	font-size: 1.3rem;
}

.hf-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.hf-pager button[aria-current="page"] {
	background: var(--hf-ink);
	color: #fff;
	border-color: var(--hf-ink);
}

.hf-empty {
	padding: 28px 8px;
	text-align: center;
	color: var(--hf-muted);
}

.hf-pill {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 4px 8px;
	background: #e7f4ee;
	color: var(--hf-green-ink);
	font-size: 12px;
	font-weight: 600;
}

.hf-pill--off {
	background: var(--hf-sand);
	color: var(--hf-muted);
}

.hf-chip {
	border: 0;
	border-radius: 999px;
	background: var(--hf-sand);
	color: var(--hf-ink);
	padding: 6px 10px;
}

.hf-chip--static {
	cursor: default;
}

.hf-chips--static {
	margin-top: 14px;
}

.hf-split {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}

.hf-vendor-scroll {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 12px;
	max-height: 64vh;
	overflow: auto;
}

.hf-vendor {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	text-align: left;
	border: 1px solid transparent;
	background: transparent;
	border-radius: 12px;
	padding: 10px 8px;
}

.hf-vendor.is-active {
	background: #f3faf6;
	border-color: #cfe5da;
}

.hf-vendor__name {
	font-weight: 600;
}

.hf-suggest {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid var(--hf-line);
}

.hf-foot {
	margin-top: 18px;
	color: var(--hf-muted);
	font-size: 12px;
}

.hf-meta .hf-field:last-child {
	margin-bottom: 0;
}

.hf-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 100002;
	max-width: min(320px, calc(100% - 32px));
	background: var(--hf-ink);
	color: #fff;
	padding: 12px 16px;
	border-radius: 12px;
}

.hf-toast[data-type="error"] {
	background: var(--hf-danger);
}

.hf-dock {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99990;
	display: flex;
	justify-content: center;
	pointer-events: none;
}

body.admin-bar .hf-dock {
	top: 32px;
}

body.admin-bar.hf-zona-activa {
	padding-top: 96px;
}

.hf-dock__bar {
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: none;
	width: 100%;
	background: var(--hf-ink);
	color: #f6f3ee;
	border-radius: 0;
	padding: 10px 16px;
	box-shadow: 0 8px 24px rgba(26, 24, 20, 0.16);
}

.hf-dock__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	min-width: 0;
	flex: 1;
}

.hf-dock__text strong {
	font-size: 14px;
}

.hf-dock__text span {
	color: #d9d3c8;
	font-size: 13px;
}

.hf-opciones {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 8px 0 12px;
}

.hf-opcion {
	width: 100%;
	text-align: left;
}

.hf-catalog {
	margin: 8px 0 24px;
}

.hf-grid {
	display: grid;
	grid-template-columns: repeat(var(--hf-cols, 4), minmax(0, 1fr));
	gap: 14px;
}

.hf-card {
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: none;
}

.hf-card__media {
	position: relative;
	display: grid;
	aspect-ratio: 4 / 3;
	background: var(--hf-sand);
	text-decoration: none;
}

.hf-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hf-card__ph {
	display: grid;
	place-items: center;
	color: var(--hf-green);
	font-size: 2rem;
	font-weight: 600;
}

.hf-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	border-radius: 999px;
	background: #fff;
	color: var(--hf-green-ink);
	font-size: 12px;
	font-weight: 700;
	padding: 4px 8px;
}

.hf-badge--local {
	background: var(--hf-ink);
	color: #fff;
}

.hf-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 14px 14px;
	flex: 1;
}

.hf-card h3 {
	margin: 0;
	font-size: 1rem;
}

.hf-card a {
	color: inherit;
	text-decoration: none;
}

.hf-card__excerpt {
	margin: 0;
	color: var(--hf-muted);
	font-size: 14px;
}

.hf-price {
	margin: 0;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.hf-card__actions {
	margin-top: auto;
	padding-top: 6px;
}

.hf-callout {
	max-width: 560px;
	margin: 12px auto;
	padding: 28px 22px;
	text-align: center;
	box-shadow: none;
}

.hf-callout h3 {
	margin: 8px 0;
	font-size: 1.35rem;
	line-height: 1.25;
}

.hf-callout .hf-kicker {
	justify-content: center;
}

.hf-check-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

@media (max-width: 1100px) {
	.hf-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.hf-split,
	.hf-grid {
		grid-template-columns: 1fr 1fr;
	}

	.hf-split,
	.hf-paquete-grid {
		grid-template-columns: 1fr;
	}

	.hf-vendor-scroll {
		max-height: none;
	}
}

@media (max-width: 782px) {
	.hf-app {
		margin-right: 12px;
	}

	body.admin-bar .hf-dock {
		top: 46px;
	}

	body.admin-bar.hf-zona-activa {
		padding-top: 112px;
	}
}

@media (max-width: 640px) {
	.hf-kpis,
	.hf-form-grid,
	.hf-grid {
		grid-template-columns: 1fr;
	}

	.hf-dock__bar {
		align-items: flex-start;
	}

	.hf-modal {
		align-items: end;
		padding: 0;
	}

	.hf-modal__dialog {
		width: 100%;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
	}

	.hf-suggest {
		flex-direction: column;
		align-items: flex-start;
	}
}

.hf-productos-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 4px;
}

.hf-modal__dialog--producto {
	width: min(760px, 100%);
}

.hf-modal .hf-input,
.hf-modal textarea.hf-input,
.hf-modal input.hf-input[type="text"],
.hf-modal input.hf-input[type="url"],
.hf-modal input.hf-input[type="file"],
.hf-modal input.hf-input[type="number"] {
	width: 100%;
	max-width: none;
	border: 1px solid var(--hf-line);
	border-radius: 12px;
	padding: 10px 12px;
	background: #fff;
	color: var(--hf-ink);
	box-shadow: none;
}

.hf-modal textarea.hf-input {
	min-height: 72px;
	resize: vertical;
}

.hf-modal .hf-cp-row .hf-input {
	flex: 1;
	margin: 0;
}

.hf-preview {
	display: block;
	width: 96px;
	height: 72px;
	object-fit: cover;
	border-radius: 10px;
	margin-top: 8px;
}

.hf-paquete-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 8px;
}

.hf-paquete-card {
	margin-top: 0;
	min-width: 0;
}

@media (max-width: 900px) {
	.hf-paquete-grid {
		grid-template-columns: 1fr;
	}
}

.hf-paquete-card .hf-panel__head {
	align-items: flex-start;
	flex-wrap: wrap;
}

.hf-paquete-card .hf-panel__head .hf-btn {
	flex: 0 0 auto;
}

.hf-switch {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 10px;
	cursor: pointer;
}

.hf-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.hf-switch__track {
	flex: 0 0 36px;
	width: 36px;
	height: 22px;
	margin-top: 1px;
	border-radius: 999px;
	background: #d9d3c8;
	position: relative;
}

.hf-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
}

.hf-switch input:checked + .hf-switch__track {
	background: #76236c;
}

.hf-switch input:checked + .hf-switch__track::after {
	left: 17px;
}

.hf-switch input:focus-visible + .hf-switch__track {
	outline: 2px solid #76236c;
	outline-offset: 2px;
}

.hf-switch__text {
	font-size: 14px;
	line-height: 1.35;
	color: var(--hf-ink);
}

.hf-form-ok {
	color: var(--hf-green-ink);
	margin: 0 0 8px;
	white-space: pre-wrap;
}

@media (prefers-reduced-motion: reduce) {
	.hf-modal,
	.hf-toast,
	.hf-bar > span {
		transition: none;
	}
}
