/* El Badulaque · carta digital
   Colores sacados del local: el rojo de la fachada, el toldo negro y el papel de la carta impresa. */
:root {
  --paper: #F3ECE0;
  --paper-2: #EAE0CF;
  --ink: #1C1917;
  --muted: #655B52;
  --red: #9C2F24;
  --line: rgba(28, 25, 23, .16);

  --serif: "DM Serif Display", Georgia, serif;
  --type: "Courier Prime", "Courier New", monospace;
  --sans: "Hanken Grotesk", system-ui, sans-serif;

  --bar-h: 64px;
  --edge: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --colw: 4.6rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--edge)); margin-inline: auto; padding-inline: var(--edge); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
main:focus { outline: none; }

/* ---------- barra superior ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding-inline: var(--edge);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar-logo { grid-column: 2; display: block; padding: 8px 4px; }
.bar-logo img { height: 42px; width: auto; }
.bar-back {
  grid-column: 1; justify-self: start;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font: 600 15px/1 var(--sans); text-decoration: none;
}
.bar-back[hidden] { display: none; }
.bar-back-long { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s ease; padding-bottom: 2px; }
.bar-back:hover .bar-back-long { background-size: 100% 1px; }
.bar-back-short { display: none; }

.lang { grid-column: 3; justify-self: end; position: relative; }
.lang select {
  appearance: none; -webkit-appearance: none;
  min-height: 44px; padding: 0 34px 0 14px;
  font: 600 15px/1 var(--sans); color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.lang select:hover { border-color: var(--ink); }
.lang::after {
  content: ""; position: absolute; right: 15px; top: 50%;
  width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); pointer-events: none;
}

/* ---------- portada: tres cartas ---------- */
.home { display: flex; flex-direction: column; min-height: calc(100svh - var(--bar-h)); }
.home-intro {
  padding-block: 18px;
  font: 400 15px/1.4 var(--sans); color: var(--muted); text-align: center;
}
.panels { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 6px 6px; }
.panel {
  position: relative; overflow: hidden; display: block; min-height: 420px;
  color: #fff; text-decoration: none; background: var(--ink);
}
.panel img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: var(--pos, 50% 50%);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.panel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 16, 14, .78) 0%, rgba(20, 16, 14, .25) 45%, rgba(20, 16, 14, 0) 70%);
}
.panel-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(20px, 3vw, 36px); }
.panel-title {
  display: inline-block;
  font: 400 clamp(40px, 4.6vw, 68px)/1 var(--serif);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  padding-bottom: 6px;
  transition: background-size .35s ease;
}
.panel-sub { display: block; margin-top: 8px; font: 500 16px/1.35 var(--sans); opacity: .92; }
.panel:hover img { transform: scale(1.03); }
.panel:hover .panel-title, .panel:focus-visible .panel-title { background-size: 100% 2px; }
.panel:focus-visible { outline-offset: -4px; outline-color: #fff; }

/* ---------- carta ---------- */
.carta-head { padding-top: clamp(24px, 4vw, 48px); padding-bottom: 8px; }
.switch { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.switch a {
  font: 400 clamp(30px, 4vw, 48px)/1.1 var(--serif);
  color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: flex-end; min-height: 48px; padding-bottom: 6px;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 0 3px no-repeat;
  transition: color .2s ease, background-size .3s ease;
}
.switch a:hover { color: var(--ink); }
.switch a[aria-current="page"] { color: var(--ink); background-size: 100% 3px; }

.chips {
  position: sticky; top: var(--bar-h); z-index: 15;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  margin-top: 16px;
}
.chips-track {
  display: flex; gap: 8px;
  max-width: calc(var(--max) + 2 * var(--edge)); margin-inline: auto;
  padding: 10px var(--edge);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.chips-track::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  font: 600 15px/1 var(--sans); white-space: nowrap; text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.chips a:hover { border-color: var(--ink); }
.chips a:active { transform: scale(.97); }
.chips a.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.sections { padding-top: 8px; padding-bottom: 72px; }
.sec {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 0 clamp(32px, 6vw, 96px);
  padding-block: clamp(36px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.sec:last-child { border-bottom: 0; }
.sec-side { align-self: start; position: sticky; top: calc(var(--bar-h) + 86px); }

/* La etiqueta negra, como en la carta impresa */
.label {
  display: inline-block;
  padding: 4px 14px 6px;
  background: var(--ink); color: var(--paper);
  font: 400 clamp(26px, 2.6vw, 34px)/1.1 var(--serif);
}
.sec-note { margin-top: 14px; color: var(--muted); font-size: 15px; max-width: 34ch; }
.sec-photo { margin-top: 24px; aspect-ratio: var(--ratio, 4 / 5); overflow: hidden; background: var(--paper-2); }
.sec-photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }

.sec-list { display: grid; gap: 32px; }
.group-photos { display: grid; gap: 8px; margin-bottom: 20px; }
.group-photos.is-multi { grid-template-columns: 1fr 1fr; }
.group-photo { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); }
.group-photos.is-multi .group-photo { aspect-ratio: 2 / 1; }
.group-photo img { width: 100%; height: 100%; object-fit: cover; }
.group-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--ink);
}
.group-title { font: 700 13px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.cols-head span { font: 600 12px/1.2 var(--sans); color: var(--muted); }

.item { padding-block: 14px; border-bottom: 1px dashed var(--line); }
.item:last-child { border-bottom: 0; }
.item-row { display: flex; align-items: baseline; gap: 10px; }
.item-name { font: 700 17px/1.35 var(--type); }
.leader { flex: 1; min-width: 16px; border-bottom: 1.5px dotted rgba(28, 25, 23, .35); transform: translateY(-4px); }
.prices {
  flex: none; display: grid; grid-template-columns: repeat(var(--cols, 1), var(--colw));
  text-align: right; font: 700 17px/1.35 var(--type); font-variant-numeric: tabular-nums;
}
.prices:not([style]) { grid-template-columns: auto; }
.cols-head { align-items: end; }
.item-desc { margin-top: 4px; color: var(--muted); font-size: 16px; max-width: 52ch; }
.item-extra .item-name { font-weight: 400; }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  padding: 2px 7px; border: 1px solid var(--red); border-radius: 999px;
  font: 600 11px/1.2 var(--sans); color: var(--red); letter-spacing: .02em;
}

/* ---------- promoción ---------- */
.promo { background: #E8572A; color: #fff; padding: 18px 20px; }
.promo-label { display: inline-block; font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; background: #fff; color: #C8401A; padding: 5px 8px; }
.promo-title { margin-top: 10px; font: 400 26px/1.15 var(--serif); }
.promo-text { margin-top: 4px; font-size: 15px; opacity: .95; }

/* ---------- alérgenos ---------- */
.als { display: inline-flex; gap: 3px; vertical-align: -3px; margin-left: 6px; }
.al {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(28, 25, 23, .28); color: var(--ink);
}
.al svg { width: 13px; height: 13px; }
.al-diet { background: #3F6B3A; border-color: #3F6B3A; color: #fff; }
.al-trace { border-style: dashed; border-color: rgba(28, 25, 23, .45); color: var(--muted); background: transparent; }
.legend { margin-top: 20px; }
.legend ul { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend li { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.legend p { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* ---------- pie ---------- */
.foot { background: var(--ink); color: var(--paper); padding-block: 56px; }
.foot-grid { display: grid; grid-template-columns: 4fr 4fr 4fr; gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.foot-logo { width: 180px; height: auto; filter: invert(1) brightness(1.8); opacity: .95; }
.foot-col { display: grid; gap: 2px; font-size: 16px; }
.foot-col p:not(:has(a)) { padding-block: 6px; }
.foot-col a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .25s ease;
  display: inline-block; padding-block: 10px;
}
.foot-col a:hover { background-size: 100% 1px; }
.foot-since { font: 400 22px/1.25 var(--serif); }
.foot-small { color: rgba(243, 236, 224, .7); font-size: 14px; }

/* ---------- entrada al cargar ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-enter] .panel { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 90ms); }
  [data-enter].carta-head { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

/* ---------- tablet y móvil ---------- */
@media (max-width: 900px) {
  .sec { grid-template-columns: 1fr; }
  .sec-side { position: static; }
  .sec-photo { aspect-ratio: var(--ratio-m, 4 / 3); margin-bottom: 8px; }
  .group-photos.is-multi { grid-template-columns: 1fr; }
  .sec-photo img { object-position: var(--pos-m, var(--pos, 50% 50%)); }
  .sec-list { margin-top: 20px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-logo { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --bar-h: 58px; --colw: 3.7rem; }
  .bar-logo img { height: 32px; }
  .bar-back-long { display: none; }
  .bar-back-short { display: inline; }
  .lang select { padding-left: 12px; font-size: 14px; }
  .panels { grid-template-columns: 1fr; grid-auto-rows: 1fr; }
  .panel { min-height: 190px; }
  .panel img { object-position: var(--pos-m, var(--pos, 50% 50%)); }
  .panel-title { font-size: 40px; }
  .panel-sub { font-size: 15px; }
  .home-intro { padding-block: 14px; font-size: 14px; }
  .switch { gap: 2px 16px; }
  .switch a { font-size: 25px; min-height: 44px; }
  .sec-side { position: static; }
  :root { --colw: 3.5rem; }
  .item-name { font-size: 16px; }
  .prices { font-size: 15px; }
  .leader { display: none; }
  .item-row { justify-content: space-between; }
  .cols-head span { font-size: 11px; }
  .foot-grid { grid-template-columns: 1fr; }
}
