/* Precision Labs — category / shop grid.
   Everything here is page-specific. The banner, cards and sidebar are built on
   the shared kit in base.css (.pl-wrap, .pl-cols--narrow, .pl-grid--2, .pl-card,
   .pl-btn, .pl-chip, .pl-badge, .pl-price); this file only positions them and
   supplies what the grid alone needs.

   Colours come from tokens.css. The two exceptions are the banner scrim stops,
   written as rgba(12,16,19,…) — that is --pl-ink at 90% and 25% alpha, exactly
   as the design specifies it. There is no token for a translucent ink, and the
   scrim tokens are a different colour (9,13,24).

   Corners are square throughout: no border-radius appears in this file. */

/* ── Collection banner ─────────────────────────────────────────────── */
.pl-banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 210px;
  background: var(--pl-bd-light) center / cover no-repeat;
  color: var(--pl-on-dark);
  isolation: isolate;
}
/* The scrim only earns its place over a photo; on the flat fallback it would
   just make an unreadable dark slab. */
.pl-banner--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(12, 16, 19, .9), rgba(12, 16, 19, .25));
}
/* Without a category photo the banner was a flat black slab with the copy
   stranded on the left and two-thirds of it empty. It now carries the same
   treatment the homepage hero uses — a navy wash that lifts the right-hand side
   plus a 40px grid — so the space reads as designed rather than unfinished.

   Kept deliberately quiet: the grid lines are white at 3.5% and the wash tops
   out at 55% navy, which leaves the eyebrow/heading/description contrast
   unchanged (they sit over the darkest corner). Both layers are decoration on
   the background, so nothing here can intercept a click. */
.pl-banner:not(.pl-banner--photo) {
  background:
    /* the grid, drawn first so the wash sits over it and fades it out */
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, .035) 0 1px,
      transparent 1px 40px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, .035) 0 1px,
      transparent 1px 40px
    ),
    /* navy lifting out of the bottom-right corner */
    radial-gradient(
      120% 150% at 88% 108%,
      rgba(34, 55, 126, .55) 0%,
      rgba(34, 55, 126, .18) 42%,
      transparent 72%
    ),
    var(--pl-ink);
}

/* A hairline of accent along the bottom edge, the same device the section
   headers use, so the banner is closed off rather than bleeding into the grid. */
.pl-banner:not(.pl-banner--photo)::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pl-navy), transparent 62%);
}
.pl-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 30px;
  padding-bottom: 30px;
}
.pl-banner__eyebrow { color: var(--pl-accent-lt); letter-spacing: .26em; }
.pl-banner__h { color: var(--pl-on-dark); }
.pl-banner__desc {
  max-width: 520px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--pl-on-dark-mu);
  text-wrap: pretty;
}

/* ── Category chips + sort ─────────────────────────────────────────── */
.pl-shopbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 18px;
}
.pl-shopbar__chips { display: flex; flex-wrap: wrap; gap: 9px; }
.pl-shopbar__chips .pl-chip--nav:hover { border-color: var(--pl-ink); }
.pl-shopbar__chips .pl-chip--nav.is-on:hover { border-color: var(--pl-navy); }

/* A sort control the shopper reads as a sentence, not as a form. */
.pl-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--pl-muted);
}
.pl-sort__label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--pl-muted);
  margin: 0;
}
.pl-sort__field { position: relative; display: inline-flex; align-items: center; }
.pl-sort__field::after {
  content: "\25BE";                      /* ▾ */
  position: absolute;
  right: 4px;
  font-size: 11px;
  color: var(--pl-muted);
  pointer-events: none;
}
.pl-sort__select {
  width: auto;
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 20px 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pl-ink);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.pl-sort__select:hover { color: var(--pl-navy); }
.pl-sort__select:focus,
.pl-sort__select:focus-visible { border-color: var(--pl-bd-strong); box-shadow: none; }

/* ── Page body ─────────────────────────────────────────────────────── */
.pl-shop { padding-bottom: var(--pl-section-y); align-items: start; }
.pl-shop__notices:empty { display: none; }
.pl-shop__main { min-width: 0; }

.pl-empty {
  padding: 40px 0;
  font-size: 16px;
  color: var(--pl-muted);
}

/* ── Product card ──────────────────────────────────────────────────── */
.pl-pcard { display: flex; flex-direction: column; min-width: 0; transition: border-color .18s; }
.pl-pcard:hover { border-color: var(--pl-bd-strong); }

.pl-pcard__media {
  position: relative;
  height: 220px;
  background: var(--pl-bd-light);
  overflow: hidden;
}
.pl-pcard__media > a { display: block; width: 100%; height: 100%; }
/* The catalogue is 1000x1000 transparent vial renders on a light plate, so the
   fit is contain — cover would crop the vial out of its own photograph. */
.pl-pcard__media img {
  width: 100%;
  height: 100%;
  padding: 14px;
  object-fit: contain;
  transition: transform .3s ease;
}
.pl-pcard:hover .pl-pcard__media img { transform: scale(1.03); }

.pl-pcard__badge { position: absolute; top: 12px; left: 12px; }
.pl-pcard__badge--oos { background: var(--pl-ink); color: var(--pl-on-dark); }
.pl-pcard--oos .pl-pcard__media img { opacity: .55; }

