/* CyMarket — Vanilla CSS (HTML + JS only) */

:root {
  --brand: #A32D2D;
  --brand-bg: #fef2f2;
  --gold: #D4A017;
  --la-molina: #639922;
  --smp: #185FA5;
  --venta-bg: #dcfce7;  --venta-fg: #15803d;
  --alq-bg:   #fef3c7;  --alq-fg:   #b45309;
  --busco-bg: #dbeafe;  --busco-fg: #1d4ed8;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--slate-50);
  color: var(--slate-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

button, input, textarea, select {
  font-family: inherit;
  font-weight: 400;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- LAYOUT ---------- */
.mm-app { width: 100%; max-width: 1480px; margin: 0 auto; }

/* ---------- HEADER ---------- */
.mm-header {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--slate-200);
  background: white;
  position: sticky; top: 0; z-index: 30;
}
.mm-logo { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: none; cursor: pointer; padding: 0; }
.mm-logo-text {
  color: var(--brand);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.3px;
  line-height: 1;
}

.mm-search { flex: 1; max-width: 540px; position: relative; }
.mm-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }
.mm-search input {
  width: 100%; padding: 10px 36px 10px 40px;
  font-size: 13px;
  border: 1px solid var(--slate-200); background: var(--slate-50);
  border-radius: 999px; outline: none;
  transition: all 0.15s;
}
.mm-search input:focus { background: white; border-color: var(--slate-400); }
.mm-search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}

.mm-nav { display: flex; align-items: center; gap: 4px; }
.mm-nav-item {
  background: transparent; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--slate-600); font-size: 13px; font-weight: 500; position: relative;
}
.mm-nav-item.active { color: var(--brand); }
.mm-nav-item .badge {
  background: var(--brand); color: white; font-size: 10px;
  padding: 1px 6px; border-radius: 999px; margin-left: 2px; font-weight: 500;
}

.mm-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--slate-200);
  background: oklch(0.85 0.04 200);
  color: var(--slate-700); cursor: pointer;
  font-weight: 500; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- BUTTONS ---------- */
.mm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: normal; text-align: center; line-height: 1.3;
  transition: transform 0.08s, filter 0.12s;
  border: 1px solid transparent;
  background: white;
}
.mm-btn:active:not(:disabled) { transform: translateY(1px); }
.mm-btn:disabled { cursor: not-allowed; background: var(--slate-100); color: var(--slate-400); border-color: var(--slate-200); }

