/* Despensa ERP — página "Ir a la despensa" (mismo diseño del boceto aprobado). */
.dsp, .dsp-cats-grid {
  --dsp-verde: #2E6B3F;
  --dsp-verde-osc: #1F4D2C;
  --dsp-verde-claro: #E7F1E9;
  --dsp-texto: #1C2620;
  --dsp-suave: #5B6660;
  --dsp-borde: #E6E8E3;
  --dsp-borde-2: #D5DBD3;
  --dsp-fondo: #FAFAF7;
  --dsp-gris: #F2F4F0;
  --dsp-naranja: #9A4A12;
  --dsp-naranja-claro: #FBEDE3;
  color: var(--dsp-texto);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.dsp { max-width: 1280px; margin: 0 auto; padding: 8px 0 48px; }
.dsp *, .dsp-cats-grid * { box-sizing: border-box; }
.dsp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buscador + carrito + categorías: fijos arriba al bajar (--dsp-top lo calcula el JS según el
   encabezado fijo del tema y la barra de administración). */
.dsp-fija { position: relative; z-index: 30; background: rgba(250,250,247,0.98); padding: 8px 8px 0; margin: 0 -8px; }
.dsp-fija.dsp-pegada { position: fixed; z-index: 9990; margin: 0; box-shadow: 0 6px 16px rgba(28,38,32,.10); }
.dsp-barra { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dsp-buscador { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; background: var(--dsp-gris); border-radius: 999px; padding: 0 16px; height: 44px; color: var(--dsp-suave); }
.dsp-buscador input { flex: 1; border: 0 !important; background: transparent !important; font: inherit; font-size: 15px; color: var(--dsp-texto); outline: none; height: 44px; padding: 0 !important; box-shadow: none !important; }
.dsp-btn-carrito { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--dsp-verde); background: #fff; color: var(--dsp-verde) !important; font-weight: 600; text-decoration: none !important; }
.dsp-contador { min-width: 24px; height: 24px; border-radius: 999px; background: var(--dsp-verde); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

/* Barra de categorías fija */
.dsp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; border-bottom: 1px solid var(--dsp-borde); scrollbar-width: none; }
.dsp-chips::-webkit-scrollbar { display: none; }
.dsp-chip { flex: 0 0 auto; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--dsp-borde-2); background: #fff; color: var(--dsp-texto); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.dsp-chip:hover { border-color: var(--dsp-verde); color: var(--dsp-verde); }
.dsp-sin-resultados { color: var(--dsp-suave); font-style: italic; padding: 24px 0; }

/* Categoría + carrusel */
.dsp-cat { padding-top: 28px; scroll-margin-top: calc(var(--dsp-top, 0px) + var(--dsp-alto-fija, 120px)); }
.dsp-cat-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dsp-cat-cab h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.dsp-cat-n { font-size: 13px; color: var(--dsp-suave); }
.dsp-ver-todos { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--dsp-verde) !important; }
.dsp-flecha { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--dsp-borde-2); background: #fff; color: var(--dsp-texto); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.dsp-carrusel { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.dsp-carrusel::-webkit-scrollbar { display: none; }

/* Tarjeta */
/* 5 tarjetas y media a la vista en PC (la media invita a deslizar: hay más). */
.dsp-card { flex: 0 0 calc((100% - 5 * 16px) / 5.5); min-width: 0; scroll-snap-align: start; background: #fff; border: 1px solid var(--dsp-borde); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.dsp-card[hidden] { display: none; }
.dsp-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--dsp-gris); }
.dsp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dsp-agotado { position: absolute; top: 12px; left: 12px; background: var(--dsp-naranja); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.dsp-cuerpo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.dsp-cuerpo h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; min-height: 39px; }
.dsp-cuerpo h3 a { color: var(--dsp-texto) !important; text-decoration: none !important; }
.dsp-attr { display: flex; flex-direction: column; gap: 4px; }
.dsp-attr-nombre { font-size: 11px; font-weight: 700; color: var(--dsp-suave); text-transform: uppercase; letter-spacing: .03em; }
.dsp-pres { display: flex; flex-wrap: wrap; gap: 6px; }
.dsp-pill.dsp-pill-off { opacity: .45; border-style: dashed; }
.dsp-pill { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--dsp-borde-2); background: #fff; color: var(--dsp-texto); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dsp-pill[aria-pressed="true"] { border-color: var(--dsp-verde); background: var(--dsp-verde-claro); color: var(--dsp-verde-osc); }
.dsp-precio { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.dsp-precio span { font-size: 18px; font-weight: 700; }
.dsp-precio del { font-size: 13px; color: var(--dsp-suave); }
/* Alto mínimo (no fijo): "Pedir bajo reserva" en dos líneas no se sale del botón. */
.dsp-agregar { min-height: 44px; height: auto; padding: 8px 10px; line-height: 1.2; white-space: normal; border-radius: 10px; border: 0; background: var(--dsp-verde); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.dsp-agregar:hover { background: var(--dsp-verde-osc); }
.dsp-agregar.dsp-reserva { border: 1px solid var(--dsp-naranja); background: var(--dsp-naranja-claro); color: var(--dsp-naranja); }
.dsp-agregar[disabled] { opacity: .6; cursor: wait; }
.dsp-nota { font-size: 12px; color: var(--dsp-suave); margin-top: -4px; }

/* Panel "Agregado" */
.dsp-panel { position: fixed; top: 96px; right: 24px; z-index: 99999; width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--dsp-borde); border-radius: 16px; box-shadow: 0 12px 32px rgba(28,38,32,.16); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dsp-panel[hidden] { display: none; }
.dsp-panel-cab { display: flex; align-items: center; gap: 10px; }
.dsp-panel-ok { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 999px; background: var(--dsp-verde-claro); color: var(--dsp-verde); display: inline-flex; align-items: center; justify-content: center; }
.dsp-panel-txt { display: flex; flex-direction: column; min-width: 0; }
.dsp-panel-txt strong { font-size: 15px; }
.dsp-panel-txt span { font-size: 13px; color: var(--dsp-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsp-panel-cerrar { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; color: var(--dsp-suave); cursor: pointer; padding: 0; }
.dsp-panel-total { font-size: 14px; background: var(--dsp-gris); border-radius: 10px; padding: 10px 12px; }
.dsp-panel-acciones { display: flex; gap: 8px; }
.dsp-seguir, .dsp-ver-carrito { flex: 1; height: 44px; border-radius: 10px; font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; cursor: pointer; }
.dsp-seguir { border: 1px solid var(--dsp-borde-2); background: #fff; color: var(--dsp-texto); font-weight: 600; }
.dsp-ver-carrito { background: var(--dsp-verde); color: #fff !important; }

/* Botón de WhatsApp (plugin WP WhatsApp Chat): solo el ícono, sin el globo de texto, para que no tape
   las tarjetas. Solo en las páginas que usan este plugin. */
body .qlwapp__text,
body .qlwapp__button .qlwapp__text,
body .qlwapp-text { display: none !important; }
body .qlwapp__button,
body .qlwapp-toggle { padding: 0 !important; width: 52px !important; height: 52px !important; min-width: 0 !important; border-radius: 999px !important; justify-content: center !important; }
body .qlwapp__icon,
body .qlwapp-icon { margin: 0 !important; }

/* Cuadrícula de categorías (página principal) */
.dsp-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.dsp-cat-tile { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--dsp-borde); border-radius: 16px; overflow: hidden; text-decoration: none !important; color: var(--dsp-texto) !important; transition: border-color .15s; }
.dsp-cat-tile:hover { border-color: var(--dsp-verde); }
.dsp-cat-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--dsp-gris); }
.dsp-cat-tile-nombre { padding: 10px 12px 0; font-weight: 700; font-size: 15px; }
.dsp-cat-tile-n { padding: 2px 12px 12px; font-size: 13px; color: var(--dsp-suave); }

/* Celular */
@media (max-width: 640px) {
  .dsp-btn-carrito span:not(.dsp-contador) { display: none; }
  .dsp-flecha, .dsp-cat-n { display: none; }
  .dsp-cat-cab h2 { font-size: 18px; }
  .dsp-carrusel { gap: 12px; }
  /* 2 tarjetas y un tercio a la vista en el celular. */
  .dsp-card { flex-basis: calc((100% - 2 * 12px) / 2.333); }
  .dsp-img { aspect-ratio: 1 / 1; }
  .dsp-cuerpo { padding: 10px; gap: 8px; }
  .dsp-cuerpo h3 { font-size: 13px; min-height: 34px; }
  .dsp-pill { height: 30px; padding: 0 8px; font-size: 12px; }
  .dsp-precio span { font-size: 16px; }
  .dsp-agregar { font-size: 13px; }
  .dsp-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
  .dsp-cats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
