:root {
  --md-primary: #0A84FF;
  --md-primary-dark: #0066CC;
  --md-accent: #FF9500;
  --md-bg: #F5F5F7;
  --md-surface: #FFFFFF;
  --md-surface-2: #FBFBFD;
  --md-text: #1D1D1F;
  --md-text-muted: #86868B;
  --md-border: rgba(0,0,0,.08);
  --md-border-strong: rgba(0,0,0,.14);
  --md-shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.05);
  --md-shadow-lg: 0 12px 30px rgba(0,0,0,.08);
  --md-radius: 14px;
  --md-radius-lg: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  background: var(--md-bg);
  color: var(--md-text);
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

h1, h2, h3, p { margin: 0; }

/* ── Topbar (frosted, Apple-ish) ── */
.md-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--md-text);
  border-bottom: 1px solid var(--md-border);
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 10;
}
.md-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #ffffff !important;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  padding: 3px;
}
.md-topbar h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--md-text);
}
.md-topbar p {
  font-size: .75rem;
  color: var(--md-text-muted);
  margin-top: 1px;
  letter-spacing: 0;
}

/* ── Share strip (tono amber suave, Apple-like) ── */
.md-share-strip {
  background: transparent;
  padding: 14px 20px 10px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.md-share-title {
  font-weight: 600;
  color: var(--md-text);
  font-size: .84rem;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.md-share-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.md-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: .78rem;
  color: #fff;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  letter-spacing: -0.01em;
}
.md-share-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.md-share-btn:active { transform: translateY(0); opacity: 0.9; }
.md-share-btn span { font-size: .95rem; }
.md-share-wa { background: #25d366; }
.md-share-fb { background: #1877f2; }
.md-share-x  { background: #000; }
.md-share-ig { background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%); }

/* ── Buscador flotante (Apple-style, overlay anclado arriba) ── */
.md-search-wrap {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  max-width: 560px;
  margin: 0 auto;
  z-index: 150;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--md-border);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.06);
  animation: mdSearchSlideDown .22s cubic-bezier(.32,.72,0,1);
}
.md-search-wrap.hidden { display: none; }
@keyframes mdSearchSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.md-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: rgba(120,120,128,0.12);
  border-radius: 12px;
  color: var(--md-text-muted);
  transition: background .18s ease, box-shadow .2s ease;
  border: 1px solid transparent;
  cursor: text;
}
.md-search:focus-within {
  background: #fff;
  border-color: rgba(10,132,255,0.35);
  box-shadow: 0 0 0 4px rgba(10,132,255,0.12);
  color: var(--md-text);
}
.md-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}

#mdSearchInput {
  appearance: none;
  border: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--md-text);
  letter-spacing: -0.01em;
  outline: none;
  padding: 0;
  height: 100%;
}
#mdSearchInput::placeholder {
  color: var(--md-text-muted);
  opacity: 1;
}
#mdSearchInput::-webkit-search-cancel-button,
#mdSearchInput::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.md-search-clear {
  appearance: none;
  border: 0;
  background: rgba(120,120,128,0.2);
  color: #6b7280;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.md-search-clear:hover { background: rgba(120,120,128,0.3); color: #111; }
.md-search-clear.hidden { display: none; }

.md-search-cancel {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--md-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 2px;
  flex-shrink: 0;
}
.md-search-cancel.hidden { display: none; }

/* ─── Búsquedas rápidas (chips) ─── */
.md-quick-search {
  margin-top: 8px;
  padding: 10px 8px 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: mdQsFade .18s ease;
}
.md-quick-search.hidden { display: none; }
@keyframes mdQsFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.md-quick-search-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--md-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 4px 8px;
}
.md-quick-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.md-qs-chip {
  appearance: none;
  border: 0;
  background: rgba(120,120,128,0.12);
  color: var(--md-text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.md-qs-chip:hover { background: rgba(120,120,128,0.2); }
.md-qs-chip:active { transform: scale(.96); }
.md-qs-chip .md-qs-emoji { font-size: 0.95rem; }

/* ── Sin resultados (al filtrar) ── */
.md-no-results {
  text-align: center;
  padding: 40px 24px 20px;
  max-width: 520px;
  margin: 0 auto;
}
.md-no-results.hidden { display: none; }
.md-no-results-emoji { font-size: 2rem; margin-bottom: 8px; opacity: 0.85; }
.md-no-results-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--md-text);
  letter-spacing: -0.01em;
}
.md-no-results-sub {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--md-text-muted);
}

