/* Shared storefront edges. Full-bleed backgrounds remain outside the content rail.
   Honor narrower saved widths; cap wide presets at the existing 1240px header. */
body[data-app="mall-pc"][data-template-id] {
  --store-content-width:min(var(--store-body-width,1200px),1240px);
  --store-layout-gutter:24px;
  --store-layout-rail:min(calc(100% - 2 * var(--store-layout-gutter)),var(--store-content-width));
}
body[data-app="mall-pc"][data-template-id] .site-header {
  box-sizing:border-box;
  width:100%;
  max-width:none;
  margin-inline:0;
  padding-inline:max(var(--store-layout-gutter),calc((100% - var(--store-content-width)) / 2));
}
body[data-app="mall-pc"][data-template-id] :is(.template-topbar-inner,.store-intro,.catalog-shell,.service-band,.account-view,.sf-inner,.sf-article,.mps-route-notice),
body[data-app="mall-pc"][data-template-id] #storeContent > [data-mall-page-sections] {
  box-sizing:border-box;
  width:var(--store-layout-rail);
  max-width:var(--store-content-width);
  margin-inline:auto;
  padding-inline:0;
}
/* Grid tracks already provide side gutters for these two full-bleed presets. */
body[data-app="mall-pc"][data-template-id="enterprise-mall"] #storeContent > .mps-sections[data-page-type="home"] {
  width:100%;
  max-width:none;
  grid-template-columns:minmax(var(--store-layout-gutter),1fr) minmax(0,calc(var(--store-content-width) * .64)) minmax(0,calc(var(--store-content-width) * .36)) minmax(var(--store-layout-gutter),1fr);
}
body[data-app="mall-pc"][data-template-id="enterprise-mall"] [data-section-id="enterprise-hero"] > .mps-inner,
body[data-app="mall-pc"][data-template-id="blue-marketplace"] .mps-blue-layout {
  box-sizing:border-box;
  width:var(--store-layout-rail);
  max-width:var(--store-content-width);
  margin-inline:auto;
}
body[data-app="mall-pc"][data-template-id="blue-marketplace"] #storeContent > .mps-sections[data-page-type="home"] {
  width:100%;
  max-width:none;
  grid-template-columns:minmax(var(--store-layout-gutter),1fr) minmax(0,var(--store-content-width)) minmax(var(--store-layout-gutter),1fr);
}
@media (max-width:760px) {
  body[data-app="mall-pc"][data-template-id] { --store-layout-gutter:12px; }
}

/* The editor canvas uses the same content rail as the published page. */
.mps-preview[data-preview-channel="pc"][data-template-id] {
  --store-content-width:min(var(--store-body-width,1200px),1240px);
  --store-layout-gutter:12px;
  --store-layout-rail:min(calc(100% - 2 * var(--store-layout-gutter)),var(--store-content-width));
}
.mps-preview[data-preview-channel="pc"][data-template-id] > :is(.mps-preview-brand,.mps-preview-intro,.mps-preview-announcement,.mps-sections) {
  box-sizing:border-box;
  width:var(--store-layout-rail);
  max-width:var(--store-content-width);
  margin-inline:auto;
  padding-inline:0;
}
.mps-preview[data-preview-channel="pc"][data-template-id="enterprise-mall"] > .mps-sections {
  width:100%;max-width:none;
  grid-template-columns:minmax(var(--store-layout-gutter),1fr) minmax(0,calc(var(--store-content-width) * .64)) minmax(0,calc(var(--store-content-width) * .36)) minmax(var(--store-layout-gutter),1fr);
}
.mps-preview[data-preview-channel="pc"][data-template-id="enterprise-mall"] [data-section-id="enterprise-hero"] > .mps-inner,
.mps-preview[data-preview-channel="pc"][data-template-id="blue-marketplace"] .mps-blue-layout {
  width:var(--store-layout-rail);max-width:var(--store-content-width);margin-inline:auto;
}
.mps-preview[data-preview-channel="pc"][data-template-id="blue-marketplace"] > .mps-sections {
  width:100%;max-width:none;
  grid-template-columns:minmax(var(--store-layout-gutter),1fr) minmax(0,var(--store-content-width)) minmax(var(--store-layout-gutter),1fr);
}
