/* ============================================================
   Oletrak Block Builder — base styles for mode.php / browse.php
   Per-block colours and columns live in the content-hashed
   blocks-<hash>.css and header-<hash>.css files. Nothing here is
   generated per request, and no inline styles are used anywhere.
   ============================================================ */

:root {
  --bb-ink: var(--neutral-900, var(--neutral-900));
  --bb-muted: #4b5563;
  --bb-line: var(--neutral-200);
  --bb-surface: var(--white);
  --bb-page: #f6f7f9;
  --bb-brand: var(--brand-navy-700, var(--brand-navy-700));
  --bb-brand-ink: var(--white);
  --bb-accent: #2563eb;
  --bb-radius: 12px;
  --bb-gap: 16px;
  --bb-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  /* Premium page width: a centred content column with generous gutters so
     blocks never run edge to edge on large screens. */
  --bb-max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.bb-page {
  margin: 0;
  background: var(--bb-page);
  color: var(--bb-ink);
  /* Same face as the rest of the site: tokens.css already declares Poppins
     as --font-sans, and bb_storefront_head() loads it. */
  font-family: var(--font-sans, "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif);
  font-size: 15px;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; }

a { color: var(--bb-accent); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--bb-accent);
  outline-offset: 2px;
}

.bb-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.bb-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bb-brand);
  color: var(--white);
  border-radius: 0 0 8px 0;
}
.bb-skip:focus { left: 0; }

/* ---------- announcement (Header setting, never a block) ---------- */
.bb-announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 44px 8px 16px;
  font-size: 14px;
  text-align: center;
  background: var(--neutral-900);
  color: var(--white);
  position: relative;
}
/* Links in the announcement are buttons, not prose: the UA underline made
   them read as hyperlinks and cut through descenders on the dark plate. */
.bb-announcement a,
.bb-announcement button { color: inherit; font-weight: 600; text-decoration: none; }
.bb-announcement-track { display: block; }
.bb-announcement-msg { display: none; }
.bb-announcement-msg.is-active { display: inline; }
.bb-announcement-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.bb-announcement-close:hover { background: rgba(255, 255, 255, .15); }
.bb-announcement[hidden] { display: none; }

/* ---------- header (Header settings, never blocks) ---------- */
.bb-header {
  background: var(--bb-surface);
  border-bottom: 1px solid var(--bb-line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.bb-header-inner {
  max-width: var(--bb-max);
  margin: 0 auto;
  padding: 10px clamp(14px, 4vw, 44px);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bb-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bb-brand);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -.02em;
}
.bb-brand img { border-radius: 8px; }

.bb-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.bb-switcher-group { display: flex; align-items: center; gap: 4px; }
.bb-switcher-main,
.bb-switcher-child {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--bb-muted);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14px;
}
.bb-switcher-main:hover,
.bb-switcher-child:hover { background: #eef2f6; color: var(--bb-brand); }
.bb-switcher-group.is-active .bb-switcher-main,
.bb-switcher-child[aria-current="page"] {
  background: var(--bb-brand);
  color: var(--bb-brand-ink);
}
.bb-switcher-children { display: flex; gap: 2px; }

.bb-search {
  display: flex;
  align-items: stretch;
  flex: 0 1 320px;
  min-width: 180px;
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}
.bb-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 9px 14px;
  font: inherit;
  color: var(--bb-ink);
  background: transparent;
}
.bb-search input:focus { outline: none; }
.bb-search button {
  border: 0;
  padding: 0 16px;
  background: var(--bb-brand);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.bb-search button:hover { background: var(--neutral-800); }

.bb-account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.bb-account a { color: var(--bb-brand); text-decoration: none; font-weight: 600; }
.bb-account a:hover { text-decoration: underline; }
.bb-account .bb-sell {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bb-accent);
  color: var(--white);
}

/* ---------- main ---------- */
.bb-main {
  max-width: var(--bb-max);
  margin: 0 auto;
  padding: 20px clamp(14px, 4vw, 44px) 48px;
}

/* The index bridge wraps each published block in .mk-bb-live. Matching the
   mode.php column gives the static homepage the same premium width and
   left/right breathing room instead of edge-to-edge sections. */
.mk-bb-live {
  width: 100%;
  max-width: var(--bb-max);
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 44px) 4px;
}
.mk-bb-live .hb { margin: 0 0 18px; }

.bb-preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--neutral-50);
  border: 1px solid #fdba74;
  color: #7c2d12;
  font-weight: 600;
}

.bb-preview-msg {
  flex: 1 1 340px;
  min-width: 0;
}

/* Desktop/mobile switch inside the preview banner — swaps the same token. */
.bb-preview-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(124, 45, 18, .22);
}

.bb-preview-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}

.bb-preview-switch-link:hover {
  background: rgba(255, 255, 255, .85);
  color: #431407;
}

