:root {
  --shop-gap: 24px;
  --shop-card-radius: 14px;
}

body.shop-page { overflow: hidden; }

#shop {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  height: 100vh;
  height: 100dvh;
}

.shop-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  background: var(--header-bg);
  color: var(--header-text);
  height: 56px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.shop-title { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shop-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.shop-accounts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-content {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

.shop-filters {
  width: 280px;
  flex: 0 0 280px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.shop-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shop-filters-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.shop-filters-reset {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #111827;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.shop-filter-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-filter-title {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.shop-filter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #1f2937;
}

.shop-filter-item input {
  width: 14px;
  height: 14px;
}

.shop-filter-sublist {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #111827;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.shop-tag input {
  width: 13px;
  height: 13px;
}

.shop-results {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shop-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #111827;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.shop-account:hover { background: #eef2f7; }

.shop-account.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.shop-account-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  flex-shrink: 0;
}

.shop-account-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shop-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--shop-gap);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.shop-card {
  border: 1px solid var(--border);
  border-radius: var(--shop-card-radius);
  background: #fff;
  display: grid;
  grid-template-rows: 190px 1fr;
  overflow: hidden;
  color: #111827;
  width: 240px;
  min-height: 280px;
  transition: box-shadow 0.2s ease;
}

.shop-card:hover {
  box-shadow: 0 14px 30px rgba(15,23,42,0.12);
}

.shop-card-image {
  width: 100%;
  height: 100%;
  min-height: 190px;
  flex: 0 0 190px;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  color: #9ca3af;
  font-size: 12px;
}

.shop-card-image-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}

.shop-card-image-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-card-thumbs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #fff;
  border-top: 1px solid #eef2f7;
}

.shop-card-thumbs img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.shop-card-body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 54px;
}

.shop-card-title {
  font-weight: 600;
  font-size: 13px;
  color: #111827;
  line-height: 1.3;
  min-height: 3.9em;
  max-height: 3.9em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.shop-card-price {
  font-weight: 700;
  color: #111827;
  font-size: 13px;
}

.shop-card-link {
  text-decoration: none;
  color: inherit;
}

.shop-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .shop-content {
    flex-direction: column;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .shop-filters {
    width: 100%;
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
  }
  .shop-results { overflow: visible; }
  .shop-list { overflow: visible; flex: 0 0 auto; }
  .shop-card { width: 200px; min-height: 250px; }
  .shop-card { grid-template-rows: 170px 1fr; }
  .shop-card-image { min-height: 170px; flex: 0 0 170px; }
  .shop-card-thumbs img { width: 30px; height: 30px; }
  .shop-toolbar { padding: 8px 12px; }
}

@media (max-width: 640px) {
  .shop-card { width: calc(50% - 8px); min-height: 240px; }
  .shop-card { grid-template-rows: 160px 1fr; }
  .shop-card-image { min-height: 160px; flex: 0 0 160px; }
  .shop-card-thumbs img { width: 28px; height: 28px; }
  .shop-account { font-size: 11px; padding: 5px 8px; }
}
