:root {
  --paper: #f8f3ea;
  --ink: #221c18;
  --muted: #74685e;
  --accent: #e2552d;
  --accent-dark: #c2431f;
  --line: #ddd1c1;
}

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

body {
  font-family: "Inter", system-ui, sans-serif;
  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: "Fraunces", Georgia, serif; }
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: "Inter", sans-serif; 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;
}
.item-cta { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--accent); }

.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; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
