/* Mesa Velúmbar — Carta Digital QR v3 (Papel marfil #FCFBF9, Burdeos #3D222E, Carbón #231F20) */
:root {
  --mv-ivory: #fcfbf9;
  --mv-paper: #ffffff;
  --mv-soft: #f7f3ef;
  --mv-plum: #3d222e;
  --mv-plum-hover: #2d1822;
  --mv-plum-tint: #f5ecef;
  --mv-plum-border: #dfd0d6;
  --mv-charcoal: #231f20;
  --mv-muted: #5a4d53;
  --mv-rule: #e6dfd9;
  --mv-safe-bg: #eef6f1;
  --mv-safe-ink: #14532d;
  --mv-safe-border: #bbf7d0;
  --mv-hit-bg: #f8eff2;
  --mv-hit-border: #8b4c63;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.mv-page {
  margin: 0;
  background: var(--mv-ivory);
  color: var(--mv-charcoal);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--mv-plum); }
:focus-visible { outline: 3px solid var(--mv-plum); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--mv-plum); color: #fcfbf9;
  padding: 9px 14px; border-radius: 6px; z-index: 999; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 12px; }

/* Única referencia de ALISA Systems: banda fina superior discreta (32-36 px) */
.studio-bar {
  min-height: 34px;
  background: #f3eee9;
  border-bottom: 1px solid var(--mv-rule);
  color: var(--mv-muted);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  text-align: center;
  gap: 6px;
}

.studio-bar a {
  color: var(--mv-plum);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mv-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* Cabecera propia de Mesa Velúmbar + Bodegón */
.mv-header {
  margin-bottom: 22px;
}

.mv-title-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.mv-brand {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: clamp(28px, 6.4vw, 40px);
  line-height: 1.04;
  letter-spacing: 0.01em;
  color: var(--mv-plum);
  text-transform: uppercase;
}

.mv-tagline {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mv-charcoal);
}

.mv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.mv-btn-primary {
  background: var(--mv-plum);
  color: #fcfbf9;
}
.mv-btn-primary:hover { background: var(--mv-plum-hover); }

.mv-btn-outline {
  background: var(--mv-paper);
  color: var(--mv-plum);
  border-color: var(--mv-plum-border);
}
.mv-btn-outline:hover { border-color: var(--mv-plum); background: var(--mv-plum-tint); }

.mv-hero-figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--mv-rule);
  background: var(--mv-soft);
}

.mv-hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.mv-hero-cap {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--mv-muted);
  background: var(--mv-paper);
  border-top: 1px solid var(--mv-rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* Filtro interactivo 14 alérgenos UE */
.mv-filter {
  background: var(--mv-paper);
  border: 1px solid var(--mv-rule);
  border-radius: 12px;
  padding: 15px 16px;
  margin-bottom: 24px;
}

.mv-filter-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.mv-filter-head h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 18.5px;
  color: var(--mv-plum);
}

.mv-filter-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-mode-btn,
.filter-clear-btn {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--mv-plum-border);
  background: var(--mv-ivory);
  color: var(--mv-plum);
}

.filter-mode-btn[aria-pressed="true"] {
  background: var(--mv-plum);
  color: #fcfbf9;
  border-color: var(--mv-plum);
}

.filter-clear-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.allergen-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.allergen-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--mv-plum-border);
  background: var(--mv-plum-tint);
  color: var(--mv-plum);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.allergen-chip:hover {
  border-color: var(--mv-plum);
}

.allergen-chip .code-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--mv-paper);
  border: 1px solid var(--mv-plum-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--mv-plum);
}

.allergen-chip[aria-pressed="true"] {
  background: var(--mv-plum);
  border-color: var(--mv-plum);
  color: #fcfbf9;
}

.allergen-chip[aria-pressed="true"] .code-badge {
  background: #fcfbf9;
  border-color: #fcfbf9;
  color: var(--mv-plum);
}

.filter-status {
  margin: 12px 0 0;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--mv-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--mv-charcoal);
}

