/* =====================================================================
   BSW-Bricks — Toypro-stijl design tokens & components
   ===================================================================== */

:root {
  --bb-yellow: #FFD500;
  --bb-yellow-dark: #E6BF00;
  --bb-ink: #1A1A1A;
  --bb-ink-2: #4A4A4A;
  --bb-muted: #8A8A8A;
  --bb-line: #E6E6E6;
  --bb-bg: #FFFFFF;
  --bb-bg-2: #FAFAFA;
  --bb-accent: #E63946;
  --bb-success: #06A77D;
  --bb-radius: 8px;
  --bb-radius-pill: 999px;
  --bb-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --bb-shadow-card: 0 4px 16px rgba(0,0,0,0.08);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; color: var(--bb-ink); background: var(--bb-bg); }
:focus-visible { outline: 2px solid var(--bb-yellow-dark); outline-offset: 2px; }
button:focus-visible, .bb-add-btn:focus-visible, .bb-btn-primary:focus-visible { outline-color: var(--bb-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 0; left: 0; transform: translateY(-100%); background: var(--bb-yellow); color: var(--bb-ink); padding: 8px 16px; z-index: 10000; text-decoration: none; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
body { margin: 0; }
body { line-height: 1.55; }
a { color: var(--bb-ink); text-decoration: none; }
a:hover { color: var(--bb-accent); }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Header ---------- */
.bb-header { border-bottom: 1px solid var(--bb-line); position: sticky; top: 0; z-index: 100; background: var(--bb-bg); }
.bb-header-top { background: var(--bb-ink); color: #fff; font-size: 12px; padding: 8px 0; }
.bb-header-top-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.bb-locale-switcher { display: flex; gap: 8px; }
.bb-locale-switcher a { color: rgba(255,255,255,0.6); text-transform: uppercase; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.bb-locale-switcher a.is-active { color: var(--bb-yellow); background: rgba(255,213,0,0.12); }

.bb-header-main { padding: 18px 0; }
.bb-header-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 24px; align-items: center; }
.bb-logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.bb-logo span { color: var(--bb-accent); }
.bb-search { position: relative; }
.bb-search input { width: 100%; padding: 12px 48px 12px 16px; border: 2px solid var(--bb-line); border-radius: var(--bb-radius); font-size: 15px; outline: none; transition: border-color 0.15s; }
.bb-search input:focus { border-color: var(--bb-yellow-dark); }
.bb-search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--bb-yellow); color: var(--bb-ink); padding: 8px 14px; border-radius: var(--bb-radius); font-weight: 700; cursor: pointer; }
.bb-search button:hover { background: var(--bb-yellow-dark); }
.bb-cart-link { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--bb-line); border-radius: var(--bb-radius); font-weight: 600; }
.bb-cart-link .count { background: var(--bb-accent); color: #fff; padding: 1px 8px; border-radius: var(--bb-radius-pill); font-size: 12px; font-weight: 700; }
.bb-account-link { color: var(--bb-ink-2); font-weight: 500; padding: 8px 12px; }

.bb-nav { background: var(--bb-yellow); border-bottom: 1px solid var(--bb-yellow-dark); }
.bb-nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; gap: 28px; }
.bb-nav a { display: block; padding: 14px 0; font-weight: 700; font-size: 15px; }
.bb-nav a:hover { color: var(--bb-accent); }

/* ---------- Hero / 3-step Toypro flow ---------- */
.bb-hero { background: linear-gradient(135deg, #fffbe5 0%, #fff8d6 100%); padding: 60px 24px; }
.bb-hero-inner { max-width: 980px; margin: 0 auto; text-align: center; }
.bb-hero h1 { font-size: 42px; font-weight: 800; margin: 0 0 12px; letter-spacing: -1px; }
.bb-hero p { font-size: 18px; color: var(--bb-ink-2); margin: 0 0 32px; }

.bb-3step { background: var(--bb-ink); color: #fff; border-radius: 16px; padding: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.bb-3step-col { text-align: left; }
.bb-3step-num { display: inline-flex; width: 32px; height: 32px; background: var(--bb-yellow); color: var(--bb-ink); border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px; }
.bb-3step-col h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.bb-3step-col p { margin: 0 0 16px; font-size: 13px; color: rgba(255,255,255,0.7); }
.bb-3step-input { width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; font-size: 15px; }

@media (max-width: 700px) {
  .bb-hero h1 { font-size: 28px; }
  .bb-3step { grid-template-columns: 1fr; padding: 24px; }
  .bb-header-inner { grid-template-columns: auto 1fr; }
  .bb-search { grid-column: 1 / -1; order: 3; }
}

/* ---------- Search autocomplete ---------- */
.bb-suggest { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--bb-line); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow-card); margin-top: 6px; max-height: 480px; overflow: auto; display: none; z-index: 1000; }
.bb-suggest-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--bb-line); text-decoration: none; color: var(--bb-ink); }
.bb-suggest-item:hover { background: var(--bb-bg-2); }
.bb-suggest-item img { width: 40px; height: 40px; object-fit: contain; background: var(--bb-bg-2); border-radius: 4px; padding: 4px; flex: 0 0 40px; }
.bb-suggest-text { flex: 1; min-width: 0; }
.bb-suggest-no { font-family: ui-monospace, monospace; font-size: 11px; color: var(--bb-muted); }
.bb-suggest-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-suggest-price { font-weight: 700; font-size: 13px; color: var(--bb-ink); flex: 0 0 auto; }
.bb-suggest-all { display: block; padding: 10px 14px; text-align: center; font-weight: 700; font-size: 13px; background: var(--bb-yellow); color: var(--bb-ink); }

