/* Como en Casa Restaurante - base: tokens, tipografía, botones, barra y héroe */
:root {
  --crema: #FBF2DE;
  --crema-2: #F3E4C3;
  --papel: #FFFAEE;
  --tinta: #2B1B0F;
  --tinta-2: #644A33;
  --verde: #0F7D33;
  --verde-hondo: #0B4322;
  --naranja: #E8552B;
  --naranja-btn: #C23C15;
  --marron: #633E19;
  --linea: rgba(99, 62, 25, .2);
  --sombra: 0 18px 40px -18px rgba(70, 38, 8, .45);
  --f: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-mano: "Caveat", "Segoe Print", cursive;
  --sale: cubic-bezier(.16, 1, .3, 1);
  --lado: max(16px, calc((100vw - 1180px) / 2));
  --barra: 64px;
  --r: 28px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--barra) + 12px);
  scrollbar-color: var(--marron) var(--crema-2);
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--crema);
  color: var(--tinta);
  font: 400 1.0625rem/1.5 var(--f);
  font-optical-sizing: auto;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--naranja-btn); color: var(--papel); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.defs { position: absolute; }

:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; border-radius: 6px; }
.salto {
  position: fixed; left: 12px; top: -80px; z-index: 50;
  background: var(--tinta); color: var(--papel); padding: 12px 18px; border-radius: 999px;
}
.salto:focus { top: 12px; }

h1, h2 {
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: -.022em;
  line-height: .92;
  text-wrap: balance;
}
h2 { font-size: clamp(2.5rem, 9.5vw, 4.75rem); }
h3 { font-weight: 700; line-height: 1.1; letter-spacing: -.015em; }
.bajada { font-size: 1.125rem; color: var(--tinta-2); max-width: 34em; margin-top: 16px; text-wrap: pretty; }
.nota { font: 600 1.5rem/1 var(--f-mano); color: var(--naranja-btn); }
.soles { white-space: nowrap; }

/* Botones: todo lo interactivo es píldora */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 1.0625rem; line-height: 1; text-decoration: none; white-space: nowrap;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer;
  transition: transform .14s var(--sale), background-color .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.96); }
