/* ==========================================================
   TOKENS — blue palette pulled from the BextBuyz logo
   ========================================================== */
:root {
	--bg: #FBFAFD;
	--panel: #FFFFFF;
	--line: #E7E4F0;
	--line-soft: #EFEDF6;
	--ink: #0B1330;
	--ink-soft: #6C6F86;

	--brand: #2F5FFF;
	--brand-dark: #14226B;
	--spark: #FFB627;
	--spark-ink: #5A3A00;
	--boost: #5BA7FF;
	--trust: #0F9B8E;

	/* Exception, by design: "Post a Listing" / "Publish Listing" stay
	   pink even though the rest of the site is blue — a deliberate
	   call-to-action color that cuts through the new palette. */
	--accent-post: #E31C79;
	--accent-post-dark: #B71361;

	--grad: linear-gradient(135deg, #DCE8FF 0%, #FFE3B0 55%, #DCE8FF 100%);

	/* Semantic tints — flat, theme-aware backgrounds for badges,
	   banners and status pills (unread dot, pending/rejected status,
	   success/error messages). Kept as separate tokens from the base
	   palette so dark mode can swap them for translucent versions
	   instead of hand-picked dark hexes everywhere they're used. */
	--brand-tint: #F3F6FF;
	--boost-tint: #EDE9FE;
	--success-bg: #E6F5F2;
	--warn-bg: #FFF6E5;
	--warn-border: #F3DCA5;
	--error-bg: #FDECEF;
	--error-border: #F5C2CF;

	--font-head: 'Bricolage Grotesque', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-body: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	--container: 1180px;
	--radius: 8px;
}

/* ==========================================================
   DARK MODE — same token names, dark values. Two ways in:
   1. Visitor's OS/browser prefers dark AND they haven't explicitly
      chosen Light here (the :not([data-theme="light"]) guard).
   2. Visitor explicitly chose Dark via the header toggle or
      Settings → Appearance, regardless of their OS preference
      (the [data-theme="dark"] rule below, which wins on specificity
      either way since it doesn't sit inside the media query).
   "System" (the default) means no data-theme attribute at all, so
   rule 1 alone decides it. See theme.js for the toggle logic and
   the no-flash inline script in header.php that applies a saved
   choice before first paint. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0B1020;
		--panel: #121831;
		--line: #262E4D;
		--line-soft: #1C2340;
		--ink: #EDEFF8;
		--ink-soft: #9BA0C2;

		--brand: #5B82FF;
		--brand-dark: #8CA6FF;
		--spark: #FFC557;
		--spark-ink: #FFD98C;
		--boost: #7FBBFF;
		--trust: #35C7B6;

		--accent-post: #FF4D94;
		--accent-post-dark: #FF7AAE;

		--grad: linear-gradient(135deg, #1B2B52 0%, #4A3A1E 55%, #1B2B52 100%);

		--brand-tint: rgba(91,130,255,0.16);
		--boost-tint: rgba(127,187,255,0.16);
		--success-bg: rgba(53,199,182,0.16);
		--warn-bg: rgba(255,197,87,0.16);
		--warn-border: rgba(255,197,87,0.35);
		--error-bg: rgba(255,77,148,0.16);
		--error-border: rgba(255,77,148,0.35);
	}
}
:root[data-theme="dark"] {
	--bg: #0B1020;
	--panel: #121831;
	--line: #262E4D;
	--line-soft: #1C2340;
	--ink: #EDEFF8;
	--ink-soft: #9BA0C2;

	--brand: #5B82FF;
	--brand-dark: #8CA6FF;
	--spark: #FFC557;
	--spark-ink: #FFD98C;
	--boost: #7FBBFF;
	--trust: #35C7B6;

	--accent-post: #FF4D94;
	--accent-post-dark: #FF7AAE;

	--grad: linear-gradient(135deg, #1B2B52 0%, #4A3A1E 55%, #1B2B52 100%);

	--brand-tint: rgba(91,130,255,0.16);
	--boost-tint: rgba(127,187,255,0.16);
	--success-bg: rgba(53,199,182,0.16);
	--warn-bg: rgba(255,197,87,0.16);
	--warn-border: rgba(255,197,87,0.35);
	--error-bg: rgba(255,77,148,0.16);
	--error-border: rgba(255,77,148,0.35);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 15.5px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	transition: background-color .2s ease, color .2s ease;
}

/* Smooth, not jarring, when the toggle flips — scoped to the
   surfaces that actually carry a theme color. */
.bb-topbar, .bb-card, .bb-form-card, .bb-side-panel, .bb-footer,
.bb-user-dropdown, .bb-notif-dropdown, .bb-location-dropdown,
.bb-cat-picker-panel, .bb-cat-header-row {
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0 0 0.4em; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
p { margin: 0 0 1em; max-width: 62ch; }

.bb-container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ==========================================================
   TOPBAR
   ========================================================== */
.bb-topbar {
	background: var(--panel); color: var(--ink); position: sticky; top: 0; z-index: 100;
	border-bottom: 1px solid var(--line);
	box-shadow: 0 2px 10px rgba(11,19,48,0.05);
}
.bb-topbar-inner {
	display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
	padding: 12px 0;
}
.bb-logo { flex: none; display: flex; align-items: center; }
.bb-logo-img { height: 34px; width: auto; display: block; }

.bb-search-bar {
	flex: 1; min-width: 200px;
	display: flex; align-items: center; gap: 8px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 9px 16px;
}
.bb-search-bar input {
	background: none; border: none; outline: none; color: var(--ink);
	font-size: 13.5px; width: 100%;
}
.bb-search-bar input::placeholder { color: var(--ink-soft); }

/* ==========================================================
   PAYOUT EARNINGS BAR (Dashboard → Payout tab)
   ========================================================== */
.bb-payout-earnings {
	display: flex; flex-direction: column; gap: 4px;
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 24px 28px; background: linear-gradient(135deg, var(--brand-tint) 0%, var(--warn-bg) 100%);
}
.bb-payout-earnings-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.bb-payout-earnings-amount { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; color: var(--ink); }
.bb-payout-earnings-sub { font-size: 12.5px; color: var(--ink-soft); }

/* ==========================================================
   HOMEPAGE TILE SECTIONS (bbp-01)
   ========================================================== */
.bb-tile-grid { display: grid; gap: 18px; }
.bb-tile-grid-3 { grid-template-columns: repeat(3, 1fr); }
.bb-tile-grid-4 { grid-template-columns: repeat(4, 1fr); }

.bb-tile { display: flex; flex-direction: column; gap: 10px; }
.bb-tile-image {
	display: block; aspect-ratio: 1 / 1; border-radius: var(--radius);
	overflow: hidden; background: var(--grad);
}
.bb-tile-image img { width: 100%; height: 100%; object-fit: cover; }
.bb-tile-placeholder {
	width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
	color: var(--brand-dark);
}
.bb-tile-label { font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: center; }

@media (max-width: 860px) {
	.bb-tile-grid-4 { grid-template-columns: repeat(2, 1fr); }
	.bb-tile-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
	.bb-tile-label { font-size: 12px; }
}

/* ==========================================================
   ICON BUTTONS (hamburger, location, notifications) — light
   topbar now, so location and notifications get their own real
   color instead of plain neutral/white icons.
   ========================================================== */
.bb-icon-btn {
	display: flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; flex: none;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 50%;
	color: var(--ink); cursor: pointer;
}
.bb-icon-btn:hover { background: var(--line-soft); }

#bb-location-btn {
	background: rgba(47,95,255,0.08); border-color: rgba(47,95,255,0.18); color: var(--brand);
}
#bb-location-btn:hover { background: rgba(47,95,255,0.16); }

#bb-notif-btn {
	background: rgba(15,155,142,0.08); border-color: rgba(15,155,142,0.18); color: var(--trust);
}
#bb-notif-btn:hover { background: rgba(15,155,142,0.16); }

