/* Go Local — clean unified CSS */

/* Base */
html, body {
  margin: 0;
  height: 100%;
  width: 100%;
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  background: #f7f7f9;
  color: #1f2c38;
}

/* Grid layout */
#wrap {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 380px 1fr;
}

/* Sidebar */
#sidebar {
  background: #fff;
  border-right: 1px solid #e6e6e6;
  padding: 18px 18px 24px;
  overflow: auto;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.45;
  color: #1f2c38;
}

/* Map */
#map-wrap { position: relative; }
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Header */
.logo { text-align: center; margin-bottom: 12px; }
.logo img { max-width: 72%; height: auto; }
.title { text-align: center; font-weight: 800; font-size: 22px; }
.subtitle { text-align: center; color: #55616c; font-size: 13px; margin-bottom: 14px; }

/* Hide search completely */
.search, #search, #search-go, .search-go-btn {
  display: none !important;
}

/* Category Filters */
.cat-h {
  font-size: 16px;
  font-weight: 800;
  margin: 10px 0 8px;
}
.cats {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #eef1f4;
  padding: 8px;
  border-radius: 10px;
  background: #fbfbfc;
}
.cats label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.cats input {
  width: 18px;
  height: 18px;
}

/* Hide specific categories */
#cats label:has(input[value="Entertainment"]),
#cats label:has(input[value="Retail - Specialty"]),
#cats label:has(input[value="Catering"]) {
  display: none !important;
}

/* Buttons in sidebar */
.actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.btn {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.15px;
  color: #444;
  background: #f6f7f8;
  border: 1px solid #d2d7dc;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover {
  background: #eaeef2;
  border-color: #c4c9ce;
  color: #222;
}
.btn:active {
  background: #e0e4e8;
  transform: translateY(1px);
}

/* Random block (sidebar desktop) */
.random {
  text-align: center;
  margin-top: 12px;
}
.random .go {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  border-radius: 12px;
  padding: 10px 16px;
  background: #2b79c2;
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.random .go:hover {
  background: #1a5b91;
  transform: translateY(-1px);
}
.random .go:active {
  transform: translateY(1px);
}
.random .help {
  margin-top: 8px;
  font-size: 12px;
  color: #555;
}

/* Legend */
.legend {
  border: 1px solid #e5e9ee;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
}
.legend h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}
.legend .legend-explain {
  display: block;
  white-space: normal;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.85;
  margin-top: 6px;
}
.legend .legend-explain a {
  color: #2b79c2;
  text-decoration: none;
  font-weight: 600;
  transition: color .15s ease, text-decoration .15s ease;
}
.legend .legend-explain a:hover,
.legend .legend-explain a:focus {
  color: #1a5b91;
  text-decoration: underline;
}

.row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.sw {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* Badge */
.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2147483642;
  pointer-events: auto;
}
.badge img {
  display: block;
  height: 100px;
  width: auto;
}
@media (max-width: 950px) {
  .badge img { height: 96px; }
  body.sidebar-open .badge {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
@media (min-width: 951px){
  .badge img { height: 130px; }
}

/* Chamber logo */
@media (min-width:951px){
  #map-chamber-logo { display:none !important; }
}
@media (max-width:950px){
  #map-chamber-logo{
    position:absolute;
    top:8px;
    left:50%;
    transform:translateX(-50%);
    z-index:2147483641;
  }
  #map-chamber-logo img{
    height:44px;
    width:auto;
    padding-right:30px;
  }
}

/* Close button visibility */
@media (min-width:951px){
  #sidebar-close { display:none !important; }
}
@media (max-width:950px){
  #sidebar-close{
    position:sticky;
    top:8px;
    margin-bottom:10px;
    background:#fff;
    border:1px solid #ccc;
    border-radius:10px;
    font-weight:700;
    padding:8px 12px;
    cursor:pointer;
  }
}

/* Mobile layout */
@media (max-width:950px){
  #wrap{
    grid-template-columns:1fr;
    grid-template-rows:auto 1fr;
  }
  #sidebar{
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:min(92vw,420px);
    transform:translateX(-102%);
    transition:transform .28s ease;
    z-index:2147483665;
    background:#fff;
    box-shadow:0 18px 50px rgba(0,0,0,.25);
  }
  body.sidebar-open #sidebar{ transform:translateX(0); }
  #map-wrap{ height:100dvh; }
}

/* Remove overlay entirely */
#overlay {
  display: none !important;
  background: none !important;
  pointer-events: none !important;
}
body.sidebar-open #overlay {
  display: none !important;
}

/* Mobile toggle */
#mobile-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid #d7dbe0;
  background: rgba(255,255,255,0.96);
  font: 700 22px/46px Montserrat, system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  z-index: 2147483663;
}
@media (min-width: 951px) {
  #mobile-toggle { display: none; }
}

/* Desktop: inline "i" button next to Surprise Me */
.info-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:999px;
  cursor:pointer;
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  font:700 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:#0B6AA2;
}

#rand-info-inline { display:none; }
@media (min-width:951px){
  #rand-info-inline{ display:inline-flex; margin-left:8px; }
}