.mm-btn-primary { background: var(--brand); color: white; border-color: var(--brand); }
.mm-btn-ghost   { background: transparent; color: var(--slate-700); }
.mm-btn-outline { background: white; color: var(--slate-800); border-color: var(--slate-300); }
.mm-btn-wa      { background: #25D366; color: white; border-color: #25D366; }
.mm-btn-danger  { background: #dc2626; color: white; border-color: #dc2626; }
.mm-btn-danger:hover:not(:disabled)      { filter: brightness(0.95); }
.mm-btn-danger-soft { background: white; color: #dc2626; border-color: #f0c4c4; }
.mm-btn-danger-soft:hover:not(:disabled) { background: #fef2f2; border-color: #e3a3a3; }
.mm-btn-sm      { padding: 6px 12px; font-size: 13px; }
.mm-btn-lg      { padding: 12px 20px; font-size: 15px; }
.mm-btn-full    { width: 100%; }

/* ---------- BADGES + DOTS ---------- */
.mm-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 999px; }
.mm-badge-venta    { background: var(--venta-bg);  color: var(--venta-fg); }
.mm-badge-alquiler { background: var(--alq-bg);    color: var(--alq-fg); }
.mm-badge-busco    { background: var(--busco-bg);  color: var(--busco-fg); }

.mm-sede {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--slate-600);
}
.mm-sede .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mm-sede.la_molina .dot { background: var(--la-molina); }
.mm-sede.smp .dot { background: var(--smp); }
.mm-sede.ambas .dot { background: linear-gradient(90deg, var(--la-molina) 0 50%, var(--smp) 50% 100%); }

/* ---------- SEDE SWITCH ---------- */
.mm-sede-switch {
  display: inline-flex; background: var(--slate-100);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.mm-sede-switch button {
  background: transparent; color: var(--slate-600);
  border: none; border-radius: 8px; padding: 6px 14px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.mm-sede-switch button.active { background: var(--brand); color: white; }
.mm-sede-switch button .dot { width: 7px; height: 7px; border-radius: 50%; }
.mm-sede-switch button.active .dot { background: white; }

/* ---------- CHIPS ---------- */
.mm-chips { display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.mm-chip {
  background: white; color: var(--slate-700);
  border: 1px solid var(--slate-200);
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
/* Chip destacado de Postres: brilla hasta el primer clic para incentivar. */
.mm-chip-glow {
  background: var(--brand); color: white; border-color: var(--brand);
  animation: mm-chip-glow 1.5s ease-in-out infinite;
}
.mm-chip-glow:hover { filter: brightness(1.05); }
@keyframes mm-chip-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 45, 45, 0.45); }
  50%      { box-shadow: 0 0 16px 3px rgba(163, 45, 45, 0.55); }
}
/* Estado de disponibilidad de postres: verde "Activo ahora" / rojo "No activo". */
.mm-food-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.mm-food-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.mm-food-status.on  { background: #dcfce7; color: #15803d; }
.mm-food-status.on .dot  { background: #22c55e; }
.mm-food-status.off { background: #fee2e2; color: #dc2626; }
.mm-food-status.off .dot { background: #ef4444; }
/* Pill sobre la foto de la card de postres — llamativo. */
.mm-card-food {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.mm-card-food .dot { width: 8px; height: 8px; border-radius: 50%; background: white; }
.mm-card-food.on  { background: #16a34a; color: white; }
.mm-card-food.on .dot { animation: mm-blink 1.4s ease-in-out infinite; }
.mm-card-food.off { background: #dc2626; color: white; }
@keyframes mm-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.mm-chip.active { background: var(--slate-900); color: white; border-color: var(--slate-900); }
.mm-chip.active.type-venta    { background: var(--venta-bg);  color: var(--venta-fg);  border-color: var(--venta-bg); }
.mm-chip.active.type-alquiler { background: var(--alq-bg);    color: var(--alq-fg);    border-color: var(--alq-bg); }
.mm-chip.active.type-busco    { background: var(--busco-bg);  color: var(--busco-fg);  border-color: var(--busco-bg); }

/* ---------- PHOTO ---------- */
.mm-photo {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 8px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mm-photo-label {
  position: absolute; bottom: 6px; right: 8px; font-size: 9px;
  font-family: var(--mono); letter-spacing: 1px; opacity: 0.6;
}

/* ---------- CARD ---------- */
.mm-card {
  text-align: left; background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s;
}
.mm-card:hover { border-color: var(--slate-300); }
.mm-card .row { display: flex; align-items: center; justify-content: space-between; }
.mm-card h3 {
  margin: 0; font-size: 14px; font-weight: 500; color: var(--slate-900);
  line-height: 1.3; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.mm-card .pr { font-size: 16px; font-weight: 500; color: var(--slate-900); }
.mm-card .pr small { font-size: 12px; color: var(--slate-500); font-weight: 400; }
.mm-card .rating { font-size: 11px; color: var(--slate-500); display: inline-flex; align-items: center; gap: 3px; }
.mm-card .star { color: var(--gold); }
.mm-card .foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; }

/* ---------- LAYOUTS ---------- */
.mm-page { padding: 24px 32px 48px; }
.mm-page-narrow { max-width: 720px; margin: 0 auto; padding: 24px 32px 48px; }
.mm-page-medium { max-width: 980px; margin: 0 auto; padding: 24px 32px 48px; }
.mm-page-large { max-width: 1160px; margin: 0 auto; padding: 24px 32px 48px; }


.mm-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--slate-100);
}
.mm-toolbar .chips-wrap { flex: 1; min-width: 0; }

.mm-section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.mm-section-title h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.2px; }
.mm-section-title p  { margin: 4px 0 0; font-size: 13px; color: var(--slate-500); }
.mm-section-title button.clear {
  background: transparent; border: none; color: var(--slate-500);
  font-size: 13px; cursor: pointer;
}

.mm-grid { display: grid; gap: 16px; }
.mm-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mm-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mm-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.mm-empty {
  padding: 48px 24px; text-align: center;
  background: var(--slate-50); border-radius: 16px;
  border: 1px dashed var(--slate-200);
}
.mm-empty .ico-wrap { display: inline-flex; padding: 14px; border-radius: 50%; background: white; margin-bottom: 12px; border: 1px solid var(--slate-200); color: var(--slate-400); }
.mm-empty h3 { margin: 0; font-size: 17px; font-weight: 500; }
.mm-empty p { margin: 6px 0 16px; font-size: 13px; color: var(--slate-500); }

/* ---------- DETAIL ---------- */
.mm-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; }
.mm-back {
  background: transparent; border: none; cursor: pointer; color: var(--slate-600);
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 16px;
}
.mm-gallery { border: 1px solid var(--slate-200); border-radius: 14px; overflow: hidden; background: white; }
.mm-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mm-thumb {
  width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--slate-200); background: white;
  display: flex; align-items: center; justify-content: center;
}

.mm-detail h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.3px; line-height: 1.2; text-wrap: pretty; }
.mm-detail .price-big { font-size: 34px; font-weight: 500; color: var(--slate-900); }
.mm-detail .price-unit { color: var(--slate-500); }
.mm-detail .desc { margin: 20px 0 0; font-size: 14px; color: var(--slate-700); line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; }
.mm-text-link { color: #2563eb; text-decoration: underline; overflow-wrap: break-word; }
.mm-text-link:hover { color: #1d4ed8; }

.mm-owner {
  margin-top: 20px; padding: 12px; width: 100%; text-align: left;
  border: 1px solid var(--slate-200); border-radius: 12px; background: white;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.mm-owner .av {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: var(--slate-700);
}

/* ---------- HOURLY SCHEDULE (alquileres) ---------- */
.mm-hourly {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.mm-hourly button {
  aspect-ratio: 2 / 1;
  border-radius: 8px; border: none;
  background: var(--venta-bg); color: var(--venta-fg);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  font-family: inherit;
  transition: transform 0.08s;
}
.mm-hourly button:not(:disabled):active { transform: translateY(1px); }
.mm-hourly button.occ {
  background: var(--slate-200); color: var(--slate-400);
  cursor: not-allowed;
}
.mm-hourly button.past {
  background: transparent; color: var(--slate-300);
  cursor: not-allowed; border: 1px dashed var(--slate-200);
}
.mm-hourly button.in-range { background: #fecaca; color: var(--brand); }
.mm-hourly button.selected { background: var(--brand); color: white; }
.mm-hourly button.is-now { box-shadow: inset 0 0 0 2px var(--gold); }

.mm-cal-title .mm-cal-date {
  margin-left: auto; font-size: 12px; font-weight: 400; color: var(--slate-500);
  text-transform: capitalize;
}

.mm-cal-legend { display: flex; font-size: 11px; color: var(--slate-500); margin-top: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; gap: 14px; }
.mm-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mm-cal-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* Row con botón Limpiar + botón Reservar */
.mm-rental-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}
.mm-rental-actions .mm-btn {
  white-space: normal;
  height: auto;
  min-height: 44px;
}
.mm-rental-actions .mm-btn-ghost {
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  background: white;
}
.mm-rental-actions .mm-btn-ghost:hover { border-color: var(--slate-400); }

/* ---------- NEGOCIABLE TAGS ---------- */
.mm-neg {
  font-size: 11px; font-weight: 400;
  color: var(--alq-fg); background: var(--alq-bg);
  padding: 2px 7px; border-radius: 999px;
  margin-left: 4px; vertical-align: middle;
}
.mm-neg-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  background: var(--alq-bg); color: var(--alq-fg);
  font-size: 12px; font-weight: 500;
  margin-left: 4px;
}

/* ---------- RENTAL MANAGER list ---------- */
.mm-rental-mgr-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .mm-rental-mgr-list { grid-template-columns: 1fr; } }
.mm-rental-mgr.has-draft { border-color: var(--alq-fg); box-shadow: 0 0 0 2px var(--alq-bg); }

.mm-rental-mgr-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--slate-100);
  flex-wrap: wrap;
}
.mm-rental-mgr-foot .mm-btn { flex-shrink: 0; }

.mm-draft-pill {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--alq-fg); font-weight: 500;
  background: var(--alq-bg);
  padding: 5px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.mm-draft-pill.saved {
  background: var(--venta-bg); color: var(--venta-fg);
}

.mm-hourly button.is-draft {
  box-shadow: inset 0 0 0 2px var(--alq-fg);
}

/* ---------- TOGGLE FIELD (publish) ---------- */
.mm-toggle-field {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px;
  border: 1px solid var(--slate-200); border-radius: 12px;
  background: white; cursor: pointer;
}
.mm-toggle-field .lbl { font-size: 14px; font-weight: 500; color: var(--slate-800); }
.mm-toggle-field .sub { font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.mm-toggle {
  width: 40px; height: 24px; border-radius: 12px; background: var(--slate-200);
  border: none; cursor: pointer; position: relative; padding: 0; flex-shrink: 0;
  transition: background 0.15s;
}
.mm-toggle .thumb {
  width: 18px; height: 18px; border-radius: 50%; background: white;
  position: absolute; top: 3px; left: 3px;
  transition: left 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.mm-toggle.on { background: var(--brand); }
.mm-toggle.on .thumb { left: 19px; }

/* ---------- FORMS ---------- */
.mm-field { display: block; }
.mm-field .label { font-size: 12px; color: var(--slate-600); margin-bottom: 6px; font-weight: 500; }
.mm-input, .mm-select, .mm-textarea {
  width: 100%; padding: 12px 14px;
  font-size: 14px; border: 1px solid var(--slate-300);
  border-radius: 10px; outline: none; background: white;
}
.mm-textarea { resize: vertical; min-height: 100px; }
.mm-input.err { border-color: var(--brand); }
.mm-input:focus, .mm-select:focus, .mm-textarea:focus { border-color: var(--slate-400); }

.mm-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mm-spacer-12 { height: 12px; }
.mm-spacer-20 { height: 20px; }

.mm-sede-choice { display: flex; gap: 8px; }
.mm-sede-choice button {
  flex: 1; padding: 12px; border-radius: 10px;
  border: 1px solid var(--slate-300); background: white; color: var(--slate-700);
  font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.mm-sede-choice button .dot { width: 8px; height: 8px; border-radius: 50%; }
.mm-sede-choice button.active { border-color: var(--brand); background: var(--brand-bg); color: var(--brand); }

/* ---------- MODAL ---------- */
.mm-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.mm-modal {
  background: white; border-radius: 16px;
  width: min(440px, 100%); padding: 32px; position: relative;
}
.mm-modal-close {
  position: absolute; top: 16px; right: 16px; background: transparent;
  border: none; cursor: pointer; color: var(--slate-400); padding: 4px;
}
.mm-modal h2 { margin: 20px 0 6px; font-size: 20px; font-weight: 500; letter-spacing: -0.2px; }
.mm-modal p.sub { margin: 0 0 22px; font-size: 13px; color: var(--slate-500); }
.mm-err { margin: 8px 0 0; font-size: 12px; color: var(--brand); display: flex; align-items: center; gap: 6px; }
.mm-code-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; width: 100%; }
.mm-code-row input {
  flex: 1; min-width: 0; max-width: 56px;
  height: 64px; font-size: 26px; text-align: center;
  border: 1px solid var(--slate-300); border-radius: 10px; outline: none;
  font-family: inherit; padding: 0;
}
.mm-link {
  background: transparent; border: none; color: var(--slate-500);
  font-size: 12px; cursor: pointer; text-decoration: underline;
  font-family: inherit; width: 100%; margin-top: 12px; padding: 0;
}

/* ---------- STEPPER ---------- */
.mm-stepper { display: flex; gap: 8px; margin: 20px 0 28px; align-items: center; }
.mm-stepper .step { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--slate-400); }
.mm-stepper .step.current { color: var(--brand); }
.mm-stepper .step.done    { color: var(--slate-400); }
.mm-stepper .num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--slate-100); color: var(--slate-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.mm-stepper .step.current .num { background: var(--brand); color: white; }
.mm-stepper .step.done .num    { background: var(--brand-bg); color: var(--brand); }
.mm-stepper .lbl { font-size: 13px; font-weight: 500; }
.mm-stepper .sep { width: 16px; height: 1px; background: var(--slate-200); }

.mm-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mm-type-card {
  padding: 20px; border-radius: 12px; text-align: left;
  border: 1.5px solid var(--slate-200);
  background: white; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
}
.mm-type-card .title { font-size: 16px; font-weight: 500; margin-top: 6px; }
.mm-type-card .desc  { font-size: 12px; color: var(--slate-500); }
.mm-type-card.sel-venta    { border-color: var(--venta-fg);  background: var(--venta-bg); }
.mm-type-card.sel-alquiler { border-color: var(--alq-fg);    background: var(--alq-bg); }
.mm-type-card.sel-busco    { border-color: var(--busco-fg);  background: var(--busco-bg); }

.mm-photos-up { display: flex; gap: 8px; }
.mm-photo-up {
  flex: 1; aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--slate-300); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-400); background: var(--slate-50); cursor: pointer;
}

.mm-info-banner {
  margin-top: 16px; padding: 14px; border-radius: 10px;
  background: var(--busco-bg); color: var(--busco-fg);
  font-size: 13px; line-height: 1.5;
}
.mm-info-banner strong { font-weight: 500; display: block; margin-bottom: 4px; }

.mm-actions { display: flex; justify-content: space-between; margin-top: 24px; }
.mm-actions.end { justify-content: flex-end; }

/* ---------- PROFILE ---------- */
.mm-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.mm-profile-head .av {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 500; color: var(--slate-700);
}
.mm-profile-head .meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--slate-600); }
.mm-profile-head .sep { color: var(--slate-300); }
.mm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.mm-stat { border: 1px solid var(--slate-200); border-radius: 12px; padding: 14px; background: white; }
.mm-stat .v { font-size: 22px; font-weight: 500; color: var(--slate-900); }
.mm-stat .l { font-size: 12px; color: var(--slate-500); margin-top: 2px; }

.mm-block { margin-bottom: 32px; }
.mm-block h2 { margin: 0 0 14px; font-size: 16px; font-weight: 500; }
.mm-block h2 .count { color: var(--slate-400); font-weight: 400; }
.mm-block .sub { margin: -8px 0 14px; font-size: 13px; color: var(--slate-500); }

.mm-rental-mgr {
  border: 1px solid var(--slate-200); border-radius: 12px; padding: 14px; background: white;
}
.mm-rental-mgr .head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.mm-rental-mgr .head .ph { width: 44px; }
.mm-rental-mgr .head .ti { font-size: 13px; font-weight: 500; }
.mm-rental-mgr .head .me { font-size: 11px; color: var(--slate-500); }

.mm-busco-row {
  border: 1px solid var(--slate-200); border-radius: 12px; padding: 16px; background: white;
}
.mm-busco-row .top { display: flex; align-items: center; gap: 10px; }
.mm-busco-row .top .ti { font-size: 15px; font-weight: 500; }
.mm-busco-row .top .ct { margin-left: auto; font-size: 13px; }
.mm-busco-row .top .ct.has { color: var(--brand); }
.mm-busco-row .top .ct.none { color: var(--slate-500); }
.mm-busco-row .ms { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.mm-busco-row .m {
  padding: 10px; border-radius: 8px; background: var(--slate-50);
  border: 1px solid var(--slate-200);
  display: flex; align-items: center; gap: 12px; text-align: left;
  cursor: pointer; font-family: inherit; color: var(--slate-800);
}

/* ---------- MATCHES ---------- */
.mm-matches-head h1 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -0.2px; }
.mm-agent-status {
  border: 1px solid var(--slate-200); background: white;
  border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: all 0.3s;
}
.mm-agent-status.run { border-color: #fde68a; background: #fffbeb; }
.mm-agent-status .ico {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--slate-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-500);
}
.mm-agent-status.run .ico { background: #fde68a; color: #854d0e; animation: mmPulse 1.4s ease-in-out infinite; }
@keyframes mmPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: 0.85; } }
.mm-agent-status .ti { font-size: 14px; font-weight: 500; color: var(--slate-900); }
.mm-agent-status .sub { font-size: 12px; color: var(--slate-500); }

.mm-match-card { border: 1px solid var(--slate-200); border-radius: 14px; background: white; overflow: hidden; }
.mm-match-card .head { padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.mm-match-card.has-rows .head { border-bottom: 1px solid var(--slate-100); }
.mm-match-card .head .ti { font-size: 15px; font-weight: 500; }
.mm-match-card .head .me { font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.mm-new-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  background: var(--brand-bg); color: var(--brand);
  font-size: 11px; font-weight: 500;
}
.mm-new-pill .blip { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: mmPulse 1.4s ease-in-out infinite; }

.mm-match-row {
  width: 100%; padding: 14px 18px; text-align: left;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  border-top: 1px solid var(--slate-100);
  font-family: inherit;
}
.mm-match-row:first-of-type { border-top: none; }
.mm-match-row:hover { background: var(--slate-50); }
.mm-match-row .ph { width: 56px; flex-shrink: 0; }
.mm-match-row .ti { font-size: 14px; font-weight: 500; color: var(--slate-900); }
.mm-match-row .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--slate-500); }
.mm-match-row .reasons { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.mm-match-row .reasons .r {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--venta-fg);
}
.mm-match-row .reasons .r.dim { color: var(--slate-400); }

