/*
 * Browse the shelves (/browse, /browse/{key}) — 2026-11-19.
 * Layers on shared.css + subpage.css (body.subpage). Bump ?v= in browse.php
 * on any change (immutable cache).
 */

.page-hero.hero-browse {
  background: linear-gradient(135deg, var(--tint-butter) 0%, var(--tint-pink) 50%, var(--tint-lavender) 100%);
  padding-top: 2.5rem;
  padding-bottom: 2.25rem;
}

.hero-browse .hero-back {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-magenta);
  text-decoration: none;
}

body.browse .subpage-section {
  padding-top: 1.75rem;
}

body.browse .subpage-section > .inner {
  max-width: 1120px;
}

/* ---- chips: collections, filters, other aisles ---- */

.browse-chips,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.browse-chips {
  justify-content: center;
  margin-bottom: 1.75rem;
}

.browse-chips.other {
  margin: 2.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--tint-lavender);
}

.chip {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--tint-lavender);
  background: #fff;
  color: var(--brand-purple);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.chip:hover {
  background: var(--tint-lavender);
}

.chip.on {
  background: var(--brand-purple);
  border-color: var(--brand-purple);
  color: #fff;
}

.chip.on::after {
  content: " ×";
  font-weight: 500;
}

/* Collections on the landing page: equal-width pills, four to a row (two on
   phones); a short last row stretches to fill, so the block is always even. */
.browse-chips.collections .chip {
  flex: 1 1 calc(25% - 0.5rem);
  text-align: center;
  padding: 0.55rem 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-filters {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.filter-label {
  min-width: 2.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #8a7a9e;
}

.browse-count {
  color: #8a7a9e;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

/* ---- aisle tiles ---- */

.aisle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.aisle-tile {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--tint-lavender);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(77, 0, 141, 0.07);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.aisle-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(77, 0, 141, 0.13);
}

.aisle-tile .photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  display: block;
  padding: 0.5rem;
}

.aisle-tile .photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  padding: 0;
}

.placeholder.tint-pink { background: var(--tint-pink); }
.placeholder.tint-lavender { background: var(--tint-lavender); }
.placeholder.tint-sky { background: var(--tint-sky); }
.placeholder.tint-mint { background: var(--tint-mint); }
.placeholder.tint-butter { background: var(--tint-butter); }

.aisle-tile .label {
  padding: 0.7rem 0.9rem 0.85rem;
  background: var(--tint-lavender);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.aisle-tile .name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--brand-purple);
}

.aisle-tile .count {
  font-size: 0.85rem;
  color: #8a7a9e;
}

/* ---- product cards ---- */

.browse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.browse-card {
  background: #fff;
  border: 1px solid var(--tint-lavender);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Product photos: show the whole product, never crop it. */
.browse-card .photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  display: block;
}

.browse-card .info {
  padding: 0.7rem 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  border-top: 1px solid var(--tint-lavender);
}

.browse-card .name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.browse-card .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.browse-card .price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-purple);
}

.browse-card .tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-magenta);
  background: var(--tint-pink);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---- buttons, strip, empty state, visit note ---- */

.browse-all,
.browse-pages {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-browse {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--brand-purple);
  color: var(--brand-purple);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-browse:hover,
.btn-browse.primary {
  background: var(--brand-purple);
  color: #fff;
}

.browse-strip {
  margin-top: 3rem;
}

.browse-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--tint-lavender);
  border-radius: 20px;
}

.browse-empty h2 {
  margin-bottom: 0.4rem;
}

.browse-empty a,
.browse-visit a {
  color: var(--brand-magenta);
  font-weight: 700;
}

.browse-visit {
  margin: 2.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--tint-butter);
  border-radius: 20px;
  text-align: center;
  color: #5b4a70;
}

.browse-visit .fine {
  font-size: 0.9rem;
  color: #8a7a9e;
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .aisle-grid,
  .browse-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  body.browse .subpage-section { padding-left: 1rem; padding-right: 1rem; }
  .aisle-grid,
  .browse-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .aisle-tile .name { font-size: 0.95rem; }
  .browse-card .info { padding: 0.55rem 0.65rem 0.7rem; }
  .browse-card .name { font-size: 0.88rem; }
  .browse-chips { justify-content: flex-start; }
  .browse-chips.collections .chip { flex-basis: calc(50% - 0.5rem); font-size: 0.86rem; padding: 0.55rem 0.35rem; }
  /* filter rows scroll sideways instead of stacking four lines deep */
  .filter-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.2rem; }
}