.empty-state {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--mv-plum-tint);
  border: 1px solid var(--mv-plum-border);
  color: var(--mv-plum);
  font-size: 13.5px;
}
.empty-state[hidden] { display: none; }

/* Secciones y platos de carta */
.menu-section {
  margin-bottom: 24px;
}

.menu-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 7px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid var(--mv-rule);
}

.menu-section-head h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 23px;
  color: var(--mv-plum);
}

.section-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--mv-muted);
}

.dish-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dish-card {
  background: var(--mv-paper);
  border: 1px solid var(--mv-rule);
  border-radius: 10px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.dish-card[hidden] { display: none; }

.dish-card.is-safe {
  border-left: 4px solid var(--mv-safe-ink);
}

.dish-card.is-contains-allergen {
  background: var(--mv-hit-bg);
  border-color: var(--mv-hit-border);
  border-left: 4px solid var(--mv-plum);
}

.dish-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.dish-top h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--mv-charcoal);
}

.dish-price {
  flex-shrink: 0;
  text-align: right;
  font-size: 16.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mv-plum);
}

.dish-vat {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mv-muted);
}

.dish-desc {
  margin: 3px 0 0;
  font-size: 14.5px;
  color: var(--mv-muted);
}

.dish-allergens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
}

.dish-allergen-label {
  font-weight: 700;
  color: var(--mv-charcoal);
}

.allergen-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mv-plum-tint);
  border: 1px solid var(--mv-plum-border);
  color: var(--mv-plum);
  font-weight: 600;
}

.allergen-tag.is-matched {
  background: var(--mv-plum);
  border-color: var(--mv-plum);
  color: #fcfbf9;
}

.allergen-none {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--mv-safe-bg);
  border: 1px solid var(--mv-safe-border);
  color: var(--mv-safe-ink);
  font-weight: 600;
}

.section-empty {
  margin: 0;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px dashed var(--mv-rule);
  background: var(--mv-paper);
  font-size: 13.5px;
  color: var(--mv-muted);
}
.section-empty[hidden] { display: none; }

/* Bloque QR + Descarga PDF */
.mv-qr-card {
  background: var(--mv-paper);
  border: 1px solid var(--mv-rule);
  border-radius: 12px;
  padding: 18px 16px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.mv-qr-frame {
  background: #ffffff;
  border: 1px solid var(--mv-rule);
  border-radius: 10px;
  padding: 10px;
  flex-shrink: 0;
}

.mv-qr-frame svg {
  width: 152px;
  height: 152px;
}

.mv-qr-body h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--mv-plum);
}

.mv-qr-body p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--mv-muted);
}

.mv-qr-url {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--mv-soft);
  border: 1px solid var(--mv-rule);
  font-size: 12.5px;
  color: var(--mv-charcoal);
  word-break: break-all;
}

/* Leyenda 14 alérgenos + legal */
.mv-legend {
  background: var(--mv-paper);
  border: 1px solid var(--mv-rule);
  border-radius: 12px;
  padding: 18px 16px;
}

.mv-legend h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--mv-plum);
}

.mv-legend-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--mv-muted);
}

.legend-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--mv-ivory);
  border: 1px solid var(--mv-rule);
  font-size: 13.5px;
  color: var(--mv-charcoal);
}

.legend-code {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--mv-plum);
  color: #fcfbf9;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.legal-box {
  margin: 0;
  background: var(--mv-soft);
  border-left: 3px solid var(--mv-plum);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mv-charcoal);
}

/* Pie propio del restaurante ficticio */
.mv-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--mv-rule);
  font-size: 12.5px;
  color: var(--mv-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mv-parent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1A1D26;
  font-weight: 600;
}

.mv-systems-mark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

@media (min-width: 640px) {
  .mv-qr-card {
    flex-direction: row;
    align-items: center;
    padding: 20px;
  }

  .legend-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .mv-wrap {
    padding: 28px 24px 56px;
  }

  .mv-title-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  .dish-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .legend-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media print {
  .studio-bar,
  .mv-filter,
  .mv-actions {
    display: none;
  }

  body.mv-page {
    background: #ffffff;
  }
}
.u-ml-8 { margin-left: 8px; }