/* Base: hide mobile floating info by default on desktop */
#rand-info {
  display: none;
}

/* Mapbox controls */
.mapboxgl-ctrl-bottom-right { margin: 10px; }
@media (max-width: 950px){
  .mapboxgl-ctrl-bottom-right { margin: 12px; }
  .mapboxgl-ctrl-group > button {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
    line-height: 40px !important;
  }
  .mapboxgl-ctrl-group {
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    border-radius: 10px;
  }
}

/* Popup typography + sizing */
.mapboxgl-popup {
  z-index: 2147483661; /* above map UI, below sidebar */
}
.mapboxgl-popup-content {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  padding: 18px 20px 16px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 14px 30px rgba(0,0,0,0.22);
}
.mapboxgl-popup-content h4 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.mapboxgl-popup-content .links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mapboxgl-popup-content .links a {
  color: #2b79c2;
  font-weight: 600;
  text-decoration: none;
}
.mapboxgl-popup-content .links a:hover,
.mapboxgl-popup-content .links a:focus {
  color: #1a5b91;
  text-decoration: underline;
}
@media (max-width: 950px){
  .mapboxgl-popup-content {
    font-size: 16px;
    line-height: 1.5;
  }
}
.mapboxgl-popup-close-button {
  font-size: 18px;
}

/* Loading overlay */
#map-loading{
  position:fixed;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:#fff;
  z-index:2147483667;
  transition:opacity .25s ease;
  opacity:1;
  pointer-events:auto;
  font-family:Montserrat, system-ui, sans-serif;
}
#map-loading.hide{
  opacity:0;
  pointer-events:none;
}
#map-loading .spinner{
  width:28px;
  height:28px;
  border-radius:50%;
  border:3px solid #cfd6dd;
  border-top-color:#2b79c2;
  animation:spin .8s linear infinite;
  margin-bottom:10px;
}
#map-loading .msg{
  color:#2b79c2;
  font-weight:700;
  font-size:14px;
}
@keyframes spin{ to { transform:rotate(360deg); } }

/* Surprise Me info popup overlay */
#rand-info-pop{
  position: fixed;
  z-index: 2147483666;
  display: none;
  background: #fff;
  color: #111;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  width: min(320px, calc(100vw - 32px));
  padding: 12px 12px 8px;
  font-family: "Montserrat",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
}
#rand-info-pop.show{
  display:block;
}
#rand-info-pop .hdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
  font-weight:600;
  font-size:15px;
}
#rand-info-pop .close{
  background:transparent;
  border:none;
  font:800 16px/1 system-ui;
  cursor:pointer;
  color:#555;
}
#rand-info-pop p{ margin:0 0 8px 0; }

/* Desktop: popup position is computed in JS */
@media (min-width: 951px){
  #rand-info-pop[data-pos="anchor"]{ }
}

/* Mobile: popup sits above the “i” button; JS fine-tunes exact coords */
@media (max-width: 950px){
  #rand-info-pop{
    right: 16px;
    bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}

/* ===================== MOBILE FAB + INFO ===================== */

@media (max-width: 950px){
  /* Hide sidebar Surprise Me + inline info on mobile */
  .random .go,
  .random .help,
  #rand-info-inline {
    display: none !important;
  }

  /* Layout variables for FAB + info icon */
  :root{
    --fab-width: 220px;     /* width of Surprise Me on mobile */
    --fab-gap: 12px;        /* gap between button and "i" */
    --fab-icon: 44px;       /* diameter of info button */
    --fab-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  /* Surprise Me floating FAB */
  #rand-fab{
    position: fixed !important;
    bottom: var(--fab-bottom) !important;
    left: 50% !important;
    width: var(--fab-width) !important;
    transform: translateX(calc(-50% - (var(--fab-icon) + var(--fab-gap)) / 2)) !important;
    z-index: 2147483662 !important;

    border: none;
    border-radius: 16px;
    padding: 16px 22px;
    background: #2b79c2;
    color: #fff;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
  }
  #rand-fab:hover,
  #rand-fab:focus {
    background: #1f5f99;
  }
  #rand-fab:active {
    background: #184c7b;
    transform: translateX(calc(-50% - (var(--fab-icon) + var(--fab-gap)) / 2)) translateY(2px);
  }

  /* Floating info "i" button to the right of FAB */
  #rand-info{
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    position: fixed !important;
    bottom: var(--fab-bottom) !important;
    left: calc(50% + (var(--fab-width) / 2) + (var(--fab-gap) / 2)) !important;

    width: var(--fab-icon);
    height: var(--fab-icon);
    border-radius: 999px;

    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    font: 700 18px/1 Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: #0B6AA2;
    z-index: 2147483663;
    cursor: pointer;
  }

  /* Hide FAB + info when sidebar is open */
  body.sidebar-open #rand-fab,
  body.sidebar-open #rand-info{
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Desktop: keep FAB hidden entirely */
@media (min-width: 951px){
  #rand-fab{ display: none !important; }
}