/* Theme toggle — shows whichever icon matches the *currently active*
   appearance (sun while light, moon while dark), for both the
   System-driven default and an explicit override. */
#bb-theme-toggle-btn svg { position: absolute; }
.bb-theme-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) #bb-theme-toggle-btn .bb-theme-icon-sun { display: none; }
	:root:not([data-theme="light"]) #bb-theme-toggle-btn .bb-theme-icon-moon { display: block; }
}
:root[data-theme="dark"] #bb-theme-toggle-btn .bb-theme-icon-sun { display: none; }
:root[data-theme="dark"] #bb-theme-toggle-btn .bb-theme-icon-moon { display: block; }

.bb-location-menu { position: relative; }
.bb-location-dropdown {
	position: absolute; top: calc(100% + 10px); left: 0;
	background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
	min-width: 190px; box-shadow: 0 10px 30px rgba(0,0,0,0.14);
	overflow: hidden; z-index: 200; display: none;
}
.bb-location-dropdown.open { display: block; }
.bb-location-dropdown a { display: block; padding: 10px 16px; font-size: 13.5px; color: var(--ink); }
.bb-location-dropdown a:hover { background: var(--bg); }
.bb-location-dropdown a.active { color: var(--brand); font-weight: 700; }

.bb-topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ==========================================================
   NOTIFICATIONS BELL
   ========================================================== */
