/* ============================================================
   Buscador con sugerencias, marcas/categorías a la vista y
   "Repetir pedido". Ver build/js/buscador.js y auth.js
   Ojo: en esta web 1rem = 10px (html { font-size: 62.5% })
   ============================================================ */

/* ---------- Sugerencias del buscador ---------- */
.search-container.con-sugerencias {
  position: relative;
}
.sugerencias {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(420px, 92vw);
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  padding: 0.6rem;
  z-index: 1500;
  font-family: "Montserrat", sans-serif;
  text-align: left;
}
.sugerencias[hidden] {
  display: none;
}
.sug-item {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 10px;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: #222;
}
.sug-item:hover,
.sug-item.activa {
  background: #fdf1f1;
}
.sug-item img {
  width: 4.8rem;
  height: 4.8rem;
  object-fit: contain;
  background: #f7f7f7;
  border-radius: 8px;
}
.sug-texto {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.sug-nombre {
  font-size: 1.4rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sug-nombre mark {
  background: none;
  color: #b91616;
  font-weight: 800;
}
.sug-detalle {
  font-size: 1.2rem;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sug-precio {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
  font-size: 1.4rem;
  font-weight: 800;
  white-space: nowrap;
}
.sug-sin-stock {
  font-size: 1.1rem;
  font-weight: 600;
  color: #b91616;
}
.sug-todos {
  display: block;
  margin-top: 0.4rem;
  border-top: 1px solid #f0e6e6;
  border-radius: 0 0 10px 10px;
  padding: 1.2rem 0.8rem;
  font-size: 1.3rem;
  color: #b91616;
  text-align: center;
}
.sug-vacio {
  padding: 1.6rem 1rem;
  font-size: 1.4rem;
  color: #777;
  text-align: center;
}

/* En el celular la lista toma el ancho de la barra roja (que es la que la contiene) */
@media (max-width: 760px) {
  .search-container.con-sugerencias {
    position: static;
  }
  .sugerencias {
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: auto;
  }
}

/* ---------- Marcas y categorías a la vista ---------- */
.chips-categorias {
  display: grid;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
  font-family: "Montserrat", sans-serif;
}
.chips-fila {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 3.8rem;
  padding: 0 1.6rem;
  border: 2px solid #b91616;
  border-radius: 999px;
  background: #fff;
  color: #b91616;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip:hover {
  background: #fdf1f1;
}
.chip.activo {
  background: #b91616;
  color: #fff;
}
.chips-sub .chip {
  min-height: 3.2rem;
  padding: 0 1.3rem;
  border-width: 1px;
  border-color: #e3caca;
  color: #555;
  font-size: 1.3rem;
  font-weight: 600;
}
.chips-sub .chip.activo {
  background: #333;
  border-color: #333;
  color: #fff;
}

/* En el celular cada fila se desliza con el dedo */
@media (max-width: 760px) {
  .chips-categorias {
    padding: 0;
  }
  .chips-fila {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.2rem 1.6rem;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 1.6rem, #000 calc(100% - 3rem), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 1.6rem, #000 calc(100% - 3rem), transparent 100%);
  }
  .chips-fila::-webkit-scrollbar {
    display: none;
  }
}

/* ---------- Repetir pedido (Mis pedidos) ---------- */
.pedido-acciones {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}
.btn-repetir {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4rem;
  padding: 0 1.6rem;
  border: none;
  border-radius: 8px;
  background: #00a046;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn-repetir:hover {
  background: #008c3a;
}
.btn-repetir:disabled {
  background: #9bcfb0;
  cursor: wait;
}
.repetir-titulo {
  margin: 1.4rem 0 0.4rem;
  font-weight: 700;
  font-size: 0.9em;
  text-align: left;
}
.repetir-lista {
  margin: 0;
  padding-left: 1.8rem;
  text-align: left;
  font-size: 0.85em;
  color: #555;
}
