/* ============================================================
   BostonBargains — Main Stylesheet
   Mobile-first responsive design
   Breakpoints:
     < 480px  = small phones
     480-768px = large phones / small tablets
     768-1024px = tablets / small laptops
     > 1024px = desktop
   ============================================================ */

/* ── Design tokens ── */
:root {
  --navy:      #1B3A6B;
  --navy-dark: #15305a;
  --gold:      #F5C242;
  --gold-dark: #e0aa00;
  --red:       #E24B4A;
  --green:     #3B6D11;
  --green-bg:  #EAF3DE;
  --blue-bg:   #E6F1FB;
  --amber-bg:  #FAEEDA;
  --amber:     #854F0B;
  --g50:  #f9fafb;
  --g100: #f3f4f6;
  --g200: #e5e7eb;
  --g300: #d1d5db;
  --g400: #9ca3af;
  --g500: #6b7280;
  --g700: #374151;
  --g900: #111827;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);
  --nav-h: 56px;
  --mobile-menu-w: 300px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--g100);
  color: var(--g900);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Overlay (mobile menu backdrop) ── */
.bb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 399;
  opacity: 0;
  transition: opacity .25s;
}
.bb-overlay.active { display: block; opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   NAV — Desktop (≥ 769px)
   Shows: Logo | Search bar | Nav links | Avatar dropdown | CTA
   ═══════════════════════════════════════════════════════════════ */
.bb-nav {
  background: var(--navy);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 400;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.bb-logo {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.bb-logo span { color: var(--gold); }
.bb-logo:hover { text-decoration: none; }

/* Desktop search bar */
.bb-nav-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.13);
  border-radius: var(--r-md);
  padding: 0 12px;
  gap: 8px;
  height: 38px;
  transition: background .15s;
}
.bb-nav-search:focus-within { background: rgba(255,255,255,.2); }
.bb-nav-search i { color: rgba(255,255,255,.6); font-size: 17px; flex-shrink: 0; }
.bb-nav-search input {
  background: none; border: none; outline: none;
  color: #fff; font-size: 14px; flex: 1; width: 100%;
}
.bb-nav-search input::placeholder { color: rgba(255,255,255,.5); }

/* Right side of desktop nav */
.bb-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.bb-nav-link { color: rgba(255,255,255,.85); font-size: 14px; }
.bb-nav-link:hover { color: #fff; text-decoration: none; }
.bb-nav-icon {
  color: rgba(255,255,255,.8);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
}
.bb-nav-icon:hover { color: #fff; text-decoration: none; }
.bb-nav-btn {
  background: var(--gold);
  color: var(--navy) !important;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-md);
  padding: 7px 16px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.bb-nav-btn:hover { background: var(--gold-dark); text-decoration: none; }

/* Desktop dropdown */
.bb-nav-dropdown { position: relative; }
.bb-nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  cursor: pointer; user-select: none;
}
.bb-nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
}
.bb-nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--g700);
  border-bottom: 1px solid var(--g100);
}
.bb-nav-dropdown-menu a:last-child { border-bottom: none; }
.bb-nav-dropdown-menu a:hover {
  background: var(--g50);
  text-decoration: none;
  color: var(--g900);
}

/* Hamburger button — hidden on desktop */
.bb-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  margin-left: auto;
  flex-shrink: 0;
}
.bb-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.bb-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bb-hamburger.open span:nth-child(2) { opacity: 0; }
.bb-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE SLIDE-IN MENU (≤ 768px)
   Full-height panel that slides in from the right
   ═══════════════════════════════════════════════════════════════ */
.bb-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(var(--mobile-menu-w), 88vw);
  height: 100dvh;
  height: 100vh; /* fallback */
  background: #fff;
  z-index: 500;
  /* Hidden by default — shown only when .open is added by JS.
     display:none ensures content is truly invisible and out of flow
     until the menu is opened, preventing text flash on slow CSS load. */
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Slide animation runs only when transitioning from open → close or reverse */
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.bb-mobile-menu.open {
  display: flex;
  transform: translateX(0);
}

