/* ==========================================================================
   La Huella — Menú Digital. Mismos tonos que el sitio principal (brasas,
   cuero, cobre) pero proyecto y hoja de estilos 100% independientes.
   ========================================================================== */

:root {
  --bg: #140f0d;
  --bg-alt: #1b1411;
  --bg-card: #241a16;
  --ink: #f5ecdf;
  --ink-dim: #c7b7a5;
  --ink-faint: #8d7b6c;
  --gold: #c99a4d;
  --gold-soft: #e6c384;
  --ember: #b8402a;
  --line: rgba(245, 236, 223, 0.12);
  --line-strong: rgba(245, 236, 223, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Instrument Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; margin: 0; }
p { margin: 0; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

.container { max-width: 720px; margin-inline: auto; padding-inline: 18px; }

/* ---------- Header ---------- */
.menu-header {
  padding: 32px 18px 18px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.menu-header .eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 8px;
}
.menu-header h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
.menu-header p { color: var(--ink-dim); margin-top: 6px; font-size: 0.92rem; }

.search-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search-bar input {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--ink);
}
.search-bar input::placeholder { color: var(--ink-faint); }

.cat-nav {
  position: sticky;
  top: 61px;
  z-index: 19;
  background: var(--bg);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.cat-pill.active, .cat-pill:hover { border-color: var(--gold); color: var(--gold-soft); background: rgba(201,154,77,0.1); }

/* ---------- Menu list ---------- */
main { padding-bottom: 60px; }
.cat-section { padding: 32px 18px 8px; }
.cat-section h2 {
  font-size: 1.4rem;
  color: var(--gold-soft);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.menu-item { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: none; }
.menu-item-info { flex: 1; min-width: 0; }
.menu-item-name { font-family: "Fraunces", serif; font-size: 1.08rem; }
.menu-item-desc { color: var(--ink-faint); font-size: 0.88rem; margin-top: 4px; }
.menu-item-price { color: var(--gold-soft); font-size: 0.95rem; white-space: nowrap; padding-top: 2px; }

.empty-state, .loading-state {
  text-align: center;
  color: var(--ink-faint);
  padding: 60px 18px;
}

.credit-footer {
  text-align: center;
  padding: 20px 18px 36px;
  color: var(--ink-faint);
  font-size: 0.76rem;
  opacity: 0.7;
}

/* ---------- Admin ---------- */
.admin-wrap { max-width: 900px; margin-inline: auto; padding: 32px 18px 80px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-header h1 { font-size: 1.4rem; }
.admin-panel { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 20px clamp(16px,4vw,30px); margin-bottom: 24px; }
.admin-panel h2 { font-size: 1.15rem; margin-bottom: 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: rgba(245,236,223,0.05);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 1rem;
}
.field select option { background: var(--bg-card); color: var(--ink); }
.field textarea { min-height: 64px; resize: vertical; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 140px; }
.field-row .field.price-field { max-width: 130px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}
.btn-primary { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #1a1310; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-danger { background: transparent; border-color: var(--ember); color: var(--ember); }
.btn-danger:hover { background: rgba(184,64,42,0.12); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.login-box { max-width: 380px; margin: 100px auto; }
.login-box .field { margin-bottom: 18px; }
#loginError { color: var(--ember); margin-top: 10px; font-size: 0.9rem; }

.admin-search { margin-bottom: 20px; }

.admin-cat-block { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: rgba(245,236,223,0.03);
}
.admin-cat-head h3 { font-size: 1rem; color: var(--gold-soft); }
.admin-cat-head .count { color: var(--ink-faint); font-size: 0.85rem; }
.admin-cat-head .chevron { transition: transform 0.2s var(--ease); color: var(--ink-faint); }
.admin-cat-block.open .chevron { transform: rotate(180deg); }
.admin-cat-items { display: none; padding: 8px 16px 16px; }
.admin-cat-block.open .admin-cat-items { display: block; }

.dish-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.dish-row:last-child { border-bottom: none; }
.dish-row .field-row { margin-bottom: 8px; }
.dish-row .dish-actions { display: flex; gap: 10px; margin-top: 6px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  padding: 13px 22px;
  border-radius: 8px;
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
  z-index: 300;
  font-size: 0.92rem;
  max-width: 90vw;
  text-align: center;
}
.toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 640px) {
  .admin-header { flex-wrap: nowrap; }
}