/* ── Tabs de categoría (Apple segmented) ── */
.md-cat-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--md-border);
  position: sticky;
  top: 72px;
  z-index: 9;
  -webkit-overflow-scrolling: touch;
}
.md-cat-tabs::-webkit-scrollbar { height: 0; }
.md-cat-tab {
  flex-shrink: 0;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(120,120,128,0.12);
  color: var(--md-text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.1;
  cursor: pointer;
  border: 0;
  transition: background .15s ease, color .15s ease, transform .12s ease;
  letter-spacing: -0.01em;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.md-cat-tab:hover { background: rgba(120,120,128,0.18); }
.md-cat-tab:active { transform: scale(.97); }
.md-cat-tab.active {
  background: var(--md-text);
  color: #fff;
  font-weight: 700;
}
.md-cat-tabs-loading {
  color: var(--md-text-muted);
  font-size: .85rem;
  padding: 4px;
}

/* ── Lista de productos ── */
.md-menu-list {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.md-cat-section {
  margin-bottom: 32px;
  scroll-margin-top: 160px;
}
.md-cat-section.md-hidden { display: none; }
.md-cat-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--md-text);
  padding: 4px 0 8px;
  margin-bottom: 10px;
  border-bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.md-cat-title-icon { font-size: 1.25rem; }
.md-cat-count {
  margin-left: auto;
  font-size: .7rem;
  color: var(--md-text-muted);
  font-weight: 500;
  background: rgba(120,120,128,0.12);
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0;
}

.md-item {
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--md-shadow);
  transition: transform .15s ease, box-shadow .2s ease;
}
.md-item.md-hidden { display: none; }
.md-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--md-shadow-lg);
}
.md-item-img {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
}
.md-item-img-placeholder {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.md-item-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.md-item-name {
  font-size: .98rem;
  font-weight: 600;
  color: var(--md-text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.md-item-desc {
  font-size: .82rem;
  color: var(--md-text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.md-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.md-item-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--md-text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.md-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  transition: transform .1s, background .15s;
  user-select: none;
}
.md-like-btn:hover { background: #fecaca; }
.md-like-btn:active { transform: scale(.94); }
.md-like-btn.liked {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-color: #dc2626;
  animation: likePop .4s ease;
}
.md-like-btn .heart { font-size: 1rem; }
@keyframes likePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  70%  { transform: scale(.95); }
  100% { transform: scale(1); }
}
.md-like-count { font-variant-numeric: tabular-nums; }

/* ── Loading & footer ── */
.md-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--md-text-muted);
}
.md-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--md-border);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.md-footer {
  text-align: center;
  padding: 24px 20px 40px;
  color: var(--md-text-muted);
  font-size: .82rem;
}
.md-footer p:first-child { font-size: 1rem; color: var(--md-text); font-weight: 700; margin-bottom: 4px; }
.md-footer-hint { font-size: .72rem; }

/* ── Toast ── */
.md-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  z-index: 100;
  max-width: 90%;
  text-align: center;
  animation: toastIn .3s ease;
}
.md-toast.hidden { display: none; }
@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

@media (max-width: 480px) {
  .md-topbar h1 { font-size: 1.1rem; }
  .md-item-img, .md-item-img-placeholder { width: 60px; height: 60px; }
  .md-item { padding: 10px 12px; gap: 10px; }
  .md-item-name { font-size: .92rem; }
}

/* ── Preview de producto (imagen grande) ── */
.menu-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: mpFadeIn .2s ease;
}
.menu-preview-overlay.hidden { display: none; }
@keyframes mpFadeIn { from { opacity: 0; } to { opacity: 1; } }