/* ---------- MISC ---------- */
.mm-spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: mm-spin 0.8s linear infinite;
}
@keyframes mm-spin { to { transform: rotate(360deg); } }

.mm-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-row-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mm-meta-dot { color: var(--slate-300); }
.mm-meta-time { font-size: 12px; color: var(--slate-500); }
.mm-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.mm-extra-meta { margin: 4px 0 0; font-size: 13px; color: var(--slate-500); }
.mm-extra-meta strong { color: var(--slate-800); font-weight: 400; }
.mm-cta-hint { margin: 8px 0 0; font-size: 12px; color: var(--slate-500); text-align: center; }
.mm-cal-title { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: var(--slate-700); display: flex; align-items: center; gap: 8px; }

/* ---------- CARD: favorito + vendido ---------- */
.mm-card-photo-wrap { position: relative; }
.mm-card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: none;
  color: var(--slate-600); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 0.1s, background 0.15s;
}
.mm-card-fav:hover { background: white; transform: scale(1.06); }
.mm-card-fav.on { color: var(--brand); }
.mm-card-sold-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(15,23,42,0.85); color: white;
  font-size: 11px; font-weight: 500; letter-spacing: 0.3px;
}
.mm-card.is-sold .mm-photo { opacity: 0.55; }
.mm-card.is-sold h3 { color: var(--slate-500); text-decoration: line-through; text-decoration-thickness: 1px; }
.mm-card.is-sold .pr { color: var(--slate-500); }

