/* Leaf & Bloom - the shop page (shop.html).
 * Redesigned 30 Sep 2026 to match the homepage's 29 Sep redesign. Linked only
 * from these pages, after the shared stylesheets, so these rules win ties.
 * Shared components (.pcard, .benefits, .acc, .swipe-row) live in base.css.
 * Everything here is scoped to this page's own classes (.shop-head,
 * .shop-bar, .shop-grid, .shop-choose, .shop-trust). */

/* -- Page head: The collection / Everything we make ---------------------- */
/*  On a phone the head, the toolbar and the applied filter stacked into
 *  about 220px of bands and gaps before the first product. The head is
 *  tighter, and the toolbar and the filter are now one line (below). */
.shop-head { padding-block: var(--sp-2) var(--sp-5); gap: var(--sp-3); }
.shop-head .section-title { margin-top: var(--sp-1); }
@media (min-width: 900px) {
  .shop-head { padding-block: var(--sp-4) var(--sp-7); }
}

/* -- Toolbar: filter, the applied filter, count, sort ------------------- */
/*  One ivory pill instead of two ruled bands: the filter button, the
 *  applied "In stock" chip, and the sort on a single line. Still sticky.
 *  When it sticks, a page-coloured band runs behind it to both screen edges
 *  (::before), so cards scrolling up pass under the band, not past the
 *  pill's round ends; the pill itself is drawn by ::after on top of the
 *  band. Both sit below the controls (negative z-index inside the bar's own
 *  stacking context). html has overflow-x: clip, so the band cannot cause
 *  sideways scrolling. It sits a few px under the header, not flush. */
.shop-bar {
  top: 76px;
  gap: var(--sp-2);
  padding: var(--sp-2);
  margin-bottom: var(--sp-5);
  background: none;
  border: 0;
}
@media (min-width: 1024px) { .shop-bar { top: 92px; } }
.shop-bar::before,
.shop-bar::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.shop-bar::before {
  inset: calc(var(--sp-2) * -1) calc(50% - 50vw);
  z-index: -2;
  background: var(--c-bg);
}
.shop-bar::after {
  inset: 0;
  z-index: -1;
  background: var(--c-surface);
  border: var(--card-edge);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-soft);
}
/*  Dark: the applied chip was tint on a near-identical bar, with a 70%
 *  remove glyph, and read as disabled. A firm edge and a full-strength x. */
:root[data-theme="dark"] .shop-bar .chip { box-shadow: inset 0 0 0 1px var(--c-line-strong); color: var(--c-heading-deep); }
:root[data-theme="dark"] .shop-bar .chip button { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shop-bar .chip { box-shadow: inset 0 0 0 1px var(--c-line-strong); color: var(--c-heading-deep); }
  :root:not([data-theme="light"]) .shop-bar .chip button { opacity: 1; }
}
.shop-bar__left { gap: var(--sp-2); min-width: 0; }
.shop-bar .filter-trigger { padding-inline: var(--sp-4); }
.shop-bar .filter-trigger svg { flex: none; }
.shop-bar .chips { flex-wrap: nowrap; margin: 0; }
.shop-bar .chip { padding-left: var(--sp-4); white-space: nowrap; }
.shop-bar .chip button { width: 36px; }
.shop-bar__count { padding-left: var(--sp-2); white-space: nowrap; }
.shop-bar .sort-select {
  flex: none;
  border-radius: var(--r-pill);
  border-color: var(--c-line);
  background-color: transparent;
}
@media (min-width: 768px) {
  .shop-bar { margin-bottom: var(--sp-6); }
}
/*  Phones (under 600px): two lines instead of one squeezed one. At 390 the
 *  filter button, the applied chips and the sort shared 350px, so the sort
 *  read "Sort: Featur..." and the chips showed one and a half pills in a
 *  139px box. Now the pill holds the filter button (its word back) and the
 *  sort at full width, and the applied chips run as their own swipeable
 *  line under it, on the page colour. shop-filters.js hides the chip row
 *  when nothing is applied, so the bar is then the one pill again.
 *  .shop-bar__left steps aside (display: contents) so its three children
 *  can be ordered with the sort; the pill (::after) is held to the first
 *  line: 44px controls plus the bar's 4px padding above and below. */