.menu-preview-card {
  background: var(--md-surface, #fff);
  border-radius: 16px;
  max-width: 380px;
  width: 92%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  position: relative;
  animation: mpCardIn .25s cubic-bezier(.32,.72,0,1);
}
@keyframes mpCardIn {
  from { transform: scale(.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}
.menu-preview-card img {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  background: #f8fafc;
  display: block;
}
.menu-preview-info {
  padding: 14px 16px 18px;
}
.menu-preview-info h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--md-text, #0f172a);
  margin: 0 0 5px;
}
.menu-preview-info p {
  font-size: .84rem;
  color: var(--md-text-muted, #64748b);
  margin: 0 0 8px;
  line-height: 1.4;
}
.menu-preview-info span {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--md-primary, #2563EB);
}
.menu-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  border: 0;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.menu-preview-close:hover { background: rgba(0,0,0,.7); }
.md-item-img { cursor: pointer; }

/* ═══ Carrusel de publicidad ═══════════════════════════════════════ */
.ads-carousel { position: relative; width: 100%; max-width: 900px; margin: 10px auto 16px; border-radius: 14px; overflow: hidden; background: #0f172a; aspect-ratio: 16/6; min-height: 120px; }
.ads-carousel.hidden { display: none; }
.ads-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; color: #fff; cursor: default; }
.ads-slide.active { opacity: 1; pointer-events: auto; }
.ads-slide.has-link { cursor: pointer; }
.ads-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ads-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0)); }
.ads-caption h4 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.ads-caption p { margin: 2px 0 0; font-size: .9rem; opacity: .95; }
.ads-dots { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.ads-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; border: 0; padding: 0; }
.ads-dot.active { background: #fff; }

/* ─── MenuConfig — modificadores aplicados por /api/menu-config ─── */
body.md-hide-prices .md-item-price { display: none; }
body.md-no-likes .md-like-btn { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   COMUNIDAD — reacciones, ranking en vivo, badges
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Reacciones ricas (sustituye al botón ♥ cuando está activo) ─── */
.md-react-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  min-width: 0;
  padding-bottom: 2px;
}
.md-react-bar::-webkit-scrollbar { display: none; }
.md-react-btn {
  appearance: none;
  border: 0;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 8px 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
  min-height: 30px;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}
.md-react-btn:hover { background: #e2e8f0; }
.md-react-btn:active { transform: scale(.92); }
.md-react-btn .md-react-emoji {
  font-size: 1.05rem;
  line-height: 1;
  filter: grayscale(.2);
  transition: filter .15s, transform .18s;
}
.md-react-btn .md-react-count {
  min-width: 0;
  text-align: left;
}
.md-react-btn .md-react-count:empty { display: none; }
.md-react-btn.active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  box-shadow: 0 2px 6px rgba(251,191,36,.3);
}
.md-react-btn.active .md-react-emoji { filter: none; transform: scale(1.08); }
.md-react-btn.md-react-pop .md-react-emoji { animation: mdReactPop .35s ease; }
@keyframes mdReactPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4) rotate(-8deg); }
  75%  { transform: scale(.95) rotate(4deg); }
  100% { transform: scale(1.08); }
}

/* ─── Ranking en vivo (Apple-like) ─── */
.md-ranking {
  margin: 14px 16px 4px;
  padding: 14px;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: 18px;
  box-shadow: var(--md-shadow);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.md-rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}
