/* ============================================================
 * Foodjin — Markets page styles
 * Self-contained — used by markets/{food|grocery|clothing|service|all-cities}.html
 * Color tokens mirror the homepage v2 design language.
 * ============================================================ */

:root {
  --brand:        #CB202D;
  --brand-dark:   #AA1C27;
  --brand-soft:   #FCE8EA;
  --title:        #25313D;
  --subtitle:     #5A6573;
  --hint:         #9A938D;
  --bg:           #F7F7F7;
  --surface:      #FFFFFF;
  --divider:      #ECEEF2;
  --success:      #3F7E31;
  --warning:      #F59E0B;

  /* Per-category accent — overridden in each page */
  --cat-accent:   #CB202D;
  --cat-accent-soft: #FCE8EA;
  --cat-ink:      #25313D;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--title);
  background: var(--surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   Header
============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
}
.site-header .row {
  display: flex; align-items: center; gap: 32px;
  padding: 14px 0;
}
.site-header .logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
}
.site-header .logo img { height: 32px; width: auto; display: block; }
.site-header .nav { display: flex; gap: 24px; font-size: 14px; font-weight: 500; color: var(--subtitle); }
.site-header .nav a:hover { color: var(--title); }
.site-header .spacer { flex: 1; }
.site-header .cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: white;
  padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
}
.site-header .cta:hover { background: var(--brand-dark); }

/* ============================================================
   Category hero
============================================================ */
.cat-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--cat-accent-soft) 0%, var(--surface) 70%);
  padding: 64px 0 56px;
}
.cat-hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.cat-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cat-accent); margin-bottom: 18px;
}
.cat-hero .eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cat-accent);
}
.cat-hero h1 {
  font-size: 56px; font-weight: 900; letter-spacing: -0.025em;
  line-height: 1.04; margin-bottom: 18px;
}
.cat-hero h1 span { color: var(--cat-accent); }
.cat-hero .lead {
  font-size: 19px; color: var(--subtitle);
  margin-bottom: 22px; max-width: 540px; line-height: 1.5;
}
.cat-hero .body {
  font-size: 15px; color: var(--subtitle);
  margin-bottom: 28px; max-width: 540px; line-height: 1.65;
}
.cat-hero .stats {
  display: flex; gap: 32px; padding-top: 24px;
  border-top: 1px solid var(--divider);
}
.cat-hero .stat .num {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--cat-accent);
}
.cat-hero .stat .lbl {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--hint); margin-top: 2px;
}
.cat-hero .visual {
  aspect-ratio: 1 / 1;
  background: var(--cat-accent) center/cover no-repeat;
  border-radius: 24px;
  box-shadow: 0 30px 80px -30px var(--cat-accent);
  position: relative; overflow: hidden;
}
.cat-hero .visual::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(155deg, transparent 50%, rgba(0,0,0,0.18));
}

/* ============================================================
   Sections
============================================================ */
.section { padding: 56px 0; }
.section.bg { background: var(--bg); }
.section-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.section-head .t { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.section-head .s { font-size: 14px; color: var(--subtitle); margin-top: 4px; }
.section-head .live-pill {
  margin-left: auto;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  background: var(--divider); color: var(--hint);
  display: inline-flex; align-items: center; gap: 6px;
}
.section-head .live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hint); }
.section-head .live-pill.on { background: #DCEFD7; color: var(--success); }
.section-head .live-pill.on .dot { background: var(--success); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ============================================================
   Vendor / item rails
============================================================ */
/* v2 (2026-06-09) — vendor + item cards share a single shape (photo on
   top, body below) so both columns of each market section read as equal
   visual weight. Previously vendor rows were compact (~70px) and item
   blocks were tall (~280px), which made the right column 4× taller and
   left a big empty void below the vendors. */
/* v2 (2026-06-10) — rails are 2-column card grids capped to a fixed
   max-height; cards scroll vertically inside the lane so the section
   never grows unbounded as more live vendors / items come in. */
.vendor-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  gap: 16px;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 14px 4px;
  margin: 0 -4px;
  -webkit-overflow-scrolling: touch;
}
/* Thin brand-tinted vertical scrollbar */
.vendor-rail::-webkit-scrollbar,
.item-rail::-webkit-scrollbar { width: 6px; }
.vendor-rail::-webkit-scrollbar-track,
.item-rail::-webkit-scrollbar-track { background: transparent; }
.vendor-rail::-webkit-scrollbar-thumb,
.item-rail::-webkit-scrollbar-thumb { background: var(--cat-accent-soft); border-radius: 999px; }
.vendor-rail::-webkit-scrollbar-thumb:hover,
.item-rail::-webkit-scrollbar-thumb:hover { background: var(--cat-accent); }
.vendor-rail, .item-rail { scrollbar-color: var(--cat-accent-soft) transparent; scrollbar-width: thin; }

.vendor-card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
  min-width: 0;
}
.vendor-card:hover { transform: translateY(-2px); border-color: var(--cat-accent); }
.vendor-card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg) center/cover no-repeat;
  position: relative;
}
.vendor-card .badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--cat-accent-soft); color: var(--cat-accent);
}
.vendor-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.vendor-card .name { font-size: 15px; font-weight: 700; color: var(--title); line-height: 1.3; }
.vendor-card .meta {
  font-size: 12px; color: var(--subtitle); margin-top: 4px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.vendor-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--hint); }
