/* Tienda pública del negocio (helpLedesma v2). Filas compactas tipo app de delivery; pensada primero para el celular. */
:root {
  --fondo: #f5f6f5;
  --superficie: #ffffff;
  --borde: #e6e9e6;
  --texto: #18201b;
  --texto-suave: #6b756e;
  --acento: #1f8f14;
  --acento-fuerte: #187310;
  --acento-texto: #ffffff;
  --acento-suave: #e8f5e5;
  --error: #c2412f;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(16, 24, 18, .06), 0 4px 16px rgba(16, 24, 18, .06);
  --sombra-alta: 0 10px 30px rgba(16, 24, 18, .18);
  --alto-cabecera: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0e1110;
    --superficie: #171b19;
    --borde: #262c29;
    --texto: #e9eeea;
    --texto-suave: #98a39c;
    --acento: #3fc42f;
    --acento-fuerte: #52d443;
    --acento-texto: #0b0d0c;
    --acento-suave: rgba(63, 196, 47, .14);
    --error: #f07a68;
    --sombra: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 150px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body.sin-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.contenedor { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.suave { color: var(--texto-suave); }
.chico { font-size: 13px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

/* ---------- Cabecera ---------- */
.cabecera { background: var(--superficie); border-bottom: 1px solid var(--borde); }
.cabecera-fila { min-height: var(--alto-cabecera); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.marca-logo {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--acento); color: var(--acento-texto); font-weight: 800; font-size: 16px; letter-spacing: .5px;
}
.marca h1 { font-size: 18px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca p { margin: 1px 0 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boton-carrito {
  flex: none; display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--acento); color: var(--acento-texto); font-weight: 650; cursor: pointer;
}
.boton-carrito svg { width: 20px; height: 20px; }
.boton-carrito .contador { background: rgba(255, 255, 255, .25); }
@media (min-width: 900px) { .boton-carrito { display: inline-flex; } }
.contador { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; }

/* ---------- Barra fija: mensaje, búsqueda y rubros ---------- */
.barra-fija { position: sticky; top: 0; z-index: 5; background: var(--fondo); padding-top: 12px; box-shadow: 0 1px 0 var(--borde); }
.mensaje-negocio { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--acento-suave); font-size: 13.5px; }
.filtros { display: flex; gap: 8px; align-items: center; }
.filtros .buscador { flex: 1; min-width: 0; }
.buscador {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px;
}
.buscador svg { width: 18px; height: 18px; color: var(--texto-suave); flex: none; }
.buscador input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--texto); font: 16px/1 inherit; }
.buscador:focus-within { border-color: var(--acento); }
.rubros { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: none; }
.rubros::-webkit-scrollbar { display: none; }
.rubro {
  flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); font-size: 14px; white-space: nowrap;
}
.rubro.activo { background: var(--texto); color: var(--fondo); border-color: var(--texto); }
.boton-filtro, .ordenar select {
  flex: none; height: 46px; padding: 0 12px; border: 1px solid var(--borde); border-radius: 12px;
  background: var(--superficie); color: var(--texto); font: 14px/1 inherit; font-weight: 600; cursor: pointer;
}
.boton-filtro { display: inline-flex; align-items: center; gap: 6px; max-width: 42vw; }
.boton-filtro span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boton-filtro svg { width: 18px; height: 18px; flex: none; }
.boton-filtro.con-filtro { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-fuerte); }
.ordenar select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.estado-filtro { margin: 0 0 10px; font-size: 13.5px; color: var(--texto-suave); }
.enlace { border: 0; background: none; padding: 0; color: var(--acento-fuerte); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 899px) { .ordenar { display: none; } .boton-filtro { max-width: 46vw; } }
.hoja-seccion { grid-column: 1 / -1; margin: 10px 0 2px; font-size: 13px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .05em; }
.segmentos { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmentos button { min-height: 44px; border: 1px solid var(--borde); border-radius: 12px; background: var(--fondo); font-size: 14px; cursor: pointer; }
.segmentos button[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-fuerte); font-weight: 650; }