.pl-pcard__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 22px;
}
.pl-pcard__title { margin: 0; }
.pl-pcard__title a { display: inline-block; }
.pl-pcard__title a:hover { color: var(--pl-navy); }

.pl-pcard__desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--pl-muted);
  text-wrap: pretty;
}
.pl-pcard__contents {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pl-t2);
  border-left: 2px solid var(--pl-bd-light);
  padding-left: 10px;
}

.pl-pcard__chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Card chips are the design's tighter uppercase variant. Scoped here so the
   shared .pl-chip used elsewhere in the theme is left exactly as base.css
   defines it. */
.pl-pcard__chips .pl-chip {
  padding: 5px 8px;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pl-t2);
}
.pl-pcard__chips .pl-chip--lab {
  color: var(--pl-navy);
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.pl-pcard__chips .pl-chip--lab:hover { background: var(--pl-info-bd); }

.pl-pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
}
.pl-pcard__price { display: inline-flex; align-items: baseline; gap: 8px; }
.pl-pcard__from {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pl-muted);
}
.pl-pcard__price del { font-size: 15px; }
/* Woo's loop button already carries .pl-btn .pl-btn--sm; keep it from
   stretching when the price wraps to its own line. */
.pl-pcard__foot .pl-btn { flex: none; }
.pl-pcard__foot .added_to_cart {
  font-size: 12px;
  font-weight: 600;
  color: var(--pl-navy);
}

/* ── Pagination ────────────────────────────────────────────────────── */
.pl-pagination { margin-top: 28px; }
.pl-pagination:empty { display: none; }
.pl-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pl-pagination li { list-style: none; }
/* Deliberately over-qualified. WooCommerce ships
   `.woocommerce nav.woocommerce-pagination ul li a` at (0,2,4), which outranks
   a plain `.pl-pagination li > .page-numbers` (0,2,1) — so without matching its
   element chain the theme's pagination silently renders as Woo's default at
   every width, not just on mobile. */
.pl-pagination nav.woocommerce-pagination ul.page-numbers li .page-numbers,
.pl-pagination li > .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--pl-bd-strong);
  font-size: 13px;
  font-weight: 600;
  color: var(--pl-t3);
}
.pl-pagination li > a.page-numbers:hover {
  border-color: var(--pl-navy);
  color: var(--pl-navy);
}
.pl-pagination li > .page-numbers.current {
  background: var(--pl-navy);
  border-color: var(--pl-navy);
  color: var(--pl-on-dark);
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.pl-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.pl-finder { background: var(--pl-ink); color: var(--pl-on-dark); padding: 24px; }
.pl-finder__h { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.pl-finder__p {
  margin: 10px 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--pl-on-dark-mu);
  text-wrap: pretty;
}
.pl-finder .pl-btn { padding: 13px 18px; font-size: 11.5px; letter-spacing: .14em; }

.pl-includes { padding: 22px; }
.pl-includes__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
  list-style: none;
  font-size: 14px;
  color: var(--pl-t2);
}

.pl-ship { padding: 22px; }
.pl-ship__h { font-size: 15px; font-weight: 600; }
/* A <progress> element rather than a div with an inline width: same 5px bar,
   real semantics, and no style attribute generated in PHP. */
.pl-ship__bar {
  display: block;
  width: 100%;
  height: 5px;
  margin: 12px 0 8px;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--pl-bd);
  color: var(--pl-navy);
}
.pl-ship__bar::-webkit-progress-bar { background: var(--pl-bd); }
.pl-ship__bar::-webkit-progress-value { background: var(--pl-navy); }
.pl-ship__bar::-moz-progress-bar { background: var(--pl-navy); }
.pl-ship--met .pl-ship__bar { color: var(--pl-ok-fg); }
.pl-ship--met .pl-ship__bar::-webkit-progress-value { background: var(--pl-ok-fg); }
.pl-ship--met .pl-ship__bar::-moz-progress-bar { background: var(--pl-ok-fg); }
.pl-ship__note { font-size: 13.5px; line-height: 1.5; color: var(--pl-muted); }
.pl-ship--met .pl-ship__note { color: var(--pl-ok-fg); font-weight: 600; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1199px) {
  /* The sidebar drops below the grid at this width (base.css), so lay its three
     cards side by side rather than as a long tail under the products. */
  .pl-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 767px) {
  .pl-banner { min-height: 170px; }
  .pl-banner__desc { font-size: 14.5px; }

  .pl-shopbar { padding-top: 18px; padding-bottom: 14px; }
  .pl-shopbar__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(var(--pl-gutter) * -1);
    padding: 0 var(--pl-gutter) 2px;
  }
  .pl-shopbar__chips::-webkit-scrollbar { display: none; }
  .pl-shopbar__chips .pl-chip--nav { flex: none; }
  .pl-sort { margin-left: 0; }

  .pl-pcard__media { height: 200px; }
  .pl-pcard__body { padding: 18px; }
  /* Hit targets stay at 44px on touch. */
  .pl-pcard__foot .pl-btn { min-height: 44px; }
  .pl-pcard__chips .pl-chip--lab { min-height: 32px; }
}
