/* ============================================================
   teas.co.uk, WooCommerce archive (shop / category / brand)
   Layered on top of WC core CSS. Inherits design-system.css tokens.
   Cyan accent (matches homepage).
   ============================================================ */

/* ===== ARCHIVE HEAD ===== */
.archive-head{
  display:grid;grid-template-columns:1fr auto;gap:24px;align-items:end;
  margin-bottom:28px;
}
.archive-head-l{display:flex;flex-direction:column;gap:6px}
.archive-head .eyebrow{
  display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;
  font-family:var(--fm);font-size:11px;text-transform:uppercase;letter-spacing:.10em;
  color:var(--slate);font-weight:600;
}
.archive-head .eyebrow .pip{
  width:8px;height:8px;border-radius:50%;background:var(--acc);
  box-shadow:0 0 0 4px rgba(0,224,255,.18);
}
.archive-head .eyebrow .dot{color:var(--mist)}
.archive-head .eyebrow .count{font-weight:600}
.archive-head h1.archive-title{
  font-family:var(--fb);font-size:54px;font-weight:800;letter-spacing:-.025em;
  line-height:1;margin:8px 0 0;text-wrap:balance;
}
.archive-head .archive-lede{
  font-size:14.5px;line-height:1.55;color:var(--slate);margin:8px 0 0;max-width:60ch;
}

/* WC ordering dropdown */
.archive-head-r .woocommerce-ordering{
  display:flex;align-items:center;gap:0;margin:0;padding-bottom:10px;
}
.archive-head-r .woocommerce-ordering select{
  background:#fff;border:1.5px solid var(--hair);border-radius:var(--r-pill);
  padding:11px 36px 11px 18px;
  font-family:inherit;font-size:13px;font-weight:600;color:var(--ink);
  outline:none;cursor:pointer;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230E0F12' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat;background-position:right 14px center;
  transition:border-color .14s var(--ease);
}
.archive-head-r .woocommerce-ordering select:focus{border-color:var(--ink)}

/* ===== ARCHIVE GRID (filter rail + loop) ===== */
.archive-grid{
  display:grid;grid-template-columns:240px 1fr;gap:36px;margin-bottom:36px;
  align-items:start;
}

/* Filter rail */
.archive-filters{display:flex;flex-direction:column;gap:0}
/* If filters are empty (no active sidebar widgets and stub didn't render), let the grid collapse */
.archive-filters:empty{display:none}
.archive-grid:has(.archive-filters:empty){grid-template-columns:1fr}

/* Filter rail interior, most of the styling lives in design-system.css under .filters / .filter-group / .f-row */
/* Override sticky behaviour to give the topbar room */
.archive-filters .filters{position:sticky;top:80px;align-self:flex-start}

/* ===== PRODUCT LOOP ===== */
.archive-loop{
  display:flex;flex-direction:column;gap:18px;
}

/* WC's notices, breadcrumbs etc. sit at the top */
.archive-loop .woocommerce-notices-wrapper{margin:0}

/* The product list itself, override WC default ul styling.
   2026-05-10 (round 3): bumped to 4 columns at desktop (was 3). Lee wants
   denser visual scan + the cards are now compact enough with the tea-family
   gradient frame that 4 across reads cleanly. */
.archive-loop ul.products{
  display:grid;grid-template-columns:repeat(4,1fr);gap:var(--gap);
  list-style:none;margin:0;padding:0;
}
.archive-loop ul.products::before,
.archive-loop ul.products::after{display:none}

/* Each product card, extends .prod in design-system.css */
.archive-loop ul.products li.product{
  margin:0 !important;width:100% !important;clear:none !important;
  /* the rest of the styling comes from design-system.css .prod rules */
}

/* WooCommerce defaults that need cleanup inside our .prod card */
.archive-loop ul.products li.product .woocommerce-LoopProduct-link{
  display:flex !important;flex-direction:column;gap:10px;
  text-decoration:none;color:inherit;
}
.archive-loop ul.products li.product .woocommerce-loop-product__title{
  font-family:var(--fb);font-size:13.5px;font-weight:600;letter-spacing:-.005em;
  line-height:1.3;margin:0;padding:0;color:var(--ink);
}
.archive-loop ul.products li.product .price{
  font-family:var(--fb);font-weight:700;font-size:15px;letter-spacing:-.012em;
  margin:0;color:var(--ink);
}
.archive-loop ul.products li.product .price del{
  font-weight:500;font-size:11.5px;color:var(--mist);margin-right:4px;
}
.archive-loop ul.products li.product .price ins{
  background:transparent;text-decoration:none;color:var(--berry);
}

/* Star rating in the loop */
.archive-loop ul.products li.product .star-rating{
  font-size:11px;margin:0 0 4px;color:var(--amber);
}

/* WC adds default sale-flash inline; we hide it (we have our own .badge in content-product.php) */
.archive-loop ul.products li.product .onsale{display:none !important}

