:root {
  --paper: #f8f3ea;
  --ink: #221c18;
  --muted: #74685e;
  --accent: #e2552d;
  --accent-dark: #c2431f;
  --line: #ddd1c1;
  --font-titulo: "Fraunces", Georgia, serif;
  --font-texto: "Inter", system-ui, sans-serif;
}

/* Los menús de clientes solo definen --paper, --ink y --accent; el resto se deriva. */
:root.tema-cliente {
  --muted: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 18%, var(--paper));
  --accent-dark: color-mix(in srgb, var(--accent) 82%, #000);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-texto);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 96px; /* espacio para la barra de ventas */
}

h1, h2, h3 { font-family: var(--font-titulo); }
a { color: inherit; text-decoration: none; }

/* Barra superior del demo */
.demo-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--ink); color: #fff; font-size: .85rem;
}
.demo-back { font-weight: 600; }
.demo-back:hover { color: #f2b544; }
.demo-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  border: 1px solid rgba(255,255,255,.35); padding: 4px 10px; border-radius: 999px;
}

/* Menú */
.menu { max-width: 760px; margin: 0 auto; padding: 48px 20px 24px; }
.menu-header { text-align: center; margin-bottom: 40px; }
.menu-kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; color: var(--muted); }
.menu-header h1 { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 700; margin: 6px 0 14px; }
.menu-hint { color: var(--muted); font-size: .95rem; }

.menu-section { margin-bottom: 40px; }
.menu-section h2 {
  font-size: 1.5rem; font-style: italic; font-weight: 500; text-align: center;
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
}
.menu-section h2::before, .menu-section h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font: inherit; color: inherit; padding: 12px 14px; border-radius: 12px;
}
.item-row { display: flex; align-items: baseline; gap: 8px; }
.item-name { font-weight: 600; font-size: 1.05rem; }
.item-dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); min-width: 20px; }
.item-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.item-desc { color: var(--muted); font-size: .9rem; margin-top: 2px; }

.item.has-3d { cursor: pointer; transition: background .2s; }
.item.has-3d:hover, .item.has-3d:focus-visible { background: #fff; box-shadow: 0 6px 20px -12px rgba(60,30,10,.35); outline: none; }
.item.has-3d:focus-visible { box-shadow: 0 0 0 3px var(--accent); }

.badge-3d {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-texto); font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; background: var(--accent); padding: 2px 7px; border-radius: 6px;
  vertical-align: 2px; margin-left: 6px;
}
.badge-tag {
  display: inline-block; font-family: var(--font-texto); font-size: .66rem; font-weight: 600;
  color: var(--accent); border: 1px solid currentColor; padding: 1px 7px; border-radius: 999px;
  vertical-align: 2px; margin-left: 6px; text-transform: uppercase; letter-spacing: .05em;
}
.item-cta { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--accent); }