.btn-chico { min-height: 44px; padding: 0 18px; font-size: 1rem; }
.btn-solido { background: var(--naranja-btn); color: #FFF8EA; box-shadow: 0 10px 22px -12px rgba(194, 60, 21, .9); }
.btn-linea { border-color: var(--tinta); }
.btn-crema { background: var(--papel); color: var(--tinta); box-shadow: var(--sombra); }
.enlace {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
  text-decoration-color: var(--naranja);
}
.enlace svg { transition: transform .25s var(--sale); }
@media (hover: hover) and (pointer: fine) {
  .btn-solido:hover { background: #A93210; }
  .btn-linea:hover { background: var(--tinta); color: var(--papel); }
  .btn-crema:hover { background: #fff; }
  a:hover .enlace svg, .enlace:hover svg { transform: translateX(5px); }
}

/* Barra */
.barra {
  position: sticky; top: 0; z-index: 30; height: var(--barra);
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--lado);
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(251, 242, 222, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.marca { display: block; margin-right: auto; }
.marca img { width: 96px; margin-top: 18px; filter: drop-shadow(0 4px 6px rgba(70, 38, 8, .22)); transform-origin: 0 0; transition: scale .35s var(--sale), translate .35s var(--sale); }
.barra.baja .marca img { scale: .7; translate: 0 2px; }
.barra .btn { transition: opacity .25s, transform .14s var(--sale), background-color .2s; }
.barra.con-fijo .btn { opacity: 0; pointer-events: none; visibility: hidden; }
.barra-nav { display: none; gap: 28px; font-weight: 600; }
.barra-nav a { text-decoration: none; padding: 12px 0; }
.solo-ancho { display: none; }
@media (hover: hover) and (pointer: fine) {
  .barra-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--naranja); }
}
@media (min-width: 900px) {
  :root { --barra: 76px; }
  .barra-nav { display: flex; }
  .solo-ancho { display: inline; }
  .marca img { width: 118px; margin-top: 26px; }
  .barra.baja .marca img { scale: .7; translate: 0 2px; }
  .escena-foto, .escena-3d { inset: -9%; width: 118%; height: 118%; }
  .barra.con-fijo .btn { opacity: 1; pointer-events: auto; visibility: visible; }
}

/* Héroe */
.heroe {
  position: relative; overflow-x: clip;
  display: grid; grid-template-columns: minmax(0, 1fr);
  padding: 10px var(--lado) 28px;
  min-height: calc(100svh - var(--barra));
  grid-template-rows: auto 1fr auto auto;
}
.heroe-texto { display: contents; }
.heroe h1 {
  order: 1; position: relative; z-index: 2;
  font-size: min(21.4vw, 7rem); font-stretch: 75%; line-height: .84;
  padding-top: 14px;
}
.heroe h1 span { display: block; }
.nota-mama {
  order: 1; position: absolute; z-index: 3;
  top: 30px; left: calc(var(--lado) + 41vw);
  display: flex; align-items: flex-end; gap: 4px;
  font-size: clamp(1.2rem, 5.3vw, 1.75rem); rotate: -4deg; white-space: nowrap;
}
.nota-mama svg { flex: none; margin-bottom: -10px; }
.heroe-mesa {
  order: 2; position: relative; z-index: 1;
  width: min(100%, 470px); height: 100%; min-height: min(92vw, 430px); max-height: 520px;
  margin: -3vw auto 0;
}
.mantel {
  position: absolute; inset: 8% -22% 4% 16%;
  rotate: 7deg; border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(15, 125, 51, .17) 0 20px, transparent 20px 40px),
    repeating-linear-gradient(90deg, rgba(15, 125, 51, .17) 0 20px, transparent 20px 40px),
    var(--papel);
  box-shadow: var(--sombra);
}
.escena { position: absolute; inset: 0 2% 6% 2%; }
.escena-foto, .escena-3d { position: absolute; inset: -4%; width: 108%; height: 108%; max-width: none; }
.escena-foto {
  object-fit: contain;
  transition: translate .42s var(--sale), opacity .3s;
}
.escena-foto.sale { translate: -70% 0; opacity: 0; transition: translate .28s cubic-bezier(.5, 0, .9, .4), opacity .25s; }
.escena-foto.entra { translate: 70% 0; opacity: 0; transition: none; }
.escena-3d { opacity: 0; transition: opacity .6s; touch-action: pan-y; }
.escena-3d model-viewer { width: 100%; height: 100%; background: transparent; --poster-color: transparent; --progress-bar-color: transparent; touch-action: pan-y; }
.escena.es-3d .escena-3d { opacity: 1; }
.escena.es-3d .escena-foto { opacity: 0; pointer-events: none; }

.sello {
  position: absolute; left: -2px; top: 12%; z-index: 2;
  width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--naranja-btn); color: #FFF8EA; rotate: -11deg;
  box-shadow: 0 12px 22px -10px rgba(120, 40, 10, .7);
  outline: 2px dashed rgba(255, 248, 234, .65); outline-offset: -8px;
}
.sello span { font-size: .8125rem; font-weight: 700; line-height: 1; }
.sello b { font-size: 2.5rem; font-weight: 800; font-stretch: 75%; line-height: .9; letter-spacing: -.03em; }
.sello i { font-style: normal; font-size: .45em; vertical-align: .75em; margin-right: 2px; letter-spacing: 0; }

.cambia {
  position: absolute; left: 50%; bottom: -4px; translate: -50% 0; z-index: 3;
  display: flex; padding: 4px; gap: 2px; border-radius: 999px;
  background: var(--papel); box-shadow: var(--sombra);
}
.cambia button {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  font-size: .875rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color .25s, color .25s;
}
.cambia button b { font-weight: 800; margin-left: 2px; }
.cambia button[aria-pressed="true"] { background: var(--verde-hondo); color: var(--papel); }
.nota-gira { position: absolute; right: 0; bottom: 15%; z-index: 2; rotate: -5deg; font-size: 1.35rem; pointer-events: none; }