/* ---------- ICON BTN (detail meta: fav + reportar) ---------- */
.mm-icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: white; border: 1px solid var(--slate-200);
  color: var(--slate-600); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.mm-icon-btn:hover { border-color: var(--slate-400); }
.mm-icon-btn.on { color: var(--brand); border-color: var(--brand-bg); background: var(--brand-bg); }

/* ---------- SORT DROPDOWN ---------- */
.mm-sort { position: relative; display: inline-block; }
.mm-sort-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 1px solid var(--slate-200);
  border-radius: 8px; padding: 8px 12px;
  font-size: 13px; cursor: pointer; color: var(--slate-700);
  font-family: inherit; font-weight: 500;
}
.mm-sort-trigger .lbl { color: var(--slate-500); font-weight: 400; }
.mm-sort-trigger:hover { border-color: var(--slate-300); }
.mm-sort-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: white; border: 1px solid var(--slate-200);
  border-radius: 10px; padding: 4px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: all 0.15s;
  z-index: 20;
}
/* En PC el menú se abre con clic (state.sortOpen → .is-open), no con hover,
   porque el hueco entre el botón y el menú lo cerraba antes de poder cliquear. */
.mm-sort.is-open .mm-sort-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.mm-sort.is-open .mm-sort-trigger { border-color: var(--slate-300); }
.mm-sort-menu button {
  width: 100%; background: transparent; border: none; cursor: pointer;
  padding: 8px 10px; border-radius: 6px; font-size: 13px;
  text-align: left; color: var(--slate-700); font-family: inherit;
  display: flex; align-items: center; justify-content: space-between;
}
.mm-sort-menu button:hover { background: var(--slate-50); }
.mm-sort-menu button.active { color: var(--brand); font-weight: 500; }

