:root {
  --brand: #003048;
  --brand-2: #005a7c;
  --surface: #ffffff;
  --muted: #667085;
  --line: #d8dee4;
  --available: #97dd00;
  --unavailable: #667085;
  --reserved: #D18D07;
  --sold: #772904;
  --branco: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #17212b;
  background: #eef2f5;
  font-family: Roboto, Arial, sans-serif;
}
.cls-3 {
  fill: #005a7f;
}
.cls-6 {
  fill: #003048;
}
.cls-9 {
  fill: #b7b16c;
}
.cls-11 {
  fill: #025c42;
}
.cls-13 {
  fill: #00405b;
}
.cls-14 {
  fill: #988e60;
}
.cls-17 {
  fill: #e1dcb2;
}
.cls-21 {
  fill: #545454;
}
.cls-23 {
  fill: gray;
}
.cls-24 {
  fill: #007239;
}
.cls-25 {
  fill: #151515;
}
.cls-26 {
  fill: #ffbf7f;
}
.cls-28 {
  fill: #989898;
}
.vendido {
  fill: var(--sold);
}
.reservado {
  fill: var(--reserved);
}
.disponivel {
  fill: var(--available);
}
.indisponivel {
  fill: var(--unavailable);
}
.map-app {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.map-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(14px, 3vw, 32px);
  color: var(--branco);
  background: var(--surface);
}

.map-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.map-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}
.bsimbolo {
  width: 35px;
}

.header-summary-menu {
  display: contents;
}

.header-summary-menu > summary {
  display: none;
}

.header-summary-menu:not([open]) > .status-counts {
  display: flex;
}

.status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: flex-end;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(0, 48, 69, 0.14);
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--brand);
  text-decoration: none;
}

.status-pill:first-child {
  border-left: 0;
}

a.status-pill:hover,
a.status-pill:focus-visible {
  color: var(--brand-2);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.disponivel,
.lot-status.disponivel {
  color: var(--available);
}

.status-dot.indisponivel,
.lot-status.indisponivel {
  color: var(--unavailable);
}

.status-dot.reservado,
.lot-status.reservado {
  color: var(--reserved);
}

.status-dot.vendido,
.lot-status.vendido {
  color: var(--sold);
}

.map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  padding: 16px clamp(14px, 3vw, 32px) 24px;
  min-height: 0;
}

.map-panel,
.lot-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

.map-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
}

.map-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.search-group {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1fr);
  gap: 8px;
}

.mobile-controls-menu {
  display: contents;
}

.mobile-controls-content {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(300px, 1.4fr);
  gap: 10px;
  align-items: center;
}

.mobile-controls-menu > summary {
  display: none;
}

.mobile-controls-menu:not([open]) > .mobile-controls-content {
  display: grid;
}

.search-field {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cfd7df;
  border-radius: 6px;
  font: inherit;
  text-transform: uppercase;
  background: var(--branco);
}

.filter-group,
.zoom-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group,
.typology-filter {
  min-width: 0;
}

.typology-filter {
  display: grid;
  grid-template-columns: auto minmax(170px, 1fr);
  gap: 8px;
  align-items: center;
}