/* Mobile menu header strip */
.bb-mobile-menu-header {
  background: var(--navy);
  padding: 0 16px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.bb-mobile-menu-logo { color: #fff; font-size: 18px; font-weight: 700; }
.bb-mobile-menu-logo span { color: var(--gold); }
.bb-mobile-menu-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.bb-mobile-menu-close:hover { color: #fff; }

/* Mobile search inside drawer */
.bb-mobile-search {
  padding: 14px 16px;
  background: var(--g50);
  border-bottom: 1px solid var(--g200);
  flex-shrink: 0;
}
.bb-mobile-search form {
  display: flex;
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--r-md);
  overflow: hidden;
  height: 42px;
}
.bb-mobile-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 12px;
  font-size: 14px;
  color: var(--g900);
}
.bb-mobile-search button {
  background: var(--navy);
  border: none;
  color: #fff;
  padding: 0 14px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Mobile user banner (when logged in) */
.bb-mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--blue-bg);
  border-bottom: 1px solid var(--g200);
  flex-shrink: 0;
}
.bb-mobile-user-info { flex: 1; min-width: 0; }
.bb-mobile-user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bb-mobile-user-email {
  font-size: 12px;
  color: var(--g500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile menu nav links */
.bb-mobile-nav { flex: 1; padding: 8px 0; }
.bb-mobile-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--g700);
  border-bottom: 1px solid var(--g100);
  transition: background .12s;
}
.bb-mobile-nav a:last-child { border-bottom: none; }
.bb-mobile-nav a:hover { background: var(--g50); text-decoration: none; color: var(--g900); }
.bb-mobile-nav a i { font-size: 20px; color: var(--navy); width: 24px; text-align: center; flex-shrink: 0; }
.bb-mobile-nav .bb-mobile-nav-divider {
  height: 1px;
  background: var(--g200);
  margin: 6px 0;
}
.bb-mobile-nav .bb-mobile-nav-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--g400);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 12px 20px 4px;
}

/* Mobile CTA at bottom of drawer */
.bb-mobile-cta {
  padding: 16px;
  border-top: 1px solid var(--g200);
  background: var(--g50);
  flex-shrink: 0;
}
.bb-mobile-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  padding: 13px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
}
.bb-mobile-cta a:hover { background: var(--gold-dark); text-decoration: none; }