/* ---------- LOGIN: badge modo dev ---------- */
.mm-dev-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: #fef3c7; color: #854d0e;
  font-size: 11px; font-weight: 500;
  margin-bottom: 8px;
}

/* ---------- LOGIN: phone input ---------- */
.mm-phone-input {
  display: flex; align-items: stretch;
  border: 1px solid var(--slate-300); border-radius: 10px;
  overflow: hidden; background: white;
}
.mm-phone-input:focus-within { border-color: var(--slate-400); }
.mm-phone-input.err { border-color: var(--brand); }
.mm-phone-input .prefix {
  display: inline-flex; align-items: center;
  padding: 0 14px;
  background: var(--slate-50); color: var(--slate-700);
  border-right: 1px solid var(--slate-200);
  font-size: 14px; font-weight: 500;
}
.mm-phone-input input {
  flex: 1; padding: 12px 14px;
  font-size: 14px; border: none; outline: none; background: white;
  font-family: inherit;
}

/* ---------- REPORT MODAL ---------- */
.mm-report-reasons { display: flex; flex-direction: column; gap: 8px; }
.mm-report-reason {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: white; border: 1px solid var(--slate-200);
  cursor: pointer; font-family: inherit; font-size: 14px;
  color: var(--slate-700); text-align: left;
}
.mm-report-reason:hover { border-color: var(--slate-300); }
.mm-report-reason .dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--slate-300); flex-shrink: 0;
}
.mm-report-reason.active { border-color: var(--brand); background: var(--brand-bg); color: var(--brand); }
.mm-report-reason.active .dot { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 2.5px white; }

/* ---------- PUBLISH: foto preview ---------- */
.mm-photo-up.has-img { padding: 0; border-style: solid; border-color: var(--slate-200); overflow: hidden; position: relative; cursor: default; background: white; }
.mm-photo-up.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-photo-rm {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(15,23,42,0.7); color: white;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mm-photo-up.is-add {
  flex-direction: column; gap: 2px;
  font-family: inherit;
}
.mm-photo-up.is-add:hover { border-color: var(--slate-400); background: white; }

/* ---------- PROFILE: lista de publicaciones propias ---------- */
.mm-my-list {
  border: 1px solid var(--slate-200); border-radius: 12px;
  background: white; overflow: hidden;
}
.mm-my-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid var(--slate-100);
}
.mm-my-row:first-child { border-top: none; }
.mm-my-row .ph { width: 48px; flex-shrink: 0; }
.mm-my-row .info { flex: 1; min-width: 0; }
.mm-my-row .info .t {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mm-my-row .info .t .ti { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-my-row .info .m { font-size: 12px; color: var(--slate-500); margin-top: 2px; }

/* ---------- FEED chip favoritos ---------- */
.mm-chip.is-fav { background: var(--brand-bg); color: var(--brand); border-color: var(--brand-bg); }

/* ---------- PEDIDOS: hero ---------- */
.mm-page-hero { margin-bottom: 20px; }
.mm-page-hero h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.3px; }
.mm-page-hero p { margin: 6px 0 0; font-size: 14px; color: var(--slate-500); max-width: 580px; }

/* ---------- COINCIDENCIAS: banner intro ---------- */
.mm-intro-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--busco-bg); color: var(--busco-fg);
  margin-bottom: 16px;
}
.mm-intro-banner .ico {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.6);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mm-intro-banner .body { flex: 1; }
.mm-intro-banner .ti { font-size: 14px; font-weight: 500; }
.mm-intro-banner p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.mm-intro-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--busco-fg); opacity: 0.7; padding: 4px;
  display: inline-flex; align-items: center;
}
.mm-intro-close:hover { opacity: 1; }

/* ---------- PROFILE: pausadas + acciones múltiples ---------- */
.mm-my-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mm-my-actions .mm-btn { padding: 5px 10px; font-size: 12px; }
.mm-paused-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--alq-bg); color: var(--alq-fg);
  font-size: 10px; font-weight: 500; margin-left: 6px;
  vertical-align: middle;
}
.mm-my-row.is-paused .ph { opacity: 0.6; }
.mm-my-row.is-paused .info .ti { color: var(--slate-500); }

/* ---------- MENÚ DEL DÍA — coming soon ---------- */
.mm-coming-soon-hero {
  text-align: center;
  padding: 60px 24px 40px;
  background: linear-gradient(180deg, var(--slate-50), white);
  border-radius: 20px;
  margin-bottom: 32px;
  border: 1px solid var(--slate-200);
}
.mm-coming-soon-hero .badge-coming {
  display: inline-block;
  padding: 5px 12px; border-radius: 999px;
  background: var(--brand-bg); color: var(--brand);
  font-size: 11px; font-weight: 500; letter-spacing: 1px;
  margin-bottom: 16px;
}
.mm-coming-soon-hero h1 {
  margin: 0; font-size: 36px; font-weight: 500; letter-spacing: -0.5px;
}
.mm-coming-soon-hero p {
  max-width: 580px; margin: 12px auto 0;
  font-size: 15px; color: var(--slate-600); line-height: 1.6;
}
.mm-coming-cta {
  margin-top: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.mm-coming-hint { font-size: 12px; color: var(--slate-500); }

.mm-coming-faq h2 {
  margin: 0 0 16px; font-size: 18px; font-weight: 500;
}
.faq-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 700px) { .faq-grid { grid-template-columns: 1fr; } }
.faq-card {
  padding: 20px; border-radius: 14px;
  background: white; border: 1px solid var(--slate-200);
}
.faq-card .ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--slate-100); color: var(--slate-700);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.faq-card h3 { margin: 0; font-size: 15px; font-weight: 500; }
.faq-card p { margin: 6px 0 14px; font-size: 13px; color: var(--slate-500); line-height: 1.5; }