@media (max-width: 599px) {
  .shop-bar {
    flex-wrap: wrap;
    column-gap: var(--sp-2);
    row-gap: var(--sp-3);
    padding: var(--sp-1);
  }
  .shop-bar::after { bottom: auto; height: calc(44px + 2 * var(--sp-1)); }
  .shop-bar__left { display: contents; }
  .shop-bar .filter-trigger { order: 0; padding-inline: var(--sp-4); }
  .shop-bar__count { order: 1; padding-left: 0; }
  .shop-bar .sort-select {
    order: 2;
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
    margin-left: auto;
    padding-left: var(--sp-4);
    padding-right: var(--sp-7);
    text-overflow: ellipsis;
  }
  /* [data-filter-chips] outranks the later .shop-bar .chips { flex } rule. */
  .shop-bar .chips[data-filter-chips] {
    order: 3;
    flex: 1 0 100%;
    gap: var(--sp-2);
    padding-bottom: var(--sp-1);
  }
  .shop-bar .chip { gap: 0; padding: 0 0 0 var(--sp-4); }
  .shop-bar .chip button { width: 40px; }
}

/* -- Product grid ------------------------------------------------------- */
/*  Phones: the shared swipe row (swipe-row in the markup), three full
 *  cards with the next one peeking, instead of a 2 + 1 grid of 160px cards.
 *  From 768px, three across; the card itself is the shared .pcard. */
@media (min-width: 768px) and (max-width: 1023px) {
  .shop-grid { gap: var(--sp-4); }
}

/* -- Start here (the chooser) ------------------------------------------- */
/*  Three stacked text cards were 1,500px on a phone. The two product cards
 *  (hair, lips) are now the swipe row on a phone and two equal columns from
 *  768px, the icon beside the heading and the product links as a price
 *  footer under a gold hairline. "Still deciding" is short, and held to the
 *  lip card's height it was mostly empty, so it is its own full-width strip
 *  under the pair at every width (.shop-choose__more, below). */
.shop-choose .section-head { margin-bottom: var(--sp-5); }

.shop-choose .chooser { gap: var(--sp-4); }
@media (min-width: 768px) {
  .shop-choose .chooser { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
}

.shop-choose .chooser__card {
  padding: var(--sp-5);
  box-shadow: var(--shadow-soft);
}
@media (min-width: 1024px) { .shop-choose .chooser__card { padding: var(--sp-6); } }
/*  Phones: 16px padding, and the product name one step down, so each
 *  footer row (name, price) stays one 44px line in a 262px card at 360. */
@media (max-width: 519px) {
  .shop-choose .chooser__card { padding: var(--sp-4); }
  .shop-choose .chooser__list a > span:first-child { font-size: var(--fs-small); }
}

.shop-choose .chooser__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
/*  The homepage's "Before you order" icon: a solid forest circle with a
 *  cream glyph. The tint circle all but vanished on the dark card. */
.shop-choose .chooser__icon {
  flex: none;
  margin: 0;
  background: var(--c-brand-fill);
  color: var(--c-on-brand);
}
.shop-choose .chooser__card h3 { margin: 0; line-height: var(--lh-snug); }
.shop-choose .chooser__card p { font-size: var(--fs-body); margin-bottom: var(--sp-2); }

/*  The footer: a fading gold rule, then one row per product, name on the
 *  left and its price in Cormorant on the right. */
.shop-choose .chooser__list {
  position: relative;
  gap: 0;
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 0;
}
.shop-choose .chooser__list::before {
  content: '';
  position: absolute;
  top: var(--sp-3);
  left: 0; right: 0;
  height: 1px;
  background: var(--g-gold);
}
.shop-choose .chooser__list li + li { border-top: 1px solid var(--c-line); }
.shop-choose .chooser__list a {
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 44px;
  padding-block: var(--sp-2);
  color: var(--c-heading-deep);
  font-weight: 500;
  text-decoration: none;
}
.shop-choose .chooser__list a:hover > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.shop-choose .chooser__price {
  flex: none;
  font-family: var(--ff-display);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: var(--lh-flat);
  white-space: nowrap;
}
.shop-choose .chooser__go {
  flex: none;
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  transition: transform var(--dur) var(--ease);
}
.shop-choose .chooser__list a:hover .chooser__go { transform: translateX(3px); }

/*  "Still deciding", the strip under the pair. On a phone it is the same
 *  card at its own height, 16px under the swipe row (the row's bottom
 *  padding already gives the gap). From 768px it is one band: the heading
 *  and sentence on the left, the FAQ link on the right behind an upright
 *  gold hairline. */
@media (min-width: 768px) {
  .shop-choose .shop-choose__more {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--sp-7);
    align-items: center;
    margin-top: var(--sp-5);
  }
  .shop-choose .shop-choose__more .chooser__head,
  .shop-choose .shop-choose__more p { grid-column: 1; }
  .shop-choose .shop-choose__more p { max-width: 68ch; margin-bottom: 0; }
  .shop-choose .shop-choose__more .chooser__list {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
    align-content: center;
    margin: 0;
    padding: 0 0 0 var(--sp-6);
  }
  .shop-choose .shop-choose__more .chooser__list::before {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 1px; height: auto;
    background: linear-gradient(180deg, transparent,
      color-mix(in srgb, var(--c-gold) 70%, transparent) 28%,
      color-mix(in srgb, var(--c-gold) 70%, transparent) 72%, transparent);
  }
}

