@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg: #fcf7f3;
  --card: #ffffff;
  --ink: #50331d;
  --muted: #6f513b;
  --accent: #d6a681;
  --available: #fcf7f3;
  --storage-available: #f5e4d6;
  --reserved: #cbb6a5;
  --sold: #e7cbb6;
  --hover: #d6a681;
  --outline: #e7cbb6;
  --stroke: #50331d;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fcf7f3, #f5e4d6 45%, #e7cbb6 100%);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0 0 24px;
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
}

.map-card,
.info-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(80, 51, 29, 0.12);
}

.svg-host {
  width: 100%;
  height: min(70vh, 700px);
  min-height: 360px;
  overflow: hidden;
  cursor: grab;
  position: relative;
  touch-action: none;
}

.svg-host svg {
  touch-action: none;
}

.info-card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.info-card {
  display: flex;
  flex-direction: column;
}

.spot-details {
  border: 1px dashed var(--accent);
  padding: 12px;
  border-radius: 12px;
  min-height: 200px;
}

.spot-details p {
  margin: 6px 0;
}

.muted {
  color: var(--muted);
}

.legend {
  margin-top: auto;
  padding-top: 16px;
  display: grid;
  gap: 8px;
}

.legend .swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--stroke);
  margin-right: 8px;
  vertical-align: middle;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.swatch.available { background: var(--available); }
.swatch.reserved { background: var(--reserved); }
.swatch.sold { background: var(--sold); }

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .svg-host {
    height: min(60vh, 520px);
    min-height: 320px;
  }

  .info-card {
    height: 450px;
  }

  .spot-details {
    overflow: visible;
  }
}

svg {
  width: 100%;
  height: 100%;
  display: block;
}

.parking-spot {
  cursor: pointer;
  transition: fill 160ms ease;
  opacity: 1;
}

.map-marker {
  cursor: pointer;
  pointer-events: all;
}
.map-card {
  position: relative;
}

.floor-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.floor-switcher .floor-btn {
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  background: #f5e4d6;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  text-shadow: none;
}

.floor-switcher .floor-btn.active {
  background: var(--accent);
  color: var(--ink);
}

.map-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 2;
}

.map-toolbar button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--bg);
  font-weight: 600;
  cursor: pointer;
}

.map-toolbar button:hover {
  background: #f5e4d6;
}


.parking-spot.selected {
  filter: none;
}

.spot-label {
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  fill: var(--ink);
}

.spot-tooltip,
.spot-bubble {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--outline);
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(80, 51, 29, 0.18);
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.spot-bubble {
  z-index: 4;
  pointer-events: auto;
}

.booking-row {
  margin-top: 12px;
}

.telegram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--hover);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  box-shadow: 0 10px 18px rgba(80, 51, 29, 0.16);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.telegram-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(80, 51, 29, 0.2);
  filter: brightness(1.02);
}

.telegram-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 14px rgba(80, 51, 29, 0.16);
}

.telegram-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.spot-bubble .telegram-button {
  font-size: 0.8rem;
  padding: 8px 10px;
}