/* Add-to-cart button on the card */
.archive-loop ul.products li.product .button.add_to_cart_button{
  align-self:flex-start;
  background:var(--ink);color:var(--acc);border-radius:var(--r-pill);
  padding:9px 16px;font-family:inherit;font-weight:700;font-size:12px;
  border:none;cursor:pointer;
  display:inline-flex;align-items:center;gap:6px;
  text-transform:none;letter-spacing:0;
  transition:transform .14s var(--ease),background .14s var(--ease);
  margin:auto 0 0;
}
.archive-loop ul.products li.product .button.add_to_cart_button:hover{
  transform:translateY(-1px);background:var(--acc);color:var(--ink);
}
.archive-loop ul.products li.product .button.add_to_cart_button.added{display:none}
.archive-loop ul.products li.product .added_to_cart{
  align-self:flex-start;
  background:#042220;color:var(--acc);border-radius:var(--r-pill);
  padding:9px 16px;font-weight:700;font-size:12px;
  display:inline-flex;align-items:center;gap:6px;text-transform:none;
  margin-top:6px;
}
.archive-loop ul.products li.product .pcard-add{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:42px;
  margin-top:12px;
  border:0;
  border-radius:var(--r-pill);
  background:#042220;
  color:var(--acc);
  font-family:var(--fm);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  text-decoration:none;
  transition:transform .14s var(--ease),background .14s var(--ease),color .14s var(--ease);
}
.archive-loop ul.products li.product .pcard-add:hover,
.archive-loop ul.products li.product .pcard-add:focus-visible{
  transform:translateY(-1px);
  background:var(--acc);
  color:#042220;
}
.archive-loop ul.products li.product .pcard-add.added{
  background:#042220;
  color:var(--acc);
}
.archive-loop ul.products li.product .pcard-add.loading{
  opacity:.68;
  pointer-events:none;
}
.archive-loop ul.products li.product .pcard-add + .added_to_cart{
  width:100%;
  justify-content:center;
  min-height:42px;
  margin-top:8px;
}

/* ===== PAGINATION ===== */
.archive-loop .woocommerce-pagination{
  margin:24px 0 0;padding:24px 0 0;border-top:1px solid var(--hair);
}
.archive-loop .woocommerce-pagination ul.page-numbers{
  display:flex;align-items:center;justify-content:center;gap:6px;
  list-style:none;margin:0;padding:0;border:none;
}
.archive-loop .woocommerce-pagination ul.page-numbers li{
  margin:0;border:none;
}
.archive-loop .woocommerce-pagination ul.page-numbers li > *{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:40px;height:40px;padding:0 12px;
  border-radius:var(--r-pill);
  font-family:var(--fb);font-weight:600;font-size:13px;
  background:#fff;color:var(--ink);
  text-decoration:none;
  border:1.5px solid var(--hair);
  transition:all .14s var(--ease);
}
.archive-loop .woocommerce-pagination ul.page-numbers li a:hover{
  background:#042220;color:var(--acc);border-color:#042220;
}
.archive-loop .woocommerce-pagination ul.page-numbers li > .current{
  background:#042220;color:var(--acc);border-color:#042220;
}

/* ===== EMPTY STATE ===== */
.archive-empty{
  background:#fff;border-radius:var(--r-3xl);padding:48px;
  box-shadow:var(--sh-card);text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:18px;
}
.archive-empty .woocommerce-info{
  background:transparent;border:none;color:var(--slate);
  padding:0;margin:0 !important;font-size:15px;
}
.archive-empty .woocommerce-info::before{display:none}

/* WooCommerce result count, hidden because we show it in the archive head */
.archive-loop .woocommerce-result-count{display:none}

/* Top sort dropdown duplicated by woocommerce_before_shop_loop, also hidden */
.archive-loop > .woocommerce-ordering{display:none}

/* ===== RESPONSIVE ===== */
@media (max-width:1400px){
  /* Wide-desktop step: stay 4-col until the column min-width gets cramped */
  .archive-loop ul.products{grid-template-columns:repeat(4,1fr)}
}
@media (max-width:1180px){
  .archive-head{grid-template-columns:1fr}
  .archive-grid{grid-template-columns:1fr}
  .archive-filters .filters{position:static}
  /* Below 1180px the left-rail collapses so cards have more room — 3-col is the natural mid breakpoint */
  .archive-loop ul.products{grid-template-columns:repeat(3,1fr)}
  .archive-head h1.archive-title{font-size:42px}
}
@media (max-width:760px){
  .archive-loop ul.products{grid-template-columns:1fr 1fr;gap:12px}
  .archive-head h1.archive-title{font-size:32px}
  .archive-loop ul.products li.product .pcard-add{
    min-height:44px;
    font-size:11px;
    letter-spacing:.06em;
  }
}

