/*
 * Storefront visual polish
 *
 * The storefront keeps its existing data and interactions. This layer only
 * unifies the visual hierarchy of the announcement, category selector and
 * product list so the page reads like a complete commerce surface.
 */
:root {
  --store-surface: #ffffff;
  --store-page: #f5f7fa;
  --store-line: #e6ebf2;
  --store-muted: #8a97a8;
  --store-heading: #26364a;
}

body[data-app="mall-pc"] {
  background: var(--store-page);
}

body[data-app="mall-pc"] .announcement {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  min-height: 46px;
  margin: 16px auto 0;
  padding: 0 18px;
  border: 1px solid #e8edf4;
  border-left: 4px solid var(--store-accent);
  border-radius: 3px;
  background: var(--store-surface);
  box-shadow: 0 4px 14px rgb(43 70 101 / 5%);
  color: #53647a;
  font-size: 13px;
  line-height: 1.6;
}

body[data-app="mall-pc"] .announcement::before {
  content: "公告";
  flex: 0 0 auto;
  color: var(--store-accent);
  font-weight: 700;
}

body[data-app="mall-pc"] .catalog-shell {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 0 64px;
}

body[data-app="mall-pc"] .catalog-sidebar {
  position: static;
  padding: 0;
  border: 0;
  background: linear-gradient(90deg, rgb(237 246 255 / 84%), rgb(237 246 255 / 28%) 52%, transparent);
}

body[data-app="mall-pc"] .catalog-sidebar .section-head,
body[data-app="mall-pc"] .catalog-toolbar {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 0 0 16px;
  padding: 0 14px;
  border: 0;
  border-left: 4px solid var(--store-accent);
  border-radius: 2px;
  background: linear-gradient(90deg, #eaf3fc 0%, rgb(234 243 252 / 56%) 42%, transparent 100%);
}

body[data-app="mall-pc"] .catalog-sidebar .section-head {
  justify-content: space-between;
}

body[data-app="mall-pc"] .catalog-sidebar .section-head h2,
body[data-app="mall-pc"] .catalog-toolbar h2 {
  margin: 0;
  color: var(--store-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

body[data-app="mall-pc"] .catalog-sidebar #categoryCount {
  color: var(--store-muted);
  font-size: 11px;
}

body[data-app="mall-pc"] #catalogCategories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 34px;
}

body[data-app="mall-pc"] #catalogCategories button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 88px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--store-line);
  border-radius: 4px;
  background: var(--store-surface);
  box-shadow: 0 2px 8px rgb(42 68 98 / 4%);
  color: #526176;
  font-size: 13px;
  text-align: center;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

body[data-app="mall-pc"] #catalogCategories button:hover {
  border-color: #9fc7f5;
  color: var(--store-accent);
  transform: translateY(-1px);
}

body[data-app="mall-pc"] #catalogCategories button.is-active {
  border-color: var(--store-accent);
  background: var(--store-accent);
  color: #fff;
  font-weight: 600;
}

body[data-app="mall-pc"] #catalogCategories svg {
  display: none;
}

body[data-app="mall-pc"] .catalog-main {
  width: 100%;
}

body[data-app="mall-pc"] .catalog-toolbar {
  justify-content: space-between;
  padding-right: 8px;
  border-bottom: 0;
}

body[data-app="mall-pc"] .catalog-toolbar p {
  display: none;
}

body[data-app="mall-pc"] .catalog-toolbar h2 {
  font-size: 20px;
}

body[data-app="mall-pc"] .catalog-result-meta {
  min-height: 30px;
  margin: -8px 0 12px;
  padding: 0 2px;
  color: var(--store-muted);
}