/* Hoja de rubros (celular): todos a la vista, en grilla */
.hoja {
  position: fixed; z-index: 11; inset: auto 0 0 0; max-height: 80vh; display: flex; flex-direction: column;
  background: var(--superficie); border-radius: 20px 20px 0 0; box-shadow: var(--sombra-alta); padding-bottom: env(safe-area-inset-bottom);
}
.hoja-cuerpo { overflow-y: auto; padding: 4px 16px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hoja-rubro {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--borde); border-radius: 12px; background: var(--fondo); text-align: left; font-size: 14px; cursor: pointer;
}
.hoja-rubro span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hoja-rubro.activo { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-fuerte); font-weight: 650; }
@media (min-width: 900px) { .solo-celu { display: none !important; } .hoja, [data-hoja-fondo] { display: none !important; } }

/* ---------- Diseño: lista de rubros a la izquierda en pantallas grandes ---------- */
.diseno { display: block; }
.lateral { display: none; }
@media (min-width: 900px) {
  .barra-fija { padding-bottom: 12px; }
  .estado-filtro { margin: 10px 0 0; }
  html { scroll-padding-top: 100px; }
  .diseno { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
  .lateral { display: block; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 18px 0; }
  .lateral-titulo { margin: 0 0 8px 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-suave); }
  .lateral nav { display: flex; flex-direction: column; gap: 2px; }
  .lateral button {
    display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
    background: none; color: var(--texto); font-size: 14px; text-align: left; cursor: pointer;
  }
  .lateral button:hover { background: var(--superficie); }
  .lateral button.activo { background: var(--acento-suave); color: var(--acento-fuerte); font-weight: 650; }
}

