/* ==========================================================================
   Shop — product imagery
   --------------------------------------------------------------------------
   Uploaded photos are wildly inconsistent: real ones range from 899x1599
   (tall portrait) to 4096x3072 (landscape). Left alone, the listing grid
   would have tiles of different heights.

   Every tile is therefore a fixed square, and the photo is fitted inside it
   with `contain` rather than `cover`. Cover would keep the tiles uniform too,
   but it crops, and on a tall photo of a shopping bag it would cut off the
   product. Letterboxing against a neutral ground is the lesser evil in a shop.
   ========================================================================== */

.product-media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--white);
  padding: .625rem;
  border-bottom: 1px solid var(--line);
}

/* Detail page: cap the height so a 4096px-tall photo does not push the
   buying options off the screen. */
.product-figure {
  margin: 0 0 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem;
}
.product-figure img {
  width: 100%;
  max-height: 30rem;
  object-fit: contain;
}

/* ==========================================================================
   Shop — cart and quantity controls
   ========================================================================== */

.qty { display: flex; align-items: center; gap: .5rem; }

.cart-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.cart-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--cream-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: .75rem;
}
.cart-item__main { flex: 1 1 14rem; min-width: 0; }
.cart-item__name { font-weight: 700; }
.cart-item__meta { list-style: none; margin: .375rem 0 0; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.cart-item__meta .is-np { color: var(--warn); }
.cart-item__qty { display: flex; align-items: center; gap: .375rem; }
.cart-item__qty-input { width: 4.5rem; text-align: center; }
.cart-item__price { font-weight: 700; white-space: nowrap; }
.cart-item__tags { font-size: var(--fs-sm); color: var(--muted); }

.cart-list--compact .cart-item { padding: .75rem 1rem; }

/* Header cart badge */
/* The basket in the shop's header: an icon and a count, shown only once
   there is something in it (cart.js sets `hidden`). `[hidden]` needs the
   !important because .nav__link sets display:flex, which would otherwise
   win on specificity and render a basket the reader was told they do not
   have. */
.cart-link { position: relative; gap: .375rem; }
.cart-link[hidden] { display: none !important; }
.cart-link__icon { width: 22px; height: 22px; flex: none; }
.cart-link__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding-inline: .375rem;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 700;
}

/* Filter / sort bar on the product listing */
.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.shop-filters__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .375rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--cream-soft);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.chip[aria-current="true"] { background: var(--gold); border-color: var(--gold); }
