/* CityBoard Map — responsive layout & bottom sheet */

@media (max-width: 767px) {
  .cb-map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .cb-map-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8600;
    max-height: 72vh;
    border-right: 0;
    border-top: 1px solid var(--cb-map-border);
    border-radius: var(--cb-map-radius-lg) var(--cb-map-radius-lg) 0 0;
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.14);
    transform: translateY(calc(100% - 56px));
    transition: transform var(--cb-map-transition);
  }

  .cb-map-panel.is-expanded {
    transform: translateY(0);
  }

  .cb-map-panel.is-hidden-mobile {
    transform: translateY(100%);
    pointer-events: none;
  }

  .cb-map-panel__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 10px 16px 6px;
    cursor: pointer;
  }

  .cb-map-panel__handle::before {
    content: "";
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: #cbd5e1;
  }

  .cb-map-panel__search,
  .cb-map-panel__filters {
    display: none;
  }

  .cb-map-panel.is-expanded .cb-map-panel__search,
  .cb-map-panel.is-expanded .cb-map-panel__filters {
    display: block;
  }

  .cb-map-stage {
    grid-row: 1;
    min-height: 100%;
  }

  .cb-map-mobile-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 8700;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }

  .cb-map-mobile-bar .cb-map-btn,
  .cb-map-mobile-bar .cb-map-filter-chip {
    pointer-events: auto;
    box-shadow: var(--cb-map-shadow-float);
  }

  .cb-map-page[data-cb-mobile-panel="list"] .cb-map-panel {
    transform: translateY(0);
  }

  .cb-map-page[data-cb-mobile-panel="list"] .cb-map-mobile-bar [data-cb-mobile-show="list"] {
    background: var(--cb-map-blue);
    color: #fff;
    border-color: var(--cb-map-blue);
  }

  .cb-map-controls {
    bottom: 72px;
    right: 12px;
  }

  .cb-map-search-area {
    top: 12px;
  }
}

@media (min-width: 768px) {
  .cb-map-panel__handle,
  .cb-map-mobile-bar {
    display: none !important;
  }
}

/* RE map legacy mobile */
@media (max-width: 767px) {
  .re-map-page .re-map-shell.cb-map-layout {
    grid-template-columns: 1fr;
  }

  .re-map-page .re-map-results.cb-map-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8600;
    max-height: 72vh;
    border-right: 0;
    border-top: 1px solid var(--cb-map-border);
    border-radius: var(--cb-map-radius-lg) var(--cb-map-radius-lg) 0 0;
    transform: translateY(calc(100% - 56px));
    transition: transform var(--cb-map-transition);
  }

  .re-map-page[data-re-mobile-panel="list"] .re-map-results.cb-map-panel {
    transform: translateY(0);
  }

  .re-map-page[data-re-mobile-panel="map"] .re-map-results.cb-map-panel {
    transform: translateY(calc(100% - 56px));
  }

  .re-map-mobile-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 8700;
    display: flex;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .re-map-mobile-bar .cb-btn {
    flex: 1;
    min-height: 44px;
    border-radius: var(--cb-map-radius);
    box-shadow: var(--cb-map-shadow-float);
  }

  .re-map-controls {
    bottom: 72px;
  }
}

/* Filter drawer / bottom sheet */
.cb-map-filter-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8800;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--cb-map-radius-lg) var(--cb-map-radius-lg) 0 0;
  box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.18);
  transform: translateY(100%);
  transition: transform var(--cb-map-transition);
}

.cb-map-filter-sheet.is-open {
  transform: translateY(0);
}

.cb-map-filter-sheet[hidden] {
  display: none !important;
}

@media (min-width: 768px) {
  .re-map-results.is-filters-open .re-map-filters-panel.cb-map-filter-sheet {
    position: static;
    transform: none;
    width: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Catalog map strip — legacy panel rules removed (see cb-catalog-map-4-2-166.css) */
