.admin-shop,
.admin-shop-panel {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.admin-shop-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-shop-category {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 500 var(--text-label)/1.3 var(--font);
  text-align: left;
  cursor: pointer;
}

.admin-shop-category[aria-pressed="true"] {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}

.admin-shop-category strong {
  font: 800 15px/1.3 var(--display);
  overflow-wrap: anywhere;
}

.admin-shop-category > span:not(.admin-shop-status) {
  color: var(--muted);
}

.admin-shop-toolbar,
.admin-shop-toolbar > div:first-child,
.admin-shop-actions,
.admin-shop-editor header,
.admin-shop-editor footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-shop-toolbar,
.admin-shop-editor header,
.admin-shop-editor footer {
  justify-content: space-between;
}

.admin-shop-toolbar h2,
.admin-shop-editor h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
}

.admin-shop-status {
  display: inline-block;
  justify-self: start;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-shop-status[data-visible="true"] {
  background: var(--gold);
  color: var(--ink);
}

.admin-shop-products {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #e8e8e8;
}

.admin-shop-row {
  display: grid;
  grid-template-columns: 42px minmax(90px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e8e8e8;
}

.admin-shop-thumb {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
  overflow: hidden;
}

.admin-shop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-shop-product-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  overflow-wrap: anywhere;
}

.admin-shop-product-copy strong {
  line-height: 1.25;
}

.admin-shop-product-copy small,
.admin-shop-price {
  color: var(--muted);
  font-size: var(--text-label);
}

.admin-shop-price {
  white-space: nowrap;
}

.admin-shop-actions .admin-shop-icon,
.admin-shop-editor .admin-shop-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.admin-shop-icon[data-admin-shop-action$="-up"] svg,
.admin-shop-icon[data-admin-shop-action$="-down"] svg {
  transform: rotate(90deg);
}

.admin-shop-icon:disabled {
  opacity: .4;
}

.admin-shop-editor,
.admin-shop-preview {
  padding: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.admin-shop-editor {
  display: grid;
  gap: 12px;
}

.admin-shop-editor-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 2fr;
  gap: 10px;
}

.admin-shop-editor-fields .field {
  min-width: 0;
  margin: 0;
}

.admin-shop-description {
  grid-column: 1 / -1;
}

.admin-shop-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
}

.admin-shop-preview summary {
  cursor: pointer;
  font-weight: 750;
}

.admin-shop-preview .shop-panel {
  margin-top: 14px;
}

.admin-shop-empty {
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}

@media (max-width: 850px) {
  .admin-shop-editor-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .admin-shop-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .admin-shop-row .admin-shop-status {
    grid-column: 2;
  }

  .admin-shop-row .admin-shop-actions {
    grid-column: 3;
    grid-row: 1 / 3;
    justify-content: end;
    max-width: 120px;
    gap: 4px;
  }

  .admin-shop-row .admin-shop-price {
    grid-column: 1 / 2;
    grid-row: 2;
    white-space: normal;
    line-height: 1;
  }
}

@media (max-width: 580px) {
  .admin-shop-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shop-toolbar > .admin-shop-actions {
    justify-content: start;
  }
}
