/* ── Base ────────────────────────────────────────────────────── */
#bb-wrapper, #bb-formular-wrapper {
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
}
#bb-wrapper *, #bb-formular-wrapper * { box-sizing: border-box; }

/* ── Suchleiste ──────────────────────────────────────────────── */
#bb-suche-bar {
  background: #fff;
  border: 1px solid #e8e8e8;
  padding: 12px 16px;
  margin-bottom: 0;
  border-bottom: none;
}
.bb-suche-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.bb-suche-row input[type="text"],
.bb-suche-row select {
  padding: 8px 11px;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  border: 1px solid #e0e0e0;
  background: #fff;
  transition: border-color .2s;
  height: 36px;
}
.bb-suche-row input:focus,
.bb-suche-row select:focus { border-color: #ffc107; outline: none; }
#bb-suche          { flex: 1.5; min-width: 150px; }
#bb-stadt          { flex: 1;   min-width: 130px; }
#bb-branche-filter { min-width: 150px; }
.bb-radius-wrap    { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bb-radius-wrap label { font-size: 13px; color: #777; font-family: inherit; }
#bb-radius         { min-width: 85px; height: 36px; cursor: pointer; }

#bb-stadt-fehler { margin-top: 6px; font-size: 12px; color: #c62828; font-family: inherit; }
#bb-treffer-info  { margin-top: 6px; min-height: 18px; }
.bb-treffer-badge {
  display: inline-block; font-size: 12px; font-family: inherit;
  background: #fff8e1; color: #7a5000;
  padding: 2px 10px; border-left: 3px solid #ffc107;
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP LAYOUT (>768px)
══════════════════════════════════════════════════════════════ */
#bb-mobile-map,
#bb-mobile-list,
#bb-mobile-detail { display: none; }

#bb-map-container {
  position: relative;
  width: 100%;
  height: 650px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  display: block;
}

/* Karte füllt den gesamten Container */
#bb-karte {
  position: absolute;
  top: 0; left: 280px; right: 0; bottom: 0;
  z-index: 1;
  transition: left .3s ease;
}

/* Wenn Detail-Panel offen: Karte etwas einengen */
#bb-map-container.detail-open #bb-karte {
  right: 340px;
}

/* ── Desktop Listenleiste (links, wie Google Maps) ────────────── */
#bb-sidebar-list {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#bb-sidebar-list::-webkit-scrollbar { width: 4px; }
#bb-sidebar-list::-webkit-scrollbar-thumb { background: #ffc107; }

/* ── Desktop List-Item (Google Maps Stil) ─────────────────────── */
.bb-list-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.bb-list-item:hover    { background: #fffde7; }
.bb-list-item.active   { background: #fff8e1; border-left: 3px solid #ffc107; padding-left: 11px; }

.bb-list-thumb {
  width: 42px; height: 34px; flex-shrink: 0;
  object-fit: contain; border: 1px solid #eee;
}
.bb-list-initials {
  width: 42px; height: 34px; flex-shrink: 0;
  background: #ffc107; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; font-family: inherit;
}
.bb-list-info { flex: 1; min-width: 0; }
.bb-list-name {
  font-size: 13px; font-weight: 600; font-family: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.bb-list-meta { font-size: 11px; color: #777; font-family: inherit; line-height: 1.5; }

/* ── Detail-Panel Desktop ─────────────────────────────────────── */
#bb-detail-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  background: #fff;
  border-left: 1px solid #e0e0e0;
  z-index: 20;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s ease;
}
#bb-detail-panel.open { transform: translateX(0); }
#bb-detail-panel::-webkit-scrollbar { width: 4px; }
#bb-detail-panel::-webkit-scrollbar-thumb { background: #ffc107; }

#bb-detail-close {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: flex-end;
  width: 100%; padding: 10px 12px;
  background: #fff; border: none; border-bottom: 1px solid #f0f0f0;
  font-size: 20px; color: #999; cursor: pointer; font-family: inherit;
  z-index: 5;
}
#bb-detail-close:hover { color: #333; }

/* ── Marker: Runder Pin wie Google Maps ───────────────────────── */
.bb-marker-icon { background: none; border: none; }
.bb-pin {
  width: 28px; height: 28px;
  background: #ffc107;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .15s, background .15s;
  cursor: pointer;
}
.bb-pin.active {
  background: #e0a800;
  transform: scale(1.3);
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
}
.bb-center-pin {
  width: 14px; height: 14px; background: #1a73e8;
  border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* ── Detail-Inhalt ────────────────────────────────────────────── */
#bb-detail-content { padding: 16px; }
.bb-detail-logo {
  width: 100%; max-height: 130px; object-fit: contain;
  border: 1px solid #f0f0f0; margin-bottom: 14px; display: block;
}
.bb-detail-initials {
  width: 100%; height: 80px; background: #ffc107; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; font-family: inherit; margin-bottom: 14px;
}
.bb-detail-name { font-size: 16px; font-weight: 700; font-family: inherit; margin: 0 0 8px; }
.bb-detail-badges { margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.bb-detail-section { margin-bottom: 12px; }
.bb-detail-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: #999; font-family: inherit; margin-bottom: 2px;
}
.bb-detail-value { font-size: 13px; color: #333; font-family: inherit; line-height: 1.5; }
.bb-detail-value a { color: #1a73e8; text-decoration: none; }
.bb-detail-value a:hover { text-decoration: underline; }
.bb-detail-desc {
  font-size: 13px; color: #555; font-family: inherit; line-height: 1.6;
  border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 4px;
}
.bb-detail-website-btn {
  display: block; width: 100%; margin-top: 14px; padding: 10px;
  text-align: center; background: #ffc107; color: #fff;
  font-family: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; border: none; cursor: pointer; transition: background .2s;
}
.bb-detail-website-btn:hover { background: #e0a800; color: #fff; }

.bb-badge {
  display: inline-block; background: #15cd72; color: #fff;
  font-size: 11px; padding: 2px 7px; font-family: inherit; font-weight: 600;
}
.bb-dist-badge {
  display: inline-block; background: #ffc107; color: #fff;
  font-size: 11px; padding: 2px 7px; font-family: inherit; font-weight: 600;
}

#bb-loading, .bb-leer {
  padding: 20px; text-align: center; font-size: 13px;
  color: #777; font-family: inherit;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE LAYOUT (≤768px) — wie Google Maps App
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Desktop-Elemente ausblenden */
  #bb-map-container { display: none !important; }

  /* Mobile Karte */
  #bb-mobile-map {
    display: block;
    width: 100%;
    height: 55vw;
    min-height: 240px;
    max-height: 360px;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    position: relative;
    z-index: 1;
  }

  /* Mobile horizontale Karten-Leiste */
  #bb-mobile-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding: 12px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-top: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  #bb-mobile-list::-webkit-scrollbar { display: none; }

  #bb-mobile-loading {
    padding: 16px; text-align: center;
    font-size: 13px; color: #777; font-family: inherit;
    width: 100%; flex-shrink: 0;
  }

  /* Mobile Karte (Google-Maps-Stil) */
  .bb-mobile-card {
    flex-shrink: 0;
    width: 220px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    scroll-snap-align: start;
    transition: box-shadow .2s, border-color .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }
  .bb-mobile-card:hover,
  .bb-mobile-card.active {
    border-color: #ffc107;
    box-shadow: 0 2px 8px rgba(255,193,7,.25);
  }
  .bb-mobile-card-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  }
  .bb-mobile-thumb {
    width: 36px; height: 28px; object-fit: contain; border: 1px solid #eee; flex-shrink: 0;
  }
  .bb-mobile-initials {
    width: 36px; height: 28px; flex-shrink: 0;
    background: #ffc107; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; font-family: inherit;
    border-radius: 4px;
  }
  .bb-mobile-name {
    font-size: 13px; font-weight: 700; font-family: inherit;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
  }
  .bb-mobile-meta { font-size: 11px; color: #777; font-family: inherit; line-height: 1.6; }

  /* Mobile Detail: Vollbild-Overlay von unten */
  #bb-mobile-detail {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    flex-direction: column;
  }
  #bb-mobile-detail.open { display: flex; }

  #bb-mobile-detail-header {
    position: sticky; top: 0;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    z-index: 5;
  }
  #bb-mobile-detail-close {
    background: none; border: none; font-size: 15px; font-family: inherit;
    color: #1a73e8; cursor: pointer; padding: 0; font-weight: 600;
  }
  #bb-mobile-detail-content { padding: 16px; flex: 1; }

  /* Suchleiste auf Mobil */
  .bb-suche-row { flex-direction: column; }
  .bb-suche-row input, .bb-suche-row select { width: 100%; min-width: 0; }
  .bb-radius-wrap { width: 100%; justify-content: space-between; }
  #bb-radius { flex: 1; margin-left: 8px; }
}

/* ══════════════════════════════════════════════════════════════
   FORMULAR
══════════════════════════════════════════════════════════════ */
#bb-formular-wrapper { max-width: 680px; margin: 0 auto; }
#bb-formular-wrapper h3 { font-family: inherit; font-weight: 700; margin-bottom: 4px; }
#bb-formular-wrapper > p { color: #777; font-size: 14px; }

.bb-progress-container { margin: 20px 0 6px; background: #f0f0f0; height: 4px; overflow: hidden; }
.bb-progress-bar { height: 100%; background: #ffc107; transition: width .35s ease; width: 0%; }
.bb-step-label { font-size: 12px; color: #777; margin-bottom: 20px; font-family: inherit; }

.bb-step { display: none; }
.bb-step[data-step="1"] { display: block; }
.bb-step-title {
  font-size: 15px; font-weight: 700; font-family: inherit;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #ffc107;
}
.bb-step-hint { font-size: 13px; color: #777; margin: -8px 0 16px; font-family: inherit; }

.bb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.bb-full { grid-column: 1 / -1; }
.bb-form-gruppe { display: flex; flex-direction: column; gap: 5px; }
.bb-form-gruppe label { font-size: 13px; font-weight: 600; font-family: inherit; }
.bb-required { color: #e53935; }
.bb-form-gruppe input,
.bb-form-gruppe select,
.bb-form-gruppe textarea {
  padding: 9px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid #e0e0e0; color: inherit; background: #fff;
  transition: border-color .2s; width: 100%;
}
.bb-form-gruppe input:focus,
.bb-form-gruppe select:focus,
.bb-form-gruppe textarea:focus { border-color: #ffc107; outline: none; }
.bb-form-gruppe input.bb-invalid { border-color: #e53935; }
.bb-form-gruppe small { font-size: 11px; color: #999; }

.bb-logo-upload-box {
  border: 2px dashed #e0e0e0; padding: 20px; text-align: center;
  cursor: pointer; transition: border-color .2s; position: relative;
}
.bb-logo-upload-box:hover { border-color: #ffc107; }
.bb-logo-upload-box input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
#bb-logo-placeholder { color: #aaa; font-size: 13px; font-family: inherit; }
#bb-logo-preview { max-width: 120px; max-height: 70px; object-fit: contain; display: none; }

.bb-form-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.bb-btn-prev {
  font-family: inherit; font-weight: 600; padding: 9px 20px; font-size: 14px;
  cursor: pointer; background: #f5f5f5; color: inherit; border: 1px solid #e0e0e0;
  transition: background .2s;
}
.bb-btn-prev:hover { background: #ebebeb; }
.bb-btn-next, .bb-btn-submit {
  font-family: inherit; font-weight: 600; padding: 9px 24px; font-size: 14px;
  cursor: pointer; background: #ffc107; color: #fff; border: none; transition: background .2s;
}
.bb-btn-next:hover, .bb-btn-submit:hover { background: #e0a800; }
.bb-btn-submit:disabled { background: #ccc; cursor: not-allowed; }

#bb-form-meldung {
  padding: 14px 18px; margin-bottom: 16px;
  font-size: 14px; font-family: inherit; border-left: 4px solid;
}
.bb-success { background: #f0fdf4; color: #166534; border-color: #15cd72; }
.bb-error   { background: #fff1f1; color: #c62828; border-color: #e53935; }

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