.vendor-card .meta .star { color: var(--warning); font-weight: 700; }

.item-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  gap: 16px;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 14px 4px;
  margin: 0 -4px;
  -webkit-overflow-scrolling: touch;
}
.item-card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
  min-width: 0;
}
.item-card:hover { transform: translateY(-2px); border-color: var(--cat-accent); }
.item-card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg) center/cover no-repeat;
  position: relative;
}
.item-card .live-pill {
  position: absolute; top: 10px; left: 10px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px;
  background: #DCEFD7; color: var(--success);
}
.item-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.item-card .vendor {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--hint);
}
.item-card .title { font-size: 15px; font-weight: 700; color: var(--title); line-height: 1.3; }
.item-card .row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--divider);
}
.item-card .price { font-size: 16px; font-weight: 800; color: var(--cat-accent); }
.item-card .meta { font-size: 11px; color: var(--subtitle); }

/* v2 (2026-06-10) — empty-state placeholder shown inside an empty rail. */
.rail-empty {
  grid-column: 1 / -1;
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--subtitle);
  background: var(--bg);
  border: 1px dashed var(--divider);
  border-radius: 12px;
}

/* ============================================================
   "Get the app" CTA strip
============================================================ */
.app-cta {
  background: linear-gradient(155deg, var(--cat-ink) 0%, #1A2230 100%);
  color: white;
  padding: 56px 0;
  text-align: center;
}
.app-cta h2 {
  font-size: 36px; font-weight: 900; letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.app-cta p { font-size: 16px; color: rgba(255,255,255,0.78); margin-bottom: 28px; }
.app-cta .stores { display: inline-flex; gap: 12px; }
/* Store button — matches the homepage hero pattern: black bg, two-line label */
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #111; color: #fff;
  padding: 9px 16px; border-radius: 12px;
  border: 1px solid #111;
  transition: background 0.15s ease;
  font-weight: 600;
}
.store-btn:hover { background: #2B231D; }
.store-btn .glyph { font-size: 22px; line-height: 1; }
.store-btn .lbl { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-btn .lbl .pre { font-size: 10px; opacity: 0.75; font-weight: 500; }
.store-btn .lbl .name { font-size: 14px; font-weight: 600; }
/* Reset legacy small/b rules that previous version of this file relied on */
.store-btn small, .store-btn b { all: unset; }

/* ============================================================
   Cities grid (all-cities page)
============================================================ */
.cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.city-card {
  background: var(--surface); border: 1px solid var(--divider); border-radius: 12px;
  padding: 16px 18px;
  border-left: 3px solid var(--success);
}
.city-card.soon { border-left-color: var(--warning); }
.city-card .name { font-size: 16px; font-weight: 700; }
.city-card .state { font-size: 12px; color: var(--subtitle); margin-top: 2px; }
.city-card .status {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 11px; font-weight: 700;
  color: var(--success); letter-spacing: 0.04em; text-transform: uppercase;
}
.city-card.soon .status { color: var(--warning); }
.city-card .status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}

/* ============================================================
   Footer (minimal — matches homepage tone)
============================================================ */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--divider);
  padding: 36px 0 28px;
  font-size: 13px;
  color: var(--subtitle);
}
.site-footer .row {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.site-footer .row a:hover { color: var(--title); }
.site-footer .crumbs { font-size: 12px; color: var(--hint); }

/* ============================================================
   Responsive
============================================================ */
/* v2 (2026-06-09) — full responsive sweep across header + rails + city grid.
   Three breakpoints (1024 / 860 / 480) cover tablet portrait, large-phone /
   small-tablet, and small-phone respectively. The auto-fit minmax on the
   rails already collapses gracefully; these queries tune typography + gutters
   so the layout stays composed at every size. */
@media (max-width: 1024px) {
  .site-header .row { gap: 20px; }
  .cat-hero { padding: 56px 0 48px; }
  .cat-hero h1 { font-size: 48px; }
  .cat-hero .lead { font-size: 17px; }
  .section { padding: 48px 0; }
  .section-head .t { font-size: 26px; }
  .vendor-rail, .item-rail { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; max-height: 520px; }
  .cities-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 860px) {
  .cat-hero { padding: 40px 0 32px; }
  .cat-hero .container { grid-template-columns: 1fr; gap: 32px; }
  .cat-hero h1 { font-size: 40px; }
  .cat-hero .visual { aspect-ratio: 16 / 10; }
  .section { padding: 40px 0; }
  .section-head .t { font-size: 24px; }
  .site-header .nav { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .cat-hero { padding: 32px 0 28px; }
  .cat-hero h1 { font-size: 32px; }
  .cat-hero .lead { font-size: 15px; }
  .cat-hero .stats { gap: 22px; }
  .cat-hero .stat .num { font-size: 22px; }
  .section { padding: 32px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 22px; }
  .section-head .live-pill { margin-left: 0; }
  .vendor-rail, .item-rail { grid-template-columns: 1fr; gap: 12px; max-height: 460px; }
  .vendor-card .body, .item-card .body { padding: 12px 14px 14px; }
  .vendor-card .name, .item-card .title { font-size: 14px; }
  .cities-grid { grid-template-columns: 1fr; }
  .app-cta { padding: 40px 0; }
  .app-cta h2 { font-size: 26px; }
  .app-cta .stores { flex-direction: column; align-items: center; gap: 10px; }
  .site-footer .row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer .row > a { font-size: 13px; }
}