.bb-notif-menu { position: relative; }
.bb-notif-dot {
	position: absolute; top: -3px; right: -3px;
	min-width: 16px; height: 16px; padding: 0 3px;
	background: var(--brand); color: #fff; border-radius: 50%;
	font-size: 9.5px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	border: 2px solid var(--panel);
}
.bb-notif-dropdown {
	position: absolute; top: calc(100% + 10px); right: 0;
	background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
	width: 300px; max-height: 380px; overflow-y: auto;
	box-shadow: 0 10px 30px rgba(0,0,0,0.14); z-index: 200; display: none;
}
.bb-notif-dropdown.open { display: block; }
.bb-notif-item {
	display: flex; flex-direction: column; gap: 2px;
	padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.bb-notif-item:hover { background: var(--bg); }
.bb-notif-item.unread { background: var(--brand-tint); }
.bb-notif-msg { font-size: 13px; color: var(--ink); }
.bb-notif-time { font-size: 11px; color: var(--ink-soft); }
.bb-notif-empty { padding: 20px 16px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.bb-notif-viewall { display: block; padding: 11px 16px; font-size: 12.5px; font-weight: 700; color: var(--brand); text-align: center; }

.bb-notif-list { display: flex; flex-direction: column; }
.bb-notif-row {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	padding: 14px 4px; border-bottom: 1px solid var(--line-soft);
}
.bb-notif-row:hover { background: var(--bg); }
.bb-notif-row.unread { background: var(--brand-tint); }
.bb-notif-row .bb-notif-msg { font-size: 13.5px; color: var(--ink); }
.bb-notif-row .bb-notif-time { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }

/* ==========================================================
   SIDE PANEL — shared independent-scroll pattern. The hamburger
   sidebar (left-anchored) and the category Explore panel
   (right-anchored) both extend this base: fixed, full height,
   own flex layout, own scroll region — so on desktop/tablet the
   main page keeps scrolling behind the open panel while the
   panel's own content scrolls independently within it. On mobile
   the page scroll is locked instead (see theme.js) since a
   full-width panel covers the whole viewport there anyway.
   ========================================================== */
/* No visual dimming — the panel slides in over the page without
   masking it. The overlay element is kept (invisible) purely so a
   click outside the open panel still closes it. */
.bb-sidebar-overlay {
	position: fixed; inset: 0; background: transparent;
	visibility: hidden; z-index: 300;
}
.bb-sidebar-overlay.open { visibility: visible; }

.bb-side-panel {
	position: fixed; top: 0; bottom: 0; width: 300px; max-width: 84vw;
	background: var(--panel); z-index: 301;
	display: flex; flex-direction: column;
	transition: transform .25s ease;
}

.bb-sidebar {
	left: 0; transform: translateX(-100%);
	box-shadow: 10px 0 30px rgba(0,0,0,0.12);
}
.bb-sidebar.open { transform: translateX(0); }

.bb-explore-panel {
	right: 0; transform: translateX(100%);
	box-shadow: -10px 0 30px rgba(0,0,0,0.12);
}
.bb-explore-panel.open { transform: translateX(0); }
.bb-sidebar-current { color: var(--brand) !important; font-weight: 700; }

.bb-sidebar-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px; border-bottom: 1px solid var(--line); flex: none;
}
.bb-sidebar-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.bb-sidebar-close {
	background: none; border: none; font-size: 22px; line-height: 1;
	color: var(--ink-soft); cursor: pointer; padding: 4px;
}

.bb-sidebar-nav,
.bb-side-panel-nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.bb-sidebar-all {
	display: block; padding: 11px 14px; font-weight: 700; font-size: 13.5px;
	color: var(--brand); border-bottom: 1px solid var(--line-soft); margin-bottom: 6px;
}

.bb-sidebar-group { border-bottom: 1px solid var(--line-soft); }
.bb-sidebar-group summary {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink);
	cursor: pointer; list-style: none;
}
.bb-sidebar-group summary::-webkit-details-marker { display: none; }
.bb-sidebar-group summary a { color: inherit; flex: 1; }
.bb-sidebar-caret { font-size: 10px; color: var(--ink-soft); transition: transform .15s ease; }
.bb-sidebar-group[open] .bb-sidebar-caret { transform: rotate(180deg); }

.bb-sidebar-children { padding: 0 14px 10px 24px; display: flex; flex-direction: column; gap: 2px; }
.bb-sidebar-children a { padding: 7px 0; font-size: 13px; color: var(--ink-soft); }
.bb-sidebar-children a:hover { color: var(--brand); }

.bb-sidebar-parent-link {
	display: block; padding: 12px 14px; font-size: 13.5px; font-weight: 600;
	color: var(--ink); border-bottom: 1px solid var(--line-soft);
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.bb-btn {
	display: inline-block; font-weight: 700; font-size: 13.5px;
	padding: 10px 18px; border-radius: 20px; border: 1px solid transparent; cursor: pointer;
}
/* "Post a Listing" / "Post" label swap — full text by default, the
   mobile breakpoint below switches which span is shown. */
.bb-btn-text-full { display: inline; }
.bb-btn-text-short { display: none; }
.bb-btn-primary { background: var(--brand); color: #fff; }
.bb-btn-primary:hover { background: var(--brand-dark); }

/* Deliberate exception — stays pink regardless of the blue theme. */
.bb-btn-accent { background: var(--accent-post); color: #fff; }
.bb-btn-accent:hover { background: var(--accent-post-dark); }
.bb-btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.bb-btn-outline:hover { border-color: var(--ink); }
.bb-btn-ghost { background: var(--panel); border-color: var(--line); color: var(--ink); }
.bb-btn-ghost:hover { border-color: var(--ink); }

/* ==========================================================
   CATEGORY CHIP ROW
   ========================================================== */
.bb-cat-row {
	display: flex; gap: 8px; overflow-x: auto;
	padding: 14px 0; border-bottom: 1px solid var(--line-soft);
	background: var(--panel);
}
.bb-chip {
	flex: none; border: 1px solid var(--line); border-radius: 18px;
	padding: 7px 14px; font-size: 12.5px; color: var(--ink-soft); background: var(--panel);
}
.bb-chip:hover { border-color: var(--ink); color: var(--ink); }
.bb-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.bb-chip.active:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* ==========================================================
   SECTIONS
   ========================================================== */
.bb-section { padding: 40px 0; }
.bb-section-head {
	display: flex; align-items: baseline; justify-content: space-between;
	margin-bottom: 16px;
}
.bb-section-head > a:not(.bb-btn) { font-size: 13px; color: var(--brand); font-weight: 600; }

/* ==========================================================
   DEAL STRIP (boosted listings — horizontal scroll)
   ========================================================== */
.bb-deal-strip { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.bb-deal-strip .bb-card { flex: none; width: 210px; }

/* ==========================================================
   LISTING CARD
   ========================================================== */
.bb-listing-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 16px;
}

.bb-card {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
}
.bb-card-link { display: contents; color: inherit; }

.bb-card-thumb { aspect-ratio: 4/3; background: var(--grad); overflow: hidden; }
.bb-card-thumb img { width: 100%; height: 100%; object-fit: contain; }

.bb-card-body { padding: 12px 14px 14px; }

.bb-tag {
	display: inline-block; border-radius: 4px; padding: 3px 8px;
	font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; margin-bottom: 6px;
}
.bb-tag-boost { background: var(--boost-tint); color: var(--boost); }
.bb-tag-new { background: var(--success-bg); color: var(--trust); }
.bb-stock-limited { background: var(--warn-bg); color: var(--spark-ink); }
.bb-stock-sold { background: var(--error-bg); color: var(--brand-dark); }

.bb-card-title { font-size: 15.5px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.bb-currency { color: var(--brand); font-weight: 700; }
.bb-location { color: var(--brand); font-weight: 600; }
.bb-card-meta { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 8px; }
.bb-card-price { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--ink); }

/* ==========================================================
   SINGLE LISTING
   ========================================================== */
.bb-single-listing {
	display: grid; grid-template-columns: 1.2fr 0.9fr; gap: 44px;
	padding: 40px 0;
}
@media (max-width: 820px) { .bb-single-listing { grid-template-columns: 1fr; } }

.bb-single-gallery-wrap { display: flex; flex-direction: column; gap: 10px; }

.bb-single-gallery {
	background: var(--grad); border-radius: var(--radius); overflow: hidden;
	aspect-ratio: 4/3;
}
.bb-single-gallery img { width: 100%; height: 100%; object-fit: contain; }

.bb-single-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.bb-single-thumb {
	width: 60px; height: 60px; border-radius: 6px; overflow: hidden;
	border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--grad);
}
.bb-single-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bb-single-thumb.active { border-color: var(--brand); }

.bb-single-price {
	font-family: var(--font-head); font-size: 2rem; font-weight: 700;
	color: var(--ink); margin-bottom: 10px;
}

.bb-seller-row {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
	margin: 18px 0;
}
.bb-seller-avatar {
	width: 40px; height: 40px; border-radius: 50%; background: var(--grad);
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--brand-dark);
	flex: none;
}
.bb-seller-who b { display: block; font-size: 14px; }
.bb-seller-who span { font-size: 12px; color: var(--ink-soft); }

/* ==========================================================
   BOOST PANEL (owner-only, on single listing)
   ========================================================== */
.bb-boost-panel {
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 20px; margin-top: 20px; background: var(--bg);
}
.bb-boost-panel h4 { font-size: 14px; margin-bottom: 4px; }
.bb-boost-panel .bb-balance-note { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; }

.bb-boost-option {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 10px;
	background: var(--panel); cursor: pointer;
}
.bb-boost-option input { accent-color: var(--boost); }
.bb-boost-option .bb-boost-label { font-size: 13px; font-weight: 600; }
.bb-boost-option .bb-boost-cost { font-size: 13px; font-weight: 700; color: var(--boost); white-space: nowrap; }

/* ==========================================================
   BUY CREDITS
   ========================================================== */
.bb-buy-credits { display: flex; flex-direction: column; gap: 4px; }

.bb-credits-balance-row {
	display: flex; align-items: baseline; justify-content: space-between;
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 18px 22px; background: linear-gradient(135deg, var(--brand-tint) 0%, var(--warn-bg) 100%);
	margin-bottom: 8px;
}
.bb-credits-balance-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.bb-credits-balance-amount { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--ink); }