/* -- What ordering from us is like (the trust band) ---------------------- */
/*  The homepage's warm band with gold edges (classes in the markup), and
 *  the homepage's own strip since 30 Sep 2026: the same four titles, order
 *  and one-line subs, drawn exactly as base.css draws .benefits (2 x 2 on a
 *  phone, four across from 1024px). No swipe row and no rules needed here. */

/* -- Filters and sort that work (30 Sep 2026) -------------------------- */
/*  assets/js/shop-filters.js drives the drawer, the chips, the sort and
 *  the empty state. Without JavaScript it never runs and every product
 *  shows, so the controls that would do nothing are not drawn at all. */
html:not(.js) .shop-bar .filter-trigger,
html:not(.js) .shop-bar .chips,
html:not(.js) .shop-bar .sort-select { display: none; }

/*  The applied filters. More than one chip no longer pushes the bar past
 *  the screen: the row gives way and swipes, and the sort keeps its room
 *  (on phones the row is its own line under the pill, above).
 *  The remove button's focus ring is drawn inside, where the row cannot
 *  clip it. */
.shop-bar .chips {
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.shop-bar .chips::-webkit-scrollbar { display: none; }
.shop-bar .chip { flex: none; }
.shop-bar .chip button:focus-visible { outline-offset: -4px; }
.shop-bar__count { flex: none; }

/*  Flavour: each swatch is a toggle (aria-pressed), drawn as a row like
 *  the checkboxes above it - the dot, the name, the live count - so a
 *  flavour is chosen by name, not by guessing at a colour. The dot is the
 *  button's own background here, so ::before can carry the name and
 *  ::after the count; pressed, it gains a ring in the accent green. */
#filter-drawer .swatch-row { display: grid; gap: 0; }
#filter-drawer .swatch-dot {
  --dot-ring: var(--c-line-strong);
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; height: auto; min-height: 44px;
  padding: 0 0 0 calc(24px + var(--sp-3));
  border-radius: var(--r-sm);
  background: radial-gradient(circle at 12px 50%,
    var(--swatch) 0 8px, var(--dot-ring) 8.5px 9.5px, transparent 10px) no-repeat;
  font-family: var(--ff-sans);
  font-size: var(--fs-small);
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
}
#filter-drawer .swatch-dot::before { content: attr(aria-label); }
#filter-drawer .swatch-dot::after {
  content: attr(data-count);
  position: static; inset: auto;
  margin-left: auto;
  background: none; border: 0; box-shadow: none; border-radius: 0;
  color: var(--c-text-soft);
  font-size: var(--fs-micro);
}
#filter-drawer .swatch-dot[aria-pressed="true"] {
  color: var(--c-heading);
  font-weight: 500;
  background: radial-gradient(circle at 12px 50%,
    var(--swatch) 0 7px, var(--c-surface) 7.5px 8.5px, var(--c-accent) 9px 11px, transparent 11.5px) no-repeat;
}
@media (forced-colors: active) {
  #filter-drawer .swatch-dot[aria-pressed="true"] { outline: 2px solid ButtonText; outline-offset: -2px; }
}

/*  Nothing matches: an honest card in place of an empty grid. */
.filter-empty {
  display: grid; justify-items: center; gap: var(--sp-3);
  max-width: 560px;
  margin: 0 auto var(--sp-7);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  background: var(--c-surface);
  border: var(--card-edge);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
}
.filter-empty__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-tint);
  color: var(--c-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-gold) 45%, transparent);
}
.filter-empty__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.filter-empty__title {
  font-family: var(--ff-display);
  font-size: var(--fs-h2-sm);
  line-height: var(--lh-tight);
  color: var(--c-heading);
}
.filter-empty__text { max-width: 36ch; font-size: var(--fs-body); color: var(--c-text-soft); }
.filter-empty__btn { margin-top: var(--sp-2); min-height: 48px; }
@media (max-width: 767px) {
  .filter-empty { padding: var(--sp-6) var(--sp-4); margin-bottom: var(--sp-6); }
}