.bb-preview-switch-link.is-current,
.bb-preview-switch-link.is-current:hover {
  background: #7c2d12;
  color: var(--white);
}

.bb-preview-switch-link:focus-visible {
  outline: 2px solid #7c2d12;
  outline-offset: 2px;
}

.bb-frame-page .bb-preview-switch {
  background: rgba(226, 232, 240, .1);
  border-color: rgba(148, 163, 184, .4);
}

.bb-frame-page .bb-preview-switch-link { color: var(--neutral-300, var(--neutral-300)); }
.bb-frame-page .bb-preview-switch-link:hover { background: rgba(226, 232, 240, .16); color: var(--neutral-50, var(--neutral-50)); }
.bb-frame-page .bb-preview-switch-link.is-current,
.bb-frame-page .bb-preview-switch-link.is-current:hover { background: #38bdf8; color: #0b1220; }
.bb-frame-page .bb-preview-switch-link:focus-visible { outline-color: #38bdf8; }

.bb-empty {
  background: var(--white);
  border: 1px dashed var(--bb-line);
  border-radius: var(--bb-radius);
  padding: 48px 24px;
  text-align: center;
}
.bb-empty h1, .bb-empty h2 { margin: 0 0 8px; font-size: 24px; color: var(--bb-brand); }
.bb-empty p { margin: 6px 0; color: var(--bb-muted); }

.bb-btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  border: 0;
  background: var(--bb-accent);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.bb-btn:hover { filter: brightness(.94); }

/* ---------- breadcrumbs / browse (the "View" page) ----------
   This is the page a block's View link opens, so it carries the same
   language as a section heading: quiet crumbs, one headline with a count
   chip beside it, and a single tool row under a hairline instead of a
   boxed form sitting on the page background. */
.bb-crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bb-muted);
}
.bb-crumbs a { color: var(--bb-muted); text-decoration: none; transition: color .16s ease; }
.bb-crumbs a:hover { color: var(--bb-accent); text-decoration: none; }

.bb-browse-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 16px;
}
.bb-browse-head h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--bb-brand);
}
.bb-browse-count {
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bb-brand) 8%, transparent);
  color: var(--bb-brand);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.bb-browse-query { flex: 1 0 100%; margin: 2px 0 0; color: var(--bb-muted); font-size: 14px; }
.bb-browse-query a { color: var(--bb-accent); font-weight: 600; }

.bb-browse-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  padding: 10px 0 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--bb-line);
  border-radius: 0;
}
.bb-browse-tools input[type="search"] {
  flex: 1 1 240px;
  min-width: 160px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  background: var(--bb-surface);
  color: var(--bb-ink);
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.bb-browse-tools input[type="search"]:focus {
  outline: none;
  border-color: var(--bb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bb-accent) 20%, transparent);
}
.bb-browse-tools select {
  height: 44px;
  padding: 0 34px 0 16px;
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  background-color: var(--bb-surface);
  color: var(--bb-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.bb-browse-tools .bb-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
}

.bb-browse-grid {
  margin: 0;
}
/* The gap/columns land at the end of this file, after .hb-grid, so the block
   column rules do not override them. */

.bb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--bb-line);
}
.bb-page-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--bb-line);
  background: var(--bb-surface);
  color: var(--bb-brand);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.bb-page-link:hover {
  border-color: var(--bb-brand);
  background: color-mix(in srgb, var(--bb-brand) 6%, transparent);
  transform: translateY(-1px);
}
.bb-page-link.is-disabled {
  color: #9ca3af;
  background: var(--neutral-50);
  border-color: var(--bb-line);
  transform: none;
}
.bb-page-status { color: var(--bb-muted); font-size: 14px; font-weight: 600; }

@media (max-width: 640px) {
  .bb-browse-tools input[type="search"],
  .bb-browse-tools select,
  .bb-browse-tools .bb-btn { flex: 1 1 100%; width: 100%; }
  .bb-pagination { gap: 8px; }
  .bb-page-status { flex: 1 0 100%; order: -1; text-align: center; }
}

/* ---------- generic block shell ---------- */
.hb {
  /* Defaults follow the site theme (light + dark); the per-block
     content-hashed sheet overrides these when an admin sets colours. */
  --hb-bg: var(--mk-card, var(--surface, var(--white)));
  --hb-title-bg: transparent;
  --hb-title: var(--mk-text, var(--bb-ink));
  --hb-text: var(--mk-text, var(--bb-ink));
  --hb-accent: var(--bb-accent);
  --hb-card: var(--mk-card, var(--white));
  --hb-border: var(--mk-line, var(--bb-line));
  --hb-radius: var(--bb-radius);
  --hb-padding: 20px;
  --hb-gap: 14px;
  display: block;
  margin: 0 0 18px;
  padding: var(--hb-padding);
  background: var(--hb-bg);
  color: var(--hb-text);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
}
.hb-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  background: var(--hb-title-bg);
  border-radius: calc(var(--hb-radius) - 4px);
  padding: 0;
}
.hb-title { margin: 0; font-size: 19px; color: var(--hb-title); letter-spacing: -.01em; }
/* Same "View" affordance as the in-page marketplace sections (.mk-viewall):
   accent label, trailing chevron, a small slide on hover — so a block that
   leads to its browse page reads like every other section heading. */
