/* BDStall - pages/stall.css
   Stall list page + stall detail page styling.
   
   Two tiers:
   - Regular stall: free listing, no custom branding
   - Corporate stall: paid tier with banner, custom description,
     featured products, Verified Plus badge, multiple sections
   
   Visual design language: shopping district feel — each stall is
   a "storefront", not just a row in a database. Logo + identity matter.
*/

/* ════════════════════════════════════════════════════════════
   STALL LIST PAGE
   ════════════════════════════════════════════════════════════ */

.stall-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0 40px;
}
@media (min-width: 768px) {
  .stall-page-wrap { padding: 24px 0 60px; }
}

/* ─── Page header ─── */
.stall-page-header {
  text-align: center;
  margin: 8px 0 24px;
}
.stall-page-title {
  margin: 0 0 6px;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .stall-page-title { font-size: 2.125rem; }
}
.stall-page-lede {
  margin: 0 auto 12px;
  max-width: 580px;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}
.stall-page-stat {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 700;
}
.stall-page-stat strong {
  font-weight: 800;
}

/* ─── Search + filter toolbar ─── 
   Always single line — even on narrow phones (320px+).
   On very small widths, buttons collapse to icon-only via .label hiding. */
.stall-toolbar {
  display: flex; align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: nowrap;     /* never wrap to second line */
}
.stall-search {
  flex: 1 1 0;
  min-width: 0;          /* allow input to shrink below content width */
  position: relative;
}
.stall-search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--color-border-secondary);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text-primary);
  background: white;
  transition: border-color 0.15s;
}
.stall-search-input:focus {
  outline: none;
  border-color: var(--green);
}
.stall-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  pointer-events: none;
}
.stall-toolbar-btn {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: white;
  border: 1.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;        /* don't let buttons squeeze */
  transition: border-color 0.15s, color 0.15s;
}
.stall-toolbar-btn:hover {
  border-color: var(--green);
  color: var(--green-dark);
}
.stall-toolbar-btn .badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  margin-left: 2px;
}
/* On narrow phones, hide button text labels so the row fits comfortably.
   Icon + (badge for filter) remain visible. Use [data-label] for screen readers. */
@media (max-width: 479.98px) {
  .stall-toolbar-btn .label {
    display: none;
  }
  .stall-toolbar-btn {
    padding: 10px;
    min-width: 40px;
    justify-content: center;
  }
}

/* ─── Quick filter chips (under toolbar) ─── */
.stall-quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 0 14px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.stall-quick-filters::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .stall-quick-filters {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}
.stall-quick-chip {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 18px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  cursor: pointer;
}
.stall-quick-chip:hover {
  border-color: var(--green);
  color: var(--green-dark);
}
.stall-quick-chip.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.stall-quick-chip.corporate {
  border-color: var(--orange);
  color: var(--orange-dark);
}
.stall-quick-chip.corporate.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

/* ─── Featured stalls strip (top of list) ─── */
.stall-featured-section {
  margin-bottom: 28px;
}
.stall-featured-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.stall-featured-title {
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin: 0;
  display: inline-flex; align-items: center;
  gap: 6px;
}
.stall-featured-title-icon {
  color: var(--orange);
  font-size: 1rem;
}
.stall-featured-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .stall-featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Stall card ─── */
.stall-card {
  display: flex; flex-direction: column;
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 12px;
  padding: 16px 14px 14px;
  text-decoration: none;
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}
.stall-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(20,154,73,0.10);
}
.stall-card.corporate {
  border-color: rgba(245, 131, 32, 0.3);
  background: linear-gradient(180deg, rgba(252, 228, 204, 0.25) 0%, white 80px);
}
.stall-card.corporate:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 16px rgba(245,131,32,0.12);
}

.stall-card-corp-ribbon {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 10px;
  background: var(--orange);
  color: white;
  font-size: 0.6125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 10px;
  z-index: 1;
}

