/* ==========================================================================
   Bloomy — Product Listing Styles
   Loads after style.css. Reuses .product-card, .container, .btn, and the
   color tokens from style.css — this file only covers what's unique to
   Listing: hero text block, search bar, category pills, sort control.
   ========================================================================== */

/* ---- Hero (text only — no photo, unlike Homepage's hero) ---- */
.listing-hero {
  padding-block: 32px 40px;
  background-color: hsl(var(--secondary));
}

.listing-hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  margin-bottom: 12px;
}

.listing-hero__heading {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 16px;
}

.listing-hero__heading em {
  color: hsl(var(--primary));
}

.listing-hero__subtitle {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  max-width: 560px;
  margin-bottom: 28px;
}

.listing-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 14px 20px;
}

.listing-search svg {
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
}

.listing-search input {
  border: none;
  outline: none;
  background: none;
  font-size: 0.95rem;
  color: hsl(var(--foreground));
  width: 100%;
}

.listing-search input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* ---- Category pills ----
   Sticky below the nav on both desktop and mobile (matches the base44
   reference site's behavior — confirmed live, not just in the static
   mockup screenshots). Needs an explicit opaque background since content
   scrolls underneath it once it's pinned. */
.listing-filters {
  position: sticky;
  top: var(--nav-height, 73px);
  z-index: 40;
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-block: 14px;
}

.pill {
  background-color: hsl(var(--secondary));
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pill:hover {
  background-color: hsl(var(--border));
}

.pill.is-active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.pill.is-active:hover {
  background-color: hsl(var(--primary) / 0.9);
}

/* ---- Result count + sort ---- */
.listing-meta {
  border-bottom: 1px solid hsl(var(--border));
}

.listing-meta .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}

.listing-meta__count {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.listing-meta__count span {
  font-weight: 700;
  color: hsl(var(--foreground));
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-control label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.sort-control select {
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  cursor: pointer;
}

/* ---- Product grid section ---- */
.listing-grid-section {
  padding-block: 40px 64px;
}

/* .product-grid and .product-card are both defined in style.css and
   reused as-is — Listing's cards are the exact same shape as Homepage's
   featured cards (image, name, price — no badges/rating/sold-count). */

.listing-empty {
  text-align: center;
  color: hsl(var(--muted-foreground));
  padding-block: 48px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .listing-hero__heading {
    font-size: 2rem;
  }

  /* Wrapping rows don't work once the bar is stuck to the top — a
     multi-row pill block would permanently eat screen space while
     pinned. Single line, horizontal scroll instead. */
  .category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  .category-pills::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Brave */
  }

  .pill {
    flex-shrink: 0; /* stop pills squishing/wrapping in the scroll row */
  }

  .listing-meta .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

}
