:root {
  --color: #d9467a;
  --texto: #222;
  --suave: #666;
  --fondo: #faf7f5;
  --tarjeta: #fff;
  --borde: #eee;
  --radio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  padding-bottom: 90px;
}

.franja-demo {
  background: #222;
  color: #ffd84d;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  letter-spacing: .3px;
}

.encabezado {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 18px 10px;
  max-width: 1000px;
  margin: 0 auto;
}
.logo {
  width: 64px; height: 64px; flex: none;
  border-radius: 50%;
  background: var(--color);
  display: grid; place-items: center;
  font-size: 34px;
  overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
h1 { margin: 0; font-size: 24px; }
.rubro { margin: 2px 0 0; color: var(--color); font-weight: 600; }

.info { max-width: 1000px; margin: 0 auto; padding: 0 18px; }
.info p { margin: 6px 0 10px; color: var(--suave); }
.datos { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: 14px; }
.datos a { color: var(--color); }

.controles {
  position: sticky; top: 0; z-index: 5;
  background: var(--fondo);
  padding: 10px 18px;
  max-width: 1000px; margin: 0 auto;
}
#buscar {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 16px;
  background: #fff;
}
.categorias { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; }
.categorias button {
  flex: none;
  border: 1px solid var(--color);
  background: #fff;
  color: var(--color);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
}
.categorias button.activa { background: var(--color); color: #fff; }

main { max-width: 1000px; margin: 0 auto; padding: 0 18px; }
.estado { color: var(--suave); text-align: center; }
.titulo-categoria { margin: 22px 0 10px; font-size: 18px; }

.grilla { display: block; }
.fila {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.producto {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.producto.agotado { opacity: .55; }
.foto {
  aspect-ratio: 1 / 1;
  background: #f1e9e4;
  display: grid; place-items: center;
  font-size: 44px; color: #b9a49a;
  position: relative;
}
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.etiqueta {
  position: absolute; top: 8px; left: 8px;
  background: #222; color: #fff;
  font-size: 12px; padding: 3px 8px; border-radius: 999px;
}
.cuerpo { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cuerpo h3 { margin: 0; font-size: 15px; }
.cuerpo p { margin: 0; font-size: 13px; color: var(--suave); flex: 1; }
.precio { font-weight: 700; font-size: 16px; margin-top: 6px; }

.cantidad { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cantidad button, .agregar {
  border: none; cursor: pointer;
  background: var(--color); color: #fff;
  border-radius: 10px; font-size: 15px; font-weight: 600;
}
.agregar { width: 100%; padding: 9px; margin-top: 8px; }
.agregar:disabled { background: #bbb; cursor: not-allowed; }
.cantidad button { width: 36px; height: 36px; font-size: 20px; }
.cantidad span { min-width: 22px; text-align: center; font-weight: 700; }

.pie { text-align: center; color: var(--suave); font-size: 13px; padding: 30px 18px; }
.pie a { color: var(--suave); }

.barra-carrito {
  position: fixed; left: 12px; right: 86px; bottom: 14px; z-index: 10;
  max-width: 520px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border: none; border-radius: 999px;
  background: var(--color); color: #fff;
  font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.flotante-wsp {
  position: fixed; right: 14px; bottom: 14px; z-index: 10;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.fondo { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
.panel {
  position: fixed; z-index: 21;
  left: 0; right: 0; bottom: 0;
  max-height: 88vh; overflow-y: auto;
  max-width: 560px; margin: 0 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.panel[hidden], .fondo[hidden], .barra-carrito[hidden], .franja-demo[hidden], #fila-direccion[hidden] { display: none; }
.panel-cabecera { display: flex; justify-content: space-between; align-items: center; }
.panel h2 { margin: 0; }
.cerrar { border: none; background: none; font-size: 22px; cursor: pointer; }
.lista-pedido { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.lista-pedido li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; }
.lista-pedido .cantidad { margin: 0; }
.lista-pedido .cantidad button { width: 30px; height: 30px; font-size: 17px; }
.total { font-size: 18px; margin: 4px 0; text-align: right; }
.panel label { display: grid; gap: 4px; font-size: 14px; }
.panel input[type=text], .panel textarea {
  padding: 10px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; font-family: inherit;
}
.entrega { border: 1px solid #eee; border-radius: 10px; display: flex; gap: 20px; }
.entrega label { display: flex; gap: 6px; align-items: center; }
.boton-enviar {
  background: #25d366; color: #fff; border: none; border-radius: 12px;
  padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.boton-vaciar { background: none; border: none; color: var(--suave); text-decoration: underline; cursor: pointer; }