/* Unread badge on messages icon */
.bb-nav-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ── Alerts ── */
.bb-alert { padding: 13px 20px; font-size: 14px; }
.bb-alert-success { background: var(--green-bg); color: var(--green); }
.bb-alert-error   { background: #FCE8E8; color: #A32D2D; }

/* ── Hero ── */
.bb-hero { background: var(--navy); padding: 44px 20px 52px; text-align: center; }
.bb-hero h1 { color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 8px; line-height: 1.25; }
.bb-hero p  { color: rgba(255,255,255,.72); font-size: 15px; margin-bottom: 24px; }
.bb-hero-search {
  display: flex;
  max-width: 620px;
  margin: 0 auto 18px;
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: 50px;
}
.bb-hero-search input  {
  flex: 1; border: none; outline: none;
  padding: 0 16px; font-size: 15px; color: var(--g900); min-width: 0;
}
.bb-hero-search select {
  border: none; border-left: 1px solid var(--g200); outline: none;
  padding: 0 12px; font-size: 13px; background: var(--g50);
  color: var(--g700); cursor: pointer; max-width: 140px;
}
.bb-hero-search button {
  background: var(--gold); border: none; padding: 0 22px;
  font-size: 15px; font-weight: 700; color: var(--navy);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.bb-hero-search button:hover { background: var(--gold-dark); }
.bb-pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.bb-pill  {
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.22); border-radius: 20px;
  padding: 5px 16px; font-size: 13px; cursor: pointer;
}
.bb-pill:hover, .bb-pill.active {
  background: rgba(245,194,66,.2); border-color: var(--gold);
  color: var(--gold); text-decoration: none;
}

/* ── Layout ── */
.bb-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.bb-section   { padding: 36px 0; }
.bb-section-title  {
  font-size: 12px; font-weight: 700; color: var(--g500);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px;
}
.bb-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.bb-section-link { font-size: 13px; color: var(--navy); }
.bb-divider      { height: 1px; background: var(--g200); margin: 24px 0; }

/* ── Cards ── */
.bb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bb-card {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg);
  overflow: hidden; transition: box-shadow .15s; display: block; color: inherit;
}
.bb-card:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.bb-card-img {
  height: 150px; background: var(--g100);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bb-card-img img { width: 100%; height: 100%; object-fit: cover; }
.bb-card-img i   { font-size: 52px; color: var(--g400); }
.bb-card-body    { padding: 12px; }
.bb-card-price   { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.bb-card-title   { font-size: 13px; color: var(--g900); margin-bottom: 5px; line-height: 1.4; }
.bb-card-meta    { font-size: 12px; color: var(--g400); }

/* ── List view ── */
.bb-list-card {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg);
  padding: 14px 16px; display: flex; gap: 14px; color: inherit;
}
.bb-list-card:hover { box-shadow: var(--shadow-sm); text-decoration: none; }
.bb-list-img {
  width: 90px; height: 90px; border-radius: var(--r-md);
  background: var(--g100); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bb-list-img img { width: 100%; height: 100%; object-fit: cover; }
.bb-list-img i   { font-size: 36px; color: var(--g400); }
.bb-list-body    { flex: 1; min-width: 0; }
.bb-list-title   { font-size: 15px; font-weight: 600; color: var(--g900); margin-bottom: 4px; }
.bb-list-price   { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.bb-list-meta    { font-size: 13px; color: var(--g500); display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Badges ── */
.bb-badge       { font-size: 11px; padding: 2px 9px; border-radius: 10px; display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.bb-badge-green { background: var(--green-bg); color: var(--green); }
.bb-badge-blue  { background: var(--blue-bg); color: #185FA5; }
.bb-badge-amber { background: var(--amber-bg); color: var(--amber); }
.bb-badge-red   { background: #FCE8E8; color: #A32D2D; }
.bb-badge-gray  { background: var(--g100); color: var(--g500); }
.bb-stars       { color: var(--gold); }

/* ── Forms ── */
.bb-form-wrap {
  max-width: 500px; margin: 40px auto;
  background: #fff; border-radius: var(--r-lg);
  padding: 36px; box-shadow: var(--shadow-sm);
}
.bb-form-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.bb-form-sub   { font-size: 14px; color: var(--g500); margin-bottom: 24px; }
.bb-field      { margin-bottom: 18px; }
.bb-label      { display: block; font-size: 13px; font-weight: 600; color: var(--g700); margin-bottom: 6px; }
.bb-input, .bb-select, .bb-textarea {
  width: 100%; border: 1px solid var(--g200); border-radius: var(--r-md);
  padding: 10px 14px; font-size: 14px; color: var(--g900); background: #fff;
  outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.bb-input:focus, .bb-select:focus, .bb-textarea:focus {
  border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,58,107,.1);
}
.bb-textarea { resize: vertical; min-height: 90px; }
.bb-input-row { display: flex; gap: 12px; }
.bb-input-row .bb-field { flex: 1; margin-bottom: 18px; }

/* ── Buttons ── */
.bb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: var(--r-md); padding: 10px 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background .15s;
  white-space: nowrap; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.bb-btn-primary  { background: var(--navy); color: #fff; }
.bb-btn-primary:hover { background: var(--navy-dark); text-decoration: none; color: #fff; }
.bb-btn-secondary { background: #fff; color: var(--g700); border-color: var(--g200); }
.bb-btn-secondary:hover { background: var(--g50); text-decoration: none; }
.bb-btn-gold  { background: var(--gold); color: var(--navy); }
.bb-btn-gold:hover { background: var(--gold-dark); text-decoration: none; color: var(--navy); }
.bb-btn-danger { background: #FCE8E8; color: #A32D2D; border-color: #f5b4b4; }
.bb-btn-full  { width: 100%; justify-content: center; }
.bb-btn-sm    { padding: 6px 14px; font-size: 12px; }
.bb-act-btn   { padding: 5px 12px; border-radius: var(--r-sm); border: 1px solid var(--g200); font-size: 12px; cursor: pointer; background: #fff; color: var(--g700); }
.bb-act-btn:hover { background: var(--g50); text-decoration: none; }
.bb-act-btn.success { border-color: #a7d99b; color: var(--green); }
.bb-act-btn.success:hover { background: var(--green-bg); }
.bb-act-btn.danger  { border-color: #f5b4b4; color: #A32D2D; }
.bb-act-btn.danger:hover  { background: #FCE8E8; }

/* ── Browse layout ── */
.bb-browse-layout { display: flex; gap: 20px; align-items: flex-start; }
.bb-sidebar-filter {
  width: 220px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--g200);
  border-radius: var(--r-lg); padding: 18px;
}
.bb-browse-main    { flex: 1; min-width: 0; }
.bb-filter-section { margin-bottom: 20px; }
.bb-filter-stitle  {
  font-size: 11px; font-weight: 700; color: var(--g500);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}
.bb-check-row  { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.bb-check-row input { accent-color: var(--navy); cursor: pointer; }
.bb-check-label { font-size: 13px; color: var(--g700); flex: 1; }

/* ── Listing detail ── */
.bb-detail-grid  { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.bb-gallery-main {
  border-radius: var(--r-lg); overflow: hidden; background: var(--g100);
  height: 340px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.bb-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.bb-gallery-main i   { font-size: 90px; color: var(--g400); }
.bb-gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.bb-gallery-thumb {
  width: 72px; height: 72px; border-radius: var(--r-md); overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: var(--g100);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bb-gallery-thumb.active { border-color: var(--navy); }
.bb-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bb-detail-price  { font-size: 28px; font-weight: 700; color: var(--navy); }
.bb-detail-title  { font-size: 20px; font-weight: 700; color: var(--g900); margin: 8px 0; }
.bb-detail-meta   { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--g500); margin-bottom: 18px; }
.bb-detail-meta span { display: flex; align-items: center; gap: 4px; }
.bb-detail-cta    { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.bb-specs-grid    { display: grid; grid-template-columns: 1fr 1fr; }
.bb-spec-row      { padding: 10px 0; border-bottom: 1px solid var(--g100); }
.bb-spec-row:last-child, .bb-spec-row:nth-last-child(2) { border-bottom: none; }
.bb-spec-label    { font-size: 11px; color: var(--g400); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.bb-spec-val      { font-size: 13px; font-weight: 600; color: var(--g900); }

/* ── Seller card ── */
.bb-seller-card { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 16px; }
.bb-seller-top  { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bb-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue-bg); color: #185FA5;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.bb-avatar-lg { width: 64px; height: 64px; font-size: 20px; }

/* ── Messages ── */
.bb-msg-thread {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; min-height: 300px;
}
.bb-msg      { display: flex; gap: 8px; max-width: 82%; }
.bb-msg.me   { align-self: flex-end; flex-direction: row-reverse; }
.bb-bubble   { border-radius: 16px; padding: 10px 14px; font-size: 14px; line-height: 1.55; }
.bb-msg.them .bb-bubble { background: var(--g100); border: 1px solid var(--g200); border-bottom-left-radius: 4px; color: var(--g900); }
.bb-msg.me   .bb-bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.bb-msg-time { font-size: 11px; color: var(--g400); margin-top: 4px; }
.bb-compose  { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--g200); align-items: flex-end; }
.bb-compose textarea {
  flex: 1; border: 1px solid var(--g200); border-radius: 20px;
  padding: 9px 16px; font-size: 14px; resize: none; outline: none; font-family: inherit;
}
.bb-compose textarea:focus { border-color: var(--navy); }
.bb-compose button {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy); border: none; color: #fff;
  cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── Dashboard ── */
.bb-metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px;
}
.bb-metric       { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 16px; }
.bb-metric-label { font-size: 11px; color: var(--g400); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.bb-metric-val   { font-size: 26px; font-weight: 700; color: var(--g900); }

/* ── Tables ── */
.bb-table      { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); overflow: hidden; }
.bb-table-head { background: var(--g50); border-bottom: 1px solid var(--g200); padding: 10px 16px; font-size: 11px; font-weight: 700; color: var(--g500); text-transform: uppercase; letter-spacing: .4px; }
.bb-table-row  { padding: 12px 16px; border-bottom: 1px solid var(--g100); font-size: 13px; }
.bb-table-row:last-child { border-bottom: none; }
.bb-table-row:hover { background: var(--g50); }

/* ── Admin layout ── */
.bb-admin-shell   { display: flex; min-height: calc(100vh - var(--nav-h)); }
.bb-admin-sidebar { width: 210px; background: var(--g900); flex-shrink: 0; padding: 12px 0; }
.bb-admin-lbl     { font-size: 10px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .6px; padding: 12px 16px 4px; }
.bb-admin-link    { display: flex; align-items: center; gap: 9px; padding: 9px 16px; font-size: 13px; color: rgba(255,255,255,.65); text-decoration: none; cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.bb-admin-link:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.bb-admin-link.active { color: #fff; background: rgba(27,58,107,.8); }
.bb-admin-nbadge  { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 8px; }
.bb-admin-nbadge.warn { background: #D97706; }
.bb-admin-main    { flex: 1; background: var(--g100); padding: 24px; overflow-y: auto; }
.bb-tabs  { display: flex; background: #fff; border: 1px solid var(--g200); border-radius: 10px; overflow: hidden; margin-bottom: 20px; overflow-x: auto; }
.bb-tab-btn { flex: 1; padding: 10px 6px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--g500); border: none; background: none; text-align: center; white-space: nowrap; min-width: 80px; }
.bb-tab-btn.active { background: var(--navy); color: #fff; }
.bb-tc { display: none; }
.bb-tc.active { display: block; }

/* ── Callout boxes ── */
.bb-safety-box { background: var(--amber-bg); border-radius: var(--r-md); padding: 14px; font-size: 13px; color: var(--amber); line-height: 1.7; }
.bb-info-box   { background: var(--blue-bg); border-radius: var(--r-md); padding: 14px; font-size: 13px; color: #185FA5; line-height: 1.7; }

/* ── Footer ── */
.bb-footer       { background: var(--g900); margin-top: 60px; }
.bb-footer-inner { max-width: 1100px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.bb-footer-logo  { color: #fff; font-size: 18px; font-weight: 700; }
.bb-footer-logo span { color: var(--gold); }
.bb-footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.bb-footer-links a { color: rgba(255,255,255,.5); font-size: 13px; }
.bb-footer-links a:hover { color: #fff; text-decoration: none; }
.bb-footer-copy  { color: rgba(255,255,255,.3); font-size: 12px; }

/* ── Mobile bottom nav bar (phones only) ── */
.bb-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: #fff;
  border-top: 1px solid var(--g200);
  z-index: 300;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.bb-bottom-nav-inner {
  display: flex;
  height: 100%;
}
.bb-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--g400);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
  transition: color .12s;
}
.bb-bottom-nav-item i { font-size: 22px; line-height: 1; }
.bb-bottom-nav-item.active,
.bb-bottom-nav-item:hover { color: var(--navy); text-decoration: none; }
.bb-bottom-nav-item.post {
  background: var(--gold);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin: auto;
  color: var(--navy);
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.bb-bottom-nav-post-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .bb-detail-grid { grid-template-columns: 1fr 280px; }
  .bb-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Explicitly hide mobile-only elements on larger screens.
   Belt-and-suspenders: they already default to display:none,
   but this prevents any edge-case inheritance or override. */
@media (min-width: 769px) {
  .bb-bottom-nav    { display: none !important; }
  .bb-hamburger     { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 768px)
   Desktop nav hidden; hamburger + slide-in menu shown instead
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Show hamburger, hide desktop nav elements */
  .bb-hamburger        { display: flex; }
  .bb-nav-search       { display: none; }
  .bb-nav-right        { display: none; }

  /* Nav only shows logo + hamburger */
  .bb-nav              { padding: 0 16px; gap: 8px; }

  /* Show mobile bottom nav bar */
  .bb-bottom-nav       { display: block; }

  /* Add padding so content isn't under bottom nav */
  body                 { padding-bottom: 58px; }

  /* Detail layout stacks */
  .bb-detail-grid      { grid-template-columns: 1fr; }
  .bb-gallery-main     { height: 260px; }

  /* Browse layout stacks */
  .bb-browse-layout    { flex-direction: column; }
  .bb-sidebar-filter   { width: 100%; }

  /* Admin: hide sidebar, use tab bar only */
  .bb-admin-sidebar    { display: none; }
  .bb-admin-main       { padding: 16px; }

  /* Hero smaller text */
  .bb-hero             { padding: 32px 16px 40px; }
  .bb-hero h1          { font-size: 22px; }

  /* Hero search stacks vertically */
  .bb-hero-search {
    flex-direction: column;
    height: auto;
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .bb-hero-search input  { height: 48px; border-radius: 0; font-size: 16px; }
  .bb-hero-search select { height: 48px; border-radius: 0; border-left: none; border-top: 1px solid var(--g200); max-width: 100%; }
  .bb-hero-search button { height: 50px; border-radius: 0; font-size: 16px; }

  /* Forms: full width */
  .bb-form-wrap        { margin: 16px 12px; padding: 20px 18px; }
  .bb-form-title       { font-size: 20px; }

  /* Cards: 2-column on phones */
  .bb-grid             { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bb-card-img         { height: 120px; }

  /* Metrics: 2-col */
  .bb-metrics-grid     { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Tables scroll horizontally */
  .bb-table            { overflow-x: auto; }

  /* Spec grid single column */
  .bb-specs-grid       { grid-template-columns: 1fr; }

  /* Messages: full height */
  .bb-msg-thread       { min-height: 200px; }
  .bb-msg              { max-width: 92%; }

  /* Input rows stack */
  .bb-input-row        { flex-direction: column; gap: 0; }

  /* Buttons: easier to tap */
  .bb-btn              { padding: 12px 18px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Small phones (≤ 480px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .bb-container        { padding: 0 12px; }
  .bb-grid             { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bb-card-img         { height: 105px; }
  .bb-card-body        { padding: 9px; }
  .bb-card-price       { font-size: 14px; }
  .bb-card-title       { font-size: 12px; }
  .bb-pills            { gap: 6px; }
  .bb-pill             { padding: 5px 12px; font-size: 12px; }
  .bb-hero h1          { font-size: 19px; }
  .bb-detail-price     { font-size: 22px; }
  .bb-detail-title     { font-size: 17px; }
  .bb-section-header   { flex-direction: column; align-items: flex-start; gap: 8px; }
  .bb-form-wrap        { margin: 12px 8px; padding: 18px 14px; }
  .bb-metric-val       { font-size: 22px; }
  .bb-footer-inner     { padding: 24px 16px; }
  .bb-list-img         { width: 72px; height: 72px; }
  .bb-list-title       { font-size: 14px; }
}