.hb-see-all {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--hb-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, transform .2s ease;
}
.hb-see-all .ic { width: 12px; height: 12px; }
.hb-see-all:hover { text-decoration: none; color: var(--bb-brand); transform: translateX(3px); }
.hb-foot { margin-top: 12px; text-align: right; }
.hb-head .hb-see-all { order: 3; }

.hb-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--hb-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .hb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.hb-data.hb-row .hb-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* Vertical breathing room: a row scrolls horizontally, which also clips
     vertically, so without padding the hover lift and shadow were cut off. */
  padding: 6px 2px 12px;
  -webkit-overflow-scrolling: touch;
  /* The bar is hidden while the row is at rest (the layout is clean and
     auto-sliding rows move themselves) and fades in as a slim themed pill on
     hover/focus, so manual scrolling is still discoverable. */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.hb-data.hb-row:hover .hb-grid,
.hb-data.hb-row:focus-within .hb-grid { scrollbar-color: color-mix(in srgb, var(--hb-text) 30%, transparent) transparent; }
.hb-data.hb-row .hb-grid::-webkit-scrollbar { height: 8px; }
.hb-data.hb-row .hb-grid::-webkit-scrollbar-track { background: transparent; }
.hb-data.hb-row .hb-grid::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.hb-data.hb-row:hover .hb-grid::-webkit-scrollbar-thumb,
.hb-data.hb-row:focus-within .hb-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--hb-text) 30%, transparent);
  background-clip: padding-box;
}
.hb-data.hb-row:hover .hb-grid::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--hb-text) 48%, transparent);
  background-clip: padding-box;
}
.hb-data.hb-row .hb-grid > * { flex: 0 0 200px; scroll-snap-align: start; }
@media (min-width: 1024px) {
  .hb-data.hb-row .hb-grid > * { flex-basis: 214px; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-data.hb-row .hb-grid { scroll-behavior: auto; }
}
/* Pause control for auto-sliding rows (WCAG 2.2.2). */
.hb-row-pause {
  margin-inline-start: auto;
  border: 1px solid var(--hb-border);
  background: transparent;
  color: var(--hb-text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: 999px;
  cursor: pointer;
}
.hb-row-pause:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.hb-row-pause[aria-pressed="true"] { background: color-mix(in srgb, currentColor 12%, transparent); }

/* ---------- top sellers ---------- */
.hb-card.hb-seller {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
}
.hb-seller-avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: auto;
}
.hb-seller-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hb-seller .hb-body { padding: 0; gap: 2px; min-width: 0; }
.hb-seller .hb-name {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hb-count { font-size: 12px; opacity: .75; }
.hb-badge-verified { background: rgba(31, 191, 117, .16); color: #128a55; }

/* ---------- cards ---------- */
.hb-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--hb-card);
  border: 1px solid var(--hb-border);
  border-radius: calc(var(--hb-radius) - 2px);
  color: inherit;
  text-decoration: none;
  transition: box-shadow .16s ease, transform .16s ease;
}
a.hb-card:hover { box-shadow: var(--bb-shadow); transform: translateY(-1px); }
/* Cards with action buttons use a covering link instead of a wrapping anchor. */
.hb-card-linked { position: relative; }
.hb-card-linked:hover { box-shadow: var(--bb-shadow); transform: translateY(-1px); }
.hb-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.hb-card-link:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: -2px; }
.hb-card-linked .hb-body { position: relative; }
.hb-thumb {
  position: relative;
  display: block;
  /* 4:3 keeps the photo useful while the card stays short enough for a
     second row to peek into the viewport. */
  aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--hb-border) 55%, var(--hb-card));
  overflow: hidden;
}

