/* Medidas tomadas de menu.fu.do/bgklein/qr-menu (plantilla 3, cabecera "retro").
   Lo que no esta en esa carta es lo de las promos, al final. */
:root {
  --primario: #724d31;
  --fondo: #f8f1ea;
  --contenedor: #ffffff;
  --texto: #474747;
  --texto-2: #757575;
  --divisor: #0000001a;
  --sombra-sm: #a1999980 0 1px 4px;
  --sombra-md: 0 2px 9px #a199994d;
  --promo: #c2410c;
  --promo-2: #e8912d;
  --promo-suave: #fff1e6;
  --curva: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
body {
  margin: 0;
  font-family: Barlow, system-ui, sans-serif;
  font-size: 16px;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
h1, h3, h4, p { margin: 0; }
.pagina { min-height: 100vh; }
body.bloqueado { overflow: hidden; }

/* --- cabecera ---------------------------------------------------------------------------------- */
.cabecera {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 40px;
  border-radius: 0 0 60px 60px;
  color: #fff;
  min-height: 183px;
  padding: 30px 20px;
}
.cabecera__fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cabecera::after { content: ""; position: absolute; inset: 0; background: #00000080; pointer-events: none; }
.cabecera__logo { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.cabecera__logo img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; box-shadow: 5px 5px 5px #00000052; }
.cabecera h1 {
  font-size: 32px; font-weight: 700; margin: 5px 0; text-align: center;
  letter-spacing: .21px; text-shadow: 0 0 3px #0000005e;
}
.cabecera__info {
  position: absolute; top: 1em; left: 1em; z-index: 1;
  background: none; border: 0; padding: 0; color: inherit; display: none;
}
.cabecera__info svg { width: 1.5em; height: 1.5em; filter: drop-shadow(0 0 3px #0000005e); }

/* --- contenido --------------------------------------------------------------------------------- */
.contenido {
  position: relative;
  display: flex;
  margin: 20px 0 15px;
  min-height: 60vh;
  padding: 0 0 30px;
  background: var(--contenedor);
  border-radius: 40px;
  box-shadow: var(--sombra-md);
}
.lateral {
  width: 320px; flex-shrink: 0; position: sticky; top: 2em; align-self: flex-start;
  padding: 10px; margin-top: 22px; max-height: calc(100vh - 4em); overflow-y: auto;
}
.principal { flex: 1; min-width: 0; padding-right: 20px; display: flex; flex-direction: column; }

.pegajoso { position: sticky; top: 0; z-index: 5; transition: all .25s ease; }
.pegajoso__dentro {
  display: flex; flex-direction: column; gap: 1em;
  padding: 30px 20px 20px; background: var(--contenedor); border-radius: 0 40px 0 0;
}
.barra { display: flex; align-items: center; gap: 1em; }
.buscador { flex: 1; position: relative; display: block; }
.buscador svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--texto); pointer-events: none; }
.buscador input {
  width: 100%; height: 48.5px; padding: 15px 35px; font: inherit; font-size: 14px; color: var(--texto);
  background: var(--contenedor); border: 1px solid var(--divisor); border-radius: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.buscador input::placeholder { color: var(--texto-2); }
.buscador input:focus { border-color: color-mix(in srgb, var(--primario) 45%, transparent); }
.buscador input::-webkit-search-cancel-button { -webkit-appearance: none; }
.boton-categorias {
  display: none; align-items: center; justify-content: center; flex-shrink: 0;
  width: 50px; height: 50px; border-radius: 16px; border: 1px solid var(--divisor); background: transparent; font-size: 20px;
}
.boton-categorias svg { width: 18px; height: 18px; }

/* --- productos --------------------------------------------------------------------------------- */
.productos { padding: 0 6px; }
.seccion h3 { font-size: 18px; font-weight: 700; color: var(--primario); margin: 20px 10px 10px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 30px; padding: 10px 0 30px; margin: 0 10px 30px; }
.producto {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  color: inherit; text-decoration: none; cursor: pointer; border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.producto__foto { position: relative; }
.producto__foto img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; background: var(--fondo);
}
.producto__foto img.sin-foto { border: 1px solid var(--divisor); background: #f9f9f9; }
.producto__info { display: flex; flex-direction: column; padding: 10px 10px 0; margin-bottom: 5px; }
.producto h4, .producto p {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.producto h4 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.producto p { font-size: 14px; line-height: 1.3; color: var(--texto-2); margin: 0 0 10px; overflow-wrap: anywhere; }
.precio { padding: 0 10px 10px; font-size: 16px; font-weight: 600; color: var(--primario); }
.vacio { text-align: center; color: var(--texto-2); padding: 40px 20px; }

/* --- categorias (lateral y hoja) --------------------------------------------------------------- */
.categorias { list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 8px; }
.categorias button {
  display: flex; align-items: center; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; border-radius: 30px;
  background: transparent; text-align: left; font-size: 16px; color: var(--texto); transition: background-color .4s ease;
}
.categorias button span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.categorias button:hover, .categorias button.activa { background: color-mix(in srgb, var(--primario) 20%, transparent); }
.categorias button.activa { font-weight: 600; }
.categorias .marca-promo { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--promo); margin-left: 8px; }

/* --- hojas que suben desde abajo --------------------------------------------------------------- */
.hoja-fondo {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: #00000080; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.hoja-fondo.abierta { opacity: 1; visibility: visible; }
.hoja {
  width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
  padding: 0 10px; background: var(--contenedor); border-radius: 15px 15px 0 0; box-shadow: 0 -2px 8px #00000026;
  transform: translateY(100%); transition: transform .4s var(--curva);
  padding-bottom: env(safe-area-inset-bottom);
}
.hoja-fondo.abierta .hoja { transform: none; }
.hoja__cabeza { display: flex; justify-content: flex-end; align-items: center; padding: 1rem 1.5rem 1rem; flex-shrink: 0; }
.hoja__cerrar {
  width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0; background: #ececec;
  display: flex; align-items: center; justify-content: center;
}
.hoja__cerrar svg { width: 10px; height: 10px; }
.hoja .categorias { max-height: 60vh; overflow-y: auto; padding-bottom: 20px; }
.info { padding: 0 15px 30px; }
.info h2 { font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.info__linea { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 15px; color: var(--texto); text-decoration: none; }
.info__linea svg { width: 14px; height: 14px; flex-shrink: 0; }
.info h5 { text-align: center; font-size: 15px; font-weight: 600; margin: 26px 0 14px; }
.info__redes { display: flex; justify-content: center; gap: 18px; }
.info__redes a { color: var(--primario); }
.info__redes svg { width: 24px; height: 24px; }

/* --- ficha de producto ------------------------------------------------------------------------- */
.detalle {
  position: fixed; inset: 0; z-index: 900; overflow-y: auto; background: var(--contenedor);
  display: flex; flex-direction: column; overscroll-behavior: contain;
  animation: entra .25s var(--curva);
}
.detalle[hidden] { display: none; }
@keyframes entra { from { opacity: 0; transform: translateY(16px); } }
.detalle__marco { position: relative; width: 100%; max-width: 640px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.detalle__foto { position: relative; }
.detalle__foto img { display: block; width: 100%; max-height: 400px; aspect-ratio: 1; object-fit: cover; }
.detalle__atras {
  position: absolute; left: 10px; top: 15px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: #fff; box-shadow: 1px 0 8px #3d3d3d66; display: flex; align-items: center; justify-content: center; padding: 0;
}
.detalle__atras svg { width: 13px; height: 13px; margin-right: 1px; }
.detalle__contenido {
  position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column;
  margin-top: 55px; padding: 15px 15px 0; background: var(--contenedor); border-radius: 40px 40px 0 0;
}
.detalle__foto + .detalle__contenido { margin-top: -40px; }
.detalle h3 { font-size: 1.3em; font-weight: 700; margin: 0 0 8px; }
.detalle .descripcion { font-size: 14px; line-height: 1.5; color: var(--texto-2); margin: 0 0 6px; }
.detalle .precio { padding: 0; }
.detalle hr { margin: 1rem 0 5px; border: 0; border-top: 1px solid var(--divisor); }
.grupo { padding: 8px 0; }
.grupo h4 { font-size: 1.12em; font-weight: 600; }
.grupo span { display: block; font-size: .8em; font-weight: 300; color: var(--texto-2); }
.detalle__accion { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 15px 5px calc(15px + env(safe-area-inset-bottom)); background: var(--contenedor); }
.boton {
  display: block; width: 100%; padding: .5em 1.3em; border: 1px solid var(--primario); border-radius: 16px;
  background: var(--primario); color: #fff; font-weight: 700; font-size: 1em; text-align: center;
}

/* --- celular (la carta QR casi siempre se abre aca) -------------------------------------------- */
@media (max-width: 992px) {
  .cabecera { margin: 0; }
  .cabecera__info { display: block; }
  .contenido { flex-direction: column; padding: 0 0 10px; }
  .lateral { display: none; }
  .principal { padding: 0; }
  .pegajoso__dentro { padding: 16px 20px 20px; border-radius: 40px 40px 0 0; gap: 5px; }
  .pegajoso.pegado { background: var(--fondo); padding-top: 20px; }
  .pegajoso.pegado .pegajoso__dentro { border-radius: 0; background: var(--fondo); padding-top: 0; padding-bottom: 12px; }
  .barra { gap: 5px; }
  .boton-categorias { display: flex; }
}
@media (max-width: 768px) {
  .items { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .producto__foto img { aspect-ratio: 1 / 1.02; }
}

/* --- promos: lo unico que no esta en la carta de Fudo ------------------------------------------ */
.promo-cinta {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 14px;
  color: #fff; background: linear-gradient(110deg, var(--promo) 0%, var(--promo-2) 100%);
  box-shadow: 0 4px 14px #c2410c40; font-size: 14px; line-height: 1.25; overflow: hidden; position: relative;
}
.promo-cinta[hidden] { display: none; }
.promo-cinta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, #ffffff40 50%, transparent 70%);
  translate: -100% 0; animation: brillo 5s ease-in-out infinite 1s;
}
.promo-cinta b { font-weight: 700; }
.promo-cinta__icono {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 16px; font-weight: 700; background: #ffffff33; border: 1.5px solid #ffffffb3;
}
.promo-cinta__texto { flex: 1; }
.promo-cinta__hasta { display: block; font-size: 12.5px; opacity: .9; }

.etiqueta {
  position: absolute; top: 9px; left: 9px; z-index: 1; display: inline-flex; align-items: stretch;
  border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 8px #0000002e; max-width: calc(100% - 18px);
}
.etiqueta__pct { padding: 5px 8px; color: #fff; background: linear-gradient(110deg, var(--promo), var(--promo-2)); }
.etiqueta__nombre { padding: 5px 9px 5px 7px; color: var(--promo); background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.producto.en-promo .producto__foto img {
  outline: 2px solid var(--promo-2); outline-offset: -2px;
}
.precio--promo { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.precio--promo .ahora { color: var(--promo); font-weight: 700; font-size: 17px; }
.precio--promo s { color: #9b9b9b; font-size: 13.5px; font-weight: 500; text-decoration-thickness: 1.5px; }
.detalle .etiqueta { top: auto; bottom: 54px; left: 15px; font-size: 13.5px; }
.detalle .etiqueta__pct { padding: 7px 10px; }
.detalle .etiqueta__nombre { padding: 7px 12px 7px 9px; }
.detalle__contenido > .etiqueta { position: static; align-self: flex-start; margin-bottom: 10px; }
.detalle .precio--promo .ahora { font-size: 20px; }
.detalle .precio--promo s { font-size: 15px; }
.aviso-promo {
  margin: 10px 0 2px; padding: 9px 12px; border-radius: 12px; font-size: 13.5px;
  color: #8a3208; background: var(--promo-suave); border: 1px solid #fbd5b8;
}
@keyframes brillo { 0%, 55% { translate: -100% 0; } 100% { translate: 100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .promo-cinta::after { animation: none; display: none; }
  .detalle, .hoja, .hoja-fondo { animation: none; transition: none; }
}
