/* Shelves (src/ui/components/shelf.js): a crate pile and its word. Full is cheap (cool), Empty is dear
   (warm); the word always says it, so color is never the only clue. */

.shelf {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.1em 0.55em 0.1em 0.4em;
  border-radius: var(--r-pill);
  background: var(--sea-50);
  border: 2px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.3;
  vertical-align: middle;
}

.shelf__emoji {
  font-size: 1.05em;
  line-height: 1;
}

.shelf__pile {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: end;
  gap: 2px;
  height: 14px;
  padding: 0 2px 2px;
  border-bottom: 2px solid var(--sand-600);
}

.shelf__crate {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  border: 1.5px dashed var(--line-strong);
  background: transparent;
}

.shelf__crate.is-on {
  border: 1.5px solid var(--sand-600);
  background: var(--sand-400);
}

/* Overflowing: one more crate leans on top of the pile. */
.shelf__crate--extra {
  position: absolute;
  right: 0;
  top: -6px;
  transform: rotate(14deg);
}

.shelf--sm {
  font-size: var(--fs-xs);
  padding: 0 0.5em 0 0.35em;
}

/* Empty and Low: dear (warm). OK: neutral. Full and Overflowing: cheap (cool). */
.shelf--l0,
.shelf--l1 {
  background: var(--accent-100);
  border-color: var(--accent-200);
  color: var(--accent-700);
}

.shelf--l3,
.shelf--l4 {
  background: var(--sea-100);
  border-color: var(--sea-200);
  color: var(--sea-800);
}

/* The arrow ("⬇️ Cheaper soon") and its one cause chip. */
.shelf-arrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25em 0.4em;
  min-width: 0;
  max-width: 100%;
}

.shelf-arrow__dir {
  padding: 0.05em 0.55em;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 900;
  white-space: nowrap;
}

.shelf-arrow__good {
  margin-right: 0.3em;
}

.shelf-arrow.is-up .shelf-arrow__dir {
  background: var(--accent-100);
  color: var(--accent-700);
}

.shelf-arrow.is-down .shelf-arrow__dir {
  background: var(--sea-100);
  color: var(--sea-800);
}

.shelf-arrow__cause {
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