/* ---------- quick actions over the image ---------- */
.hb-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
.hb-card:hover .hb-actions,
.hb-card:focus-within .hb-actions,
.hb-actions:focus-within { opacity: 1; transform: translateY(0); }
.hb-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--hb-text) 12%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--hb-card) 88%, transparent);
  color: var(--hb-text);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .14s ease, color .14s ease, transform .14s ease;
}
.hb-act svg { width: 16px; height: 16px; }
.hb-act:hover { background: var(--hb-accent); color: #fff; transform: scale(1.05); }
.hb-act:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 2px; }
.hb-act[disabled] { opacity: .4; cursor: not-allowed; }
.hb-act.is-on { background: var(--hb-accent); color: #fff; }
.hb-act.is-on svg { fill: currentColor; }
@media (hover: none) {
  .hb-actions { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-actions, .hb-act { transition: none; }
}

/* Optional 2-line blurb under the title. */
.hb-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--hb-text) 68%, transparent);
}
.hb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hb-thumb-empty { display: block; width: 100%; height: 100%; background: #eef2f6; }
/* Listings without a photo: a themed tile, not a grey hole. The tint comes
   from the block's accent, so it follows whatever colours the block uses. */
.hb-thumb-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: color-mix(in srgb, var(--hb-border) 45%, var(--hb-card));
  color: var(--hb-accent, #2563eb);
}
.hb-thumb-ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 18% 12%, var(--hb-accent, #2563eb), transparent 62%);
  opacity: .2;
}
.hb-thumb-ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .35), rgba(15, 23, 42, .07));
}
.hb-thumb-ph > * { position: relative; z-index: 1; }
.hb-ph-icon { width: 34px; height: 34px; opacity: .9; }
.hb-ph-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
}
/* Placeholder style chosen on the block. */
.hb-thumb-ph.is-initials .hb-ph-text { font-size: 28px; letter-spacing: .04em; opacity: .8; }
.hb-thumb-ph.is-icon .hb-ph-icon { width: 48px; height: 48px; }
.hb-thumb-ph.is-pattern::before {
  background: repeating-linear-gradient(135deg, var(--hb-accent, #2563eb) 0 5px, transparent 5px 20px);
  opacity: .14;
}
.hb-thumb-ph.is-pattern::after {
  background-image: radial-gradient(circle at 1px 1px, var(--hb-accent, #2563eb) 1.2px, transparent 1.6px);
  background-size: 14px 14px;
  opacity: .16;
}
.hb-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.hb-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: var(--hb-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hb-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.hb-price { font-weight: 700; color: var(--bb-brand); }
.hb-price.hb-sale { color: #b91c1c; }
.hb-was { color: color-mix(in srgb, var(--hb-text) 58%, transparent); text-decoration: line-through; font-size: 12px; }
.hb-min { color: color-mix(in srgb, var(--hb-text) 58%, transparent); font-size: 12px; }
.hb-rating { color: #b45309; font-size: 12px; white-space: nowrap; }
[data-theme="dark"] .hb-price.hb-sale { color: #fca5a5; }
[data-theme="dark"] .hb-rating { color: #fbbf24; }
.hb-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 1px; }
.hb-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  /* Tinted from the theme text colour so chips work on a light card and on a
     dark card without switching CSS palettes. */
  background: color-mix(in srgb, var(--hb-text) 10%, transparent);
  color: color-mix(in srgb, var(--hb-text) 82%, transparent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.hb-badge-sale { background: rgba(220, 38, 38, .14); color: #b91c1c; }
.hb-badge-new { background: rgba(37, 99, 235, .14); color: #1d4ed8; }
.hb-badge-featured { background: color-mix(in srgb, var(--hb-accent) 18%, transparent); color: color-mix(in srgb, var(--hb-accent) 75%, var(--hb-text)); }
.hb-badge-muted { background: color-mix(in srgb, var(--hb-text) 8%, transparent); color: color-mix(in srgb, var(--hb-text) 62%, transparent); }
/* Location chip: town · sub-area, or the region when that is all we have. */
.hb-badge-loc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  background: color-mix(in srgb, var(--hb-text) 7%, transparent);
  color: color-mix(in srgb, var(--hb-text) 74%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hb-badge-loc svg { width: 11px; height: 11px; flex: 0 0 auto; opacity: .8; }
[data-theme="dark"] .hb-badge-sale { background: rgba(248, 113, 113, .18); color: #fca5a5; }
[data-theme="dark"] .hb-badge-new { background: rgba(96, 165, 250, .18); color: #bfdbfe; }
[data-theme="dark"] .hb-badge-verified { background: rgba(52, 211, 153, .18); color: #6ee7b7; }

/* skeleton / personal */
.hb-skeleton { pointer-events: none; }
.hb-skel-line {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f6 25%, var(--neutral-200, var(--neutral-200)) 37%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: hb-shimmer 1.4s ease infinite;
}
.hb-skel-line.short { width: 55%; }
@keyframes hb-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.hb-personal-status { margin: 8px 0 0; color: var(--bb-muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .hb-skel-line { animation: none; }
  a.hb-card { transition: none; }
}

/* ---------- mini announcement (in-page, not the header bar) ---------- */
.hb-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--hb-radius);
  background: #eef2ff;
  color: var(--hb-title);
  font-weight: 600;
}
.hb-mini.hb-align-center { justify-content: center; text-align: center; }
.hb-mini.hb-align-left { justify-content: flex-start; text-align: left; }
.hb-mini-icon { font-size: 18px; }

/* ---------- categories ---------- */
/* One row only: tiles keep a stable premium size and the row scrolls
   horizontally when a mode has more categories than fit. */
.hb-cats {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--hb-gap);
  margin: 0;
  padding: 2px 2px 10px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.hb-cats > li {
  flex: 0 0 clamp(104px, 11.5%, 148px);
  max-width: 148px;
  scroll-snap-align: start;
}
.hb-cats .hb-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  background: var(--hb-card);
  color: var(--bb-ink);
  text-decoration: none;
  text-align: center;
}
.hb-cats .hb-cat:hover { border-color: var(--hb-accent); }
.hb-cat-label { font-weight: 600; font-size: 14px; }
.hb-cat-count { color: var(--bb-muted); font-size: 12px; }

/* Tile layout: the photo IS the tile, and the name rides on it as a bubble
   chip at the bottom edge instead of sitting under the image. The chip is
   glass over the photo (blur + translucency) so the same markup stays legible
   on a pale product shot and on a dark one. */
.hb-cats-tiles .hb-cat {
  position: relative;
  display: block;
  padding: 0;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--hb-radius) - 2px);
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--hb-accent) 22%, var(--hb-card)), var(--hb-card));
  text-align: left;
}
.hb-cats-tiles .hb-cat:hover { border-color: var(--hb-accent); }
.hb-cats-tiles .hb-cat img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform .25s ease;
}
.hb-cats-tiles .hb-cat:hover img { transform: scale(1.04); }
.hb-cats-tiles .hb-cat-label {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  display: block;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #0b1f3a;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(2, 20, 35, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hb-cats-tiles .hb-cat-count {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 20, 34, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .hb-cats-tiles .hb-cat-label {
  background: rgba(18, 26, 43, 0.88);
  color: #e8eef7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hb-cats-chips { flex-wrap: nowrap; gap: 8px; }
.hb-cats-chips > li { flex: 0 0 auto; max-width: none; }
.hb-cats-chips .hb-cat {
  flex-direction: row;
  padding: 7px 14px;
  border-radius: 999px;
}
.hb-cats-icons > li { flex-basis: clamp(88px, 9%, 120px); }
.hb-cats-icons .hb-cat { border: 0; background: transparent; }

/* ---------- banners / carousel ---------- */
.hb-banner { display: block; border-radius: var(--hb-radius); overflow: hidden; }
.hb-banner img { display: block; width: 100%; }
.hb-carousel { position: relative; }
.hb-slides { position: relative; }
.hb-slide img { display: block; width: 100%; border-radius: var(--hb-radius); }
.hb-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.hb-carousel-prev, .hb-carousel-next, .hb-carousel-pause {
  appearance: none;
  border: 1px solid var(--hb-border);
  background: var(--white);
  color: var(--bb-ink);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
}
.hb-carousel-pause { font-size: 13px; }
.hb-dots { display: flex; gap: 6px; }
.hb-dot {
  width: 9px; height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--neutral-300, var(--neutral-300));
  cursor: pointer;
}
.hb-dot.is-active { background: var(--hb-accent); }

/* ---------- video ---------- */
/* The frame keeps a 16:9 box even before anything is loaded (no poster, no
   iframe yet) — otherwise the click-to-play block collapsed to zero height and
   the video appeared missing on the index page. */
.hb-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--hb-radius);
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 20% 10%, rgba(59, 130, 246, .35), transparent 60%),
    #0b1220;
}
.hb-video img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hb-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.hb-video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.hb-video-play {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hb-play-icon {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .62);
  color: var(--white);
  font-size: 22px;
}
.hb-caption { margin: 8px 0 0; color: color-mix(in srgb, var(--hb-text) 65%, transparent); font-size: 13px; }
.hb-video-cta { margin: 12px 0 0; }

/* Video shape / width / height chosen in the block settings. */
.hb-video[data-aspect="16:9"] { aspect-ratio: 16 / 9; }
.hb-video[data-aspect="4:3"] { aspect-ratio: 4 / 3; }
.hb-video[data-aspect="1:1"] { aspect-ratio: 1 / 1; }
.hb-video[data-aspect="9:16"] { aspect-ratio: 9 / 16; }
.hb-video[data-aspect="21:9"] { aspect-ratio: 21 / 9; }
.hb-video[data-width="wide"] { max-width: 1080px; margin-inline: auto; }
.hb-video[data-width="contained"] { max-width: 720px; margin-inline: auto; }
/* Vertical clips stay phone-sized even when the width is set to full/wide. */
.hb-video[data-aspect="9:16"] { max-width: min(380px, 100%); margin-inline: auto; }
.hb-video[data-height="260"] { aspect-ratio: auto; height: 260px; }
.hb-video[data-height="320"] { aspect-ratio: auto; height: 320px; }
.hb-video[data-height="420"] { aspect-ratio: auto; height: 420px; }
.hb-video[data-height="520"] { aspect-ratio: auto; height: 520px; }
.hb-video[data-height="640"] { aspect-ratio: auto; height: 640px; }
.hb-video[data-height="720"] { aspect-ratio: auto; height: 720px; }

/* ---------- showcase / promo / flash / text ---------- */
.hb-showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--hb-gap); margin: 0; padding: 0; list-style: none; }
.hb-showcase li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  background: var(--hb-card);
  color: var(--bb-ink);
  text-decoration: none;
  text-align: center;
  font-size: 13px;
}
.hb-showcase img { max-height: 72px; object-fit: contain; }

.hb-promo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--hb-radius);
}
.hb-promo-text { font-weight: 700; font-size: 17px; color: var(--hb-title); }

