/*
=====================================================================
 Belldiva product grid and filter bar
 Part of the Belldiva design system. Enqueued by functions.php as
 `belldiva-product`; see assets/css/belldiva.css for the index.
=====================================================================
*/

/* Filled in phase 6 (product filter component). Intentionally empty. */

/* =====================================================================
   Brand directory
   Used by the Brands page and (phase 2 deferral, now landed) the nav
   mega panel. Logo-led tiles: the logo is the thing people scan for,
   so it gets the space and the name sits under it as confirmation.
   ===================================================================== */
.bd .bd-brand-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.bd .bd-brand-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.bd .bd-filter {
  font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.bd .bd-filter:hover { border-color: var(--gold); color: var(--ink); }
.bd .bd-filter.is-on { border-color: var(--deep); color: var(--deep); background: var(--deep-tint); }
.bd .bd-filter-count {
  font-size: 0.62rem;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 999px; padding: 1px 6px;
}

.bd .bd-brand-search {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 6px 2px; min-width: 220px;
}
.bd .bd-brand-search svg { width: 16px; height: 16px; color: var(--ink-soft); flex-shrink: 0; }
.bd .bd-brand-search input {
  border: 0; background: transparent; font-family: inherit;
  font-size: var(--text-sm); color: var(--ink); width: 100%;
}
.bd .bd-brand-search input:focus { outline: none; }

.bd .bd-brand-az {
  display: flex; flex-wrap: wrap; gap: 2px;
  margin-bottom: var(--space-5);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: var(--space-3) 0;
}
.bd .bd-brand-az button {
  background: none; border: 0; cursor: pointer;
  font-size: var(--text-xs); letter-spacing: 0.06em;
  color: var(--ink-soft); padding: 3px 8px; border-radius: 3px;
}
.bd .bd-brand-az button:hover { color: var(--deep); background: var(--deep-tint); }

.bd .bd-brand-count {
  margin: 0 0 var(--space-5);
  font-size: var(--text-xs);
  color: var(--ink-soft);
}

.bd .bd-brand-dir {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: var(--space-4);
}
.bd .bd-brand-tile {
  display: flex; flex-direction: column;
  background: var(--ground-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard), border-color 0.2s var(--ease-standard);
}
.bd .bd-brand-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); }
.bd .bd-brand-tile.is-flash { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }

.bd .bd-brand-logo {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10;
  padding: var(--space-5);
  background: #fff;
}
/* The typeset name is the base layer; a real logo, when one is trustworthy,
   paints over it. So a 404 degrades to the name with no layout shift. */
.bd .bd-brand-logo img + .bd-brand-logo-text { display: none; }
.bd .bd-brand-logo img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  /* Brand logos arrive in wildly different sizes and colours; a gentle cap
     stops one oversized mark dominating the grid. */
  mix-blend-mode: multiply;
}
.bd .bd-brand-logo-text {
  font-family: 'Kholic', Georgia, serif;
  font-size: var(--text-md);
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  padding: 0 var(--space-2);
}
/* Long names must not overflow their tile. */
.bd .bd-brand-dir--compact .bd-brand-logo-text { font-size: var(--text-sm); }
.bd .bd-brand-meta {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--space-4);
  border-top: 1px solid var(--line-soft);
}
.bd .bd-brand-name {
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.3;
}
.bd .bd-brand-logo img {
  position: absolute; inset: var(--space-5);
  margin: auto;
}
.bd .bd-brand-go {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-2xs);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-deep);
}
.bd .bd-brand-go svg { width: 12px; height: 12px; }

.bd .bd-brand-empty { margin: var(--space-8) 0; text-align: center; color: var(--ink-soft); }
/* Brand disclaimer: the last section of the Brands page, quiet small print. */
.bd .bd-brand-disclaimer h2 {
  font-family: 'Kholic', Georgia, serif; font-weight: 400;
  font-size: var(--text-lg);
  margin: 0 0 var(--space-3);
}
.bd .bd-brand-disclaimer p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 72ch;
}

/* Compact variant, for the nav mega panel. */
.bd-brand-dir--compact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-2); }
.bd-brand-dir--compact .bd-brand-logo { aspect-ratio: 3 / 2; padding: var(--space-3); }
.bd-brand-dir--compact .bd-brand-meta { padding: var(--space-2) var(--space-3); }
.bd-brand-dir--compact .bd-brand-go { display: none; }

/* Want your brand here */
.bd .bd-brand-pitch-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-8); flex-wrap: wrap;
  background: var(--deep-tint);
  border-radius: 4px;
  padding: var(--space-10) var(--space-12);
}
.bd .bd-brand-pitch-inner h2 { margin: var(--space-2) 0 var(--space-3); }