.bb-buy-credits-heading { font-size: 15px; margin: 8px 0 4px; }

/* Selectable pack cards — the radio sits over the whole card (not just
   a tiny circle) so any click anywhere on it selects that pack, and a
   checked card is clearly set apart from the rest. */
.bb-pack-select {
	display: grid; grid-template-columns: repeat(3, 1fr);
	gap: 12px; margin: 10px 0 24px;
}
@media (max-width: 560px) { .bb-pack-select { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .bb-pack-select { grid-template-columns: 1fr; } }
.bb-pack-option {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
	border: 2px solid var(--line); border-radius: var(--radius);
	padding: 20px 12px 16px; cursor: pointer; text-align: center; background: var(--panel);
	transition: border-color .15s ease, background-color .15s ease;
}
.bb-pack-option:hover { border-color: var(--boost); }
.bb-pack-option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.bb-pack-option input { position: absolute; top: 10px; left: 10px; margin: 0; accent-color: var(--brand); }
.bb-pack-badge {
	position: absolute; top: -9px; right: 10px;
	background: var(--accent-post); color: #fff; font-size: 10px; font-weight: 800;
	border-radius: 10px; padding: 3px 9px; letter-spacing: 0.02em;
}
.bb-pack-credits { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--ink); margin-top: 6px; }
.bb-pack-credits-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.bb-pack-price { font-size: 14px; font-weight: 700; color: var(--brand); }

.bb-buy-credits-pay {
	border-top: 1px solid var(--line); padding-top: 18px; max-width: 320px;
}
#bb-buy-credits-message { font-size: 13px; font-weight: 600; margin-top: 10px; }

/* ==========================================================
   LEDGER (My Credits)
   ========================================================== */
.bb-credits-wrap .bb-credit-balance {
	font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; color: var(--brand);
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 26px 30px; display: block; margin: 14px 0 28px;
}
.bb-credit-history { width: 100%; border-collapse: collapse; }
.bb-credit-history th {
	text-align: left; font-size: 11.5px; color: var(--ink-soft); font-weight: 600;
	padding: 9px 0; border-bottom: 1px solid var(--line);
}
.bb-credit-history td { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }

/* ==========================================================
   PHOTO GRID (Post a Listing — existing image management)
   ========================================================== */
.bb-readonly-field {
	padding: 11px 14px; border: 1px solid var(--line); border-radius: 6px;
	background: var(--bg); font-size: 14px; color: var(--ink);
}
.bb-photo-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
	gap: 12px; margin: 10px 0 14px;
}
.bb-photo-item {
	border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
	padding: 6px; text-align: center; background: var(--panel);
}
.bb-photo-item img { width: 100%; height: 70px; object-fit: cover; border-radius: 4px; margin-bottom: 6px; }
.bb-photo-cover-label, .bb-photo-remove-label {
	display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-soft);
	margin: 0 !important; padding: 2px 0 !important;
}
.bb-photo-cover-label input, .bb-photo-remove-label input { margin-right: 3px; }