.hb-flash { display: block; }
.hb-flash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hb-countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: #b91c1c; }
.hb-flash-card { position: relative; }
.hb-progress { height: 7px; border-radius: 999px; background: var(--danger-tint); overflow: hidden; margin-top: 6px; }
.hb-progress span { display: block; height: 100%; background: var(--danger-600, var(--danger-600)); }
.hb-progress-text { font-size: 12px; color: var(--bb-muted); }
.hb-reserve { margin-top: 8px; }
.hb-reserve-status { font-size: 12px; color: var(--bb-muted); margin: 6px 0 0; }

.hb-richtext { color: var(--hb-title); }
.hb-richtext.hb-align-center { text-align: center; }
.hb-richtext.hb-align-left { text-align: left; }
.hb-richtext h2, .hb-richtext h3 { margin-top: 0; }
.hb-richtext a { color: var(--hb-accent); }

.hb-more-wrap { text-align: center; margin-top: 14px; }
.hb-btn { display: inline-block; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--hb-accent); color: var(--white); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.hb-sentinel { height: 1px; }

/* ---------- footer ---------- */
.bb-footer { border-top: 1px solid var(--bb-line); background: var(--white); }
.bb-footer-inner {
  max-width: var(--bb-max);
  margin: 0 auto;
  padding: 22px clamp(14px, 4vw, 44px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--bb-muted);
  font-size: 14px;
}
.bb-footer-inner p { margin: 0; }
.bb-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.bb-footer a { color: var(--bb-brand); text-decoration: none; font-weight: 600; }
.bb-footer a:hover { text-decoration: underline; }