.typology-filter label {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.typology-filter select {
  text-transform: none;
}

.zoom-group {
  justify-content: flex-end;
  grid-column: 2 / 3;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: flex-start;
  color: #344054;
  font-size: 12px;
  grid-column: 1 / 2;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-mark {
  width: 12px;
  height: 12px;
  border: 2px solid var(--branco);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(23, 33, 43, 0.28);
}

.legend-mark.disponivel {
  background: var(--available);
}

.legend-mark.indisponivel {
  background: var(--unavailable);
}

.legend-mark.reservado {
  background: var(--reserved);
}

.legend-mark.vendido {
  background: var(--sold);
}

.available-list-button {
  font-weight: 700;
}

.control-button {
  min-height: 40px;
  padding: 5px 12px;
  border: 1px solid #cfd7df;
  border-radius: 6px;
  color: #1f2937;
  background: var(--branco);
  font: inherit;
  cursor: pointer;
  text-align: center;
  margin: 0;
  text-decoration: none;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.control-button:hover,
.control-button:focus-visible {
  color: var(--brand);
  border-color: var(--brand-2);
  background: #eef7fb;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
  outline: 2px solid rgba(0, 90, 124, 0.18);
  outline-offset: 1px;
}

.control-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.control-button.is-active {
  color: var(--branco);
  border-color: var(--brand-2);
  background: var(--brand-2);
}

.control-button.is-active:hover,
.control-button.is-active:focus-visible {
  color: var(--branco);
  border-color: var(--brand);
  background: var(--brand);
}

.map-viewport {
  position: relative;
  overflow: auto;
  min-height: 0;
  cursor: grab;
  scroll-behavior: smooth;
  touch-action: none;
  background:
    linear-gradient(90deg, rgba(0, 48, 72, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 48, 72, 0.05) 1px, transparent 1px),
    var(--branco);
  background-size: 28px 28px;
}

.map-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

.map-viewport svg {
  display: block;
  width: calc(1102.32px * var(--map-zoom, 1));
  max-width: none;
  height: auto;
  margin: 20px auto 20px;
  transition: width 0.16s ease;
}

.map-nav {
  position: sticky;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: grid;
  grid-template-columns: 40px 40px 40px;
  grid-template-rows: 40px 40px 40px;
  gap: 5px;
  width: max-content;
  margin: 12px 0 -132px 12px;
  pointer-events: none;
}

.map-nav .control-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12);
}

.map-nav button[data-pan="up"] {
  grid-column: 2;
  grid-row: 1;
}

.map-nav button[data-pan="left"] {
  grid-column: 1;
  grid-row: 2;
}

.map-nav button[data-pan="home"] {
  grid-column: 2;
  grid-row: 2;
  font-weight: 700;
}

.map-nav button[data-pan="right"] {
  grid-column: 3;
  grid-row: 2;
}

.map-nav button[data-pan="down"] {
  grid-column: 2;
  grid-row: 3;
}

.map-help {
  position: sticky;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  margin: 0 0 12px 12px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #344054;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  font-size: 12px;
}

.map-alert {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid #f2b8b5;
  border-radius: 6px;
  color: #8a1f11;
  background: #fff4f2;
  font-size: 13px;
}

.lot-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
}

.lot-drawer-bar {
  display: none;
}

.lot-card {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.lot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lot-title strong {
  font-size: 24px;
  color: var(--brand);
}

.lot-status {
  font-weight: 700;
  text-transform: capitalize;
}

.lot-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.lot-detail {
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.lot-detail span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
}

.lot-detail strong {
  color: #17212b;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reservation-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.reservation-form strong {
  color: var(--brand);
  font-size: 16px;
}

.reservation-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reservation-form input,
.reservation-form select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cfd7df;
  border-radius: 6px;
  background: var(--branco);
  font: inherit;
}

.reservation-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.reservation-message.is-error {
  color: #b42318;
}

.reservation-message.is-success {
  color: #007a5a;
}