.bb-vehicle-filters {
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.bb-vehicle-filters label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 10px 0 4px; }
.bb-vehicle-filters input, .bb-vehicle-filters select {
	width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px;
}
.bb-vehicle-filters .bb-btn { margin-top: 14px; margin-right: 8px; }

/* ==========================================================
   VEHICLE SPECS (single listing page)
   ========================================================== */
.bb-vehicle-specs { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.bb-vehicle-specs h4 { font-size: 15px; margin-bottom: 12px; }
.bb-vehicle-specs h5 { font-size: 12.5px; color: var(--ink-soft); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.bb-specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.bb-specs-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-soft); padding: 6px 0; font-size: 13px; }
.bb-specs-label { color: var(--ink-soft); }
.bb-specs-value { font-weight: 600; color: var(--ink); }
.bb-specs-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-specs-tag { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 4px 11px; font-size: 12px; color: var(--ink); }

/* Vehicle form checkbox groups (Post a Listing) */
.bb-checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.bb-checkbox-chip {
	display: flex; align-items: center; gap: 6px;
	border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px;
	font-size: 12.5px; color: var(--ink); cursor: pointer; margin: 0 !important;
}
.bb-checkbox-chip input { margin: 0; }

@media (max-width: 560px) { .bb-specs-grid { grid-template-columns: 1fr; } }

/* ==========================================================
   STATUS BANNERS (pending/rejected listing preview)
   ========================================================== */
.bb-status-banner {
	margin: 20px auto 0; padding: 12px 18px; border-radius: 6px;
	font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bb-status-pending { background: var(--warn-bg); color: var(--spark-ink); border: 1px solid var(--warn-border); }
.bb-status-rejected { background: var(--error-bg); color: var(--brand-dark); border: 1px solid var(--error-border); }

/* Reusable banners — success/error messages (Settings, Post a
   Listing, Payout, etc.), replacing one-off inline styles so every
   plugin's messages stay theme-aware together. */
.bb-banner-success { color: var(--trust); background: var(--success-bg); border-radius: 6px; padding: 10px 14px; font-size: 13px; }
.bb-banner-error { color: var(--brand-dark); background: var(--error-bg); border-radius: 6px; padding: 10px 14px; font-size: 13px; }

/* ==========================================================
   FOOTER
   ========================================================== */
.bb-footer {
	border-top: 1px solid var(--line); padding: 40px 0 0; margin-top: 50px;
	font-size: 13px; color: var(--ink-soft); background: var(--panel);
}
.bb-footer-columns {
	display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
	padding-bottom: 32px;
}
/* No extra margin-top here — .bb-footer-col's flex "gap" already
   spaces the logo and this paragraph; adding margin-top on top of
   that was doubling up the space. */
.bb-footer-brand p { max-width: 32ch; margin-top: 0; }
/* The footer logo is a stacked icon+wordmark lockup (square canvas),
   not a wide horizontal logo — sizing it by a short height alone
   squashed the wordmark down to a sliver. Size it by width instead,
   generous enough that the "BEXTBUYZ" text stays legible. */
.bb-footer-logo-img { width: 130px; height: auto; display: block; }

.bb-footer-col { display: flex; flex-direction: column; gap: 9px; }
.bb-footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); margin: 0 0 2px; }
.bb-footer-col a { color: var(--ink-soft); }
.bb-footer-col a:hover { color: var(--brand); }

.bb-footer-bottom {
	border-top: 1px solid var(--line-soft); padding: 16px 0;
	display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
	font-size: 12px;
}
.bb-footer-countries { color: var(--ink-soft); }

/* ==========================================================
   BACK TO TOP
   ========================================================== */
.bb-back-to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 90;
	width: 42px; height: 42px; border-radius: 50%;
	background: var(--ink); color: #fff; border: none; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
	box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.bb-back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.bb-back-to-top:hover { background: var(--brand); }

@media (max-width: 860px) {
	.bb-footer-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
	.bb-footer-columns { grid-template-columns: 1fr; }
	.bb-back-to-top { right: 14px; bottom: 14px; width: 38px; height: 38px; }

	/* Only the brand block (logo + tagline) centers on mobile — the
	   Marketplace/Categories/Company link columns stay left-aligned. */
	.bb-footer-brand { align-items: center; text-align: center; }
	.bb-footer-brand .bb-footer-logo-img { margin: 0 auto; }
}

/* ==========================================================
   FORMS (Post a Listing, My Account)
   ========================================================== */
.bb-form-card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px;
}
.bb-form-card label {
	display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
	margin: 14px 0 6px;
}
.bb-form-card label:first-of-type { margin-top: 0; }
.bb-form-card input[type="text"],
.bb-form-card input[type="email"],
.bb-form-card input[type="number"],
.bb-form-card input[type="tel"],
.bb-form-card input[type="password"],
.bb-form-card input[type="file"],
.bb-form-card textarea,
.bb-form-card select {
	width: 100%; padding: 11px 14px; border: 1px solid var(--line);
	border-radius: 6px; font-size: 14px; box-sizing: border-box; font-family: var(--font-body);
	background: var(--panel); color: var(--ink);
}
.bb-form-card input:disabled { background: var(--bg); color: var(--ink-soft); }
.bb-form-card textarea { resize: vertical; }
.bb-form-row {
	display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 560px) { .bb-form-row { grid-template-columns: 1fr; } }