/* ---------- responsive header ---------- */
@media (max-width: 860px) {
  .bb-header-inner { gap: 10px; }
  .bb-search { order: 3; flex: 1 1 100%; }
  .bb-account { margin-left: auto; }
  .bb-switcher { order: 2; flex: 1 1 100%; }
}
@media (max-width: 520px) {
  .bb-header-inner { padding-inline: 12px; }
  .bb-main { padding: 14px 12px 36px; }
  .bb-footer-inner { padding-inline: 12px; }
  /* Wins over the per-block sheet so a wide desktop padding cannot squeeze a
     phone: the block keeps a safe inner gutter and the title bar wraps. */
  .mk-bb-live .hb,
  .bb-main .hb { --hb-padding: 14px; --hb-gap: 10px; }
  .hb-head { flex-wrap: wrap; gap: 6px 10px; }
  .hb-title { font-size: 17px; }
  .hb-see-all { font-size: 13px; }
  .hb-card .hb-body { padding: 8px 10px 10px; }
  .bb-account .bb-sell { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  .bb-header, .bb-announcement, .bb-footer, .bb-search, .bb-pagination { display: none !important; }
  .hb { break-inside: avoid; }
}

/* ---- admin preview device frame (never rendered on a live page) ---- */
.bb-main.bb-preview-is-mobile {
  max-width: 430px;
  padding-inline: 12px;
  outline: 1px dashed var(--neutral-400, var(--neutral-400));
  outline-offset: 10px;
  border-radius: 10px;
}
.bb-main.bb-preview-is-desktop { max-width: var(--bb-max); }

/* ---- device-framed mobile preview shell (admin preview only) ---- */
.bb-frame-page {
  margin: 0;
  padding: 24px 16px 48px;
  background: var(--neutral-900);
  color: var(--neutral-200, var(--neutral-200));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.bb-frame-page .bb-preview-banner { max-width: 900px; margin: 0 auto 20px; }
.bb-frame-shell { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bb-frame-bezel { padding: 12px; border-radius: 34px; background: var(--neutral-800, var(--neutral-800)); box-shadow: 0 24px 60px rgba(2, 6, 23, .55); }
.bb-frame-screen { display: block; width: 390px; height: 844px; max-height: calc(100vh - 220px); border: 0; border-radius: 24px; background: var(--white); }
.bb-frame-caption { margin: 0; color: var(--neutral-400, var(--neutral-400)); font-size: 13px; text-align: center; }
@media (max-width: 460px) { .bb-frame-screen { width: 100%; height: 640px; } .bb-frame-bezel { padding: 8px; } }

/* ============================================================
   Visual polish — last so it refines every block type at once.
   Colours come from --hb-* tokens, so light and dark both work.
   ============================================================ */
.hb {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -24px rgba(15, 23, 42, .35);
}
.hb-head { align-items: center; }
.hb-title {
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hb-title::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: 999px;
  background: var(--hb-accent);
  flex: 0 0 auto;
}
.hb-see-all {
  padding: 0;
  border-radius: 0;
  background: none;
}

.hb-card {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
a.hb-card:hover,
.hb-card-linked:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -18px rgba(15, 23, 42, .45);
  border-color: color-mix(in srgb, var(--hb-accent) 35%, var(--hb-border));
}
.hb-card:focus-within { border-color: color-mix(in srgb, var(--hb-accent) 45%, var(--hb-border)); }
.hb-thumb img { transition: transform .35s ease; }
.hb-card:hover .hb-thumb img { transform: scale(1.045); }
.hb-name { font-size: 14.5px; font-weight: 650; }
.hb-price { font-size: 15px; letter-spacing: -.01em; }
.hb-badge { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); }

.hb-btn,
.hb-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 0;
  background: var(--hb-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--hb-accent) 80%, transparent);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.hb-btn:hover,
.hb-load-more:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--hb-accent) 90%, transparent); }
.hb-btn:focus-visible,
.hb-load-more:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 3px; }
.hb-row-pause { border-radius: 999px; }