/* Logo + identity row */
.stall-card-identity {
  display: flex; align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.stall-logo {
  width: 52px; height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stall-logo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Hash-based color variants for the initial-fallback logo.
   8 distinct backgrounds — pick consistently from stall name hash. */
.stall-logo.color-1 { background: linear-gradient(135deg, #149A49, #0E7A38); }
.stall-logo.color-2 { background: linear-gradient(135deg, #F58320, #C56612); }
.stall-logo.color-3 { background: linear-gradient(135deg, #1877F2, #0F5FCE); }
.stall-logo.color-4 { background: linear-gradient(135deg, #E2136E, #B30E58); }
.stall-logo.color-5 { background: linear-gradient(135deg, #7360F2, #5546C4); }
.stall-logo.color-6 { background: linear-gradient(135deg, #0088CC, #006699); }
.stall-logo.color-7 { background: linear-gradient(135deg, #EB6E0E, #B85309); }
.stall-logo.color-8 { background: linear-gradient(135deg, #5F5E5A, #3D3C39); }

.stall-card-name-block {
  flex: 1; min-width: 0;
}
.stall-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin: 0 0 3px;
  display: flex; align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
  /* Truncate long names to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stall-card-verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 4px;
}
.stall-card-verified.plus {
  background: var(--orange);
}
.stall-card-rating {
  display: inline-flex; align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stall-card-rating .stars {
  color: #F5A623;
  font-size: 0.8125rem;
  letter-spacing: -0.5px;
}
.stall-card-rating .num {
  font-weight: 700;
  color: var(--color-text-primary);
}
.stall-card-rating .count {
  color: var(--color-text-tertiary);
}

/* Card meta row (location · products) */
.stall-card-meta {
  display: flex; align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
  flex-wrap: wrap;
}
.stall-card-meta-item {
  display: inline-flex; align-items: center;
  gap: 4px;
}
.stall-card-meta-icon {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}
.stall-card-meta-sep {
  color: var(--color-border-secondary);
}

/* Category chips on card */
.stall-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0;
}
.stall-card-tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-tertiary);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}
.stall-card-tag-more {
  color: var(--color-text-tertiary);
  font-style: italic;
  background: transparent;
  border: none;
}

/* ─── Main stall grid ─── */
.stall-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-bottom: 28px;
}
@media (min-width: 600px) {
  .stall-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .stall-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ─── Search results info bar ─── */
.stall-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: var(--green-light);
  border: 1px solid rgba(20,154,73,0.18);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 18px;
}
.stall-search-clear {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.stall-search-clear:hover { text-decoration: underline; }

/* ─── No results state ─── */
.stall-empty {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 12px;
  color: var(--color-text-secondary);
}
.stall-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.stall-empty-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 6px;
}
.stall-empty-msg {
  font-size: 0.875rem;
  margin: 0;
}


/* ════════════════════════════════════════════════════════════
   STALL DETAIL PAGE
   ════════════════════════════════════════════════════════════ */

.stall-detail-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
@media (min-width: 768px) {
  .stall-detail-wrap { padding-bottom: 60px; }
}

/* ─── Hero (banner area) ─── */
.stall-hero {
  position: relative;
  width: 100%;
}
/* Corporate variant: full banner image */
.stall-hero.corporate {
  /* Banner spec: 1200 x 400 px upload, 3:1 ratio.
     Use aspect-ratio so the banner scales perfectly with viewport width
     while keeping the seller-uploaded image at native proportions. */
  width: 100%;
  aspect-ratio: 3 / 1;
  max-height: 400px;          /* never grow past native 400px tall on wide screens */
  background: var(--color-bg-page);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.stall-hero.corporate::after {
  /* Bottom-left "safe zone" overlay where the stall logo overlaps the banner.
     Stronger gradient at bottom-left, fading up and right.
     Keeps any banner content above this zone clearly readable. */
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.30) 60%, rgba(0,0,0,0.50) 100%);
  pointer-events: none;
}
.stall-hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Regular variant: solid colored band, much shorter */
.stall-hero.regular {
  height: 80px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}
@media (min-width: 768px) {
  .stall-hero.regular { height: 120px; }
}

/* ─── Identity card (sits below banner, only logo floats up) ─── */
.stall-detail-identity {
  max-width: 1200px;
  margin: 14px auto 0;
  padding: 0 14px;
  position: relative;
  z-index: 2;
}
@media (min-width: 768px) {
  .stall-detail-identity {
    margin-top: 18px;
    padding: 0 20px;
  }
}

.stall-identity-card {
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (min-width: 768px) {
  .stall-identity-card {
    padding: 22px;
    flex-direction: row;
    align-items: center;
  }
}

.stall-identity-logo {
  width: 88px; height: 88px;
  border-radius: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  overflow: hidden;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  /* Logo floats up onto banner; card itself stays below */
  margin-top: -60px;
}
@media (min-width: 768px) {
  .stall-identity-logo {
    width: 104px; height: 104px;
    margin-top: -76px;
    font-size: 2.25rem;
  }
}
/* Reuse hash-color classes from list view */
.stall-identity-logo.color-1 { background: linear-gradient(135deg, #149A49, #0E7A38); }
.stall-identity-logo.color-2 { background: linear-gradient(135deg, #F58320, #C56612); }
.stall-identity-logo.color-3 { background: linear-gradient(135deg, #1877F2, #0F5FCE); }
.stall-identity-logo.color-4 { background: linear-gradient(135deg, #E2136E, #B30E58); }
.stall-identity-logo.color-5 { background: linear-gradient(135deg, #7360F2, #5546C4); }
.stall-identity-logo.color-6 { background: linear-gradient(135deg, #0088CC, #006699); }
.stall-identity-logo.color-7 { background: linear-gradient(135deg, #EB6E0E, #B85309); }
.stall-identity-logo.color-8 { background: linear-gradient(135deg, #5F5E5A, #3D3C39); }
.stall-identity-logo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.stall-identity-info {
  flex: 1; min-width: 0;
}

.stall-identity-name-row {
  display: flex; align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.stall-identity-name {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0;
}
@media (min-width: 768px) {
  .stall-identity-name { font-size: 1.625rem; }
}

.stall-verified-badge {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.stall-verified-badge.regular {
  background: var(--green-light);
  color: var(--green-dark);
}
.stall-verified-badge.plus {
  background: linear-gradient(135deg, var(--orange) 0%, #C56612 100%);
  color: white;
}
.stall-verified-badge .icon {
  font-size: 0.75rem;
}

/* Meta row: rating + member since + location */
.stall-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  align-items: center;
}
.stall-identity-meta-item {
  display: inline-flex; align-items: center;
  gap: 5px;
}
.stall-identity-meta-icon {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}
.stall-identity-meta strong {
  color: var(--color-text-primary);
  font-weight: 700;
}
.stall-identity-meta .stars {
  color: #F5A623;
  letter-spacing: -0.5px;
  font-size: 0.875rem;
}

/* Action buttons */
.stall-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .stall-actions {
    margin-left: auto;
    flex-shrink: 0;
  }
}
.stall-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: filter 0.15s, transform 0.15s;
  min-height: 40px;
}
.stall-action-btn:hover { filter: brightness(0.92); }
.stall-action-btn:active { transform: translateY(1px); }
.stall-action-btn.primary {
  background: var(--green);
  color: white;
  flex: 1;
}
@media (min-width: 768px) {
  .stall-action-btn.primary { flex: 0 0 auto; min-width: 140px; }
}
.stall-action-btn.whatsapp { background: var(--whatsapp); color: white; }
.stall-action-btn.website {
  background: white;
  color: var(--orange-dark);
  border: 1.5px solid var(--orange);
}
.stall-action-btn.website:hover { filter: none; background: var(--orange-light); }

/* ─── Page body grid (info + content) ─── */
.stall-detail-body {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 14px;
}
@media (min-width: 768px) {
  .stall-detail-body { padding: 0 20px; }
}

/* ─── About section (corporate only) ─── */
.stall-about {
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  margin-bottom: 24px;
}
.stall-about-title {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin: 0 0 8px;
}
.stall-about-text {
  font-size: 0.9375rem;
  color: #2A2A28;
  line-height: 1.65;
  margin: 0;
}
.stall-about-text p { margin: 0 0 10px; }
.stall-about-text p:last-child { margin-bottom: 0; }

/* ─── Featured products (corporate only) ─── */
.stall-featured-products {
  margin-bottom: 28px;
}
.stall-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.stall-section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  margin: 0;
  display: flex; align-items: center;
  gap: 8px;
}
.stall-section-title-icon {
  font-size: 1rem;
}
.stall-section-link {
  font-size: 0.8125rem;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.stall-section-link:hover {
  text-decoration: underline;
}

/* Featured product strip (horizontal scroll on mobile, grid on desktop) */
.stall-featured-products-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.stall-featured-products-row::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .stall-featured-products-row {
    overflow-x: visible;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: 0;
  }
}
.stall-featured-product {
  flex: 0 0 160px;
  scroll-snap-align: start;
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
@media (min-width: 768px) {
  .stall-featured-product { flex: 1; }
}
.stall-featured-product:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(20,154,73,0.10);
}
.stall-featured-product-img {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, #ECEAE3 0%, #DDDAD0 100%);
  display: block;
  object-fit: cover;
}
.stall-featured-product-body {
  padding: 8px 10px 10px;
}
.stall-featured-product-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stall-featured-product-price {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--green-dark);
  margin: 0;
}

/* ─── Products section (the main grid — reuses category-list patterns) ─── */
.stall-products {
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 12px;
  padding: 18px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
@media (min-width: 768px) {
  .stall-products { padding: 22px; }
}

.stall-products-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.stall-products-search {
  flex: 1; min-width: 200px;
  position: relative;
}
.stall-products-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--color-border-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: white;
}
.stall-products-search input:focus {
  outline: none;
  border-color: var(--green);
}
.stall-products-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  pointer-events: none;
}
.stall-products-sort {
  padding: 10px 14px;
  border: 1.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  background: white;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-family: inherit;
  cursor: pointer;
}

/* Quick stat row above products grid */
.stall-products-count {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  margin: 0 0 12px;
}
.stall-products-count strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* Product grid — uses simple thumb/title/price layout, lighter than full category cards */
.stall-products-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 600px) {
  .stall-products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .stall-products-grid { grid-template-columns: repeat(4, 1fr); }
}

.stall-product-card {
  display: flex; flex-direction: column;
  background: white;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.stall-product-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(20,154,73,0.10);
}
.stall-product-card-img-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, #ECEAE3 0%, #DDDAD0 100%);
  position: relative;
}
.stall-product-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.stall-product-card-body {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column;
  flex: 1;
}
.stall-product-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stall-product-card-price {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--green-dark);
  margin: auto 0 0;
  line-height: 1;
}
.stall-product-card-old {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 500;
}

/* ─── Per-product action button (corporate stalls only) ───
   Bottom of each product card. The button shown depends on the stall's
   monetization mode (set via [data-stall-mode] on the products grid):
     "ecom"        → Buy Now button (orange, primary CTA)
     "classified"  → Call button (green, contact CTA)
   Basic stalls don't render the button at all (markup omits it). */
.stall-product-action {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  margin-top: 8px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}
.stall-product-action:hover { filter: brightness(0.92); }
.stall-product-action:active { transform: translateY(1px); }
.stall-product-action.buy-now {
  background: var(--orange);
  color: white;
}
.stall-product-action.call {
  background: var(--green);
  color: white;
}
.stall-product-action .icon {
  font-size: 0.875rem;
}
/* ─── Stall detail pagination ───
   Always single line, always centered.
   Mobile (<480px): show only Prev / current page / Next — 3 buttons, no overflow
   Tablet (480-768px): + first, last, ellipsis
   Desktop (≥768px): full pagination with all numbers visible */
.stall-detail-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  flex-wrap: nowrap;
  padding: 4px 0;
  width: 100%;
}
@media (min-width: 600px) {
  .stall-detail-pagination { gap: 6px; }
}

.stall-detail-pagination a,
.stall-detail-pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--color-border-tertiary);
  background: white;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stall-detail-pagination svg { display: block; flex-shrink: 0; }
@media (min-width: 600px) {
  .stall-detail-pagination a,
  .stall-detail-pagination span {
    padding: 0 12px;
  }
}
.stall-detail-pagination a:hover {
  border-color: var(--green);
  color: var(--green-dark);
}
.stall-detail-pagination .active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.stall-detail-pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Mobile pagination — keep up to 3 page numbers visible, hide further ones.
   .pg-far    = numbers beyond the first 3 (always hidden on mobile)
   .pg-ellipsis = the … span (also hidden on mobile to keep tight) */
@media (max-width: 479.98px) {
  .stall-detail-pagination .pg-far,
  .stall-detail-pagination .pg-ellipsis {
    display: none;
  }
  .stall-detail-pagination .nav-label {
    display: none;
  }
  .stall-detail-pagination a,
  .stall-detail-pagination span {
    padding: 0 8px;
    font-size: 0.75rem;
    min-width: 32px;
    height: 32px;
  }
}


/* ════════════════════════════════════════════════════════════
   STALL FILTER SHEET (bottom sheet mobile, side panel desktop)
   Reuses the same pattern as category filters but lighter.
   ════════════════════════════════════════════════════════════ */

.stall-filter-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}
.stall-filter-overlay.open {
  pointer-events: auto;
  visibility: visible;
}
.stall-filter-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.25s;
}
.stall-filter-overlay.open .stall-filter-backdrop {
  opacity: 1;
}

.stall-filter-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: white;
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.stall-filter-overlay.open .stall-filter-sheet {
  transform: translateY(0);
}
@media (min-width: 768px) {
  .stall-filter-overlay {
    align-items: center;
    justify-content: center;
  }
  .stall-filter-sheet {
    max-width: 520px;
    max-height: 80vh;
    border-radius: 14px;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
  }
  .stall-filter-overlay.open .stall-filter-sheet {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stall-filter-handle {
  width: 40px; height: 4px;
  background: var(--color-border-secondary);
  border-radius: 2px;
  margin: 8px auto 0;
}
@media (min-width: 768px) {
  .stall-filter-handle { display: none; }
}

.stall-filter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--color-border-tertiary);
}
.stall-filter-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}
.stall-filter-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--color-bg-subtle);
  border-radius: 50%;
  color: var(--color-text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.stall-filter-close:hover { background: var(--color-bg-hover); }

.stall-filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.stall-filter-group {
  margin-bottom: 20px;
}
.stall-filter-group:last-child { margin-bottom: 0; }

.stall-filter-group-title {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin: 0 0 8px;
}

/* Toggle row (verified, corporate package) */
.stall-filter-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-tertiary);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s;
}
.stall-filter-toggle:hover { border-color: var(--green); }
.stall-filter-toggle-label {
  display: flex; align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.stall-filter-toggle-icon {
  font-size: 1rem;
}
/* Custom switch */
.stall-filter-toggle-switch {
  position: relative;
  width: 38px; height: 22px;
  background: var(--color-border-secondary);
  border-radius: 11px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.stall-filter-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.stall-filter-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.stall-filter-toggle input:checked ~ .stall-filter-toggle-switch {
  background: var(--green);
}
.stall-filter-toggle input:checked ~ .stall-filter-toggle-switch::after {
  transform: translateX(16px);
}

/* Multi-select checklist (categories) */
.stall-filter-checklist {
  display: flex; flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.stall-filter-check {
  display: flex; align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  user-select: none;
}
.stall-filter-check:hover { background: var(--color-bg-subtle); }
.stall-filter-check input {
  width: 18px; height: 18px;
  accent-color: var(--green);
  flex-shrink: 0;
  cursor: pointer;
}
.stall-filter-check-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
}
.stall-filter-check.checked {
  background: var(--green-subtle);
}

/* Cascading location picker */
.stall-filter-location-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stall-filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border-secondary);
  border-radius: 8px;
  background: white;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-text-primary);
  cursor: pointer;
}
.stall-filter-select:focus {
  outline: none;
  border-color: var(--green);
}

/* Rating pills */
.stall-filter-ratings {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stall-filter-rating-pill {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: white;
  border: 1.5px solid var(--color-border-tertiary);
  border-radius: 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.stall-filter-rating-pill:hover {
  border-color: var(--green);
  color: var(--green-dark);
}
.stall-filter-rating-pill.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.stall-filter-rating-pill .star {
  color: #F5A623;
  font-size: 0.875rem;
}
.stall-filter-rating-pill.active .star {
  color: white;
}

/* Footer */
.stall-filter-footer {
  display: flex; gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border-tertiary);
  background: white;
}
.stall-filter-clear {
  padding: 11px 16px;
  background: white;
  border: 1.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.stall-filter-clear:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}
.stall-filter-apply {
  flex: 1;
  padding: 11px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: filter 0.15s;
}
.stall-filter-apply:hover { filter: brightness(0.92); }

body.stall-filter-open {
  overflow: hidden;
}

/* ─── "Located in" link on stall detail page ─── */
.stall-located-in {
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  display: inline-flex; align-items: center;
  gap: 5px;
}
.stall-located-in-icon {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}
.stall-located-in a {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.stall-located-in a:hover {
  border-bottom-color: var(--green-dark);
}