.heroe-bajada {
  order: 3; margin-top: 26px;
  font-size: clamp(1.125rem, 4.9vw, 1.5rem); font-weight: 600; line-height: 1.25; letter-spacing: -.01em;
  max-width: 21em; text-wrap: balance;
}
.heroe-acciones { order: 4; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.heroe-acciones .btn { flex: 1 1 auto; padding: 0 20px; }

@media (min-width: 900px) {
  .heroe {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; align-content: center; column-gap: 24px;
    padding-top: 0; padding-bottom: 48px; grid-template-rows: none;
  }
  .heroe-texto { display: block; position: relative; }
  .heroe h1 { font-size: clamp(5.5rem, 10.4vw, 9.5rem); }
  .nota-mama { top: 14px; left: 50%; font-size: 2rem; }
  .nota-gira { font-size: 1.7rem; right: 4%; bottom: 13%; }
  .nota-mama svg { width: 56px; height: 38px; }
  .heroe-mesa { width: min(100%, 660px); height: auto; max-height: none; aspect-ratio: 1 / .92; margin: 0 0 0 auto; }
  .mantel { inset: 6% -30% 2% 12%; }
  .sello { width: 132px; height: 132px; left: -24px; }
  .sello span { font-size: 1rem; }
  .sello b { font-size: 3.25rem; }
  .cambia button { font-size: 1rem; padding: 0 20px; }
  .heroe-bajada { margin-top: 30px; font-size: 1.625rem; }
  .heroe-acciones { margin-top: 28px; }
  .heroe-acciones .btn { flex: 0 0 auto; padding: 0 30px; }
}

/* Barra de pedido fija (solo teléfono) */
.pedir-fijo {
  position: fixed; z-index: 25; left: 10px; right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 60px; padding: 6px 6px 6px 20px; border-radius: 999px;
  background: var(--verde-hondo); color: var(--papel); text-decoration: none;
  box-shadow: 0 16px 34px -12px rgba(11, 67, 34, .8);
  translate: 0 140%; visibility: hidden;
  transition: translate .5s var(--sale), visibility 0s .5s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.pedir-fijo.ve { translate: 0 0; visibility: visible; transition: translate .5s var(--sale), visibility 0s; }
.pedir-fijo > span:first-child { font-size: .9375rem; line-height: 1.1; }
.pedir-fijo b { font-weight: 800; white-space: nowrap; }
.pedir-fijo-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px;
  background: var(--naranja-btn); color: #FFF8EA; font-weight: 700; white-space: nowrap;
}
.pedir-fijo:active .pedir-fijo-btn { transform: scale(.96); }
@media (min-width: 900px) { .pedir-fijo { display: none; } }

/* Movimiento: el plato llega a la mesa y gira un poco con el scroll */
@media (prefers-reduced-motion: no-preference) {
  .escena { animation: llega 1s var(--sale) both; }
  .mantel { animation: tiende .9s var(--sale) both; }
  .sello { animation: estampa .5s .55s var(--sale) both; }
  .heroe h1 span { animation: sube .7s var(--sale) both; }
  .heroe h1 span + span { animation-delay: .07s; }
  .nota-mama { animation: aparece .5s .7s both; }
  @keyframes llega { from { translate: 46% -4%; rotate: 38deg; opacity: 0; } }
  @keyframes tiende { from { rotate: 16deg; scale: .9; opacity: 0; } }
  @keyframes estampa { from { scale: 1.9; opacity: 0; } }
  @keyframes sube { from { translate: 0 28%; opacity: 0; } }
  @keyframes aparece { from { opacity: 0; } }
  @supports (animation-timeline: scroll()) {
    .escena-foto { animation: gira linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    @keyframes gira { to { rotate: -7deg; scale: .92; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