/* Post a Listing: Publish + Save to Draft side by side, Delete
   (edit mode only) set apart below so it doesn't read as a third
   equally-weighted primary action. */
.bb-listing-form-actions { display: flex; gap: 10px; margin-top: 18px; }
.bb-listing-form-actions .bb-btn { flex: 1; text-align: center; }
.bb-listing-delete-form { margin-top: 14px; text-align: center; }
.bb-listing-delete-form .bb-btn { color: var(--brand-dark); }
@media (max-width: 480px) { .bb-listing-form-actions { flex-direction: column; } }

/* ==========================================================
   MY LISTINGS — manage rows
   ========================================================== */
.bb-manage-list { display: flex; flex-direction: column; gap: 12px; }
.bb-manage-row {
	display: flex; align-items: center; gap: 16px;
	border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
	background: var(--panel);
}
.bb-manage-thumb {
	width: 64px; height: 64px; border-radius: 6px; background: var(--grad);
	overflow: hidden; flex: none;
}
.bb-manage-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bb-manage-info { flex: 1; min-width: 0; }
.bb-manage-title { font-weight: 700; font-size: 14px; display: block; margin-bottom: 4px; }
.bb-manage-actions { display: flex; gap: 8px; flex: none; }

.bb-stock-quick-form {
	display: flex; align-items: center; gap: 6px; margin-top: 8px;
}
.bb-stock-quick-form select, .bb-stock-quick-form input[type="number"] {
	padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px;
}
.bb-stock-quick-form input[type="number"] { width: 60px; }
.bb-stock-quick-form .bb-btn { padding: 6px 12px; font-size: 12px; }
.bb-manage-actions form { margin: 0; }

/* ==========================================================
   CATEGORY SLIDER (homepage)
   ========================================================== */
.bb-slider { position: relative; }
.bb-slider-track {
	display: flex; gap: 16px; overflow-x: auto; scroll-behavior: smooth;
	scroll-snap-type: x mandatory; padding-bottom: 4px;
	scrollbar-width: none;
}
.bb-slider-track::-webkit-scrollbar { display: none; }
.bb-slider-track .bb-card {
	flex: 0 0 calc((100% - 32px) / 3);
	scroll-snap-align: start;
	min-width: 200px;
}
.bb-slider-arrow {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 34px; height: 34px; border-radius: 50%;
	background: var(--panel); border: 1px solid var(--line);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; z-index: 2; font-size: 16px; color: var(--ink);
}
.bb-slider-prev { left: -14px; }
.bb-slider-next { right: -14px; }
@media (max-width: 1100px) and (min-width: 641px) {
	.bb-slider-track .bb-card { flex: 0 0 calc((100% - 16px) / 2); }
}
@media (max-width: 640px) {
	.bb-slider-track .bb-card { flex: 0 0 calc(100% - 40px); }
	.bb-slider-arrow { display: none; }
}

/* ==========================================================
   USER MENU (avatar + dropdown)
   ========================================================== */
.bb-user-menu { position: relative; }
.bb-user-avatar {
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--grad); color: var(--brand-dark);
	border: none; cursor: pointer; overflow: hidden; padding: 0;
	font-family: var(--font-head); font-weight: 700; font-size: 14px;
	display: flex; align-items: center; justify-content: center;
}
/* Shared avatar building blocks — a real uploaded photo, or the
   same colored-initials circle used everywhere one isn't set
   (header avatar button, Settings preview; chat has its own
   multi-color rotation, see bextbuyz-chat/assets/css/chat.css). */
.bb-avatar-img { border-radius: 50%; object-fit: cover; display: block; }
.bb-avatar-initials {
	width: 100%; height: 100%; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-head); font-weight: 700;
}

/* Settings → Account profile-picture field */
.bb-avatar-field { display: flex; align-items: center; gap: 16px; margin: 8px 0 4px; }
.bb-avatar-field-preview { width: 64px; height: 64px; flex: none; background: var(--grad); color: var(--brand-dark); font-size: 20px; }
.bb-avatar-field-controls { display: flex; flex-direction: column; gap: 8px; }
.bb-avatar-remove-label { display: flex !important; align-items: center; gap: 6px; font-size: 12.5px !important; font-weight: 500 !important; margin: 0 !important; color: var(--ink-soft); cursor: pointer; }
.bb-avatar-remove-label input { margin: 0; }
.bb-user-dropdown {
	position: absolute; top: calc(100% + 10px); right: 0;
	background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
	min-width: 170px; box-shadow: 0 10px 30px rgba(0,0,0,0.14);
	overflow: hidden; z-index: 200; display: none;
}
.bb-user-dropdown.open { display: block; }
.bb-user-dropdown a {
	display: block; padding: 11px 16px; font-size: 13.5px; color: var(--ink);
}
.bb-user-dropdown a:hover { background: var(--bg); }
.bb-nav-badge {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 17px; height: 17px; padding: 0 4px; margin-left: 6px;
	background: var(--brand); color: #fff; border-radius: 50%;
	font-size: 10px; font-weight: 700;
}

/* ==========================================================
   SETTINGS — Appearance tab (Light/Dark/System radio group)
   ========================================================== */
.bb-theme-option-group { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bb-theme-option {
	display: flex; align-items: center; gap: 10px;
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 12px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink);
	cursor: pointer; margin: 0 !important;
}
.bb-theme-option:has(input:checked) { border-color: var(--brand); background: var(--bg); }
.bb-theme-option input { margin: 0; accent-color: var(--brand); }

/* ==========================================================
   TABS (Dashboard)
   ========================================================== */
