/* OrderStraight — Home restaurant feed + sticky filters.
   Progressive enhancement: every rule is gated on body.os-home-feed.
   Uses existing --os-* tokens only. No new type, colour or imagery. */

/* ---------- Sticky cuisine row + filter pills ---------- */
body.os-home-feed .os-cuisine-row {
  position: static; /* Visible in normal flow; scrolls away with the page. */
  top: auto;
  z-index: 40; /* below .os-topbar (50) and bottom nav (60) */
  margin-top: 0;
  max-width: none;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  background: #fff !important;
}
body.os-home-feed .os-cuisine-row > .os-cuisine-strip {
  max-width: 1248px; margin-inline: auto;
}
body.os-home-feed .os-filter-pills {
  position: -webkit-sticky; position: sticky;
  top: var(--os-feed-header-height, 0px);
  z-index: 39;
  max-width: none;
  margin-top: 0;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: #fff !important;
  border-bottom: 1px solid var(--os-line);
  scroll-padding-inline: 16px;
}
/* Keep pills aligned with content column on wide screens. */
@media (min-width: 1312px) {
  body.os-home-feed .os-filter-pills {
    padding-inline: calc((100% - 1248px) / 2);
  }
}
/* Fullscreen overlays (map, rail detail, dialogs) must stay above. */
body.os-home-feed.os-rail-view .os-cuisine-row,
body.os-home-feed.os-rail-view .os-filter-pills { position: static; }

/* Anchors / focus scrolling should not hide under the sticky stack. */
body.os-home-feed #osAllSection {
  scroll-margin-top: calc(var(--os-feed-header-height, 0px) + 56px);
}

/* ---------- All stores vertical feed ---------- */
/* Match the existing expanded Featured list, including its outer width. */
body.os-home-feed #osAllSection {
  max-width: 720px;
  width: 100%;
  padding-inline: 0;
}
body.os-home-feed #osAllSection > .os-section-head {
  padding-inline: 14px;
}
body.os-home-feed #osAllSection #osGrid.os-rail {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
  max-width: 720px !important;
  width: 100%;
  padding: 14px 14px 24px !important;
  margin: 0 auto;
}

body.os-home-feed #osAllSection #osGrid > .os-card {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  scroll-snap-align: none !important;
  scroll-margin-top: calc(var(--os-feed-header-height, 0px) + 64px);
}
body.os-home-feed #osAllSection #osGrid > .os-card[hidden],
body.os-home-feed #osAllSection #osGrid > .os-feed-pending { display: none !important; }

body.os-home-feed #osAllSection #osGrid > .os-card .hero {
  aspect-ratio: 23 / 10 !important;
  border-radius: 12px;
}
body.os-home-feed #osAllSection #osGrid > .os-card .body { padding: 6px 4px 4px !important; }
body.os-home-feed #osAllSection #osGrid > .os-card .body > .name-row { min-height: 36px; margin: 0 0 1px; }
body.os-home-feed #osAllSection #osGrid > .os-card .os-compact-status { margin: 2px 0 0; }
body.os-home-feed #osAllSection #osGrid > .os-card .meta-row.os-compact-distance-row { margin: 3px 0 0; }
body.os-home-feed #osAllSection #osGrid > .os-card .os-compact-optional { margin-top: 3px; gap: 2px 8px; }
body.os-home-feed #osAllSection #osGrid > .os-card .rating-row { margin-top: 2px; }
body.os-home-feed #osAllSection #osGrid > .os-card .meta-row { margin-bottom: 0; }
body.os-home-feed #osAllSection #osGrid > .os-card .os-contact { width: 32px; height: 36px; min-width: 32px; min-height: 36px; }
body.os-home-feed #osAllSection #osGrid > .os-card .name { font-size: 17px !important; }
body.os-home-feed #osAllSection #osGrid > .os-card .meta-row,
body.os-home-feed #osAllSection #osGrid > .os-card .rating-row { font-size: 14px !important; }

/* ---------- Manual "Load more" fallback ---------- */
body.os-home-feed #osAllSection .os-feed-more {
  display: flex; justify-content: center;
  padding: 8px 0 calc(24px + env(safe-area-inset-bottom, 0px));
}
body.os-home-feed #osAllSection .os-feed-more[hidden] { display: none; }
body.os-home-feed #osAllSection .os-feed-more button {
  min-height: 44px; min-width: 44px;
  padding: 10px 22px;
  border: 1px solid var(--os-line); border-radius: 999px;
  background: #fff; color: var(--os-primary);
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
body.os-home-feed #osAllSection .os-feed-more button:hover { background: #f3f0ea; }
body.os-home-feed #osAllSection .os-feed-more button:focus-visible {
  outline: 2px solid var(--os-primary); outline-offset: 2px;
}
body.os-home-feed #osAllSection .os-feed-more button:disabled,
body.os-home-feed #osAllSection .os-feed-more button[aria-busy="true"] { opacity: .6; cursor: default; }

/* ---------- Subtle reveal for newly shown cards ---------- */
@media (prefers-reduced-motion: no-preference) {
  body.os-home-feed #osAllSection #osGrid > .os-card { animation: osFeedIn .28s ease both; }
  @keyframes osFeedIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  body.os-home-feed #osAllSection #osGrid > .os-card,
  body.os-home-feed #osAllSection #osGrid > .os-card:hover { animation: none; transform: none; transition: none; }
}