.md-rank-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--md-text);
  letter-spacing: -0.02em;
}
.md-rank-sub {
  font-size: .7rem;
  color: var(--md-text-muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.md-rank-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.md-rank-scroller::-webkit-scrollbar { display: none; }
.md-rank-card {
  flex: 0 0 auto;
  width: 128px;
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.md-rank-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.md-rank-pos {
  position: absolute;
  top: 6px; left: 6px;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(234,88,12,.3);
}
.md-rank-img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  background: #f1f5f9;
  display: block;
}
.md-rank-img-ph {
  display: grid;
  place-content: center;
  font-size: 2rem;
  color: #94a3b8;
}
.md-rank-name {
  margin-top: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
  min-height: 2.4em;
}
.md-rank-meta {
  margin-top: 2px;
  font-size: .7rem;
  color: #64748b;
  font-weight: 600;
}

/* ─── Badges del cliente ─── */
.md-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 16px 0;
}
.md-badge {
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .75rem;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}

/* ═══════════════════════════════════════════════════════════════════════
   DOCK flotante de comunidad
   ═══════════════════════════════════════════════════════════════════════ */
.md-dock {
  position: fixed;
  right: 14px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}
.md-dock.hidden { display: none; }
.md-dock-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(15,23,42,.88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #fff;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.md-dock-btn:hover  { background: rgba(15,23,42,.95); }
.md-dock-btn:active { transform: scale(.95); }
.md-dock-btn[hidden] { display: none !important; }
.md-dock-emoji { font-size: 1.1rem; display: inline-flex; align-items: center; }
.md-dock-btn-search {
  background: rgba(255,255,255,.95);
  color: var(--md-text);
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.md-dock-btn-search:hover { background: #fff; }
.md-dock-btn-search .md-dock-emoji { color: var(--md-text); }
.md-dock.md-dock-search-open .md-dock-btn-search {
  background: var(--md-primary);
  color: #fff;
  border-color: transparent;
}
.md-dock.md-dock-search-open .md-dock-btn-search .md-dock-emoji { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   SHEET modal (bottom slide)
   ═══════════════════════════════════════════════════════════════════════ */
.md-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
}
.md-sheet.hidden { display: none; }
.md-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: sheetFadeIn .2s ease;
}
.md-sheet-card {
  position: relative;
  background: var(--md-surface);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 50px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  animation: sheetSlideUp .3s cubic-bezier(.32,.72,0,1);
  overflow: hidden;
}
@keyframes sheetFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.md-sheet-handle {
  width: 42px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 9px auto 0;
}
.md-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
}
.md-sheet-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--md-text);
  letter-spacing: -0.01em;
}
.md-sheet-close {
  appearance: none;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: .95rem;
  cursor: pointer;
}
.md-sheet-body {
  padding: 6px 18px 24px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* ─── Formularios dentro del sheet (Apple-style) ─── */
.md-sheet-form { display: grid; gap: 10px; margin-bottom: 14px; }
.md-sheet-row  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.md-sheet-row label { font-size: .78rem; font-weight: 500; color: var(--md-text-muted); }
.md-sheet-input, .md-sheet-textarea {
  appearance: none;
  border: 1px solid var(--md-border);
  border-radius: 12px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: .95rem;
  width: 100%;
  background: #fff;
  color: var(--md-text);
  letter-spacing: -0.01em;
  transition: border-color .15s ease, box-shadow .2s ease;
}
.md-sheet-input::placeholder,
.md-sheet-textarea::placeholder { color: var(--md-text-muted); }
.md-sheet-input:focus, .md-sheet-textarea:focus {
  outline: 0;
  border-color: rgba(10,132,255,0.45);
  box-shadow: 0 0 0 4px rgba(10,132,255,0.12);
}
.md-sheet-textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
.md-sheet-btn {
  appearance: none;
  border: 0;
  background: var(--md-primary);
  color: #fff;
  padding: 13px 18px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10,132,255,.2);
  transition: background .15s ease, transform .1s ease;
}
.md-sheet-btn:hover { background: var(--md-primary-dark); }
.md-sheet-btn:active { transform: scale(.98); }
.md-sheet-btn[disabled] { opacity: .5; cursor: not-allowed; }
.md-sheet-btn-ghost {
  background: rgba(120,120,128,0.12);
  color: var(--md-text);
  box-shadow: none;
}
.md-sheet-btn-ghost:hover { background: rgba(120,120,128,0.18); }

.md-form-hint {
  font-size: .78rem;
  color: var(--md-text-muted);
  text-align: center;
  margin: 2px 4px 0;
  letter-spacing: -0.005em;
}

/* ─── Photo picker Apple-style ─── */
.md-file-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.md-photo-picker { display: block; }
.md-photo-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(120,120,128,0.08);
  border: 1px dashed rgba(120,120,128,0.35);
  border-radius: 12px;
  color: var(--md-text);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.md-photo-btn:hover {
  background: rgba(120,120,128,0.14);
  border-color: var(--md-primary);
}
.md-photo-btn:active { transform: scale(.99); }
.md-photo-btn.hidden { display: none; }
.md-photo-ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(10,132,255,0.15), rgba(10,132,255,0.08));
  display: grid;
  place-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.md-photo-lbl { flex: 1; text-align: left; color: var(--md-text); font-weight: 500; }
.md-photo-hint {
  font-size: .78rem;
  color: var(--md-text-muted);
  font-weight: 400;
}