.bb-tabs {
	display: flex; gap: 6px; border-bottom: 1px solid var(--line);
	margin: 20px 0 24px; overflow-x: auto;
}
.bb-tab-btn {
	background: none; border: none; cursor: pointer;
	padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
	border-bottom: 2px solid transparent; white-space: nowrap;
}
.bb-tab-btn.active { color: var(--ink); border-bottom-color: var(--brand); }

/* ==========================================================
   RESPONSIVE — TABLET (960px and below)
   ========================================================== */
@media (max-width: 960px) {
	.bb-container { padding: 0 16px; }
	.bb-section { padding: 32px 0; }
	.bb-single-listing { gap: 28px; }
	.bb-form-card { padding: 22px; }
}

/* ==========================================================
   RESPONSIVE — MOBILE (768px and below)
   ========================================================== */
@media (max-width: 768px) {
	/* Header felt flush to the screen edge on mobile — give it its
	   own, slightly more generous side padding than the default
	   body container. */
	.bb-topbar .bb-container { padding-left: 20px; padding-right: 20px; }

	/* Topbar: wrap into two rows — logo+actions on top,
	   search and country picker stacked full-width below. */
	.bb-topbar-inner {
		flex-wrap: wrap;
		row-gap: 10px;
		padding: 12px 0;
	}
	.bb-hamburger-btn { order: 0; }
	.bb-logo { order: 1; }
	.bb-logo-img { height: 28px; }
	.bb-location-menu { order: 2; margin-left: auto; }
	.bb-topbar-actions { order: 3; gap: 8px; }
	.bb-search-bar { order: 4; flex: 0 0 100%; }

	/* Shrink the "Post a Listing" button so it doesn't crowd the avatar,
	   and swap its label for the shorter "Post" on mobile. */
	.bb-topbar-actions .bb-btn { padding: 9px 14px; font-size: 12.5px; }
	.bb-btn-text-full { display: none; }
	.bb-btn-text-short { display: inline; }

	.bb-cat-row .bb-container { padding: 0 16px; }

	/* Section headers: allow the title and action to wrap instead of squashing */
	.bb-section-head { flex-wrap: wrap; gap: 10px; }

	/* Manage rows (My Listings / Dashboard): stack instead of a cramped single line */
	.bb-manage-row { flex-wrap: wrap; }
	.bb-manage-info { flex: 1 1 100%; order: 2; }
	.bb-manage-thumb { order: 1; }
	.bb-manage-actions { order: 3; flex: 1 1 100%; justify-content: flex-start; }

	/* Single listing: image first, full width */
	.bb-single-gallery { aspect-ratio: 4 / 3; }

	/* Forms: full-bleed feel, less padding */
	.bb-form-card { padding: 18px; }

	/* Tabs: bigger tap targets */
	.bb-tab-btn { padding: 10px 14px; font-size: 13px; }

	h1 { font-size: 1.7rem; }
	h2 { font-size: 1.25rem; }
}

/* ==========================================================
   RESPONSIVE — SMALL MOBILE (480px and below)
   ========================================================== */
