/*
 * Best Before · Concept B · global styles.
 * Tokens come from theme.json (--wp--preset--*) so the Customizer and editor stay in sync.
 * Plain cascade (no @layer): theme CSS must beat unlayered plugin CSS. Page CSS lives in pages/*.css.
 */

:root {
	--bb-yellow: var(--wp--preset--color--yellow, #ffcf02);
	--bb-ink: var(--wp--preset--color--ink, #111);
	--bb-ink-2: #1a1a1a;
	--bb-ground: var(--wp--preset--color--ground, #f7f6f2);
	--bb-surface: var(--wp--preset--color--surface, #fff);
	--bb-soft-yellow: var(--wp--preset--color--soft-yellow, #fff4bf);
	--bb-pale-yellow: var(--wp--preset--color--pale-yellow, #fff8d6);
	--bb-selected: #fffdf2;
	--bb-muted: var(--wp--preset--color--muted, #555);
	--bb-body: var(--wp--preset--color--body, #444);
	--bb-border: var(--wp--preset--color--border, #e7e4da);
	--bb-border-2: #e0dccd;
	--bb-track: #cfcab9;
	--bb-urgency: var(--wp--preset--color--urgency, #a33b00);
	--bb-error: #b3261e;
	--bb-success: var(--wp--preset--color--success, #1d5b33);
	--bb-success-bg: var(--wp--preset--color--success-bg, #e6f2ea);

	--bb-font-display: var(--wp--preset--font-family--display, "Fira Sans", Arial, sans-serif);
	--bb-font-body: var(--wp--preset--font-family--body, Inter, system-ui, sans-serif);

	--bb-r-hero: 24px;
	--bb-r-panel: 20px;
	--bb-r-card: 18px;
	--bb-r-tile: 16px;
	--bb-r-control: 12px;
	--bb-r-small: 10px;
	--bb-r-badge: 6px;
	--bb-r-pill: 999px;

	--bb-touch: 44px;
	--bb-gutter: clamp(16px, 3vw, 24px);
	--bb-max: 1280px;
	--bb-gap: clamp(12px, 1.6vw, 20px);
	--bb-section: clamp(28px, 4vw, 48px);
	--bb-shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 6px 20px -12px rgba(17, 17, 17, .18);
	--bb-ease: cubic-bezier(.16, 1, .3, 1);
	--bb-tabs-h: 64px;
}

/* Higher specificity than plugin resets that set content-box. */
html *, html *::before, html *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

body {
	background: var(--bb-ground);
	color: var(--bb-ink-2);
	font-family: var(--bb-font-body);
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { overflow-wrap: anywhere; font-family: var(--bb-font-display); font-weight: 800; line-height: 1.1; color: var(--bb-ink); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.3rem + 2.2vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem); }
/* G2: inner/card-level H3s are Inter 700 in the prototypes, not the display face. */
h3 { font-size: clamp(1.125rem, 1rem + .6vw, 1.375rem); font-family: var(--bb-font-body); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--bb-ink); text-underline-offset: 3px; }
a:hover { color: #000; }
::selection { background: var(--bb-yellow); color: var(--bb-ink); }
:focus-visible { outline: 3px solid var(--bb-ink); outline-offset: 2px; border-radius: 4px; }
strong, b { font-weight: 700; }
small { font-size: .8125rem; }
.screen-reader-text { 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: 8px; top: -60px; z-index: 1000; padding: 10px 16px; background: var(--bb-ink); color: #fff; border-radius: var(--bb-r-control); font-weight: 700; }
.bb-skip:focus { top: 8px; color: #fff; }
.bb-container { width: 100%; max-width: calc(var(--bb-max) + 2 * var(--bb-gutter)); margin-inline: auto; padding-inline: var(--bb-gutter); }
.bb-main { padding-block: clamp(16px, 2.5vw, 28px) var(--bb-section); min-height: 50vh; }
[hidden] { display: none !important; }


/* ---------- Buttons ---------- */
.bb-btn, .button, button.button, a.button, input.button, .wp-element-button {
	box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: var(--bb-touch); padding: 0 20px;
	border: 1.5px solid transparent; border-radius: var(--bb-r-control);
	font: 700 .9375rem/1.2 var(--bb-font-body); text-decoration: none; text-align: center;
	cursor: pointer; transition: background-color .15s var(--bb-ease), border-color .15s var(--bb-ease), transform .15s var(--bb-ease);
	background: var(--bb-yellow); color: var(--bb-ink);
}
.bb-btn:hover, .button:hover { background: #f2c400; color: var(--bb-ink); }
.bb-btn:active, .button:active { transform: translateY(1px); }
.bb-btn--primary { background: var(--bb-yellow); color: var(--bb-ink); }
.bb-btn--dark { background: var(--bb-ink); color: #fff; }
.bb-btn--dark:hover { background: #000; color: #fff; }
/* G13: proto border is the --bb-track tone (not --bb-border-2) at a 48px target. */
.bb-btn--secondary { background: var(--bb-surface); color: var(--bb-ink); border-color: var(--bb-track); font-weight: 600; min-height: 48px; }
.bb-btn--secondary:hover { background: var(--bb-surface); border-color: var(--bb-ink); }
/* A3: a ghost (outline) button for secondary actions sat on a dark panel (e.g. "Shop weekly deals" beside the yellow "Use at basket" on the black rewards-balance card), where the solid-white secondary look doesn't belong. */
.bb-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); font-weight: 600; }
.bb-btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.bb-btn--block { width: 100%; }
.bb-btn--sm { min-height: 40px; padding: 0 16px; font-size: .875rem; }
.bb-btn[disabled], .button.disabled, .button:disabled { opacity: .5; cursor: not-allowed; }
.bb-btn.loading, .button.loading { opacity: .7; pointer-events: none; }
.bb-btn.added::after, .button.added::after { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.added_to_cart { display: inline-block; margin-top: 6px; font-size: .8125rem; font-weight: 700; }
.bb-link { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.bb-link:hover { text-decoration: underline; }
.bb-iconbtn { display: inline-grid; place-items: center; width: var(--bb-touch); height: var(--bb-touch); padding: 0; border: 0; border-radius: var(--bb-r-control); background: transparent; color: var(--bb-ink); cursor: pointer; text-decoration: none; }
.bb-iconbtn:hover { background: var(--bb-ground); }

/* ---------- Fields ---------- */
.bb-field { margin: 0 0 16px; }
.bb-label, .woocommerce form .form-row label { display: block; margin: 0 0 6px; font-size: .875rem; font-weight: 600; color: var(--bb-ink); }
.bb-help { margin: 6px 0 0; font-size: .8125rem; color: var(--bb-muted); }
.bb-error { margin: 8px 0 0; font-size: .8125rem; font-weight: 600; color: var(--bb-error); }
.bb-input, .input-text, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
	width: 100%; min-height: 48px; padding: 10px 14px;
	border: 1.5px solid #d6d5cf; border-radius: var(--bb-r-control);
	background: var(--bb-surface); color: var(--bb-ink); font-size: 1rem; line-height: 1.4;
	transition: border-color .15s var(--bb-ease), box-shadow .15s var(--bb-ease);
}
textarea { min-height: 120px; }
.bb-input:hover, .input-text:hover, select:hover, textarea:hover { border-color: #b4b3ad; }
.bb-input:focus, .input-text:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bb-ink); box-shadow: 0 0 0 3px rgba(255, 207, 2, .55); }
::placeholder { color: #807f78; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--bb-ink); }

/* ---------- Radio cards ---------- */
.bb-radiocards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; border: 0; }
.bb-radiocard { position: relative; display: flex; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--bb-border); border-radius: var(--bb-r-tile); background: var(--bb-surface); cursor: pointer; }
.bb-radiocard:has(input:checked) { background: var(--bb-selected); border-color: var(--bb-ink); box-shadow: 0 0 0 1px var(--bb-ink); }
.bb-radiocard:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.bb-radiocard input { margin-top: 2px; flex: none; }
.bb-radiocard__body { display: grid; gap: 4px; }
.bb-radiocard__title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--bb-ink); }
.bb-radiocard__text { font-size: .8125rem; color: var(--bb-body); }

/* ---------- Panels, badges, chips ---------- */
.bb-panel { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-r-panel); padding: clamp(18px, 2.4vw, 28px); }
/* G1: panel H2s are 22-28px/800 in the prototypes (Order summary, How would
   you like it?, Quick answers, Recent orders, Addresses...), not the global
   h2 clamp (which tops out at 34px and reads shouty inside a card). */
.bb-panel h2 { font-size: clamp(1.375rem, 1.2rem + .5vw, 1.75rem); }
.bb-panel--dark { background: var(--bb-ink); color: #fff; border-color: var(--bb-ink); }
.bb-panel--dark h2, .bb-panel--dark h3 { color: var(--bb-yellow); }
.bb-panel--yellow { background: var(--bb-yellow); border-color: var(--bb-yellow); }
.bb-info { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--bb-r-tile); background: var(--bb-pale-yellow); font-size: .875rem; }
.bb-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: var(--bb-r-badge); font-size: .75rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.bb-badge--off { background: var(--bb-ink); color: var(--bb-yellow); }
.bb-badge--bb { background: var(--bb-surface); color: var(--bb-ink-2); font-size: .6875rem; font-weight: 600; border: 1px solid var(--bb-border); }
.bb-chip-save { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: var(--bb-r-badge); background: var(--bb-soft-yellow); color: var(--bb-ink); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.bb-urgency { color: var(--bb-urgency); font-size: .75rem; font-weight: 600; }
.bb-chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--bb-touch); padding: 0 16px; border: 1px solid var(--bb-border); border-radius: var(--bb-r-pill); background: var(--bb-surface); color: var(--bb-ink-2); font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.bb-chip:hover { border-color: var(--bb-ink); }
.bb-chip[aria-current], .bb-chip.is-active { background: var(--bb-ink); border-color: var(--bb-ink); color: #fff; }
.bb-meta { font-size: .875rem; color: var(--bb-muted); }

/* ---------- Notice bar (theme setting + WooCommerce store notice) ---------- */
.woocommerce-store-notice, p.demo_store { position: relative; margin: 0; padding: 8px 48px 8px 16px; background: var(--bb-ink); color: #fff; font-size: .8125rem; font-weight: 600; text-align: center; }
.woocommerce-store-notice a, p.demo_store a { color: var(--bb-yellow); }
.bb-notice-bar { background: var(--bb-ink); color: #fff; font-size: .8125rem; font-weight: 600; text-align: center; padding: 8px 0; }

/* ---------- Header ---------- */
.bb-header { position: relative; z-index: 50; background: var(--bb-surface); border-bottom: 1px solid var(--bb-border); }
.bb-header__bar { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 20px); padding-block: 14px; }
.bb-header__menu, .bb-header__account { display: none; }
.bb-logo { display: inline-flex; align-items: center; flex: none; text-decoration: none; }
.bb-logo__img { height: 48px; width: auto; }
.bb-logo__text { font: 800 1.375rem/1 var(--bb-font-display); color: var(--bb-ink); }

/* ---------- K1: minimal checkout header ---------- */
.bb-header--minimal .bb-header__bar--minimal { justify-content: space-between; gap: clamp(12px, 3vw, 32px); }
.bb-header__secure { display: inline-flex; align-items: center; gap: 6px; color: var(--bb-success); font-weight: 700; font-size: .9375rem; }
.bb-header__minimalnav { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); }
.bb-header__minimalnav .bb-link { font-weight: 600; }
@media (max-width: 560px) {
	.bb-header__securetext { display: none; }
}

/* ---------- P-M1: product mobile header (back arrow, compact search, no fulfil row) ---------- */
.bb-header__back { display: none; }

/* G5: the pill was one line of nowrap/ellipsis text, so anything longer than
   "Choose" (a branch name + lead time, once chosen) truncated. A little more
   width plus a 2-line clamp lets real values wrap instead of clipping,
   without the header growing past a couple of extra pixels of row height. */
.bb-fulfil { display: flex; align-items: center; gap: 10px; flex: none; max-width: 300px; min-height: var(--bb-touch); padding: 8px 14px; border: 1px solid var(--bb-border-2); border-radius: var(--bb-r-control); background: var(--bb-ground); color: var(--bb-ink-2); text-align: left; cursor: pointer; font-size: .8125rem; }
.bb-fulfil:hover { border-color: var(--bb-ink); }
.bb-fulfil__icon { flex: none; display: grid; }
.bb-fulfil__text { display: grid; min-width: 0; }
.bb-fulfil__label { color: var(--bb-muted); line-height: 1.2; }
.bb-fulfil__value { font-size: .875rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; white-space: normal; }

.bb-search { position: relative; display: flex; align-items: center; gap: 10px; flex: 1 1 360px; min-width: 0; padding-left: 16px; border: 1px solid var(--bb-border-2); border-radius: 14px; background: var(--bb-ground); color: var(--bb-muted); }
.bb-search:focus-within { border-color: var(--bb-ink); box-shadow: 0 0 0 3px rgba(255, 207, 2, .55); }
.bb-search .bb-icon { flex: none; }
.bb-search__input { flex: 1; min-width: 0; min-height: 48px; padding: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: .9375rem; }
/* QA A11Y-02: the wrapper shows the focus ring; keep a fallback for browsers without :focus-within styling. */
.bb-search__input:focus-visible { outline: 2px solid transparent; }
.bb-search__btn { flex: none; margin: 4px; min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--bb-r-small); background: var(--bb-ink); color: #fff; font-weight: 700; font-size: .875rem; cursor: pointer; }
.bb-search__btn:hover { background: #000; }

.bb-points { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; font-size: .75rem; font-weight: 600; text-decoration: none; color: var(--bb-ink-2); }
.bb-points__pill { padding: 3px 10px; border-radius: var(--bb-r-pill); background: var(--bb-ink); color: var(--bb-yellow); font-size: .8125rem; font-weight: 700; }
/* ---------- Points polish pass (Gary #4, 16 Nov 2026): the "R146 to spend"
   sub-line under the pill had no rule of its own, so it fell back to the
   pill's bold black-on-nothing text - too heavy for a secondary line. ---------- */
.bb-points__rand { color: var(--bb-muted); font-weight: 500; font-size: .6875rem; }

.bb-basket { position: relative; display: flex; align-items: center; gap: 10px; flex: none; min-height: var(--bb-touch); padding: 8px 16px; border-radius: var(--bb-r-control); background: var(--bb-yellow); color: var(--bb-ink); font-weight: 700; text-decoration: none; }
.bb-basket:hover { background: #f2c400; color: var(--bb-ink); }
.bb-basket__text { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.bb-basket__saving { font-size: .8125rem; font-weight: 500; }
.bb-basket__count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--bb-r-pill); background: var(--bb-ink); color: var(--bb-yellow); font-size: .6875rem; font-weight: 800; line-height: 20px; text-align: center; }
/* G4: the prototype's desktop basket button has no count badge (the running
   total already says how many are in it); keep the badge for the mobile
   icon-only button, where there is no room for the total text at all. */
@media (min-width: 768px) {
	.bb-basket__count { display: none; }
}

.bb-chipbar { padding-bottom: 12px; }
/* Item 4: "All categories" sits outside the scrollable chip list so it never
   scrolls out of view - the list of real category chips fills the rest of
   the row and keeps its own scroll/fade behaviour. */
.bb-chipbar__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bb-chipbar__all { flex: none; font-weight: 700; }
.bb-chipbar__list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; min-width: 0; }
/* G6: fade the right edge so it is clear the chips scroll. */
.bb-chipbar__list { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); padding-right: 40px; }
.bb-chipbar__list::-webkit-scrollbar { display: none; }
.bb-chipbar__list > li { flex: none; }
/* G7: 13px/600 pills per the spec (was ~15px, so fewer chips fit per row). */
.bb-chipbar__list a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--bb-touch); padding: 0 16px; border: 1px solid var(--bb-border); border-radius: var(--bb-r-pill); background: var(--bb-surface); color: var(--bb-ink-2); font-size: .8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.bb-chipbar__list a:hover { border-color: var(--bb-ink); }
/* (dot now only on the Weekly deals chip - see "pulsing yellow dot" block) */
.bb-chipbar__list .current-menu-item > a, .bb-chipbar__list .current-menu-ancestor > a, .bb-chipbar__list .current-product_cat-ancestor > a { background: var(--bb-ink); border-color: var(--bb-ink); color: #fff; }

/* ---------- Breadcrumbs, page head ---------- */
.bb-crumbs { margin: 0 0 16px; font-size: .875rem; color: var(--bb-muted); }
.bb-crumbs__list { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-crumbs__list > li { display: contents; }
.bb-crumbs a, .breadcrumb-trail a, .woo-breadcrumbs a { color: #333; text-decoration: underline; text-decoration-color: var(--bb-border-2); text-underline-offset: 3px; }
.breadcrumb.woo-breadcrumbs, .breadcrumb-trail { margin: 0 0 16px; font-size: .875rem; color: var(--bb-muted); }
.breadcrumb_last { color: var(--bb-ink); font-weight: 600; }
.bb-crumbs a:hover { text-decoration: underline; }
.bb-crumbs__sep { color: var(--bb-muted); }
.bb-pagehead { margin: 0 0 20px; }
.bb-pagehead__title { margin: 0; }

/* G14: "Show all brands" (archive.css's own .bb-archive__showmore, owned by
   another area) was 17px tall - override with higher specificity here
   rather than edit that file, to keep the touch-target rule without
   crossing the file-ownership split. */
body .bb-archive__showmore { display: inline-flex; align-items: center; min-height: var(--bb-touch); padding: 0 4px; }

/* ---------- Product grid + card ---------- */
.bb-grid, ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.bb-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bb-grid__item, ul.products > li { margin: 0; padding: 0; width: auto !important; float: none !important; }
.bb-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-r-card); transition: box-shadow .2s var(--bb-ease), border-color .2s var(--bb-ease); }
.bb-card:hover { box-shadow: var(--bb-shadow); border-color: var(--bb-border-2); }
.bb-card__media { position: relative; display: block; height: 200px; padding: 12px; background: var(--bb-surface); }
.bb-card__badges { position: absolute; inset: 10px 10px auto 10px; z-index: 1; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.bb-card__img { display: block; height: 100%; }
.bb-card__img img { width: 100%; height: 100%; object-fit: contain; }
/* No-photo tile: same square framing as real product photos everywhere (cards, rails, basket). */
img.bb-noimg { object-fit: contain !important; border-radius: 8px; }
.bb-card__body { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 4px 14px 14px; }
.bb-card__brand { min-height: 16px; color: var(--bb-muted); font-size: .75rem; font-weight: 600; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-card__name { margin: 0; font: 600 .875rem/1.35 var(--bb-font-body); color: var(--bb-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.bb-card__name a { color: inherit; text-decoration: none; }
.bb-card__name a:hover { text-decoration: underline; }
.bb-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-height: 28px; margin-top: 2px; }
.bb-price { font-family: var(--bb-font-body); font-size: 1.375rem; font-weight: 800; color: var(--bb-ink); line-height: 1.2; }
.bb-price del { font-size: .75rem; font-weight: 400; color: var(--bb-muted); }
.bb-price ins { text-decoration: none; }
.bb-was { font-size: .75rem; color: var(--bb-muted); text-decoration: line-through; }
.bb-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.bb-card__action { margin-top: auto; padding-top: 8px; }
.bb-card__action .bb-btn { min-height: var(--bb-touch); border-radius: var(--bb-r-small); font-size: .875rem; }
.bb-card--compact .bb-card__media { height: 140px; padding: 8px; }
.bb-card--compact .bb-card__body { padding: 2px 10px 10px; }
.bb-card--compact .bb-card__name { font-size: .8125rem; }
.bb-card--compact .bb-price { font-size: 1.1875rem; }

/* ---------- WooCommerce notices ---------- */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-message, .woocommerce-info, .woocommerce-error, .wc-block-components-notice-banner {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 14px 16px; list-style: none;
	border: 1px solid var(--bb-border); border-radius: var(--bb-r-tile); background: var(--bb-surface); font-size: .9375rem;
}
.woocommerce-message { border-color: var(--bb-success); background: var(--bb-success-bg); color: var(--bb-success); }
.woocommerce-error { border-color: var(--bb-error); background: #fdf1f0; color: var(--bb-error); }
.woocommerce-error li { list-style: none; }
.woocommerce-message .button, .woocommerce-info .button { order: 2; margin-left: auto; min-height: 40px; }

/* ---------- Dialogs (fulfilment, drawer) ---------- */
.bb-dialog { width: min(520px, calc(100vw - 32px)); max-height: min(86vh, 720px); padding: 0; border: 0; border-radius: var(--bb-r-panel); background: var(--bb-surface); color: var(--bb-ink-2); box-shadow: 0 24px 64px -12px rgba(17, 17, 17, .35); }
.bb-dialog[open] { display: flex; animation: bbDialogIn .25s var(--bb-ease); }
.bb-dialog::backdrop { background: rgba(17, 17, 17, .5); }
@keyframes bbDialogIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bb-dialog__inner { display: flex; flex-direction: column; width: 100%; max-height: inherit; }
.bb-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--bb-border); }
.bb-dialog__title { margin: 0; font-size: 1.25rem; }
.bb-dialog__body { padding: 18px 22px; overflow-y: auto; overscroll-behavior: contain; }
.bb-dialog__foot { padding: 14px 22px 20px; border-top: 1px solid var(--bb-border); }
/* "All categories" drawer (.bb-drawer / .bb-catdrawer*): assets/css/catdrawer.css. */

/* ---------- Fulfilment dialog: mode cards + branch list ---------- */
.bb-fulfil-dialog { width: min(640px, calc(100vw - 32px)); }
.bb-fmode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; padding: 0; border: 0; }
.bb-fmode__opt { position: relative; display: block; cursor: pointer; }
.bb-fmode__input, .bb-branch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bb-fmode__card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; align-items: center; gap: 12px; min-height: 76px; padding: 14px 16px; border: 1.5px solid var(--bb-border); border-radius: var(--bb-r-tile); background: var(--bb-surface); transition: border-color .15s var(--bb-ease), background-color .15s var(--bb-ease); }
.bb-fmode__opt:hover .bb-fmode__card { border-color: #bdbcb6; }
.bb-fmode__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--bb-r-control); background: var(--bb-ground); color: var(--bb-ink); }
.bb-fmode__text { display: grid; gap: 2px; min-width: 0; }
.bb-fmode__title { font-size: .9375rem; color: var(--bb-ink); line-height: 1.25; }
.bb-fmode__meta { font-size: .8125rem; color: var(--bb-muted); line-height: 1.35; }
.bb-fmode__tick { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #c9c8c3; border-radius: 50%; color: transparent; }
.bb-fmode__input:checked + .bb-fmode__card { border-color: var(--bb-ink); background: var(--bb-selected); box-shadow: 0 0 0 1px var(--bb-ink); }
.bb-fmode__input:checked + .bb-fmode__card .bb-fmode__icon { background: var(--bb-yellow); }
.bb-fmode__input:checked + .bb-fmode__card .bb-fmode__tick { border-color: var(--bb-ink); background: var(--bb-ink); color: #fff; }
.bb-fmode__input:focus-visible + .bb-fmode__card, .bb-branch__input:focus-visible + .bb-branch__card { outline: 3px solid var(--bb-ink); outline-offset: 2px; }
.bb-fmode__input:disabled + .bb-fmode__card { opacity: .5; cursor: not-allowed; }

.bb-fpanel { padding-top: 4px; }
.bb-fpanel__postcode { max-width: 220px; font-size: 1.125rem; letter-spacing: .08em; }
.bb-fpanel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bb-fpanel__head .bb-label { margin: 0; }
.bb-fpanel__find { max-width: 240px; min-height: 40px; padding: 8px 12px; font-size: .9375rem; }
/* Scroller wraps the grid so the grid's height is content-sized and 1fr rows all match the tallest card. */
.bb-branchlist { max-height: min(46vh, 380px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.bb-branch { position: relative; display: flex; cursor: pointer; }
.bb-branch[hidden] { display: none; }
.bb-branch__card { flex: 1; display: grid; align-content: start; gap: 2px; min-height: 56px; padding: 12px 14px; border: 1.5px solid var(--bb-border); border-radius: var(--bb-r-control); background: var(--bb-surface); }
.bb-branch:hover .bb-branch__card { border-color: #bdbcb6; }
.bb-branch__name { font-weight: 700; color: var(--bb-ink); }
.bb-branch__line { font-size: .8125rem; color: var(--bb-ink-2); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bb-branch__line--muted { display: flex; align-items: center; gap: 4px; color: var(--bb-muted); }
.bb-branch__input:checked + .bb-branch__card { border-color: var(--bb-ink); background: var(--bb-selected); box-shadow: 0 0 0 1px var(--bb-ink); }
.bb-branchlist__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
@media (max-width: 560px) {
	.bb-fmode, .bb-branchlist__grid { grid-template-columns: 1fr; }
	.bb-fpanel__find { max-width: none; width: 100%; }
	.bb-branchlist { max-height: 40vh; }
}

/* ---------- Footer ---------- */
.bb-footer { margin-top: var(--bb-section); background: var(--bb-ink); color: #fff; font-size: .875rem; }
.bb-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; padding-block: 40px 28px; }
.bb-footer__col { border: 0; } /* <details> reset: desktop shows every column open and non-interactive */
.bb-footer__title { display: block; margin: 0 0 12px; font-size: .9375rem; color: var(--bb-yellow); cursor: default; list-style: none; }
.bb-footer__title::-webkit-details-marker { display: none; }
.bb-footer__title::marker { content: ""; }
.bb-footer__list { display: grid; gap: 10px; }
.bb-footer a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 3px; }
.bb-footer a:hover { text-decoration-color: #fff; color: #fff; }
.bb-footer__about { color: #ddd; }
.bb-footer__about-body p { margin: 0 0 10px; }
.bb-footer__contact { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.bb-footer__contact li { display: grid; grid-template-columns: 20px 1fr; column-gap: 10px; align-items: start; }
.bb-footer__contact a { display: contents; color: #fff; text-decoration: none; }
.bb-footer__contact a:hover span:last-child { text-decoration: underline; }
.bb-footer__contact .bb-icon { grid-column: 1; margin-top: 3px; color: var(--bb-yellow); }
.bb-footer__contact li > span:last-child, .bb-footer__contact a > span:last-child { grid-column: 2; line-height: 1.45; }
.bb-footer__address { color: #ddd; }
.bb-footer__trust { color: #bbb; font-size: .8125rem; }
.bb-footer__social { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.bb-footer__social a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .08); text-decoration: none; }
.bb-footer__social a:hover { background: rgba(255, 255, 255, .18); }

.bb-footer__payments { padding-block: 18px; border-top: 1px solid #2c2c2c; }

.bb-footer__hours { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 14px; border-top: 1px solid #2c2c2c; color: #bbb; font-size: .8125rem; }
.bb-footer__hourstext, .bb-footer__weekly { display: flex; align-items: center; gap: 8px; margin: 0; }
.bb-footer__hours .bb-icon { flex: none; }
.bb-footer__weekly strong { color: #fff; }
.bb-footer__weekly .bb-btn { min-height: 32px; padding: 0 14px; font-size: .8125rem; }

.bb-footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; border-top: 1px solid #2c2c2c; color: #bbb; }
.bb-footer__legal-list { display: flex; flex-wrap: wrap; gap: 16px; }
.bb-footer__legal-list a { text-decoration-color: rgba(255, 255, 255, .3); }
.bb-footer__copy { margin: 0; }

@media (max-width: 767px) {
	.bb-footer__grid { grid-template-columns: 1fr; gap: 0; }
	.bb-footer__col:not(.bb-footer__about):not(.bb-footer__newsletter) { border-bottom: 1px solid #2c2c2c; padding-block: 14px; }
	.bb-footer__col:not(.bb-footer__about):not(.bb-footer__newsletter) .bb-footer__title { cursor: pointer; padding-right: 24px; position: relative; }
	.bb-footer__col:not(.bb-footer__about):not(.bb-footer__newsletter) .bb-footer__title::after { content: "+"; position: absolute; right: 2px; top: -2px; font-size: 1.25rem; color: #bbb; }
	.bb-footer__col:not(.bb-footer__about):not(.bb-footer__newsletter)[open] .bb-footer__title::after { content: "\2212"; }
	.bb-footer__about { padding-top: 14px; }
	.bb-footer__payments { justify-content: center; text-align: center; }
	.bb-footer__hours { flex-direction: column; align-items: flex-start; }
	.bb-footer__weekly { flex-wrap: wrap; }
	.bb-footer__legal { flex-direction: column; align-items: flex-start; }
}

/* ---------- Mobile sticky basket + tabs ---------- */
.bb-tabs, .bb-stickybasket { display: none; }

/* ---------- Empty states, content ---------- */
.bb-empty { max-width: 640px; margin: 24px auto; text-align: center; }
.bb-empty__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.bb-search--page { margin: 16px 0; background: var(--bb-surface); }
.bb-content__body { max-width: 760px; font-size: 1.0625rem; color: #333; }
.bb-content__body > * + * { margin-top: 1em; }
.bb-postlist { display: grid; gap: 16px; }
.bb-postlist__title { font-size: 1.25rem; margin: 0 0 4px; }

/* ================= Responsive ================= */
@media (max-width: 1180px) {
	.bb-grid--5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.bb-points { display: none; }
	.bb-basket__saving { display: none !important; }
}
@media (max-width: 1024px) {
	.bb-grid, ul.products, .bb-grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.bb-fulfil { max-width: 220px; }
	.bb-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	:root { --bb-gutter: 16px; }
	body { padding-bottom: calc(var(--bb-tabs-h) + env(safe-area-inset-bottom)); }
	.bb-header__bar { flex-wrap: wrap; row-gap: 10px; padding-block: 8px 12px; }
	.bb-header__menu, .bb-header__account { display: inline-grid; }
	.bb-header__logo { order: 1; margin: 0 auto; }
	.bb-header__menu { order: 0; }
	.bb-header__account { order: 2; }
	.bb-basket { order: 3; padding: 0; width: var(--bb-touch); justify-content: center; background: transparent; }
	.bb-basket__text { display: none; }
	.bb-basket__count { top: 2px; right: 0; }
	.bb-logo__img { height: 36px; }
	.bb-search { order: 4; flex: 1 1 100%; }
	.bb-search__btn { display: none; }
	/* G17: one line with the pin visible, chevron right after the text (not
	   pushed to the far edge by the button's full-width flex row). */
	.bb-fulfil { order: 5; flex: 1 1 100%; max-width: none; min-height: var(--bb-touch); padding: 6px 0; border: 0; background: transparent; line-height: 1.35; justify-content: flex-start; }
	.bb-fulfil__label, .bb-fulfil__value { line-height: 1.35; }
	.bb-fulfil__icon { display: grid; width: 16px; }
	.bb-fulfil__icon .bb-icon { width: 16px; height: 16px; }
	.bb-fulfil__text { display: flex; flex: 0 1 auto; flex-wrap: nowrap; align-items: baseline; gap: 4px; min-width: 0; overflow: hidden; }
	.bb-fulfil__label::after { content: "\00b7"; margin-left: 4px; color: var(--bb-muted); }
	.bb-fulfil__value { -webkit-line-clamp: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* QA SH-08 superseded: one line, ellipsis only if truly too long */
	.bb-chipbar { display: none; }

	/* P-M1: product pages start higher - the fulfilment pill isn't shown, the
	   back arrow replaces the hamburger, and the search field is compact. */
	.bb-header--product .bb-fulfil { display: none; }
	.bb-header--product .bb-search { order: 4; }
	.bb-header__back { display: inline-grid; }

	/* G21: when the floating sticky basket bar is also showing (cart has
	   items), reserve extra bottom space so page content/footer links don't
	   end up hidden under both fixed bars at once. */
	body.has-sticky-basket { padding-bottom: calc(var(--bb-tabs-h) + 64px + env(safe-area-inset-bottom)); }
	.bb-grid, ul.products, .bb-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.bb-card__media { height: 140px; padding: 8px; }
	.bb-card__body { padding: 2px 10px 10px; }
	.bb-card__brand { display: none; }
	.bb-price { font-size: 1.1875rem; }
	.bb-footer__grid { grid-template-columns: 1fr; gap: 20px; padding-block: 28px 16px; }

	.bb-tabs { position: fixed; inset: auto 0 0 0; z-index: 60; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--bb-tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bb-surface); border-top: 1px solid var(--bb-border); }
	.bb-tabs__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--bb-muted); font-size: .6875rem; font-weight: 600; text-decoration: none; cursor: pointer; }
	.bb-tabs__item[aria-current="page"] { color: var(--bb-ink); }
	.bb-tabs__item[aria-current="page"] .bb-icon { stroke-width: 2.4; }
	.bb-stickybasket { position: fixed; inset: auto 12px calc(var(--bb-tabs-h) + 12px + env(safe-area-inset-bottom)) 12px; z-index: 59; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--bb-r-tile); background: var(--bb-ink); color: #fff; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
	.bb-stickybasket[hidden] { display: none !important; }
	.bb-stickybasket__text { display: grid; font-size: .875rem; }
	.bb-stickybasket__saving { color: var(--bb-yellow); font-size: .75rem; }
	.bb-dialog:not(.bb-drawer) { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--bb-r-panel) var(--bb-r-panel) 0 0; }
}
@media (max-width: 359px) {
	.bb-card__action .bb-btn { font-size: .8125rem; padding: 0 8px; }
	.bb-price { font-size: 1.0625rem; }
}

/* ---------- "We accept" payment badges (inc/payment-methods.php) ---------- */
.bb-paybadges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.bb-paybadges__label { color: var(--bb-muted); font-size: .8125rem; font-weight: 600; }
.bb-paybadges__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bb-paybadge { display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 52px; padding: 0 10px; border: 1px solid var(--bb-border); border-radius: var(--bb-r-small); background: #fff; }
.bb-paybadge img { display: block; max-width: 64px; height: 20px; object-fit: contain; }
.bb-paybadge--text { color: var(--bb-ink); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.bb-paybadges--dark .bb-paybadges__label { color: #bdbdbd; }
.bb-paybadges--dark .bb-paybadge { border-color: transparent; }

/* ---------- Scroll reveal (assets/js/reveal.js adds these classes; no JS = no effect) ---------- */
.bb-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--bb-ease, ease), transform .6s cubic-bezier(.2, .7, .2, 1); will-change: opacity, transform; }
.bb-reveal--card { transform: translateY(14px) scale(.985); }
.bb-reveal.is-in { opacity: 1; transform: none; will-change: auto; }
/* A section whose cards animate individually stays put, so nothing double-fades. */
.bb-reveal--section.bb-reveal--host { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .bb-reveal { opacity: 1; transform: none; transition: none; } }
@media print { .bb-reveal { opacity: 1 !important; transform: none !important; } }
.bb-paybadges__secure { display: flex; flex-basis: 100%; align-items: flex-start; gap: 8px; margin: 2px 0 0; color: var(--bb-muted); font-size: .8125rem; line-height: 1.45; }
.bb-paybadges__secure svg { flex: none; margin-top: 1px; color: var(--bb-success, #1d5b33); }
.bb-paybadges--dark .bb-paybadges__secure { color: #bdbdbd; }
.bb-paybadges--dark .bb-paybadges__secure svg { color: #7ddc9b; }

/* ---------- Weekly deals chip: pulsing yellow dot (Gary) ----------
   Targets the Weekly deals link itself (product_cat special-deals) so it keeps
   working whatever chip comes first (e.g. "All categories"). */
.bb-chipbar__list a[href*="special-deals"] { position: relative; }
.bb-chipbar .bb-chipbar__list > li > a[href*="special-deals"]::before {
	content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
	background: var(--bb-yellow);
	box-shadow: 0 0 0 0 rgba(255, 207, 2, .7);
	animation: bb-dot-pulse 1.6s ease-out infinite;
}
@keyframes bb-dot-pulse {
	0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 172, 0, .85); }
	45% { transform: scale(1.35); }
	70% { box-shadow: 0 0 0 9px rgba(232, 172, 0, 0); }
	100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 172, 0, 0); }
}
/* Reduced motion: no growth or ring, just a gentle glow so the dot still reads as "live". */
@keyframes bb-dot-glow { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .bb-chipbar .bb-chipbar__list > li > a[href*="special-deals"]::before { animation: bb-dot-glow 2.4s ease-in-out infinite; box-shadow: none; } }

/* ---------- Register form opt-in + notes (My Account page AND the login modal) ----------
   Site-wide so the modal's Create account tab matches the account page. */
.bb-authgate__optin { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; margin: 16px 0 !important; font-size: .875rem; line-height: 1.5; }
.bb-authgate__optin input[type="checkbox"] { width: 20px; height: 20px; margin: 0 !important; margin-top: calc((1.5em - 20px) / 2) !important; flex: none; position: static; }
.bb-authgate__optin span { display: block; }
.woocommerce-form-register .woocommerce-privacy-policy-text { margin: 0 !important; }
.woocommerce-form-register .woocommerce-privacy-policy-text p { margin: 0 0 16px !important; font-size: .875rem; line-height: 1.5; }
/* In the login modal the register form is a flex/grid column with its own gap, so the
   opt-in needs no extra outer margin (keeps 16px rhythm, same as the account page). */
#bb-login-modal .bb-authgate__optin { margin: 4px 0 !important; }
#bb-login-modal .woocommerce-form-register .woocommerce-privacy-policy-text p { margin: 12px 0 0 !important; }

/* reCAPTCHA v3 badge: hidden (it sat under the chat launcher, bottom-right); the
   required attribution text is shown under the forms instead (.bb-recaptcha-note). */
.grecaptcha-badge { visibility: hidden !important; position: fixed !important; bottom: 0 !important; right: 0 !important; width: 0 !important; height: 0 !important; overflow: hidden !important; }
.bb-recaptcha-note { margin: 12px 0 0; color: var(--bb-muted); font-size: .75rem; line-height: 1.5; }
.bb-recaptcha-note a { color: inherit; text-decoration: underline; }
