                   (* (count packages) 2)))
         max-width (* scale (apply max (map (fn [{:keys [width height length]}] (max width height length)) packages)))]
     [:svg {:width "100%" :height "80%"
-           :view-box (clojure.string/join " " [0 0 max-width total-height])}
+           :view-box (clojure.string/join " " [0 0 max-width (+ 2 total-height)])}
      [:g {:stroke :black
           :stroke-width (* scale 1)}
       (:rects
        (reduce
-        (fn [{:keys [offset] :as m} {:keys [width height length] :as package}]
-          (let [next-offset (+ offset (* scale 2))
-                height (* scale (min width height length))
-                width (* scale (max width height length))]
+        (fn [{:keys [offset] :as m} {:keys [width height length item] :as package}]
+          (let [box-height (* scale (min width height length))
+                box-width (* scale (max width height length))]
             (-> m
                 (update :rects conj
                         [:rect {:key (hash package)
                                 :x 0
-                                :y (+ offset (* scale 1))
-                                :height height
-                                :width width
-                                :fill :transparent}])
-                (update :offset + (* scale 2) height))))
-        {:offset 4 :rects nil}
+                                :y offset
+                                :height box-height
+                                :width box-width
+                                :fill (if (= (:id item) selected-flatpack-item) :black :transparent)}])
+                (update :offset - (* scale 1) box-height))))
+        {:offset total-height :rects nil}
         packages))]]))
 
 (defn select-items-view

   "This product is packaged in " (count packages) " flatpacks or boxes."])

(defn package-total-view
  [item-container packages]
  (let [show-popover (atom false)]
    (fn [_]
      (let [package-count (count packages)]
        (if (zero? package-count)

           [bootstrap/glyph {:glyph :warning}] "No flatpacks found!"]

          [:div
           [bootstrap/label {:on-click toggle-popover}
            package-count " flatpack" (when (< 1 package-count) "s")
            [bootstrap/overlay {:show @show-popover?
                                :container (reagent/current-component)}
             [package-total-overlay packages]]]])))))

(defn trolley-item
  [{:keys [desc name image-src packages id count]} remove-fn add-another-fn on-click-fn]
  [bootstrap/list-group-item {:key id :list-item true}
   [:div
    [:div.contents