@media (max-width: 480px) {
	.bb-listing-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.bb-card-title { font-size: 13.5px; }
	.bb-card-price { font-size: 14px; }
	.bb-btn { padding: 9px 16px; font-size: 13px; }
	.bb-user-avatar { width: 34px; height: 34px; font-size: 12.5px; }
	.bb-single-price { font-size: 1.6rem; }

	/* Phase 3 additions — category picker, contact box, payout bar */
	.bb-cat-picker-panel { max-height: 280px; }
	.bb-contact-method { padding: 9px 14px; font-size: 13px; }
	.bb-payout-earnings { padding: 18px 20px; }
	.bb-payout-earnings-amount { font-size: 1.9rem; }
	.bb-sidebar { width: 88vw; }
	.bb-explore-panel { width: 88vw; }
	.bb-topbar .bb-container { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================
   CATEGORY PICKER (Post a Listing — searchable, nested)
   ========================================================== */
.bb-cat-picker { position: relative; }

.bb-cat-picker-trigger {
	width: 100%; display: flex; align-items: center; justify-content: space-between;
	padding: 11px 14px; border: 1px solid var(--line); border-radius: 6px;
	background: var(--panel); font-size: 14px; font-family: var(--font-body); color: var(--ink);
	cursor: pointer; text-align: left;
}
.bb-cat-picker-caret { font-size: 11px; color: var(--ink-soft); }

.bb-cat-picker-panel {
	display: none;
	position: absolute; top: calc(100% + 6px); left: 0; right: 0;
	background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
	box-shadow: 0 12px 32px rgba(0,0,0,0.14); z-index: 250;
	max-height: 340px; overflow: hidden; display: none; flex-direction: column;
}
.bb-cat-picker.open .bb-cat-picker-panel { display: flex; }

.bb-cat-picker-search {
	margin: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
	font-size: 13.5px; flex: none;
}

.bb-cat-picker-tree { overflow-y: auto; padding: 0 6px 8px; }

.bb-cat-picker-parent-row { display: flex; align-items: stretch; }
.bb-cat-picker-option {
	flex: 1; text-align: left; background: none; border: none; cursor: pointer;
	padding: 9px 10px; font-size: 13.5px; color: var(--ink); border-radius: 6px;
}
.bb-cat-picker-option:hover, .bb-cat-picker-option.bb-match { background: var(--bg); }
.bb-cat-picker-parent { font-weight: 700; }
.bb-cat-picker-parent-label {
	flex: 1; text-align: left; background: none; border: none; cursor: pointer;
	padding: 9px 10px; font-size: 13.5px; font-weight: 700; color: var(--ink); border-radius: 6px;
}
.bb-cat-picker-parent-label:hover { background: var(--bg); }
.bb-cat-picker-child { color: var(--ink-soft); font-weight: 500; }

.bb-cat-picker-expand {
	flex: none; width: 32px; background: none; border: none; cursor: pointer;
	color: var(--ink-soft); font-size: 10px;
}
.bb-cat-picker-group.expanded .bb-cat-picker-expand { transform: rotate(180deg); }
/* .bb-cat-picker-children open/close animation rules live in the
   ANIMATIONS section further down (max-height based, not display). */

.bb-cat-picker-group.search-hidden { display: none; }
.bb-cat-picker-child.search-hidden { display: none; }

.bb-cat-picker-empty { padding: 16px; text-align: center; color: var(--ink-soft); font-size: 13px; }

/* ==========================================================
   CONTACT SELLER — phone, WhatsApp, chat (no email, ever)
   ========================================================== */
.bb-contact-seller-box { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.bb-contact-method {
	display: inline-flex; align-items: center; gap: 8px;
	border: 1px solid var(--line); border-radius: 20px;
	padding: 10px 18px; font-size: 13.5px; font-weight: 700; color: var(--ink);
	background: var(--panel);
}
.bb-contact-method:hover { border-color: var(--ink); }
.bb-contact-icon { display: flex; align-items: center; }
.bb-contact-whatsapp { background: #25D366; border-color: #25D366; color: #fff; }
.bb-contact-whatsapp:hover { background: #1FBB58; border-color: #1FBB58; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
	outline: 2px solid var(--boost); outline-offset: 2px;
}

/* Header search + country picker: no blue outline. A subtle border
   brighten on the pill keeps keyboard focus visible without the ring. */
.bb-search-bar input:focus,
.bb-search-bar input:focus-visible,
.bb-icon-btn:focus,
.bb-icon-btn:focus-visible { outline: none; box-shadow: none; }
.bb-search-bar:focus-within { border-color: var(--brand); }
.bb-icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ==========================================================
   CATEGORY / SEARCH RESULT PAGES
   ========================================================== */
.bb-archive-title { font-size: clamp(1.3rem, 2.5vw, 1.7rem); margin: 0; }
.bb-archive-count { font-size: 13px; color: var(--ink-soft); }
.bb-subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.bb-listing-grid { margin-top: 8px; }

.navigation.pagination { margin-top: 28px; }
.navigation.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.navigation.pagination .page-numbers {
	border: 1px solid var(--line); border-radius: 18px; padding: 7px 14px;
	font-size: 12.5px; color: var(--ink-soft); background: var(--panel);
}
.navigation.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.navigation.pagination a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }

/* ==========================================================
   CATEGORY PAGE — sticky sub-header (name + Explore button),
   positioned directly under the main sticky topbar.
   ========================================================== */
.bb-cat-header-row {
	position: sticky; top: 65px; z-index: 99;
	background: var(--panel); border-bottom: 1px solid var(--line-soft);
}
.bb-cat-header-row-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px; padding: 14px 0;
}
.bb-cat-header-name { margin: 0; font-size: 1.15rem; }
.bb-cat-header-parent { color: var(--ink-soft); font-weight: 600; }
.bb-cat-header-parent:hover { color: var(--brand); }
.bb-cat-header-sep { color: var(--ink-soft); margin: 0 6px; font-weight: 400; }
.bb-explore-btn { display: inline-flex; align-items: center; gap: 6px; }
.bb-explore-btn svg { transition: transform .2s ease; }
.bb-explore-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

@media (max-width: 768px) {
	.bb-cat-header-row { top: 118px; }
	/* Match the topbar's mobile side padding (added in the previous
	   round) so this row lines up with it instead of looking tighter. */
	.bb-cat-header-row .bb-container { padding-left: 20px; padding-right: 20px; }

	.bb-cat-header-name { font-size: 0.95rem; }
	.bb-explore-btn { font-size: 12px; padding: 8px 14px; }
}
@media (max-width: 480px) {
	.bb-cat-header-row .bb-container { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================
   ANIMATIONS — scroll-reveal for sections, and smooth
   open/close transitions for dropdowns, the category-picker
   accordion, the sidebar category tree, and Dashboard tabs.
   Respects prefers-reduced-motion throughout.
   ========================================================== */
@media (prefers-reduced-motion: no-preference) {
	.bb-reveal {
		opacity: 0; transform: translateY(18px);
		transition: opacity .5s ease, transform .5s ease;
	}
	.bb-reveal.bb-in-view { opacity: 1; transform: translateY(0); }
}

@keyframes bbFadeIn {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}
.bb-location-dropdown.open,
.bb-notif-dropdown.open,
.bb-user-dropdown.open,
.bb-cat-picker.open .bb-cat-picker-panel {
	animation: bbFadeIn .18s ease;
}
.bb-tab-panel.active { animation: bbFadeIn .25s ease; }

/* Category picker — animate the expand/collapse instead of an
   instant display:none/block swap. */
.bb-cat-picker-children {
	max-height: 0; overflow: hidden; padding-left: 12px;
	transition: max-height .25s ease;
}
.bb-cat-picker-group.expanded .bb-cat-picker-children,
.bb-cat-picker-group.search-match .bb-cat-picker-children {
	max-height: 600px;
}

/* Sidebar category tree (<details>/<summary>) — override the
   browser's native instant show/hide so the open/close animates. */
.bb-sidebar-children {
	display: block !important;
	max-height: 0; overflow: hidden;
	padding: 0 14px 0 24px;
	transition: max-height .25s ease, padding .25s ease;
}
.bb-sidebar-group[open] .bb-sidebar-children {
	max-height: 600px;
	padding: 0 14px 10px 24px;
}