.hb-video { box-shadow: 0 20px 44px -26px rgba(15, 23, 42, .65); }
.hb-play-icon {
  width: 68px;
  height: 68px;
  font-size: 24px;
  background: rgba(12, 18, 32, .72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  transition: transform .18s ease, background .18s ease;
}
.hb-video-play:hover .hb-play-icon { transform: translate(-50%, -50%) scale(1.06); background: var(--hb-accent); }

[data-theme="dark"] .hb { box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -28px rgba(0, 0, 0, .8); }
[data-theme="dark"] .hb-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .28); }
[data-theme="dark"] a.hb-card:hover,
[data-theme="dark"] .hb-card-linked:hover { box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .85); }

@media (prefers-reduced-motion: reduce) {
  .hb-card, .hb-thumb img, .hb-btn, .hb-load-more, .hb-play-icon { transition: none; }
  .hb-card:hover .hb-thumb img { transform: none; }
}


/* ------------------------------------------------------------
   DENSE LAYOUT — phones
   ------------------------------------------------------------
   The marketplace page should read as a wall of listings, not one card per
   screen: on a 390px viewport the row cards were 240px wide (1.4 visible) and
   a single card was ~340px tall. Here the block frame, its header and the
   cards shrink one step, so a row shows three-plus cards and two blocks fit
   in one viewport. Desktop sizes are untouched.
   ------------------------------------------------------------ */