/* ============================================================
   Rich product card additions, ported from tea-shop-cards.jsx
   These layer on top of the .prod styles in design-system.css.
   Each block degrades silently when underlying data is missing.
   ============================================================ */

/* Rare Find badge in the image area */
.prod .prod-rare{
  position:absolute;top:10px;left:10px;
  background:#c62828;color:#fff;
  font-family:var(--fm);font-size:10px;font-weight:700;
  padding:3px 9px;border-radius:4px;
  text-transform:uppercase;letter-spacing:.05em;
  z-index:2;
}
/* If both Rare Find and a Sale/Pick badge are present, push the standard badge down */
.prod .prod-rare ~ .badge{top:38px}

/* Per-cup price, the headline number */
.prod .prod-percup{
  display:flex;align-items:baseline;gap:6px;
  padding:10px 12px;margin:0 4px;
  background:linear-gradient(180deg,#f0faf0 0%,#e8f5e8 100%);
  border-radius:var(--r-md);
}
.prod .prod-percup-num{
  font-family:var(--fb);font-weight:800;color:#2e7d32;
  font-size:20px;letter-spacing:-.018em;line-height:1;
}
.prod .prod-percup-lbl{
  font-family:var(--fm);font-size:10px;font-weight:600;color:#558b2f;
  text-transform:uppercase;letter-spacing:.06em;
}

/* Tag pills (caffeine, flavour, time-of-day) */
.prod .prod-tags{
  display:flex;flex-wrap:wrap;gap:4px;
  padding:0 4px;
}
.prod .prod-tag{
  font-family:var(--fb);font-size:11px;font-weight:600;
  padding:4px 10px;border-radius:var(--r-pill);
  white-space:nowrap;line-height:1;
  display:inline-flex;align-items:center;
}
/* Caffeine tier colours, 5-tier from the JSX */
.prod .prod-tag.caffeine.free   { background:#e8f5e9; color:#2e7d32; }
.prod .prod-tag.caffeine.low    { background:#f1f8e9; color:#558b2f; }
.prod .prod-tag.caffeine.low-med{ background:#fff8e1; color:#f9a825; }
.prod .prod-tag.caffeine.medium { background:#fff3e0; color:#e65100; }
.prod .prod-tag.caffeine.high   { background:#fbe9e7; color:#bf360c; }
.prod .prod-tag.flavour { background:#f3e5f5; color:#6a1b9a; }
.prod .prod-tag.time    { background:#e3f2fd; color:#1565c0; }

/* Curator rating */
.prod .prod-rating{
  display:flex;align-items:center;gap:6px;
  padding:0 4px 4px;
}
.prod .prod-rating .prod-star{
  color:#ddd;font-size:13px;line-height:1;
}
.prod .prod-rating .prod-star.on,
.prod .prod-rating .prod-star.half{
  color:#d4a017;
}
.prod .prod-rating .prod-rating-num{
  font-family:var(--fm);font-size:11px;color:var(--slate);font-weight:600;
  margin-left:2px;
}

/* Rebalance the .meta row so brand sits above name (matches the JSX shop card) */
.prod .meta{align-items:flex-start}
.prod .meta .meta-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.prod .meta .br{margin-top:0;margin-bottom:2px;order:0}
.prod .meta .nm{order:1}

/* ===== Active-filter chips + count badges (added 2026-05-08) ===== */
.filter-active{margin:0 0 16px;padding:0 0 16px;border-bottom:1px solid rgba(14,15,18,.08)}
.filter-active h4{
  font-family:var(--mono,'JetBrains Mono',monospace);
  font-size:11px;
  letter-spacing:.08em;
  color:var(--ink-soft,#5a5a5a);
  margin:0 0 8px;
  text-transform:uppercase;
}
.active-chips{display:flex;flex-wrap:wrap;gap:6px}
.active-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#0A0B0F;
  color:#eff7f6;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  text-decoration:none;
  font-weight:500;
}
.active-chip span{opacity:.55;margin-left:2px}
.active-clear{
  font-size:12px;
  color:#9b1c1c;
  text-decoration:underline;
  margin-left:6px;
  align-self:center;
}

/* Filter row count + active state */
.f-row .ct{
  margin-left:auto;
  font-family:var(--mono,'JetBrains Mono',monospace);
  font-size:11px;
  color:var(--ink-soft,#5a5a5a);
  opacity:.7;
}
.f-row.is-active{
  background:rgba(14,15,18,.05);
  border-radius:6px;
}
.f-row.is-active .box{
  background:#0A0B0F;
  border-color:#0A0B0F;
}
.f-row.is-active .box::after{
  content:'';
  position:absolute;
  inset:3px;
  background:#eff7f6;
  border-radius:2px;
}
.f-row.is-active .nm{font-weight:600}
.f-row{position:relative}
.f-row .box{position:relative}
