/* SYDWALK MAIN STREET / C-STORE EDGE SWAP R1
   Stage 1 only: Main Street opens from the north, Discovery remains in the
   lower thumb zone, and C-store lifts from the south to FULL. HALF is reserved. */

html body[data-perspective="CUSTOMER"] #map-workspace {
  --cstore-discovery-rail-offset:0px;
  --cstore-curb-height:3.65rem;
  --main-street-north-offset:env(safe-area-inset-top,0px);
}

html body[data-perspective="CUSTOMER"] #map-workspace:has(.viewport-vendor-rail[data-landing-state="ACTIVE"]) {
  --cstore-discovery-rail-offset:calc(var(--viewport-vendor-rail-height,6.7rem) + env(safe-area-inset-bottom,0px));
}

/* Main Street page buttons do not carry Discovery's heading row. Reclaim that
   unused socket height for the Map while leaving ordinary result cards alone. */
html body[data-perspective="CUSTOMER"] #map-workspace:has(.viewport-vendor-rail[data-landing-state="ACTIVE"][data-content-source="MAIN_STREET_DOORS"]) {
  --viewport-vendor-rail-height:5.2rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail[data-content-source="MAIN_STREET_DOORS"] .viewport-vendor-rail-track {
  height:4.4rem;
}

/* The exposed rail reuses each page door's admitted icon instead of masking it
   for the older text-only compact treatment. */