/* ---------- BOTÓN DE APOYO EN HEADER ---------- */
.mm-support-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: white; border: 1px solid var(--slate-200);
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s, border-color 0.15s;
}
.mm-support-btn:hover {
  border-color: var(--brand);
  transform: scale(1.08);
}

/* ---------- MODAL DE APOYO ---------- */
.mm-donate-modal { text-align: center; max-width: 420px; }
.mm-donate-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand-bg);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.mm-donate-modal h2 { margin-bottom: 8px; }
.mm-donate-modal .sub { margin-bottom: 24px; }

.mm-donate-card {
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 20px;
  background: var(--slate-50);
  margin-bottom: 20px;
}
.mm-donate-card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 500; margin-bottom: 14px;
}
.mm-donate-card-head .brand { color: var(--slate-700); }
.mm-donate-card-head .badge {
  padding: 3px 8px; border-radius: 999px;
  background: var(--venta-bg); color: var(--venta-fg);
}
.mm-donate-qr {
  width: 180px; height: 180px;
  border-radius: 12px;
  margin: 0 auto 16px;
  display: block;
  background: white;
}
.mm-donate-qr-placeholder {
  width: 180px; height: 180px;
  border: 2px dashed var(--slate-300);
  border-radius: 12px;
  margin: 0 auto 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  color: var(--slate-400);
  font-size: 11px;
  background: white;
}
.mm-donate-phone {
  display: flex; align-items: center; justify-content: space-between;
  background: white; border: 1px solid var(--slate-200);
  border-radius: 10px; padding: 10px 14px;
  gap: 12px;
}
.mm-donate-phone .num {
  font-family: var(--mono);
  font-size: 16px; font-weight: 500;
  color: var(--slate-900);
  letter-spacing: 1px;
}

.mm-donate-thanks {
  margin: 0;
  font-size: 13px; color: var(--slate-500);
  font-style: italic;
}

/* =========================================================
   MOBILE NAV (oculto en desktop, visible bottom en móvil)
   ========================================================= */
.mm-mobile-nav { display: none; }

/* =========================================================
   RESPONSIVE — tablet
   ========================================================= */
@media (max-width: 1024px) {
  .mm-grid.cols-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mm-page, .mm-page-large { padding: 20px 20px 40px; }
}

/* =========================================================
   RESPONSIVE — móvil grande / tablet pequeño (≤768px)
   El cambio principal: nav superior → bottom tab bar
   ========================================================= */
@media (max-width: 768px) {
  /* Header: 2 filas — primero acciones, abajo búsqueda */
  .mm-header {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .mm-search {
    order: 99;
    flex-basis: 100%;
    max-width: 100%;
  }
  .mm-nav { display: none; }
  .mm-logo-text { font-size: 16px; }
  .mm-logo { margin-right: auto; }
  /* "Publicar" / "Iniciar sesión" texto se mantiene hasta pantallas muy angostas */
  .mm-header .mm-btn { padding: 9px 14px; }
  .mm-header .mm-btn-outline { padding: 8px 12px; }

  /* Bottom nav fija */
  .mm-mobile-nav {
    display: flex; align-items: stretch;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--slate-200);
    padding: 6px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 40;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
  }
  .mm-mobile-nav button {
    flex: 1; min-width: 0;
    background: transparent; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 4px;
    color: var(--slate-500);
    font-family: inherit;
    position: relative;
  }
  .mm-mobile-nav button .lbl {
    font-size: 10px; font-weight: 500;
  }
  .mm-mobile-nav button.active { color: var(--brand); }
  .mm-mobile-nav button .badge {
    position: absolute; top: 0; right: calc(50% - 18px);
    background: var(--brand); color: white;
    font-size: 9px; padding: 1px 5px; border-radius: 999px;
    font-weight: 500;
    line-height: 1.3;
  }

  /* Padding extra al body para que el contenido no quede debajo del nav fijo */
  .mm-frame-body { padding-bottom: 70px; }

  /* Pages padding */
  .mm-page, .mm-page-narrow, .mm-page-medium, .mm-page-large {
    padding: 18px 14px 30px;
  }

  /* Detail stack */
  .mm-detail { grid-template-columns: 1fr; gap: 24px; }
  .mm-detail h1 { font-size: 22px; }
  .mm-detail .price-big { font-size: 28px; }
  .mm-row-meta { flex-wrap: wrap; }

  /* Profile head */
  .mm-profile-head { flex-wrap: wrap; gap: 12px; }
  .mm-profile-head .meta { font-size: 12px; flex-wrap: wrap; }
  .mm-stats { grid-template-columns: repeat(2, 1fr); }

  /* Card grids */
  .mm-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mm-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mm-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Forms */
  .mm-2col { grid-template-columns: 1fr; }
  .mm-types { grid-template-columns: 1fr; gap: 10px; }

  /* Toolbar: stack */
  .mm-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .mm-sede-switch { align-self: flex-start; }

  /* Section title: stack title + sort */
  .mm-section-title { flex-direction: column; align-items: stretch; gap: 12px; }
  .mm-section-title .mm-sort { align-self: flex-start; }
  .mm-section-title h2 { font-size: 20px; }

  /* Modal padding */
  .mm-modal { padding: 24px 20px; }
  .mm-modal h2 { font-size: 18px; }

  /* Login code inputs */
  .mm-code-row { gap: 6px; }
  .mm-code-row input { max-width: 50px; height: 56px; font-size: 22px; }

  /* Hero menu */
  .mm-coming-soon-hero { padding: 40px 18px 30px; }
  .mm-coming-soon-hero h1 { font-size: 26px; }
  .mm-coming-soon-hero p { font-size: 14px; }

  /* My listing row */
  .mm-my-row { flex-wrap: wrap; gap: 12px; }
  .mm-my-row .info { width: calc(100% - 60px); }
  .mm-my-actions, .mm-my-row > .mm-btn { width: 100%; }
  .mm-my-actions { flex-wrap: wrap; }
  .mm-my-actions .mm-btn { flex: 1; justify-content: center; }

  /* Rental manager footer */
  .mm-rental-mgr-foot { gap: 10px; }
  .mm-draft-pill { flex-basis: 100%; }

  /* Sort dropdown — siempre visible en móvil (no hover) */
  .mm-sort-menu {
    opacity: 1; pointer-events: auto; transform: none;
    position: static; box-shadow: none; padding: 0; margin-top: 6px;
    display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px;
    background: transparent; border: none; min-width: 0;
  }
  .mm-sort-menu button {
    width: auto; padding: 8px 12px; font-size: 12px;
    background: white; border: 1px solid var(--slate-200);
    border-radius: 999px;
  }
  .mm-sort-menu button.active {
    background: var(--brand-bg); color: var(--brand); border-color: var(--brand-bg);
  }
  .mm-sort-trigger { display: none; }
}