body[data-app="mall-pc"] .catalog-main .product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body[data-app="mall-pc"] .catalog-main .product-card {
  min-height: 0;
  border: 1px solid var(--store-line);
  border-radius: 7px;
  background: var(--store-surface);
  box-shadow: 0 3px 12px rgb(42 68 98 / 4%);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body[data-app="mall-pc"] .catalog-main .product-card:hover {
  border-color: #acd0f6;
  box-shadow: 0 10px 24px rgb(42 68 98 / 10%);
  transform: translateY(-2px);
}

body[data-app="mall-pc"] .catalog-main .product-visual {
  min-height: 156px;
  border-bottom: 1px solid #edf1f6;
  background: #f8fbff;
}

body[data-app="mall-pc"] .catalog-main .product-visual img {
  object-fit: contain;
  padding: 12px;
}

body[data-app="mall-pc"] .catalog-main .product-body {
  padding: 14px;
}

body[data-app="mall-pc"] .catalog-main .product-card h3 {
  color: var(--store-heading);
  font-size: 14px;
  line-height: 1.5;
}

body[data-app="mall-pc"] .catalog-main .product-label {
  color: #8d9aae;
  font-size: 11px;
}

body[data-app="mall-pc"] .catalog-main .product-meta strong {
  color: #ef6d66;
  font-size: 18px;
}

body[data-app="mall-pc"] .catalog-main .product-meta button {
  border-color: #b8d5f5;
  border-radius: 4px;
  background: #f0f7ff;
  color: var(--store-accent);
}

body[data-app="mall-pc"] .catalog-main .product-meta button:hover {
  background: var(--store-accent);
  color: #fff;
}

/* The visual editor and the public page share the same storefront hierarchy. */
.mps-preview .mps-band-categories,
.mps-preview .mps-band-product_grid {
  padding: 0;
  border: 0;
  background: transparent;
}

.mps-preview .mps-band-categories .mps-heading,
.mps-preview .mps-band-product_grid .mps-heading {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 0 0 16px;
  padding: 0 14px;
  border-left: 4px solid var(--mps-accent, #1677ff);
  border-radius: 2px;
  background: transparent;
  color: #26364a;
  font-size: 20px;
  font-weight: 700;
}

/* 分类与商品目录是两个独立组件；标题只保留左侧强调线，不再生成整块标题背景。 */
.mps-preview .mps-band-categories,
.mps-preview .mps-band-product_grid { margin:0; padding:12px 0 16px; border:0; background:transparent; }
.mps-preview .mps-band-product_grid { margin-top:4px; padding-top:16px; border-top:1px solid #edf1f5; }
.mps-preview .mps-band-product_grid .mps-shop-status { display:grid; place-items:center; min-height:58px; margin:0; padding:12px; border:1px dashed #d9e3ee; background:rgb(248 251 255 / 72%); color:#8a9caf; }

.mps-preview .mps-band-categories .mps-commerce-slot,
.mps-preview .mps-band-product_grid .mps-commerce-slot {
  padding: 0;
}

.mps-preview .mps-band-categories .mps-shop-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mps-preview .mps-band-categories .mps-shop-categories button {
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid #e6ebf2;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  color: #526176;
  font-size: 13px;
}

.mps-preview .mps-band-categories .mps-shop-categories button:first-child,
.mps-preview .mps-band-categories .mps-shop-categories button:hover {
  border-color: var(--mps-accent, #1677ff);
  background: var(--mps-accent, #1677ff);
  color: #fff;
}

/* 后台装修预览与前台保持相同的紧凑分类比例。 */
.mps-preview .mps-showcase-categories .mps-commerce-slot[data-layout="matrix"] > .mps-shop-categories {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.mps-preview .mps-showcase-categories .mps-commerce-slot[data-layout="matrix"] > .mps-shop-categories button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #52677d;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
}
.mps-preview .mps-showcase-categories .mps-commerce-slot[data-layout="matrix"] > .mps-shop-categories button:first-child,
.mps-preview .mps-showcase-categories .mps-commerce-slot[data-layout="matrix"] > .mps-shop-categories button:hover {
  border-left-color: var(--mps-accent, #1677ff);
  background: #edf5ff;
  color: var(--mps-accent, #1677ff);
}

.mps-preview .mps-band-product_grid .mps-shop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mps-preview .mps-band-product_grid .mps-shop-product {
  border-color: #e6ebf2;
  border-radius: 7px;
  box-shadow: 0 3px 12px rgb(42 68 98 / 4%);
}

.mps-preview .mps-band-product_grid .mps-shop-cover {
  background: #f8fbff;
}

.mps-preview .mps-band-product_grid .mps-shop-cover img {
  object-fit: contain;
  padding: 12px;
}

.mps-preview .mps-band-notice {
  padding: 12px 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #53647a;
}

@media (max-width: 760px) {
  .mps-preview .mps-band-product_grid .mps-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .mps-preview .mps-band-categories .mps-shop-categories {
    gap: 8px;
  }

  .mps-preview .mps-band-categories .mps-shop-categories button {
    min-width: 0;
    padding: 0 13px;
    font-size: 12px;
  }
}

@media (max-width: 1248px) {
  body[data-app="mall-pc"] .announcement,
  body[data-app="mall-pc"] .catalog-shell {
    margin-left: 24px;
    margin-right: 24px;
  }

  body[data-app="mall-pc"] .catalog-main .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-app="mall-pc"] .announcement {
    margin-top: 12px;
    margin-left: 12px;
    margin-right: 12px;
  }

  body[data-app="mall-pc"] .catalog-shell {
    margin-left: 12px;
    margin-right: 12px;
    padding-top: 26px;
  }

  body[data-app="mall-pc"] .catalog-main .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  body[data-app="mall-pc"] #catalogCategories {
    gap: 8px;
    padding-bottom: 26px;
  }

  body[data-app="mall-pc"] #catalogCategories button {
    min-width: 0;
    padding: 0 13px;
    font-size: 12px;
  }
}