html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail[data-content-source="MAIN_STREET_DOORS"] .viewport-main-street-page > span[aria-hidden="true"] {
  display:grid;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail[data-content-source="MAIN_STREET_DOORS"] .viewport-main-street-page:not(.viewport-account-door) {
  grid-template-columns:auto minmax(0,1fr);
  grid-template-rows:1fr 1fr;
  gap:0 .45rem;
  padding:.38rem .55rem;
  text-align:left;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail[data-content-source="MAIN_STREET_DOORS"] .viewport-main-street-page:not(.viewport-account-door) > :is(strong,small) {
  grid-column:2;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-main-street-heading {
  display:flex;
  gap:.35rem;
  height:1.8rem;
  padding:0 .12rem .2rem;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-main-street-heading .viewport-main-street-page {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:.28rem;
  width:auto;
  height:1.55rem;
  padding:.15rem .48rem;
  border-radius:999px;
  white-space:nowrap;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-main-street-heading .viewport-main-street-page > span[aria-hidden="true"] {
  display:inline-grid;
  width:1.05rem;
  height:1.05rem;
  border-radius:50%;
  font-size:.72rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-main-street-heading .viewport-main-street-page > strong {
  font-size:.72rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-main-street-heading .viewport-main-street-page > small {
  display:none;
}

/* A nonzero heading remains available while its result tray is folded. The
   selected Classifier projection stays painted on the Map; only the cards
   surrender their south-edge space until the Customer asks for them again. */
html body[data-perspective="CUSTOMER"] #map-workspace:has(.viewport-vendor-rail[data-content-source="SPATIAL_DISCOVERY"][data-results-state="COLLAPSED"]) {
  --viewport-vendor-rail-height:2.4rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail[data-content-source="SPATIAL_DISCOVERY"][data-results-state="COLLAPSED"] {
  height:calc(var(--viewport-vendor-rail-height) + env(safe-area-inset-bottom,0px)) !important;
  padding-bottom:.2rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail[data-results-state="COLLAPSED"] .viewport-vendor-rail-track {
  display:none;
}

/* Main Street is the north storefront. Its handle remains on the street edge
   and the full page unfolds downward without restoring the old desktop clamp. */
html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet {
  top:var(--main-street-north-offset) !important;
  right:0 !important;
  bottom:auto !important;
  left:0 !important;
  width:100% !important;
  max-width:none !important;
  height:3.05rem;
  max-height:3.05rem;
  border-radius:0 0 1.05rem 1.05rem !important;
  box-shadow:0 .26rem 0 #d7dfe2,0 .4rem 0 #f5f7f7,0 .16rem .35rem #04153442,0 .65rem 1.15rem #04153433 !important;
  overflow:hidden;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet.is-collapsed {
  top:var(--main-street-north-offset) !important;
  right:0 !important;
  bottom:auto !important;
  left:0 !important;
  width:100% !important;
  height:3.05rem !important;
  max-height:3.05rem !important;
  border-radius:0 0 1.05rem 1.05rem !important;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet.is-collapsed.is-search-peek-open {
  height:6.75rem !important;
  max-height:6.75rem !important;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet.is-collapsed .my-bitemapp-sheet-handle {
  top:auto;
  bottom:0;
}

html body[data-perspective="CUSTOMER"] #map-workspace .main-street-vendor-search-peek {
  position:absolute;
  z-index:3;
  top:0;
  right:0;
  left:0;
  display:none;
  gap:.42rem;
  min-height:3.7rem;
  padding:.52rem .7rem .62rem;
  background:color-mix(in srgb,var(--store-look-background,#eef4f5) 96%,transparent);
  box-sizing:border-box;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet.is-search-peek-open .main-street-vendor-search-peek {
  display:flex;
}

html body[data-perspective="CUSTOMER"] #map-workspace .main-street-vendor-search-peek input {
  min-width:0;
  flex:1;
  border:var(--store-look-border,1px solid #aebdc1);
  border-radius:var(--store-look-radius,.72rem);
  background:var(--store-look-surface,#fff);
  color:var(--store-look-text,#162c35);
  padding:.52rem .7rem;
  font:inherit;
}

html body[data-perspective="CUSTOMER"] #map-workspace .main-street-vendor-search-peek button {
  min-width:4.4rem;
  border:0;
  border-radius:var(--store-look-radius,.72rem);
  background:var(--store-look-accent,#173b49);
  color:#fff;
  padding:.45rem .7rem;
  font-weight:800;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet.is-expanded .main-street-vendor-search-peek {
  display:none;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet.is-expanded {
  top:var(--main-street-north-offset) !important;
  right:0 !important;
  bottom:calc(var(--cstore-curb-height) + var(--cstore-discovery-rail-offset)) !important;
  left:0 !important;
  width:100% !important;
  height:auto !important;
  max-height:none !important;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-map-sheet::before {
  top:auto;
  bottom:0;
  border-radius:0 0 1.8rem 1.8rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-sheet-handle {
  position:absolute;
  z-index:2;
  right:0;
  bottom:0;
  left:0;
  width:100%;
  border-top:.5rem solid #d7dfe2 !important;
  border-bottom:0 !important;
}

html body[data-perspective="CUSTOMER"] #map-workspace .my-bitemapp-sheet-body {
  height:calc(100% - 3.05rem) !important;
  padding-bottom:.8rem;
}

/* Discovery is independent Main Street cargo in the lower one-finger zone. */
html body[data-perspective="CUSTOMER"] #map-workspace .viewport-vendor-rail {
  position:absolute;
  /* The active rail is the south edge's teleporting header.  It must remain
     above either page while it occupies the shared peek socket. */
  z-index:13 !important;
  right:0;
  bottom:0;
  left:0;
  width:100%;
}

/* C-store is the south storefront. PEEK leaves its north-facing tab directly
   above Discovery; FULL covers the Map. A future HALF transform can be added
   without changing this ownership or DOM order. */
html body[data-perspective="CUSTOMER"] #map-workspace .customer-vendor-experience-sheet {
  --vendor-experience-tab-height:var(--cstore-curb-height);
  top:0;
  right:0;
  bottom:var(--cstore-discovery-rail-offset);
  left:0;
  grid-template-rows:var(--vendor-experience-tab-height) minmax(0,1fr);
  transform:translateY(0);
  box-shadow:0 -.35rem 1.2rem rgb(0 0 0 / 26%);
}

html body[data-perspective="CUSTOMER"] #map-workspace .customer-vendor-experience-sheet.is-collapsed {
  bottom:var(--cstore-discovery-rail-offset);
  transform:translateY(calc(100% - var(--vendor-experience-tab-height) + var(--vendor-experience-drag-y,0px)));
  pointer-events:none;
}

html body[data-perspective="CUSTOMER"] #map-workspace .customer-vendor-experience-sheet.is-expanded {
  bottom:0;
  transform:translateY(var(--vendor-experience-drag-y,0px));
  pointer-events:auto;
}

/* Account-avatar Store dance. The Map remains the street above the Store;
   the owning camera adapter keeps the featured avatar in that visible quarter. */
html body[data-perspective="CUSTOMER"] #map-workspace
  .customer-vendor-experience-sheet.is-expanded[data-account-avatar-store-stage="OPEN"] {
  top:25%;
  bottom:0;
  transition:top 250ms ease,transform 210ms ease;
}

html body[data-perspective="CUSTOMER"] #map-workspace #customer-vendor-experience-content {
  grid-row:2;
  min-height:0;
  height:auto;
  padding-top:.9rem;
}

html body[data-perspective="CUSTOMER"] #map-workspace .customer-vendor-experience-tab,
html body[data-perspective="CUSTOMER"] #map-workspace .customer-vendor-experience-sheet.is-collapsed .customer-vendor-experience-tab {
  grid-row:1;
  align-self:start;
  width:var(--syd-step-width);
  border-top:.32rem solid var(--syd-concrete-cap) !important;
  border-bottom:0 !important;
  border-radius:1.05rem 1.05rem 0 0;
  box-shadow:inset 0 1px #f1f3f1aa,inset 0 -.42rem 0 var(--syd-concrete-riser),0 -.28rem .7rem #04153455 !important;
  pointer-events:auto;
}

@media (prefers-reduced-motion:reduce) {
  html body[data-perspective="CUSTOMER"] #map-workspace :is(.my-bitemapp-map-sheet,.customer-vendor-experience-sheet) {
    transition:none !important;
  }
}