/* =========================================================
   RESPONSIVE — móvil chico (≤480px)
   ========================================================= */
@media (max-width: 480px) {
  .mm-logo-text { font-size: 14px; }
  .mm-stats { gap: 6px; }
  .mm-stat { padding: 10px; }
  .mm-stat .v { font-size: 18px; }

  .mm-card h3 { font-size: 13px; min-height: 2.4em; }
  .mm-card .pr { font-size: 14px; }

  .mm-profile-head { flex-direction: column; align-items: flex-start; }
  .mm-profile-head .av { width: 52px; height: 52px; font-size: 18px; }
  .mm-profile-head h1 { font-size: 18px; }
  .mm-profile-head > .mm-btn { align-self: flex-start; }

  /* Donate modal smaller QR */
  .mm-donate-qr, .mm-donate-qr-placeholder { width: 150px; height: 150px; }
  .mm-donate-card { padding: 16px; }

  /* Hourly grid 3 cols en pantalla muy chica */
  .mm-hourly { grid-template-columns: repeat(3, 1fr); }
  .mm-hourly button { font-size: 12px; }

  /* Coming soon hero */
  .mm-coming-soon-hero h1 { font-size: 22px; }
}

/* =========================================================
   RESPONSIVE — extra estrecho (≤360px)
   ========================================================= */
@media (max-width: 360px) {
  .mm-grid.cols-4, .mm-grid.cols-3, .mm-grid.cols-5 { grid-template-columns: 1fr; }
  .mm-types { grid-template-columns: 1fr; }
}

/* =========================================================
   MENÚ DEL DÍA — Fase 3.5 + 8
   ========================================================= */
.mm-menu-head { margin: 24px 0 18px; }
.mm-menu-head h1 { margin: 0 0 6px; font-size: 24px; font-weight: 500; letter-spacing: -0.3px; }
.mm-menu-head p  { margin: 0; color: var(--slate-500); font-size: 14px; }

.mm-menu-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: white;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mm-menu-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }

.mm-menu-photo-wrap { position: relative; aspect-ratio: 4 / 3; background: #f1f5f9; overflow: hidden; }
.mm-menu-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-menu-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff7ed, #fee2e2);
}
.mm-menu-stock {
  position: absolute; top: 10px; right: 10px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: white; color: var(--slate-700); border: 1px solid var(--slate-200);
}
.mm-menu-stock.ok   { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.mm-menu-stock.low  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.mm-menu-stock.out  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.mm-menu-stock.open { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.mm-menu-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mm-menu-rest { font-size: 12px; color: var(--slate-500); font-weight: 500; }
.mm-menu-card h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 500; }
.mm-menu-desc { margin: 0; font-size: 13px; color: var(--slate-600); line-height: 1.4; }
.mm-menu-items { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--slate-500); }
.mm-menu-items li { margin-bottom: 2px; }
.mm-menu-pickup {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--slate-500);
  margin-top: 4px;
}
.mm-menu-foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mm-menu-price { font-weight: 600; font-size: 17px; color: var(--slate-900); }