@media (max-width: 700px) {
  .bd .bd-brand-dir { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); }
  .bd .bd-brand-pitch-inner { padding: var(--space-8) var(--space-6); }
  .bd .bd-brand-search { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bd .bd-brand-tile, .bd .bd-filter { transition: none; }
}

/* =====================================================================
   Product grid
   ===================================================================== */
.bd .bd-prod-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.bd .bd-prod-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.bd .bd-prod-selects { display: flex; gap: 10px; flex-wrap: wrap; }
.bd .bd-prod-selects select {
  font-family: inherit; font-size: var(--text-xs);
  color: var(--ink); background: var(--ground-raised);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
}
.bd .bd-prod-selects select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bd .bd-prod-count { margin: 0 0 var(--space-5); font-size: var(--text-xs); color: var(--ink-soft); }

.bd .bd-prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: var(--space-5);
}

.bd .bd-prod {
  display: flex; flex-direction: column;
  background: var(--ground-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard), border-color 0.2s var(--ease-standard);
}
.bd .bd-prod:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); }

.bd .bd-prod-media {
  position: relative; display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--line-soft);
}
.bd .bd-prod-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/*
 * Designed placeholder. The affiliate tracker has no product photography and
 * hotlinking Amazon's images breaches the Associates terms, so a card with no
 * image gets a considered panel rather than a grey box: the brand set in the
 * display serif over a category-tinted ground.
 */
.bd .bd-prod-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  text-align: center;
}
.bd .bd-prod-ph::after {
  content: ''; position: absolute; left: 50%; bottom: 26px;
  width: 26px; height: 1px; background: var(--gold);
  transform: translateX(-50%);
}
.bd .bd-prod-ph-cat {
  font-size: var(--text-2xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-deep);
}
.bd .bd-prod-ph-brand {
  font-family: 'Kholic', Georgia, serif;
  font-size: var(--text-lg); line-height: 1.15;
  color: var(--ink);
}
.bd .bd-prod-media--1 { background: linear-gradient(155deg, #F3EBDD 0%, #E9DCC6 100%); }
.bd .bd-prod-media--2 { background: linear-gradient(155deg, #EFE7DE 0%, #E2D6C8 100%); }
.bd .bd-prod-media--3 { background: linear-gradient(155deg, #E6EBE5 0%, #D6E0D6 100%); }

.bd .bd-prod-body {
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--space-4);
  flex: 1;
}
.bd .bd-prod-brand {
  font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-deep);
}
.bd .bd-prod-title {
  margin: 0;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
}
.bd .bd-prod-title a { color: inherit; }
.bd .bd-prod-title a:hover { color: var(--gold-deep); }
.bd .bd-prod-foot {
  margin-top: auto; padding-top: var(--space-3);
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap;
}
.bd .bd-prod-price { font-size: var(--text-base); color: var(--ink); }
.bd .bd-prod-go {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-2xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-deep);
}
.bd .bd-prod-go svg { width: 12px; height: 12px; }
.bd .bd-prod-review {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 8px 0 0; padding: 0;
  font-family: inherit; font-size: var(--text-2xs); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); background: none; border: none; cursor: pointer;
  transition: color 0.2s var(--ease-standard);
}
.bd .bd-prod-review:hover { color: var(--gold-deep); }
.bd .bd-prod-review-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--deep); color: #fff; flex-shrink: 0;
}
.bd .bd-prod-review-icon svg { width: 9px; height: 9px; }

.bd .bd-prod-empty { margin: var(--space-10) 0; text-align: center; color: var(--ink-soft); }
.bd .bd-prod-disclosure {
  margin: var(--space-8) 0 0;
  font-size: var(--text-xs);
  color: var(--ink-soft);
  max-width: 74ch;
  line-height: 1.6;
}

/* Admin-only hint showing where the empty offer slots live. */
.bd .bd-offer-hint-box {
  border: 1px dashed var(--gold);
  border-radius: 4px;
  padding: var(--space-5) var(--space-6);
  background: color-mix(in srgb, var(--gold-tint) 50%, transparent);
}
.bd .bd-offer-hint-box strong { display: block; font-size: var(--text-sm); margin-bottom: 4px; }
.bd .bd-offer-hint-box p { margin: 0; font-size: var(--text-xs); color: var(--ink-soft); }

@media (max-width: 640px) {
  .bd .bd-prod-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: var(--space-4); }
  .bd .bd-prod-ph-brand { font-size: var(--text-base); }
  .bd .bd-prod-selects { width: 100%; }
  .bd .bd-prod-selects select { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .bd .bd-prod { transition: none; } }
