
:root {
  --shop-basket-badge-size: 3.5rem;
  --shop-basket-badge-bg: var(--main-text);
  --shop-basket-badge-icon: var(--main-bg);
  --shop-basket-badge-count-bg: var(--profile-2);
  --shop-basket-badge-count-text: #fff;

  /* Above the content it floats over, below the header. */
  --shop-basket-badge-z-index: 2;
}

/* The badge shares the content's cell of the main grid, lying over it in the
 * lower right corner. Being sticky to the bottom, it rests in that corner
 * when the page is scrolled to its end, above the footer, and stays pinned
 * to the bottom right of the screen as the page is scrolled back up. */
.body-grid > .main > .shop-basket-badge {
  grid-area: content;
  align-self: end;
  justify-self: end;
  position: sticky;
  bottom: 1rem;
  margin: 0 1rem;
  z-index: var(--shop-basket-badge-z-index);
  width: var(--shop-basket-badge-size);
  height: var(--shop-basket-badge-size);
  border-radius: 50%;
  background-color: var(--shop-basket-badge-bg);
  box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.body-grid > .main > .shop-basket-badge:hover,
.body-grid > .main > .shop-basket-badge:focus {
  background-color: var(--button-bg-hover);
}

.shop-basket-badge svg.basket {
  width: 55%;
  height: 55%;
}
.shop-basket-badge svg.basket .colorable {
  fill: var(--shop-basket-badge-icon);
}
.shop-basket-badge:hover svg.basket .colorable,
.shop-basket-badge:focus svg.basket .colorable {
  fill: var(--button-text);
}

.shop-basket-badge > .count {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.3rem;
  box-sizing: border-box;
  border-radius: 0.7rem;
  background-color: var(--shop-basket-badge-count-bg);
  color: var(--shop-basket-badge-count-text);
  font-size: 0.8rem;
  font-weight: bold;
  line-height: 1.4rem;
  text-align: center;
}