/* Especialidades de la casa: ventanitas 3D que giran solas */
.especiales-lista { margin-bottom: 16px; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 18px; padding: 6px; }
.especiales-lista[data-n="1"] { --n: 1; max-width: 440px; margin: 0 auto; }
.especiales-lista[data-n="2"] { --n: 2; }
.especial {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  background: color-mix(in srgb, var(--paper) 88%, #fff);
  border: 1.5px solid var(--accent); border-radius: 20px; padding: 8px 8px 14px;
  /* Doble marco: borde de acento + anillo fino separado por el color del papel */
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent),
    0 18px 36px -24px rgba(40, 20, 5, .55);
  transition: transform .2s, box-shadow .2s;
}
.especial:hover { transform: translateY(-3px); }
.especial:focus-visible { outline: 3px solid var(--accent); outline-offset: 7px; }
.especial-marco { position: relative; display: block; border-radius: 14px; overflow: hidden; }
.especial-stage {
  position: relative; display: block; aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 40%, #3a2c22 0%, #16110e 75%);
}
.especial-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.especial-stage .spinner { position: absolute; top: 50%; left: 50%; margin: -19px 0 0 -19px; }
.especial-stage.sin-3d::after {
  content: "3D"; position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,255,255,.35); font-weight: 700; letter-spacing: .1em;
}
.especial-sello {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: var(--accent); color: #fff; font-size: .64rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,.5);
}
.especial-ampliar {
  position: absolute; right: 10px; bottom: 10px; z-index: 1;
  background: rgba(255,255,255,.16); color: #fff; font-size: .7rem; font-weight: 600;
  padding: 4px 8px; border-radius: 8px; backdrop-filter: blur(6px);
}
.especial-info { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 6px 0; }
.especial-nombre { font-family: var(--font-titulo); font-weight: 600; font-size: 1.08rem; line-height: 1.25; }
.especial-precio { font-weight: 700; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.especial-desc {
  padding: 0 6px; color: var(--muted); font-size: .84rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Regreso al sitio del restaurante */
.menu-volver {
  display: inline-block; margin-bottom: 20px; font-size: .85rem; font-weight: 600;
  color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .2s, border-color .2s;
}
.menu-volver:hover, .menu-volver:focus-visible { color: var(--ink); border-color: var(--ink); }

/* Contacto: pedir, llamar, cómo llegar */
.menu-contacto {
  margin: 8px 0 32px; padding: 28px 24px; text-align: center;
  border: 1.5px solid var(--accent); border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 88%, #fff);
}
.menu-contacto h2 { font-size: 1.45rem; font-style: italic; font-weight: 500; margin-bottom: 14px; }
.contacto-lugar { margin-bottom: 18px; }
.contacto-sucursal { font-weight: 600; }
.contacto-direccion { color: var(--muted); font-size: .92rem; margin: 2px 0 6px; }
.contacto-mapa { font-size: .85rem; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.contacto-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn-contacto {
  display: inline-block; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1.5px solid var(--ink); color: var(--ink); transition: background .2s, color .2s;
}
.btn-contacto:hover, .btn-contacto:focus-visible { background: var(--ink); color: var(--paper); }
.btn-contacto.principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-contacto.principal:hover, .btn-contacto.principal:focus-visible { background: var(--accent-dark); border-color: var(--accent-dark); }
@media (max-width: 560px) { .btn-contacto { width: 100%; } }

.menu-ornament { display: block; margin: 0 auto 8px; max-height: 40px; max-width: 60%; }

/* Encabezado de menús de clientes (menu.html) */
.menu-cover { width: 100%; height: clamp(160px, 34vw, 280px); object-fit: cover; display: block; }
.menu-logo { display: block; margin: 0 auto 12px; max-height: 96px; max-width: 70%; object-fit: contain; }
.menu-pie { width: 100%; height: auto; max-height: 360px; object-fit: cover; display: block; margin-top: 24px; }
.menu-cover[hidden], .menu-logo[hidden], .menu-pie[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-credit { text-align: center; font-size: .75rem; color: var(--muted); margin: 28px 0 8px; }
.menu-credit a { text-decoration: underline; text-underline-offset: 3px; }
body.sin-barra { padding-bottom: 24px; }
.menu-status { text-align: center; color: var(--muted); padding: 64px 20px 80px; }
.menu-status h2 { color: var(--ink); font-size: 1.6rem; font-weight: 500; margin-bottom: 8px; }

.menu-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 16px; }

/* Barra de ventas */
.sales-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(720px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; padding: 12px 12px 12px 20px; border-radius: 999px;
  box-shadow: 0 20px 40px -16px rgba(0,0,0,.5); z-index: 10; font-size: .92rem;
}
.btn-sales {
  background: var(--accent); color: #fff; font-weight: 600; padding: 10px 18px;
  border-radius: 999px; white-space: nowrap; transition: background .2s;
}
.btn-sales:hover { background: var(--accent-dark); }

/* Visor 3D */
.viewer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.viewer[hidden] { display: none; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(20, 14, 10, .72); backdrop-filter: blur(4px); animation: fade .25s ease; }
.viewer-panel {
  position: relative; width: min(900px, 100%); height: min(720px, 100%);
  background: #16110e; border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column; animation: pop .3s ease;
}
.viewer-stage {
  position: relative; flex: 1; min-height: 0; touch-action: none;
  background: radial-gradient(circle at 50% 40%, #3a2c22 0%, #16110e 70%);
}
.viewer-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
.viewer-stage canvas:active { cursor: grabbing; }
.viewer-loading, .viewer-error {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: #e9dfd5; font-size: .95rem; pointer-events: none; text-align: center; padding: 24px;
}
.viewer-loading[hidden], .viewer-error[hidden] { display: none; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
.viewer-gesture {
  position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.55); font-size: .78rem; pointer-events: none;
}
.viewer-info {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 18px 22px; background: var(--paper);
}
.viewer-info h2 { font-size: 1.35rem; }
.viewer-info p { color: var(--muted); font-size: .92rem; }
.viewer-price { font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.viewer-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 1rem; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .2s;
}
.viewer-close:hover { background: rgba(255,255,255,.28); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

@media (max-width: 560px) {
  .viewer { padding: 0; }
  .viewer-panel { border-radius: 0; height: 100%; }
  .sales-bar { flex-direction: column; border-radius: 20px; padding: 14px; text-align: center; }
  .sales-bar .btn-sales { width: 100%; text-align: center; }
  body { padding-bottom: 140px; }
  body.sin-barra { padding-bottom: 24px; }
  /* En celular, 2 o 3 especiales se deslizan de lado; se asoma el siguiente. */
  .especiales-lista:not([data-n="1"]) {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -20px; padding: 6px 20px 12px;
  }
  .especiales-lista:not([data-n="1"])::-webkit-scrollbar { display: none; }
  .especiales-lista:not([data-n="1"]) .especial { flex: 0 0 80%; scroll-snap-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
