.collection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collection-actions[hidden],
.collection-count[hidden],
.collection-product-actions[hidden] {
  display: none;
}

.collection-count {
  position: absolute;
  inset: 2px 0 auto auto;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding-inline: 3px;
  border-radius: 9px;
  background: var(--home-accent, #f58634);
  color: #141414;
  font: 500 11px/1 "IBM Plex Mono", monospace;
}

.collection-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 24px;
}

.collection-product-actions--listing {
  margin-block-start: 0;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.collection-product-actions .collection-button,
.new-product-back.collection-button {
  min-height: 40px;
  font-weight: 500;
}

.collection-product-actions .collection-button {
  min-width: 136px;
}

.collection-button,
.collection-dialog__close {
  min-height: 36px;
  padding-inline: 12px;
  border: 1px solid var(--home-graphite);
  border-radius: 0;
  background: #fff;
  color: #141414;
  font: inherit;
  cursor: pointer;
}

.collection-button:is(:hover, [aria-pressed="true"]),
.collection-button--primary {
  background: var(--home-graphite);
  color: #fff;
}

.collection-button--primary:hover {
  border-color: var(--home-accent);
  background: var(--home-accent);
  color: #141414;
}

.collection-button:focus-visible {
  outline: 2px solid var(--home-graphite);
  outline-offset: 3px;
}

.collection-button--text,
.collection-dialog__close {
  border-color: transparent;
}

.collection-status:empty,
.collection-dialog__empty:empty {
  display: none;
}

.collection-product-actions .collection-status {
  flex-basis: 100%;
}

.collection-product-actions--listing .collection-status {
  display: block;
  min-height: 1lh;
  color: #555;
  font-size: 12px;
}

.collection-dialog {
  width: min(640px, calc(100vw - 48px));
  max-height: 80vh;
  padding: 22px;
  border: 1px solid #2e2e2e;
  background: #fff;
  color: #141414;
}

.collection-dialog::backdrop {
  background: rgb(0 0 0 / 42%);
}

.collection-dialog__heading,
.collection-row,
.collection-row__product,
.collection-row__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collection-dialog__heading,
.collection-row {
  justify-content: space-between;
}

.collection-dialog h2,
.collection-list {
  margin: 0;
}

.collection-dialog__close { font-size: 24px; }

.collection-list {
  padding: 0;
  list-style: none;
}

.collection-row {
  padding-block: 12px;
  border-block-end: 1px solid #dedede;
}

.collection-row__product {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.collection-row__product:hover { text-decoration: underline; }
.collection-row__product strong { display: block; }

.collection-row__product img {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: contain;
}

.collection-row__actions input {
  width: 72px;
  min-height: 36px;
  padding-inline: 8px;
  border: 1px solid #bcbcbc;
  font: inherit;
}
