/* Casti's · la carta (se abre desde el QR de la mesa). Papel sobre terciopelo, como la carta física. */

.carta-page {
  --bg: var(--terciopelo); --fg: var(--tinta); --fg2: #4a2236; --focus: var(--tinta);
  --tag-bg: var(--tinta); --tag-fg: var(--terciopelo-claro); --tag-hover: #1b3d3e;
  --hdr-bg: var(--terciopelo); --hdr-fg: var(--tinta);
  background: var(--terciopelo); color: var(--tinta);
  min-height: 100svh;
}
html:has(.carta-page) { background: var(--terciopelo); scrollbar-color: var(--tinta) var(--terciopelo); }
.carta-page ::selection { background: var(--tinta); color: var(--terciopelo-claro); }

.cp-top {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter) 0;
}
.cp-top .brand { margin-right: 0; }

.cp-main { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) calc(48px + env(safe-area-inset-bottom)); }
.cp-title {
  margin: 22px 0 18px;
  font-size: clamp(3.4rem, 13vw, 6rem); line-height: .86; letter-spacing: -.035em; font-weight: 800; font-stretch: 75%;
}
.cp-label { margin: 0 0 6px; font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

/* ---------- wifi (solo al entrar desde la mesa) ---------- */
.cp-wifi {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 16px;
  margin: 0 0 22px; padding: 16px 18px; border-radius: 6px;
  background: var(--tinta); color: #f4eee8;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .16), 0 22px 40px -24px rgba(0, 0, 0, .6);
  --tag-bg: var(--terciopelo); --tag-fg: var(--tinta); --tag-hover: var(--terciopelo-claro); --focus: #ff8fc8;
}
.cp-wifi[hidden] { display: none; }
.cp-wifi__icon { width: 30px; height: 30px; color: var(--terciopelo); }
.cp-wifi .cp-label { color: var(--terciopelo-claro); }
.cp-wifi__info p { margin: 0; color: #b9d0cb; font-size: .95rem; }
.cp-wifi__info b { color: #f4eee8; font-size: 1.1rem; font-weight: 800; letter-spacing: .01em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; user-select: all; }
.cp-wifi__help { grid-column: 1 / -1; margin: 0; font-size: .92rem; color: var(--terciopelo-claro); font-weight: 600; }
.cp-wifi__help:empty { display: none; }

/* ---------- índice de secciones ---------- */
.cp-index {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 18px; padding: 10px var(--gutter) 12px;
  background: var(--terciopelo);
}
.cp-index::-webkit-scrollbar { display: none; }
.cp-index.is-stuck { box-shadow: 0 10px 20px -16px rgba(15, 42, 43, .6); }
.cp-index[hidden] { display: none; }
.cp-index a {
  flex: none; display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 6px;
  background: #fff; color: var(--tinta); box-shadow: inset 0 0 0 1.5px rgba(15, 42, 43, .28);
  font-weight: 750; font-stretch: 88%; text-decoration: none; white-space: nowrap;
}
.cp-index a:hover { box-shadow: inset 0 0 0 1.5px var(--tinta); }
.cp-index a[aria-current="true"] { background: var(--tinta); color: var(--papel); box-shadow: none; }

.cp-status { margin: 10px 0 18px; font-weight: 600; color: #4a2236; }
.cp-status:empty { display: none; }

/* ---------- secciones (tarjetas de papel) ---------- */
.cp-list { display: grid; gap: 34px; align-items: start; }
.cp-sec {
  position: relative; scroll-margin-top: 76px;
  background: var(--papel); color: var(--tinta);
  padding: 9px 9px 12px; border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .16), 0 22px 44px -22px rgba(0, 0, 0, .5);
  rotate: var(--tilt, 0deg);
}
.cp-sec:nth-child(3n+1) { --tilt: -.5deg; }
.cp-sec:nth-child(3n+2) { --tilt: .45deg; }
.cp-sec::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 8px; background: var(--papel);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
}
.cp-photo { position: relative; overflow: hidden; border-radius: 2px; aspect-ratio: 16 / 9; background: #20302f; }
.cp-photo::before {
  content: ""; position: absolute; z-index: 2; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--terciopelo);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6), 0 0 0 3px rgba(247, 243, 238, .9);
}
.cp-photo img { width: 100%; height: 100%; object-fit: cover; }
.cp-body { padding: 18px 12px 4px; }
.cp-sec h2 { margin: 0; font-size: clamp(2.2rem, 7vw, 2.8rem); line-height: .9; letter-spacing: -.02em; font-weight: 800; font-stretch: 75%; }
.cp-note { margin: 8px 0 0; color: var(--tinta-suave); font-weight: 600; }
.cp-grp { margin: 20px 0 2px; font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #4a2236; }
.cp-items { list-style: none; margin: 12px 0 0; padding: 0; }
.cp-grp + .cp-items { margin-top: 2px; }
.cp-items li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 16px;
  padding: 11px 0; border-top: 1px dashed rgba(15, 42, 43, .3);
}
.cp-name { font-size: 1.12rem; font-weight: 650; line-height: 1.25; }
.cp-detail { grid-column: 1; font-size: .92rem; color: var(--tinta-suave); line-height: 1.35; }
.cp-price { grid-row: 1; grid-column: 2; font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-price--ask { font-weight: 650; color: var(--tinta-suave); }
.cp-items li.is-out .cp-name { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--tinta-suave); }
.cp-items li.is-out .cp-price { color: var(--tinta-suave); text-decoration: line-through; }
.cp-out {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 4px; vertical-align: .12em;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: #4a2236; box-shadow: inset 0 0 0 1.5px #4a2236;
}

/* ---------- pie ---------- */
.cp-foot { margin-top: 48px; padding-top: 22px; border-top: 2px dashed rgba(15, 42, 43, .3); }
.cp-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-weight: 600; }
.cp-notes li { display: flex; align-items: center; gap: 10px; }
.cp-notes .age-badge { color: var(--tinta); }
.cp-updated { margin: 14px 0 0; color: #4a2236; font-size: .92rem; font-variant-numeric: tabular-nums; }
.cp-updated:empty { display: none; }
.cp-legal { margin: 10px 0 0; font-size: .85rem; color: #4a2236; }
.cp-legal a { color: #4a2236; }
.cp-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 26px; }
.cp-links .tag { white-space: normal; }

@media (min-width: 1000px) {
  .cp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 36px; }
  .cp-list .cp-sec:nth-child(even) { margin-top: 40px; }
}
@media (max-width: 420px) {
  .cp-wifi { grid-template-columns: auto minmax(0, 1fr); }
  .cp-wifi .tag { grid-column: 1 / -1; justify-content: center; }
  .langs button { min-width: 34px; padding: 6px 6px; }
}