/* ---------- Catalog ---------- */
.bb-wrap { max-width: 1280px; margin: 0 auto; padding: 24px; }
/* Mobiel: minder side-padding zodat content meer breedte krijgt. */
@media (max-width: 600px) {
  .bb-wrap { padding: 14px; }
}
.bb-page-head { margin: 24px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.bb-page-head h1 { font-size: 28px; font-weight: 800; margin: 0; }
.bb-page-head .meta { color: var(--bb-muted); font-size: 14px; }

.bb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.bb-card { background: var(--bb-bg); border: 1px solid var(--bb-line); border-radius: var(--bb-radius); overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.bb-card:hover { transform: translateY(-2px); box-shadow: var(--bb-shadow-card); }
.bb-card-img { position: relative; aspect-ratio: 1; background: var(--bb-bg-2); display: flex; align-items: center; justify-content: center; padding: 12px; }
.bb-card-img img { max-width: 80%; max-height: 80%; object-fit: contain; }
.bb-card-price { position: absolute; top: 8px; right: 8px; background: var(--bb-yellow); color: var(--bb-ink); padding: 4px 10px; border-radius: var(--bb-radius-pill); font-weight: 700; font-size: 13px; }
.bb-card-body { padding: 12px; }
.bb-card-no { font-size: 11px; color: var(--bb-muted); font-family: ui-monospace, monospace; }
.bb-card-name { font-size: 13px; font-weight: 600; margin: 4px 0; line-height: 1.4; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-card-meta { font-size: 11px; color: var(--bb-muted); margin-top: 4px; }

/* Favoriet-knop op category-card */
.bb-card-wrap {
  position: relative;
  display: block;             /* anders rendert inline-flow met afgekapte border */
  background: var(--bb-bg);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.bb-card-wrap:hover { transform: translateY(-2px); box-shadow: var(--bb-shadow-card); }
.bb-card-wrap .bb-card { border: 0; border-radius: 0; transition: none; }
.bb-card-wrap .bb-card:hover { transform: none; box-shadow: none; }
.bb-fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--bb-line);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--bb-muted);
  transition: color .15s, background .15s, transform .15s;
  z-index: 2;
}
.bb-fav-btn:hover { color: #e11d48; transform: scale(1.08); }
.bb-fav-btn.is-fav { color: #e11d48; background: rgba(255, 228, 230, 0.95); }
.bb-fav-btn.is-fav svg { fill: currentColor; }

/* ---------- PDP ---------- */
.bb-pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin: 32px 0; }
.bb-pdp-img { background: var(--bb-bg-2); border-radius: var(--bb-radius); padding: 40px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; min-width: 0; }
.bb-pdp-img img { max-width: 100%; max-height: 400px; object-fit: contain; }
.bb-pdp-info { min-width: 0; }
.bb-pdp-info h1 { font-size: 28px; margin: 0 0 8px; word-break: break-word; }
.bb-pdp-info .item-no { font-family: ui-monospace, monospace; color: var(--bb-muted); font-size: 13px; }

.bb-pdp-listings { margin-top: 24px; overflow-x: auto; }
.bb-pdp-listings table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bb-pdp-listings th { text-align: left; padding: 10px; border-bottom: 1px solid var(--bb-line); font-size: 11px; text-transform: uppercase; color: var(--bb-muted); }
.bb-pdp-listings td { padding: 10px; border-bottom: 1px solid var(--bb-line); vertical-align: middle; }
.bb-color-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; margin-right: 8px; border: 1px solid rgba(0,0,0,0.1); }
.bb-add-btn { background: var(--bb-yellow); border: 0; padding: 8px 14px; border-radius: var(--bb-radius); font-weight: 700; cursor: pointer; font-size: 13px; }
.bb-add-btn:hover { background: var(--bb-yellow-dark); }
.bb-add-btn:disabled { background: var(--bb-line); cursor: not-allowed; color: var(--bb-muted); }

/* ---------- Image lightbox ---------- */
.bb-pdp-img { cursor: zoom-in; position: relative; transition: background 0.2s; }
.bb-pdp-listings tbody tr { cursor: pointer; transition: background 0.12s; }
.bb-pdp-listings tbody tr:hover { background: rgba(255,213,0,0.08); }
.bb-pdp-listings tbody tr.is-selected { background: rgba(255,213,0,0.18); border-left: 3px solid var(--bb-yellow-dark); }
.bb-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; }
.bb-lightbox.is-open { display: flex; }
.bb-lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.bb-lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 36px; background: none; border: 0; cursor: pointer; line-height: 1; }