.md-photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--md-border);
  border-radius: 12px;
}
.md-photo-preview.hidden { display: none; }
.md-photo-preview img {
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--md-bg);
}
.md-photo-preview-meta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.md-photo-preview-meta > span:first-child {
  font-size: .86rem;
  color: var(--md-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.md-photo-remove {
  appearance: none;
  border: 0;
  width: 24px; height: 24px;
  border-radius: 999px;
  background: rgba(120,120,128,0.2);
  color: var(--md-text);
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  transition: background .15s ease;
}
.md-photo-remove:hover { background: rgba(255,59,48,0.18); color: #ff3b30; }

/* ─── Rating estrellas ─── */
.md-stars { display: inline-flex; gap: 2px; cursor: pointer; font-size: 1.2rem; }
.md-stars .md-star { color: #cbd5e1; transition: color .1s, transform .1s; }
.md-stars .md-star.on { color: #f59e0b; }
.md-stars .md-star:hover { transform: scale(1.15); }

/* ─── Botón de reseña inline en cada producto ─── */
.md-reviews-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  margin-left: 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: .72rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: background .15s;
}
.md-reviews-link:hover { background: #e0e7ff; }

/* ─── Moments (muro) ─── */
.md-mom-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.md-mom-card {
  background: #f8fafc;
  border: 1px solid var(--md-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.md-mom-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e2e8f0;
}
.md-mom-body { padding: 8px 10px 10px; }
.md-mom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.md-mom-who { font-size: .75rem; font-weight: 700; color: #0f172a; }
.md-mom-del {
  background: transparent;
  border: 0;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: .95rem;
  color: #94a3b8;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.md-mom-del:hover { background: rgba(255,59,48,.08); color: #FF3B30; }
.md-mom-txt { font-size: .78rem; color: #475569; margin-top: 3px; line-height: 1.35; }
.md-mom-time { font-size: .65rem; color: #94a3b8; margin-top: 4px; }

/* ─── Check-ins ─── */
.md-ci-list { display: grid; gap: 8px; }
.md-ci-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--md-border);
}
.md-ci-emoji {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  display: grid;
  place-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.md-ci-meta { flex: 1; min-width: 0; }
.md-ci-who { font-weight: 700; font-size: .88rem; color: #0f172a; }
.md-ci-sub { font-size: .72rem; color: #64748b; }

/* ─── Mesa viva: geo-gate UI ─── */
.md-geo-gate {
  text-align: center;
  padding: 18px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.md-geo-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(10,132,255,0.16), rgba(10,132,255,0.06));
  color: var(--md-primary);
  font-size: 1.8rem;
  display: grid;
  place-content: center;
  box-shadow: 0 4px 14px rgba(10,132,255,0.12);
}
.md-geo-icon-block {
  background: linear-gradient(135deg, rgba(255,59,48,0.18), rgba(255,59,48,0.06));
  color: #ff3b30;
  box-shadow: 0 4px 14px rgba(255,59,48,0.12);
}
.md-geo-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--md-text);
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.md-geo-sub {
  font-size: .86rem;
  color: var(--md-text-muted);
  max-width: 320px;
  line-height: 1.4;
}
.md-geo-gate .md-sheet-btn { margin-top: 10px; min-width: 180px; }

.md-geo-ok {
  display: inline-block;
  align-self: flex-start;
  margin: 2px 0 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(52,199,89,0.14);
  color: #1e7a3a;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─── Chat de mesa ─── */
.md-chat-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 48vh;
  overflow-y: auto;
  padding: 4px 2px 10px;
}
.md-chat-msg {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  max-width: 82%;
}
.md-chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.md-chat-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  display: grid;
  place-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.md-chat-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: .88rem;
  line-height: 1.35;
  border-top-left-radius: 4px;
}
.md-chat-msg.mine .md-chat-bubble {
  background: linear-gradient(135deg, var(--md-primary), var(--md-primary-dark));
  color: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}
.md-chat-who { font-size: .68rem; color: #64748b; margin-bottom: 2px; }
.md-chat-msg.mine .md-chat-who { color: #bfdbfe; text-align: right; }
.md-chat-compose {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--md-border);
  margin-top: 8px;
}
.md-chat-compose .md-sheet-input { flex: 1; }

/* ─── Reseñas listado ─── */
.md-rev-list { display: grid; gap: 10px; }
.md-rev-item {
  background: #f8fafc;
  border: 1px solid var(--md-border);
  border-radius: 12px;
  padding: 10px 12px;
}
.md-rev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.md-rev-who { font-weight: 700; font-size: .85rem; color: #0f172a; }
.md-rev-who .md-rev-av { margin-right: 4px; }
.md-rev-stars { color: #f59e0b; font-size: .85rem; letter-spacing: 1px; }
.md-rev-txt { font-size: .85rem; color: #334155; line-height: 1.4; }
.md-rev-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.md-rev-time { font-size: .7rem; color: #94a3b8; }
.md-rev-del {
  background: transparent;
  border: 0;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 1rem;
  color: #94a3b8;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.md-rev-del:hover { background: rgba(255,59,48,.08); color: #FF3B30; }
.md-empty {
  text-align: center;
  padding: 24px 12px;
  color: #94a3b8;
  font-size: .88rem;
}