/* ---------- Secciones y productos ---------- */
.catalogo { padding-bottom: 100px; min-width: 0; }
.seccion { padding-top: 18px; }
.seccion h2 { font-size: 18px; font-weight: 750; margin: 0 0 10px; }
.seccion h2 .suave { font-size: 14px; font-weight: 500; }
.lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 640px) { .lista { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 1180px) { .lista { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.producto {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  transition: border-color .15s ease;
}
.producto.en-carrito { border-color: var(--acento); }
.miniatura { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #fff; }
.miniatura img { width: 100%; height: 100%; object-fit: contain; }
.miniatura span { font-size: 24px; font-weight: 750; }
/* 12 tonos suaves para las miniaturas sin foto (uno por rubro). */
.t0 { background: #fde8e4; color: #b2452f; } .t1 { background: #fdf0dc; color: #a2620b; } .t2 { background: #fbf5d6; color: #8a7300; }
.t3 { background: #eef6dc; color: #4f7a12; } .t4 { background: #e2f4e4; color: #23813a; } .t5 { background: #dcf3ef; color: #12786b; }
.t6 { background: #ddf0f8; color: #136f93; } .t7 { background: #e1e9fb; color: #2f57b0; } .t8 { background: #e9e5fb; color: #5a45b8; }
.t9 { background: #f3e4f8; color: #8a3aa6; } .t10 { background: #fbe3ef; color: #ad2f6f; } .t11 { background: #ececec; color: #555; }
@media (prefers-color-scheme: dark) {
  .miniatura[class*=" t"] { background: #222826; }
}
.miniatura:has(img) { background: #fff; }
.producto-datos { min-width: 0; }
.producto h3 {
  font-size: 15px; font-weight: 600; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.producto-datos p { margin: 2px 0 0; font-size: 13px; }
.producto .precio { margin-top: 4px; font-size: 16px; font-weight: 750; color: var(--texto); }

/* Botón + y selector de cantidad */
.control { display: flex; align-items: center; }
.mas, .menos {
  width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1; font-weight: 600; display: grid; place-items: center;
}
.mas { background: var(--acento); color: var(--acento-texto); }
.mas:hover { background: var(--acento-fuerte); }
.menos { background: var(--acento-suave); color: var(--acento-fuerte); }
.cantidad-actual { min-width: 34px; text-align: center; font-weight: 700; font-size: 15px; }
.control.abierto { background: var(--acento-suave); border-radius: 999px; }

.vacio { text-align: center; color: var(--texto-suave); padding: 40px 16px; }
.pie { text-align: center; padding: 32px 0 8px; font-size: 13px; }

/* ---------- Barra inferior "Ver mi pedido" (celular) ---------- */
.barra-pedido {
  position: fixed; z-index: 8; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border: 0; border-radius: 16px;
  background: var(--acento); color: var(--acento-texto); box-shadow: var(--sombra-alta); cursor: pointer; font-weight: 650; font-size: 16px;
}
.barra-pedido span:nth-child(2) { flex: 1; text-align: left; }
.barra-pedido .contador { background: rgba(255, 255, 255, .25); }
@media (min-width: 900px) { .barra-pedido { display: none !important; } }

/* ---------- Carrito ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 650; cursor: pointer; text-decoration: none; font-size: 16px;
}
.boton-primario { background: var(--acento); color: var(--acento-texto); }
.boton-primario:hover { background: var(--acento-fuerte); }
.boton-primario:disabled { opacity: .5; cursor: not-allowed; }
.boton-secundario { background: var(--superficie); border-color: var(--borde); color: var(--texto); }
.boton-ancho { width: 100%; }
.boton-icono { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--fondo); cursor: pointer; font-size: 22px; line-height: 1; }

.carrito-fondo { position: fixed; inset: 0; background: rgba(10, 14, 12, .45); z-index: 10; }
.carrito {
  position: fixed; z-index: 11; inset: auto 0 0 0; max-height: 94vh; display: flex; flex-direction: column;
  background: var(--superficie); border-radius: 20px 20px 0 0; box-shadow: var(--sombra-alta);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 900px) { .carrito { inset: 0 0 0 auto; width: 440px; max-height: none; border-radius: 0; } }
.carrito-cabecera { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; }
.carrito-cabecera h2 { font-size: 20px; }
.carrito-cuerpo { flex: 1; overflow-y: auto; padding: 0 20px 16px; }
.carrito-lista { list-style: none; margin: 0; padding: 0; }
.carrito-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.carrito-lista .nombre { font-weight: 600; }
.carrito-lista .control { grid-column: 1; grid-row: 2; justify-self: start; }
.carrito-lista .mas, .carrito-lista .menos { width: 34px; height: 34px; font-size: 18px; }
.carrito-lista .importe { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; }
.carrito-pie { padding: 12px 20px 16px; border-top: 1px solid var(--borde); }
.carrito-pie p { margin: 4px 0 12px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.total strong { font-size: 22px; }

.formulario { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.formulario h3 { font-size: 16px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
.campo input, .campo textarea {
  min-height: 48px; padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px;
  background: var(--fondo); color: var(--texto); font: 16px/1.4 inherit; font-weight: 400;
}
.campo input:focus, .campo textarea:focus { outline: 0; border-color: var(--acento); background: var(--superficie); }
.entrega { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.entrega legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.opcion { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--borde); border-radius: 12px; cursor: pointer; }
.opcion:has(input:checked) { border-color: var(--acento); background: var(--acento-suave); }
.opcion input { width: 18px; height: 18px; accent-color: var(--acento); margin: 0; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { margin: 0; color: var(--error); font-weight: 600; }

/* ---------- Pedido enviado ---------- */
.listo { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 12, .5); }
.listo-caja { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; padding: 28px 24px 24px; background: var(--superficie); border-radius: 20px; box-shadow: var(--sombra-alta); text-align: center; }
.listo-icono { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 999px; display: grid; place-items: center; background: var(--acento-suave); color: var(--acento-fuerte); font-size: 28px; font-weight: 800; }
.listo-caja h2 { font-size: 22px; }
.listo-caja p { margin: 0 0 6px; }

.mensaje-pagina { max-width: 480px; margin: 20vh auto 0; padding: 0 16px; text-align: center; }
.mensaje-pagina h1 { font-size: 22px; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Demo: aviso arriba de todo */
.franja-demo { background: #1f2937; color: #fff; font-size: 14px; line-height: 1.4; padding: 8px 16px; text-align: center; }
.franja-demo a { color: #fde68a; }