/* ---------- Cart / Checkout ---------- */
.bb-cart-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; margin: 32px 0; }
.bb-cart-table { width: 100%; border-collapse: collapse; }
.bb-cart-table th { text-align: left; padding: 12px; font-size: 11px; text-transform: uppercase; color: var(--bb-muted); border-bottom: 1px solid var(--bb-line); }
.bb-cart-table td { padding: 14px 12px; border-bottom: 1px solid var(--bb-line); vertical-align: middle; }
.bb-cart-table img { width: 60px; height: 60px; object-fit: contain; background: var(--bb-bg-2); border-radius: 4px; padding: 4px; }
.bb-cart-summary { background: var(--bb-bg-2); border: 1px solid var(--bb-line); border-radius: var(--bb-radius); padding: 24px; height: fit-content; position: sticky; top: 100px; }
.bb-cart-summary-row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 14px; }
.bb-cart-summary-total { font-size: 20px; font-weight: 800; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--bb-line); }
.bb-btn-primary { display: block; width: 100%; padding: 14px; background: var(--bb-ink); color: #fff; text-align: center; border-radius: var(--bb-radius); font-weight: 700; border: 0; cursor: pointer; font-size: 15px; }
.bb-btn-primary:hover { background: var(--bb-ink-2); }
.bb-btn-ghost { display: inline-block; padding: 10px 16px; border: 1px solid var(--bb-line); border-radius: var(--bb-radius); font-weight: 600; }

.bb-empty { text-align: center; padding: 80px 24px; color: var(--bb-muted); }
.bb-empty h2 { color: var(--bb-ink); font-size: 24px; margin: 16px 0 8px; }

.bb-form-row { margin: 12px 0; }
.bb-form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--bb-ink-2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.bb-form-row input, .bb-form-row select { width: 100%; padding: 10px 12px; border: 1px solid var(--bb-line); border-radius: var(--bb-radius); font-size: 14px; outline: none; }
.bb-form-row input:focus, .bb-form-row select:focus { border-color: var(--bb-yellow-dark); }
.bb-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 800px) {
  .bb-pdp, .bb-cart-grid { grid-template-columns: 1fr; }
  .bb-cart-summary { position: static; }
}

/* ---------- Mobile bottom-nav ---------- */
.bb-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--bb-line); z-index: 100; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,0.06); }
.bb-bottom-nav-inner { display: flex; justify-content: space-around; align-items: center; max-width: 600px; margin: 0 auto; }
.bb-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; font-size: 10px; font-weight: 600; color: var(--bb-ink-2); text-decoration: none; min-width: 56px; position: relative; }
.bb-bottom-nav a.is-active { color: var(--bb-accent); }
.bb-bottom-nav .icon { font-size: 22px; line-height: 1; }
.bb-bottom-nav .badge { position: absolute; top: 4px; right: 8px; background: var(--bb-accent); color: #fff; border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 700; }
@media (max-width: 700px) {
  .bb-bottom-nav { display: block; }
  body { padding-bottom: 64px; }
  .bb-nav { display: none; }
}

/* Staging-switcher (devops bar) niet overlappen — bb-bottom-nav iets hoger */
#bsw-staging-bar { bottom: 0 !important; }
@media (max-width: 700px) {
  .bb-bottom-nav { bottom: 50px; } /* maak ruimte voor staging-bar (max 50px hoog) */
  body { padding-bottom: 120px; }
}

/* ---------- Footer ---------- */
.bb-footer { background: var(--bb-ink); color: #fff; padding: 48px 24px; margin-top: 64px; }
.bb-footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.bb-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 12px; color: var(--bb-yellow); }
.bb-footer a { color: rgba(255,255,255,0.7); display: block; padding: 4px 0; font-size: 14px; }
.bb-footer a:hover { color: #fff; }
.bb-footer-legal { max-width: 1280px; margin: 32px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: rgba(255,255,255,0.5); }

@media (max-width: 700px) {
  .bb-footer-inner { grid-template-columns: 1fr 1fr; }
}