@media (max-width: 639px) {
  .hb {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .hb .hb-head {
    padding: 6px 9px;
    margin-bottom: 7px;
    border-radius: 8px;
  }

  .hb .hb-title {
    font-size: 14px;
  }

  .hb .hb-see-all {
    font-size: 12px;
  }

  .hb-grid {
    gap: 8px;
  }

  .hb-data.hb-row .hb-grid {
    padding: 2px 2px 6px;
  }

  .hb-data.hb-row .hb-grid > * {
    flex-basis: 104px;
  }

  .hb-thumb {
    aspect-ratio: 4 / 3;
  }

  .hb-body {
    gap: 1px;
    padding: 4px 5px 5px;
  }

  .hb-name {
    font-size: 10px;
    line-height: 1.22;
    -webkit-line-clamp: 2;
  }

  .hb-meta {
    gap: 3px;
    font-size: 9.5px;
  }

  .hb-price {
    font-size: 11px;
  }

  .hb-was,
  .hb-min,
  .hb-rating,
  .hb-desc,
  .hb-count {
    font-size: 9.5px;
  }

  .hb-card {
    border-radius: 8px;
  }

  .hb-desc {
    display: none;
  }

  /* Seller cards ride the same row: smaller avatar, tighter name. */
  .hb-card.hb-seller {
    gap: 6px;
    padding: 6px;
  }

  .hb-seller-avatar {
    width: 26px;
    height: 26px;
  }

  .hb-seller .hb-name {
    font-size: 10.5px;
  }

  .hb-badges {
    gap: 3px;
  }

  .hb-badge {
    font-size: 9.5px;
    padding: 1px 6px;
  }

  .hb-actions {
    top: 5px;
    right: 5px;
    gap: 4px;
  }

  .hb-act {
    width: 26px;
    height: 26px;
  }

  .hb-act svg {
    width: 14px;
    height: 14px;
  }

  /* Category tiles: mini on phones so four or five fit the row at once. */
  .hb-cats {
    gap: 6px;
    padding: 0 0 4px;
  }

  .hb-cats > li {
    flex-basis: 84px;
    max-width: 84px;
  }

  .hb-cats-tiles .hb-cat {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
  }

  .hb-cats-tiles .hb-cat-label {
    left: 4px;
    right: 4px;
    bottom: 4px;
    padding: 3px 5px;
    font-size: 9.5px;
    border-radius: 999px;
  }

  .hb-cats-tiles .hb-cat-count {
    top: 4px;
    right: 4px;
    padding: 2px 5px;
    font-size: 8.5px;
  }
}

/* ------------------------------------------------------------
   BLOCKS BLEND INTO THE PAGE
   ------------------------------------------------------------
   A published block is a section of the page, not a card sitting
   inside it: the compiled per-block sheet still writes a border,
   radius, padding and a white background, which made a freshly
   added block stand out from the sections around it. These rules
   neutralise that frame (double class so they win over .hb-NNN),
   leaving the author's own background only when it is not the
   default white.
   ------------------------------------------------------------ */
.hb.hb {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 16px;
  background: transparent;
}

.hb.hb .hb-head {
  border-radius: 10px;
}

@media (max-width: 639px) {
  .hb.hb {
    margin-bottom: 14px;
  }
}

/* ------------------------------------------------------------------
   Block product names on a phone: ONE line with an ellipsis.
   Wrapping a long listing name used to push the price row down and make
   every card in the row a different height; now the name truncates and
   the card keeps its rhythm. Desktop keeps the two-line clamp.
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .hb-name {
    display: block;
    -webkit-line-clamp: unset;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .hb-meta { flex-wrap: nowrap; min-width: 0; }
  .hb-price { white-space: nowrap; }
}

/* ------------------------------------------------------------------
   BROWSE GRID — the page a block's "View" link opens
   ------------------------------------------------------------------
   Same card language as a block row, but it is a full page of results,
   so it gets real card gaps instead of the tighter row spacing, and
   three listings per line on a phone (a 390px screen leaves ~114px
   cards, which is exactly the compact card size used inside blocks).
   These rules sit last on purpose: .hb-grid sets gap and column counts
   and would otherwise win on equal specificity.
   ------------------------------------------------------------------ */
.bb-browse-grid {
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1023px) {
  .bb-browse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .bb-browse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  /* Compact cards: everything the phone card needs to stay readable in a
     ~110px column, matching the in-block card sizes above. */
  .bb-browse-grid .hb-body {
    gap: 2px;
    padding: 5px 6px 6px;
  }

  .bb-browse-grid .hb-name {
    font-size: 10.5px;
    line-height: 1.25;
  }

  .bb-browse-grid .hb-meta {
    gap: 3px;
    font-size: 9.5px;
  }

  .bb-browse-grid .hb-price {
    font-size: 11.5px;
  }

  .bb-browse-grid .hb-was,
  .bb-browse-grid .hb-min,
  .bb-browse-grid .hb-rating,
  .bb-browse-grid .hb-desc,
  .bb-browse-grid .hb-count {
    font-size: 9.5px;
  }

  .bb-browse-grid .hb-desc,
  .bb-browse-grid .hb-badge-loc {
    display: none;
  }

  .bb-browse-grid .hb-badge {
    font-size: 9.5px;
    padding: 1px 6px;
  }

  .bb-browse-grid .hb-card {
    border-radius: 8px;
  }

  .bb-browse-grid .hb-actions {
    top: 5px;
    right: 5px;
    gap: 4px;
  }

  .bb-browse-grid .hb-act {
    width: 26px;
    height: 26px;
  }

  .bb-browse-grid .hb-act svg {
    width: 14px;
    height: 14px;
  }
}

/* ------------------------------------------------------------------
   Block card names: ONE line at every width.
   ------------------------------------------------------------------
   The block cards clamped the name to two lines so a row stayed even, but
   a two-line name still made cards taller than their neighbours as soon
   as the titles differed in length. Names truncate with an ellipsis
   instead, on desktop and phone alike, so every card in a row keeps the
   same height and the price row stays on one baseline.
   ------------------------------------------------------------------ */
body .hb-name {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: horizontal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}

/* ------------------------------------------------------------------
   PHONES — block cards get the marketplace card size
   ------------------------------------------------------------------
   A block row on a phone used to be five 104px thumbnails: the name was
   10px and the price was smaller than the badge next to it. These cards
   now match the curated rows on the marketplace (Made for You,
   Recommended…), so a block reads as real listings instead of a strip of
   swatches. The one-line name clamp above still applies.
   ------------------------------------------------------------------ */
@media (max-width: 639px) {
  .hb-data.hb-row .hb-grid > * {
    flex-basis: clamp(148px, 44vw, 172px);
  }

  .hb-thumb {
    aspect-ratio: 4 / 3;
  }

  .hb-body {
    gap: 2px;
    padding: 7px 8px 9px;
  }

  .hb-name {
    font-size: 15px;
    line-height: 1.25;
  }

  .hb-meta {
    gap: 4px;
    font-size: 10px;
  }

  .hb-price {
    font-size: 16px;
  }

  .hb-was,
  .hb-min,
  .hb-rating,
  .hb-count {
    font-size: 10px;
  }

  .hb-desc {
    display: none;
  }
}