/* Mis reservas (alumno) */
.mm-my-reservations { margin-top: 24px; }
.mm-reservations-list { display: flex; flex-direction: column; gap: 10px; }
.mm-reservation-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: 10px;
  background: white;
}
.mm-reservation-row.is-closed { opacity: 0.65; }
.mm-reservation-row .code {
  flex-shrink: 0;
  font-family: var(--mono); font-weight: 600; font-size: 16px;
  width: 56px; padding: 8px 0; text-align: center;
  background: var(--slate-100); border-radius: 8px; color: var(--slate-700);
}
.mm-reservation-row .info { flex: 1; min-width: 0; }
.mm-reservation-row .ti  { font-size: 14px; font-weight: 500; color: var(--slate-900); }
.mm-reservation-row .me  { font-size: 12px; color: var(--slate-500); display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.mm-reservation-row .time { color: var(--slate-400); }

/* Modal de reserva confirmada */
.mm-menu-confirm { text-align: center; padding: 28px 24px; max-width: 380px; }
.mm-menu-confirm-code {
  display: inline-block;
  font-family: var(--mono); font-size: 36px; font-weight: 600;
  letter-spacing: 4px; color: var(--brand);
  background: #fff7ed; padding: 14px 24px; border-radius: 14px;
  border: 2px dashed #fcd34d;
  margin-bottom: 14px;
}
.mm-menu-confirm h2 { margin: 8px 0 4px; font-size: 20px; font-weight: 500; }
.mm-menu-confirm-sub { color: var(--slate-500); font-size: 14px; margin: 0 0 18px; }
.mm-menu-confirm-info {
  text-align: left; display: flex; flex-direction: column; gap: 8px;
  background: var(--slate-50); padding: 12px 14px; border-radius: 10px;
  margin-bottom: 14px;
}
.mm-menu-confirm-info > div { font-size: 13px; color: var(--slate-700); display: flex; align-items: center; gap: 8px; }
.mm-menu-confirm-info strong { font-weight: 500; }

/* Panel del restaurante */
.mm-rest-panel { background: linear-gradient(180deg, #fff7ed 0%, white 60%); border: 1px solid #fde68a; }
.mm-rest-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 500; }
.mm-rest-head .sub { margin: 0 0 10px; font-size: 13px; color: var(--slate-600); display: flex; align-items: center; gap: 5px; }
.mm-rest-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.mm-rest-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 14px 0 18px;
}
.mm-rest-stats .mm-stat { background: white; border: 1px solid var(--slate-200); border-radius: 10px; padding: 10px; text-align: center; }
.mm-rest-stats .mm-stat .v { font-size: 22px; font-weight: 600; color: var(--brand); }
.mm-rest-stats .mm-stat .l { font-size: 11px; color: var(--slate-500); margin-top: 2px; }

.mm-rest-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--slate-200); }
.mm-rest-section h3 { margin: 0 0 12px; font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.mm-rest-section h3 .count { color: var(--slate-500); font-weight: 400; font-size: 13px; }

/* Pills */
.mm-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px;
  background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--slate-200);
}
.mm-pill.ok   { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.mm-pill.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.mm-pill.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.mm-pill.out  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* Form de menú */
.mm-menu-form { display: flex; flex-direction: column; gap: 10px; }
.mm-menu-item-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.mm-menu-item-row .mm-input { width: 100%; }
.mm-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px;
}
.mm-form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--slate-600); }
.mm-form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mm-icon-btn {
  background: var(--slate-100); border: 1px solid var(--slate-200);
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.mm-icon-btn:hover { background: var(--slate-200); }
.mm-alert {
  padding: 10px 12px; border-radius: 8px; font-size: 13px;
  margin-top: 4px;
}
.mm-alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

.mm-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
.mm-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(163, 45, 45, 0.1); }

/* Modal overlay (reuso si no existe) */
.mm-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 16px;
}
.mm-modal {
  background: white; border-radius: 16px; padding: 24px;
  max-width: 460px; width: 100%; position: relative;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.mm-modal-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--slate-500);
}
.mm-modal-close:hover { background: var(--slate-100); color: var(--slate-900); }

@media (max-width: 720px) {
  .mm-rest-stats { grid-template-columns: repeat(2, 1fr); }
  .mm-menu-item-row { grid-template-columns: 1fr; }
  .mm-form-row { grid-template-columns: 1fr; }
}

/* =========================================================
   ONBOARDING TOUR — Fase 9
   ========================================================= */
.mm-onboarding { text-align: center; padding: 32px 24px 24px; max-width: 420px; }
.mm-onboarding-ico {
  width: 80px; height: 80px; margin: 0 auto 16px;
  background: linear-gradient(135deg, #fff7ed, #fee2e2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mm-onboarding h2 { margin: 0 0 10px; font-size: 22px; font-weight: 500; letter-spacing: -0.3px; }
.mm-onboarding-body { margin: 0 0 22px; color: var(--slate-600); font-size: 14.5px; line-height: 1.55; }
.mm-onboarding-dots {
  display: flex; gap: 7px; justify-content: center; margin-bottom: 22px;
}
.mm-onboarding-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--slate-200); transition: background 0.2s, transform 0.2s;
}
.mm-onboarding-dots .dot.active { background: var(--brand); transform: scale(1.25); }
.mm-onboarding-actions {
  display: flex; gap: 10px; justify-content: space-between; align-items: center;
}
.mm-onboarding-actions .mm-btn { flex: 1; }

@media (max-width: 500px) {
  .mm-header .mm-btn-label {
    display: none;
  }
  .mm-header .mm-btn {
    padding: 8px 12px;
  }
}

/* =========================================================
   ANIMACIÓN DE NAVEGACIÓN
   ========================================================= */
.mm-animate-in {
  animation: mm-fade-in 0.25s ease-out forwards;
}

@keyframes mm-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   ANIMACIONES DE CALIFICACIONES Y NOTIFICACIONES
   ========================================================= */
.mm-badge-nuevo {
  color: #22c55e;
  font-weight: 600;
  display: inline-block;
  animation: mm-pulse-nuevo 2s infinite ease-in-out;
}

@keyframes mm-pulse-nuevo {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); color: #16a34a; }
  100% { transform: scale(1); }
}

.mm-badge-bell-anim {
  animation: mm-bell-ring 1.5s infinite ease-in-out;
}

@keyframes mm-bell-ring {
  0% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(5deg); }
  40% { transform: rotate(-5deg); }
  50% { transform: rotate(0); }
  100% { transform: rotate(0); }
}

/* =========================================================
   TOASTS (avisos no intrusivos — reemplazan a alert())
   ========================================================= */
#mm-toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 440px);
}
.mm-toast {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--slate-900);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
  cursor: pointer;
}
.mm-toast.show { opacity: 1; transform: translateY(0); }
.mm-toast .ico { display: inline-flex; flex: none; }
.mm-toast .msg { flex: 1; }
.mm-toast.success { background: #14532d; }
.mm-toast.error   { background: #7f1d1d; }
.mm-toast .act {
  flex: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: white;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.mm-toast .act:hover { background: rgba(255, 255, 255, 0.24); }
@media (max-width: 760px) {
  /* No tapar la barra de navegación inferior en móvil */
  #mm-toasts { bottom: 84px; }
}

/* =========================================================
   SKELETON LOADING (cards fantasma mientras carga el feed)
   ========================================================= */
.mm-skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: mm-shimmer 1.4s infinite linear;
  border-radius: 8px;
}
@keyframes mm-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.mm-skeleton-card { pointer-events: none; }
.mm-skeleton-photo { aspect-ratio: 4 / 3; width: 100%; border-radius: 10px; margin-bottom: 10px; }
.mm-skeleton-line { height: 12px; margin-top: 8px; }
