/* ============================================================
   A Que Maciel · catalogo.css
   Catálogo público del cliente. Pensado primero para el celular:
   la mayoría entra desde un enlace de WhatsApp, no desde un PC.
   ============================================================ */

.cat-cuerpo {
  background: #FFFCF6;
  color: #3A2320;
  font-family: var(--fuente, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  padding-bottom: 96px;              /* espacio para la barra del carrito */
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- cabecera ---------------- */
.cat-cab {
  background: #5D1311;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 2px 10px rgba(93,19,17,.22);
}
.cat-cab__in { display: flex; align-items: center; gap: 11px; max-width: 720px; margin: 0 auto; }
.cat-cab__logo {
  height: 52px; width: auto; flex: 0 0 auto; display: block;
  /* el logo ya viene sin fondo: sobre el marrón del cabezal se ve
     integrado en vez de como una calcomanía blanca pegada */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.cat-cab__info { min-width: 0; }
.cat-cab__dir {
  color: #F6E7D9; font-size: 11.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cat-cab__tel {
  color: #FAC61C; font-size: 12.5px; font-weight: 700;
  text-decoration: none; display: inline-block; margin-top: 2px;
}

/* ---------------- barra de estado ---------------- */
.cat-barra {
  background: #72B234; color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 7px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.cat-barra--cerrado { background: #8A7A76; }
.cat-barra__tasa { font-weight: 600; opacity: .92; font-size: 11.5px; }

/* ---------------- buscador ---------------- */
.cat-buscador-caja {
  padding: 11px 14px 7px; max-width: 720px; margin: 0 auto;
  position: sticky; top: 0; z-index: 20; background: #FFFCF6;
}
.cat-buscador {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1.5px solid #EADFD2;
  border-radius: 999px; padding: 0 15px; height: 46px;
  transition: border-color .14s, box-shadow .14s;
}
.cat-buscador:focus-within {
  border-color: #72B234;
  box-shadow: 0 0 0 3px rgba(114,178,52,.16);
}
.cat-buscador svg {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: #A08E88; stroke-width: 2; stroke-linecap: round;
}
.cat-buscador input {
  border: 0; outline: 0; background: transparent; flex: 1 1 auto;
  font-family: inherit; font-size: 16px;   /* 16px evita el zoom de iOS */
  color: #3A2320; min-width: 0;
}
.cat-buscador input::placeholder { color: #B5A6A0; }

/* ---------------- chips de categoría ---------------- */
.cat-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 3px 14px 11px;
  max-width: 720px; margin: 0 auto;
  scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; border: 1.5px solid #EADFD2; background: #fff;
  color: #6B5650; font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  min-height: 38px; transition: all .13s; white-space: nowrap;
}
.cat-chip:active { transform: scale(.97); }
.cat-chip.activo {
  background: #5D1311; border-color: #5D1311; color: #fff;
}

/* ---------------- rejilla de productos ---------------- */
.cat-main { max-width: 720px; margin: 0 auto; padding: 0 14px 24px; }
.cat-cargando { text-align: center; padding: 50px 0; color: #A08E88; font-size: 14px; }

.cat-seccion { margin-bottom: 22px; }
.cat-seccion__tit {
  font-size: 15px; font-weight: 800; color: #5D1311;
  margin: 4px 0 10px; display: flex; align-items: baseline; gap: 8px;
}
.cat-seccion__tit span { font-size: 11.5px; font-weight: 600; color: #A08E88; }

.cat-rejilla {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 11px;
}

.cat-prod {
  background: #fff; border: 1px solid #F0E6DA; border-radius: 15px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 1px 5px rgba(93,19,17,.055);
  position: relative; transition: transform .12s, box-shadow .12s;
}
.cat-prod:active { transform: scale(.985); }
.cat-prod--agotado { opacity: .62; }

.cat-prod__foto {
  aspect-ratio: 1/1; background: #fff; position: relative; overflow: hidden;
}
.cat-prod__foto img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cat-prod__foto--sin {
  display: grid; place-items: center; font-size: 30px;
  background: #FBF5EC; color: #D8C8B8;
}
.cat-prod__sello {
  position: absolute; top: 7px; left: 7px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .4px; padding: 3px 8px; border-radius: 999px;
  background: #E4362B; color: #fff;
}
.cat-prod__sello--pocos { background: #FAC61C; color: #5D1311; }

.cat-prod__cuerpo { padding: 9px 10px 11px; display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; }
.cat-prod__nom {
  font-size: 13px; font-weight: 700; line-height: 1.25; color: #3A2320;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 33px;
}
.cat-prod__pres { font-size: 11px; color: #A08E88; }
.cat-prod__precios {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin-top: auto; padding-top: 6px;
}
.cat-prod__precio { font-size: 16px; font-weight: 800; color: #5D1311; }
.cat-prod__bs { font-size: 10.5px; color: #A08E88; }

.cat-prod__accion { padding: 0 10px 11px; }
.cat-prod__btn {
  width: 100%; min-height: 38px; border: 0; border-radius: 10px;
  background: #72B234; color: #fff; font-family: inherit;
  font-size: 13.5px; font-weight: 800; cursor: pointer;
  transition: background .12s, transform .1s;
}
.cat-prod__btn:active { transform: scale(.97); background: #639A2C; }
.cat-prod__btn:disabled { background: #E4D9CE; color: #A08E88; cursor: not-allowed; }

/* control de cantidad cuando ya está en el carrito */
.cat-cant {
  display: flex; align-items: center; justify-content: space-between;
  background: #F3F8EC; border: 1.5px solid #BFDCA0; border-radius: 10px;
  height: 38px; overflow: hidden;
}
.cat-cant button {
  width: 38px; height: 100%; border: 0; background: transparent;
  color: #4F7A22; font-size: 19px; font-weight: 700; cursor: pointer;
  font-family: inherit; line-height: 1;
}
.cat-cant button:active { background: #E4F0D6; }
.cat-cant span {
  font-size: 13.5px; font-weight: 800; color: #3D6318;
  font-variant-numeric: tabular-nums;
}

/* ---------------- sin resultados ---------------- */
.cat-vacio { text-align: center; padding: 46px 20px; color: #A08E88; }
.cat-vacio__ico { font-size: 40px; margin-bottom: 10px; }
.cat-vacio h3 { font-size: 15px; color: #6B5650; margin: 0 0 5px; }
.cat-vacio p { font-size: 13px; margin: 0; }

/* ---------------- barra del carrito ---------------- */
.cat-carrito-barra {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 696px; margin: 0 auto;
  background: #5D1311; color: #fff;
  border: 0; border-radius: 15px; padding: 14px 17px;
  display: flex; align-items: center; gap: 11px;
  font-family: inherit; font-size: 14.5px; font-weight: 800;
  cursor: pointer; z-index: 40;
  box-shadow: 0 6px 22px rgba(93,19,17,.38);
  animation: catSube .22s ease-out;
}
@keyframes catSube { from { transform: translateY(14px); opacity: 0; } }
.cat-carrito-barra__n {
  background: #72B234; color: #fff;
  min-width: 25px; height: 25px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12.5px; padding: 0 7px;
}
.cat-carrito-barra__txt { flex: 1 1 auto; text-align: left; }
.cat-carrito-barra__tot { font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------------- hoja (sheet) ---------------- */
.cat-hoja-fondo {
  position: fixed; inset: 0; background: rgba(40,15,12,.5);
  /* Por encima de la barra fija (90) y del carrito (40): si la hoja
     quedaba debajo, la barra tapaba los botones de abajo —el de
     «Olvidé mi contraseña», por ejemplo— y no se podían pulsar. */
  z-index: 110; display: flex; align-items: flex-end; justify-content: center;
  animation: catFade .18s;
}
@keyframes catFade { from { opacity: 0; } }
.cat-hoja {
  background: #FFFCF6; width: 100%; max-width: 720px;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 20px 20px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  animation: catSubeHoja .24s cubic-bezier(.2,.9,.3,1);
}

/* La barra fija (Inicio · Mis pedidos · Entrar) se dibuja POR ENCIMA de
   la hoja, así que el último botón de la hoja quedaba tapado: se veía el
   borde verde y nada más. La hoja reserva el alto de la barra para que
   su contenido termine antes. */
.cat-hoja { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
@keyframes catSubeHoja { from { transform: translateY(40px); } }
.cat-hoja__arrastre {
  width: 40px; height: 4px; background: #E4D9CE; border-radius: 99px;
  margin: 4px auto 14px;
}
.cat-hoja__tit { font-size: 19px; font-weight: 800; color: #5D1311; margin: 0 0 4px; }
.cat-hoja__sub { font-size: 12.5px; color: #A08E88; margin: 0 0 14px; }

.cat-items { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.cat-item {
  display: grid; grid-template-columns: 52px minmax(0,1fr) auto;
  gap: 10px; align-items: center;
  background: #fff; border: 1px solid #F0E6DA; border-radius: 12px; padding: 8px;
}
.cat-item__foto { width: 52px; height: 52px; border-radius: 9px; overflow: hidden; background: #FBF5EC; }
.cat-item__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-item__nom { font-size: 13px; font-weight: 700; line-height: 1.25; }
.cat-item__precio { font-size: 11.5px; color: #A08E88; margin-top: 2px; }

/* La forma de compra (Unidad / Medio cartón / Cartón) tiene que
   saltar a la vista: dos líneas del mismo producto con la misma foto
   se confunden si el distintivo está en gris pequeño. */
.cat-item__precio b {
  display: inline-block; background: #F2F9EA; color: #4F7A22;
  border: 1px solid #CDE3B4; border-radius: 5px;
  padding: 1px 6px; font-size: 11px; font-weight: 800;
  margin-right: 4px;
}
.cat-item__ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cat-item__tot { font-size: 13.5px; font-weight: 800; color: #5D1311; }
.cat-item__cant { display: flex; align-items: center; gap: 2px; }
.cat-item__cant button {
  width: 28px; height: 28px; border: 1px solid #EADFD2; border-radius: 7px;
  background: #fff; color: #6B5650; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; line-height: 1;
}
.cat-item__cant span { min-width: 26px; text-align: center; font-size: 13px; font-weight: 800; }

.cat-resumen {
  background: #fff; border: 1px solid #F0E6DA; border-radius: 13px;
  padding: 12px 14px; margin-bottom: 14px;
}
.cat-resumen__linea {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; color: #7A6660; padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.cat-resumen__linea strong { color: #3A2320; font-weight: 700; }
.cat-resumen__linea--tot {
  border-top: 1px solid #F0E6DA; margin-top: 7px; padding-top: 9px;
  font-size: 15px; color: #5D1311; font-weight: 800;
}
.cat-resumen__linea--tot strong { font-size: 20px; color: #5D1311; }
.cat-resumen__bs { text-align: right; font-size: 12px; color: #A08E88; }

.cat-btn {
  width: 100%; min-height: 50px; border: 0; border-radius: 13px;
  font-family: inherit; font-size: 15.5px; font-weight: 800;
  cursor: pointer; display: block; transition: transform .1s, background .12s;
}
.cat-btn:active { transform: scale(.985); }
.cat-btn--primario { background: #72B234; color: #fff; box-shadow: 0 3px 12px rgba(114,178,52,.3); }
.cat-btn--primario:active { background: #639A2C; }
.cat-btn--primario:disabled { background: #D6C9BC; box-shadow: none; }
.cat-btn--texto { background: transparent; color: #A08E88; font-size: 13.5px; min-height: 42px; margin-top: 4px; }

/* ---------------- campos ---------------- */
.cat-campo { display: block; margin-bottom: 12px; }
.cat-campo > span {
  display: block; font-size: 12px; font-weight: 700; color: #6B5650; margin-bottom: 5px;
}
.cat-campo input {
  width: 100%; height: 46px; border: 1.5px solid #EADFD2; border-radius: 11px;
  padding: 0 13px; font-family: inherit; font-size: 16px;   /* 16px: sin zoom en iOS */
  color: #3A2320; background: #fff; outline: 0;
  transition: border-color .13s, box-shadow .13s;
}
.cat-campo input:focus {
  border-color: #72B234; box-shadow: 0 0 0 3px rgba(114,178,52,.15);
}
.cat-campo input::placeholder { color: #C4B5AE; }
.cat-campo--error input { border-color: #E4362B; }
.cat-error {
  display: block; font-style: normal; font-size: 11.5px;
  color: #E4362B; font-weight: 600; margin-top: 3px; min-height: 0;
}

.cat-pago-aviso {
  background: #FFF8E4; border: 1px solid #F5E3A8; border-radius: 11px;
  padding: 11px 13px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.cat-pago-aviso strong { font-size: 12.5px; color: #8A6A12; }
.cat-pago-aviso span { font-size: 11.5px; color: #9B8550; line-height: 1.35; }

/* ---------------- pedido listo ---------------- */
.cat-listo { text-align: center; padding: 18px 0 22px; }
.cat-listo__icono {
  width: 68px; height: 68px; border-radius: 50%;
  background: #EAF5DC; color: #72B234;
  display: grid; place-items: center; font-size: 34px; font-weight: 700;
  margin: 0 auto 14px;
  animation: catPop .34s cubic-bezier(.2,1.4,.4,1);
}
@keyframes catPop { from { transform: scale(.4); opacity: 0; } }
.cat-listo h2 { font-size: 21px; color: #5D1311; margin: 0 0 6px; }
.cat-listo__num {
  font-size: 32px; font-weight: 800; color: #72B234;
  margin: 4px 0; letter-spacing: -.5px;
}
.cat-listo p { font-size: 13.5px; color: #7A6660; margin: 0 0 10px; }
.cat-listo__tot { font-size: 15px; font-weight: 800; color: #5D1311; }

/* ---------------- pie ---------------- */
.cat-pie {
  max-width: 720px; margin: 10px auto 0; padding: 18px 16px 26px;
  border-top: 1px solid #F0E6DA;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 11.5px; color: #A08E88; text-align: center;
}
.cat-pie__marca {
  font-size: 14px; font-weight: 800; color: #6B5650;
  letter-spacing: .2px; margin-bottom: 2px;
}
.cat-pie__credito { font-size: 11.5px; color: #A08E88; }
.cat-pie__credito a { color: #72B234; text-decoration: none; font-weight: 700; }
.cat-pie__tel { font-size: 11.5px; color: #A08E88; margin-top: 2px; }
.cat-pie__tel a { color: #6B5650; text-decoration: none; font-weight: 700; }

/* ---------------- escritorio ---------------- */
@media (min-width: 760px) {
  .cat-rejilla { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .cat-hoja { border-radius: 20px; margin-bottom: 4vh; max-height: 88vh; }
  .cat-hoja-fondo { align-items: center; padding: 20px; }
  .cat-carrito-barra { left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 696px; }
}

/* Aviso de error al enviar: va justo debajo del botón, donde está
   mirando el pulgar, no en un alert() que en iOS corta la sensación
   de app. */
.cat-error-envio {
  display: none; margin-top: 9px; padding: 10px 13px;
  background: #FDECEA; border: 1px solid #F5C6C0; border-radius: 11px;
  color: #B3271C; font-size: 12.5px; font-weight: 600; line-height: 1.35;
}
.cat-error-envio.visible { display: block; }

/* En escritorio el catálogo estaba atado a 720 px (el ancho del móvil)
   y quedaba una franja enorme de blanco a los lados con solo 3
   columnas. Aquí se ensancha por tramos: se mantiene la lectura
   cómoda pero se aprovecha la pantalla. */
@media (min-width: 1000px) {
  .cat-main,
  .cat-buscador-caja,
  .cat-chips,
  .cat-pie { max-width: 940px; }
  .cat-rejilla { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 1360px) {
  .cat-main,
  .cat-buscador-caja,
  .cat-chips,
  .cat-pie { max-width: 1180px; }
  .cat-rejilla { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* La cabecera también crece, si no el logo queda flotando a la
   izquierda de una franja vacía. */
@media (min-width: 1000px) { .cat-cab__in { max-width: 940px; } }
@media (min-width: 1360px) { .cat-cab__in { max-width: 1180px; } }

/* ============================================================
   SELECTOR DE PRESENTACIÓN (huevos: unidad / medio cartón / cartón)

   Tres botones en la tarjeta. Se usan pastillas y no un <select>
   porque en el teléfono el <select> abre el menú nativo del sistema,
   que tapa la tarjeta y se siente como salir de la app.
   ============================================================ */
.cat-pres {
  display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap;
}
.cat-pres__op {
  flex: 1 1 auto; min-width: 0;
  border: 1.5px solid #E0D3C4; background: #fff;
  border-radius: 8px; padding: 6px 7px;
  font-family: inherit; font-size: 11.5px; font-weight: 700;
  color: #7A6660; cursor: pointer; line-height: 1.15;
  transition: all .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-pres__op:active { transform: scale(.96); }
.cat-pres__op.activo {
  border-color: #72B234; background: #F2F9EA; color: #4F7A22;
  box-shadow: 0 0 0 2px rgba(114,178,52,.14);
}

/* ============================================================
   FORMA DE PAGO EN LA HOJA DEL PEDIDO
   ============================================================ */
.cat-pago { margin-top: 18px; padding-top: 16px; border-top: 1px solid #F0E6DA; }
.cat-pago__tit {
  font-size: 13px; font-weight: 800; color: #5D1311;
  text-transform: uppercase; letter-spacing: .4px; margin: 0 0 10px;
}

.cat-pago__metodos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
}
.cat-pago__op {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 11px; border: 1.5px solid #E0D3C4; background: #fff;
  border-radius: 10px; cursor: pointer; text-align: left;
  font-family: inherit; transition: all .12s;
}
.cat-pago__op:active { transform: scale(.97); }
.cat-pago__op.activo {
  border-color: #72B234; background: #F2F9EA;
  box-shadow: 0 0 0 2px rgba(114,178,52,.15);
}
.cat-pago__op-nom { font-size: 13px; font-weight: 800; color: #5D1311; line-height: 1.2; }
.cat-pago__op-mon { font-size: 10.5px; color: #A08E88; font-weight: 600; }
.cat-pago__op.activo .cat-pago__op-nom { color: #4F7A22; }

/* cuenta a la que hay que pagar */
.cat-pago__cuenta {
  margin-top: 12px; background: #FDF8F2; border: 1px solid #EDDFCD;
  border-radius: 12px; padding: 13px 14px;
}
.cat-pago__cuenta-tit {
  font-size: 12px; font-weight: 800; color: #12687C;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 9px;
}
.cat-pago__datos { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.cat-pago__dato {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding-bottom: 6px; border-bottom: 1px dashed #EFE2D2;
}
.cat-pago__dato:last-child { border-bottom: 0; padding-bottom: 0; }
.cat-pago__dato dt { font-size: 11.5px; color: #A08E88; font-weight: 600; flex: 0 0 auto; }
.cat-pago__dato dd {
  margin: 0; font-size: 13px; font-weight: 800; color: #3C2B26;
  text-align: right; word-break: break-word; user-select: all;
}
.cat-pago__instr { font-size: 11.5px; color: #8A7870; line-height: 1.45; margin: 10px 0 0; }

.cat-pago__extra { margin-top: 14px; }

/* ---- subir comprobante ---- */
.cat-subir {
  display: block; border: 2px dashed #D8C6B2; border-radius: 12px;
  background: #FDFAF6; padding: 18px 14px; text-align: center;
  cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s;
}
.cat-subir:active { border-color: #72B234; }
.cat-subir input[type=file] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.cat-subir__vacio strong {
  display: block; font-size: 13px; color: #5D1311; font-weight: 800; margin-bottom: 3px;
}
.cat-subir__vacio span { font-size: 11.5px; color: #A08E88; }
.cat-subir__img {
  max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin: 0 auto;
}

/* ---- aviso flotante ---- */
.cat-flotante {
  position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 20px);
  background: #3C2B26; color: #fff; font-size: 13px; font-weight: 700;
  padding: 11px 18px; border-radius: 22px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .25s;
  box-shadow: 0 6px 20px rgba(0,0,0,.28); max-width: calc(100% - 40px);
  text-align: center;
}
.cat-flotante.visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   HOJA DE CUENTA (entrar / registro / mis pedidos)
   ============================================================ */
.cat-aviso-comun {
  margin-top: 12px; padding: 11px 13px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.45; font-weight: 600;
}
.cat-aviso-comun--ok { background: #F2F9EA; color: #4F7A22; border: 1px solid #CDE3B4; }
.cat-aviso-comun--error { background: #FDF0EE; color: #B03024; border: 1px solid #F0C9C4; }

.cat-micuenta__quien {
  display: flex; flex-direction: column; gap: 1px;
  background: #5D1311; color: #fff; border-radius: 12px;
  padding: 13px 16px; margin-bottom: 14px;
}
.cat-micuenta__quien strong { font-size: 16px; font-weight: 800; }
.cat-micuenta__quien span { font-size: 12px; opacity: .75; }

.cat-micuenta__tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: #F5EEE5; padding: 4px; border-radius: 10px;
}
.cat-micuenta__tab {
  flex: 1; border: 0; background: transparent; padding: 9px 6px;
  border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: #8A7870; cursor: pointer; transition: all .15s;
}
.cat-micuenta__tab.activo { background: #fff; color: #5D1311; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.cat-micuenta__linea { border: 0; border-top: 1px solid #F0E6DA; margin: 20px 0 16px; }
.cat-micuenta__sub { font-size: 13px; font-weight: 800; color: #5D1311; margin: 0 0 12px; }

/* ---- lista de pedidos ---- */
.cat-ped {
  border: 1px solid #EDE1D2; border-radius: 12px; margin-bottom: 9px;
  background: #fff; overflow: hidden;
}
.cat-ped summary {
  padding: 12px 14px; cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.cat-ped summary::-webkit-details-marker { display: none; }
.cat-ped__cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-ped__num { font-size: 14px; font-weight: 800; color: #5D1311; }
.cat-ped__sub { font-size: 11.5px; color: #A08E88; margin-top: 4px; }
.cat-ped__sub b { color: #3C2B26; }

.cat-ped__estado {
  font-size: 10.5px; font-weight: 800; padding: 4px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.cat-ped__estado--nuevo  { background: #FDF0EE; color: #B03024; }
.cat-ped__estado--prep   { background: #FFF7E0; color: #9A7410; }
.cat-ped__estado--camino { background: #E9F2F5; color: #12687C; }
.cat-ped__estado--ok     { background: #F2F9EA; color: #4F7A22; }
.cat-ped__estado--mal    { background: #F2F2F2; color: #777; }

.cat-ped__cuerpo { padding: 0 14px 13px; border-top: 1px solid #F5EEE5; margin-top: 2px; }
.cat-ped__items { list-style: none; margin: 10px 0; padding: 0; }
.cat-ped__items li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: #5A4842; padding: 4px 0;
}
.cat-ped__items li em { color: #A08E88; font-style: normal; font-size: 11px; }
.cat-ped__items li b { color: #3C2B26; white-space: nowrap; }
.cat-ped__dir { font-size: 11.5px; color: #8A7870; margin: 8px 0; line-height: 1.4; }
.cat-ped__tot {
  font-size: 12.5px; color: #5A4842; border-top: 1px dashed #EFE2D2;
  padding-top: 9px; margin-top: 4px;
}
.cat-ped__tot b { color: #5D1311; font-size: 14px; }
.cat-ped__pago {
  font-size: 11.5px; font-weight: 700; padding: 6px 10px; border-radius: 8px; margin: 8px 0;
}
.cat-ped__pago--ok { background: #F2F9EA; color: #4F7A22; }
.cat-ped__pago--espera { background: #FFF7E0; color: #9A7410; }

.cat-sin-pedidos { text-align: center; padding: 30px 16px; }
.cat-sin-pedidos__ico { font-size: 38px; margin-bottom: 8px; }
.cat-sin-pedidos p { margin: 0 0 4px; font-size: 13px; color: #5A4842; }
.cat-vacio-txt { font-size: 12px; color: #A08E88; }

/* ============================================================
   MODAL DE DATOS PARA PAGAR

   Se abre al elegir el método. Letra grande y datos seleccionables:
   el cliente copia el teléfono desde aquí y lo pega en su banco.
   ============================================================ */
.cat-modal-fondo {
  position: fixed; inset: 0; background: rgba(30,12,10,.62);
  z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(2px);
  /* mismo patrón que los modales del panel: oculto por opacidad para
     poder animar la entrada, y .abierto lo muestra */
  opacity: 0; visibility: hidden; transition: opacity .16s, visibility .16s;
}
.cat-modal-fondo.abierto { opacity: 1; visibility: visible; }
.cat-modal {
  background: #fff; border-radius: 18px; padding: 22px 20px 18px;
  width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto;
  position: relative; box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.cat-modal__cerrar {
  position: absolute; top: 10px; right: 12px; width: 34px; height: 34px;
  border: 0; background: #F5EEE5; border-radius: 50%; font-size: 21px;
  line-height: 1; color: #8A7870; cursor: pointer; font-family: inherit;
}
.cat-modal__tit {
  font-size: 18px; font-weight: 800; color: #5D1311; margin: 0 0 16px;
  padding-right: 36px;
}
.cat-modal .cat-pago__dato { padding: 9px 0; }
.cat-modal .cat-pago__dato dt { font-size: 12px; }
.cat-modal .cat-pago__dato dd { font-size: 15.5px; }
.cat-modal .cat-pago__instr {
  background: #FDF8F2; border-radius: 10px; padding: 11px 13px; margin-top: 14px;
}
.cat-modal .cat-btn { margin-top: 16px; width: 100%; }

/* ============================================================
   BARRA FIJA DE ABAJO (Inicio · Mis pedidos · Mi cuenta)
   ============================================================ */
.cat-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; background: #fff;
  border-top: 1px solid #EDE1D2;
  box-shadow: 0 -3px 14px rgba(93,19,17,.09);
  padding-bottom: env(safe-area-inset-bottom);
}
.cat-nav__btn {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 8px; font-family: inherit;
  font-size: 10.5px; font-weight: 700; color: #8A7870;
  -webkit-tap-highlight-color: transparent; transition: color .12s;
}
.cat-nav__btn:active { color: #72B234; }
.cat-nav__ico { font-size: 19px; line-height: 1; }

/* la barra del carrito tiene que subir para no quedar tapada */
body:has(.cat-nav:not([hidden])) .cat-carrito-barra { bottom: 66px; }

/* el pie deja espacio para que la barra no lo tape */
body:has(.cat-nav:not([hidden])) .cat-pie { padding-bottom: 78px; }

/* Con una hoja abierta la barra sobra: estorba y confunde. */
body:has(.cat-hoja-fondo:not([hidden])) .cat-nav { display: none; }

/* botón copiar junto a los datos de la cuenta */
.cat-pago__dato dd {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
.cat-pago__copiar {
  border: 1px solid #CDE3B4; background: #F2F9EA; color: #4F7A22;
  font-family: inherit; font-size: 10.5px; font-weight: 800;
  padding: 4px 9px; border-radius: 20px; cursor: pointer;
  flex: 0 0 auto; transition: all .12s; white-space: nowrap;
}
.cat-pago__copiar:active { transform: scale(.94); }
.cat-pago__copiar.copiado { background: #72B234; color: #fff; border-color: #72B234; }

/* El modal de datos de pago tampoco lleva <form>: sin altura propia
   su contenido medía 0 y el botón quedaba sin área de toque. */
#catPagoModal .cat-modal {
  height: auto;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
#catPagoModal .cat-pago__datos { overflow-y: auto; min-height: 0; }
#catPagoModal .cat-btn { flex-shrink: 0; }

/* Respiro extra al final de las hojas: el último botón tenía que quedar
   por encima del borde inferior seguro del teléfono. */
.cat-hoja { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* El botón que cierra cada paso de la hoja (Continuar / Enviar pedido)
   se pega al fondo de la hoja mientras se desplaza: cuando la lista de
   productos es larga, antes había que bajar hasta el final para verlo. */
#catIrDatos, #catEnviar {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

/* ---- número sobre el icono del carrito ---- */
.cat-nav__ico { position: relative; display: inline-block; }
.cat-nav__n {
  position: absolute; top: -6px; right: -13px;
  background: #E4362B; color: #fff;
  font-size: 9.5px; font-weight: 800; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center;
  border: 1.5px solid #fff;
}
.cat-nav__btn--lleno { color: #5D1311; }
.cat-nav__btn--lleno .cat-nav__ico { transform: scale(1.06); }

/* ============================================================
   CABECERA DE LA HOJA (rótulo + cerrar arriba a la derecha)

   El ✕ existía pero sin estilo: se pintaba como un cuadradito gris
   suelto, pegado al borde del título. Ahora es una barra con el
   nombre de lo que se está viendo y el botón a la derecha.
   ============================================================ */
.cat-hoja__barra {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 0 10px;
  position: sticky; top: 0; z-index: 3;
  background: #FFFCF6;
  margin: 0 -18px; padding-left: 18px; padding-right: 18px;
}
.cat-hoja__rotulo {
  font-size: 12px; font-weight: 800; color: #A08E88;
  text-transform: uppercase; letter-spacing: .5px;
}
.cat-hoja__cerrar {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: #F0E5D8; color: #5D1311;
  font-size: 16px; font-weight: 700; line-height: 1;
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.cat-hoja__cerrar:active { background: #E4D3BF; transform: scale(.93); }

/* el arrastre queda debajo de la barra: no se pisa */
.cat-hoja__arrastre { margin: 0 auto 2px; }

/* ============================================================
   SUBIR EL COMPROBANTE: galería primero, cámara después

   Un solo campo con `capture` abría la cámara siempre, aunque el
   cliente ya tuviera el comprobante guardado en el teléfono.
   ============================================================ */
.cat-subir {
  border: 2px dashed #D8C6B2; border-radius: 14px;
  background: #FDFAF6; padding: 12px; text-align: center;
  position: relative;
}
.cat-subir__opciones { display: flex; flex-direction: column; gap: 8px; }

.cat-subir__op {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 11px;
  background: #fff; border: 1.5px solid #E6D9C8;
  cursor: pointer; position: relative; overflow: hidden;
  text-align: left; transition: border-color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.cat-subir__op:active { border-color: #72B234; background: #F7FCF2; }

/* la principal, la que el cliente busca primero */
.cat-subir__op--principal { border-color: #72B234; background: #F4FAEC; }
.cat-subir__op--principal .cat-subir__ico { background: #72B234; color: #fff; }

.cat-subir__op input[type=file] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  cursor: pointer;
}
.cat-subir__ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  background: #F0E5D8; display: flex; align-items: center;
  justify-content: center; font-size: 18px;
}
.cat-subir__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cat-subir__txt strong { font-size: 13.5px; color: #5D1311; font-weight: 800; }
.cat-subir__txt em { font-size: 11.5px; color: #A08E88; font-style: normal; }

.cat-subir__img {
  max-width: 100%; max-height: 220px; border-radius: 10px;
  display: block; margin: 0 auto;
}
.cat-subir__cambiar {
  margin-top: 10px; border: 0; background: transparent;
  color: #12687C; font-family: inherit; font-size: 12.5px;
  font-weight: 800; text-decoration: underline; cursor: pointer; padding: 6px;
}

/* ============================================================
   LÍNEA DE TIEMPO DEL PEDIDO (Mis pedidos)

   Siete pasos, del «recibido» al «entregado». El que está corriendo
   se resalta y lleva la frase que explica qué pasa ahora mismo.
   ============================================================ */
.cat-seg {
  background: #FDFAF6; border: 1px solid #EFE2D2;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}

.cat-seg__lista { list-style: none; margin: 0; padding: 0; }

.cat-seg__paso {
  display: flex; align-items: flex-start; gap: 11px;
  position: relative; padding-bottom: 13px;
}
.cat-seg__paso:last-child { padding-bottom: 0; }

/* la línea que une un paso con el siguiente */
.cat-seg__paso:not(:last-child)::before {
  content: ''; position: absolute;
  left: 11px; top: 24px; bottom: 0;
  width: 2px; background: #E8DAC8;
}
.cat-seg__paso--hecho:not(:last-child)::before { background: #72B234; }

.cat-seg__bola {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1;
  background: #F0E5D8; color: #A08E88;
  border: 2px solid #F0E5D8; position: relative; z-index: 1;
}

.cat-seg__paso--hecho .cat-seg__bola {
  background: #72B234; border-color: #72B234; color: #fff;
}

/* el paso actual: late despacio para que el ojo vaya ahí */
.cat-seg__paso--actual .cat-seg__bola {
  background: #fff; border-color: #E4362B; color: #E4362B;
  animation: catLate 1.8s ease-in-out infinite;
}
@keyframes catLate {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228,54,43,.45); }
  50%      { box-shadow: 0 0 0 7px rgba(228,54,43,0); }
}

.cat-seg__txt {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px; color: #A08E88; font-weight: 600;
  padding-top: 3px; line-height: 1.3;
}
.cat-seg__txt em {
  font-style: normal; font-size: 11px; font-weight: 600; color: #B99A4E;
}
.cat-seg__paso--hecho .cat-seg__txt { color: #5A4842; }
.cat-seg__paso--actual .cat-seg__txt { color: #5D1311; font-weight: 800; }

.cat-seg__msg {
  margin-top: 13px; padding: 10px 12px;
  background: #fff; border-radius: 9px;
  font-size: 12.5px; color: #5A4842; line-height: 1.45;
  border-left: 3px solid #E4362B;
}

.cat-seg--cancelado .cat-seg__aviso {
  font-size: 13px; color: #A32020; font-weight: 700;
  background: #FDECEC; border-radius: 9px; padding: 11px 13px;
}