.lot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.lot-list {
  min-height: 0;
  max-height: min(80vh, 620px);
  overflow: auto;
  padding: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.lot-list::-webkit-scrollbar {
  width: 10px;
}

.lot-list::-webkit-scrollbar-thumb {
  border: 3px solid var(--branco);
  border-radius: 999px;
  background: #b6c7d4;
}

.lot-list::-webkit-scrollbar-track {
  background: var(--branco);
}

.lot-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0 0 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.lot-list button:hover,
.lot-list button:focus-visible,
.lot-list button.is-selected {
  border-color: #b6c7d4;
  background: #eef7fb;
  outline: none;
}

.lot-list small {
  color: var(--muted);
}

.map-tooltip {
  position: fixed;
  z-index: 5;
  display: none;
  pointer-events: none;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--branco);
  background: rgba(15, 23, 42, 0.92);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

circle.padraocor {
  cursor: pointer;
  transition:
    r 0.12s ease,
    stroke-width 0.12s ease,
    opacity 0.12s ease;
}

circle.padraocor:hover,
circle.padraocor:focus,
circle.padraocor.is-selected {
  r: 7px;
  stroke: #111827;
  stroke-width: 2;
  outline: none;
}

circle.padraocor.is-selected {
  animation: selectedLotPulse 2s ease-in-out infinite;
}

@keyframes selectedLotPulse {
  0%,
  100% {
    r: 4px;
    stroke-width: 1;
  }

  50% {
    r: 6px;
    stroke-width: 2;
  }
}

circle.padraocor.is-muted {
  opacity: 0.16;
}

@media (max-width: 920px) {
  .map-header,
  .map-workspace,
  .map-controls {
    grid-template-columns: 1fr;
  }

  .map-header {
    align-items: center;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    position: relative;
  }

  .header-summary-menu {
    display: block;
    position: relative;
    justify-self: end;
    width: auto;
    border: 0;
    border-radius: 0;
    background: var(--branco);
  }

  .header-summary-menu > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    justify-self: end;
    min-height: 40px;
    min-width: 96px;
    padding: 0 13px;
    border: 1px solid #d8dee4;
    border-radius: 999px;
    color: var(--brand);
    background: var(--branco);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
    transition:
      border-color 0.18s ease,
      box-shadow 0.18s ease,
      background 0.18s ease;
  }

  .header-summary-menu > summary::-webkit-details-marker {
    display: none;
  }

  .header-summary-menu > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
  }

  .header-summary-menu[open] > summary {
    border-color: var(--brand-2);
    background: #f8fafc;
    box-shadow: 0 6px 18px rgba(0, 48, 69, 0.16);
  }

  .header-summary-menu[open] > summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
  }

  .header-summary-menu > summary:focus-visible,
  .mobile-controls-menu > summary:focus-visible {
    outline: 3px solid rgba(0, 90, 124, 0.18);
    outline-offset: 2px;
  }

  .header-summary-menu:not([open]) > .status-counts,
  .header-summary-menu .status-counts {
    display: none;
  }

  .header-summary-menu[open] .status-counts {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: min(280px, calc(100vw - 28px));
    padding: 6px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--branco);
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
  }

  .header-summary-menu[open] .status-pill {
    justify-content: flex-start;
    min-height: 40px;
    padding: 0 14px;
    border-left: 0;
    border-top: 1px solid rgba(0, 48, 69, 0.08);
  }

  .header-summary-menu[open] .status-pill:first-child {
    border-top: 0;
  }

  .map-controls {
    align-items: stretch;
  }

  .search-group {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-controls-menu {
    display: block;
    border: 1px solid #d8dee4;
    border-radius: 6px;
    background: var(--branco);
  }

  .mobile-controls-menu > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    color: #1f2937;
    background: var(--branco);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    transition:
      background 0.18s ease,
      color 0.18s ease;
  }

  .mobile-controls-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-controls-menu > summary::after {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
  }

  .mobile-controls-menu[open] > summary {
    border-bottom: 1px solid var(--line);
    color: var(--brand);
    background: #f8fafc;
  }

  .mobile-controls-menu[open] > summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
  }

  .mobile-controls-menu:not([open]) > .mobile-controls-content,
  .mobile-controls-content {
    display: none;
  }

  .mobile-controls-menu[open] .mobile-controls-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .filter-group,
  .typology-filter,
  .zoom-group,
  .map-legend {
    grid-column: auto;
    justify-content: flex-start;
  }

  .typology-filter {
    grid-template-columns: 1fr;
  }

  .map-workspace {
    display: flex;
    flex-direction: column;
    padding-bottom: 78px;
  }

  .lot-details {
    grid-template-columns: 1fr;
  }

  .map-panel,
  .lot-panel {
    min-height: auto;
  }

  .lot-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: grid;
    grid-template-rows: 58px;
    height: 58px;
    max-height: min(86vh, 680px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    transform: none;
    transition: height 0.2s ease;
  }

  .lot-panel.is-open {
    grid-template-rows: 58px auto auto minmax(120px, 1fr);
    height: min(82vh, 640px);
  }

  .lot-drawer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--branco);
  }

  .lot-drawer-bar::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #b6c7d4;
    transform: translateX(-50%);
  }

  .lot-drawer-bar strong {
    color: var(--brand);
    font-size: 15px;
  }

  .lot-drawer-open {
    overflow: hidden;
  }

  .lot-panel:not(.is-open) .lot-card,
  .lot-panel:not(.is-open) .lot-actions,
  .lot-panel:not(.is-open) .lot-list {
    display: none;
  }

  .lot-panel.is-open .lot-card {
    max-height: 38vh;
    overflow: auto;
  }

  .lot-panel.is-open .lot-list {
    min-height: 0;
    max-height: none;
    overscroll-behavior: contain;
  }

  .map-viewport {
    min-height: 420px;
  }
}
@media (max-width: 767px) {
  .map-nav {
    display: none;
  }
  .search-group {
    grid-template-columns: 1fr;
  }
  .control-button {
    min-width: 40px;
  }
  .map-legend span {
    white-space: normal;
  }
}
