/* === Congreso Spa Internacional — Mapa de Stands === */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #17191f;
  --muted: #667085;
  --line: #d7dbe3;
  --accent: #1f7aec;
  --accent-dark: #0f4fa8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}

.app {
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

button, select { font: 700 14px/1 Arial, Helvetica, sans-serif; }

.tab {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

.stand-select {
  font-size: 14px;
  padding: 8px 12px;
  min-height: 40px;
  color: #1f2937;
  background: #fff;

  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  max-width: 100%;
  gap: 16px;
  align-items: start;
}

.map-shell, .details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-shell {
  min-width: 0;
  overflow: auto;
  padding: 14px;
  min-width: 0;
  max-width: 100%;
  min-width: 0;
  max-width: 100%;
}

.map-title {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.map-svg {
  max-width: 100%;
  max-width: 100%;
  display: block;
  height: auto;
  background: #fff;
}

.source-layer { pointer-events: none; }

.mask {
  fill: #fff;
  pointer-events: none;
}

.stand-label-cover {
  pointer-events: none;
}

.stand-shape {
  stroke: #231f20;
  stroke-width: .222;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  /* fill viene del atributo SVG (color por estado desde Noco) - NO poner fill aqui */
}

.stand-label {
  fill: #111;
  font-family: inherit;
  font-size: 10px;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: middle;
  alignment-baseline: middle;
  pointer-events: none;
  user-select: none;
}

.stand-label.floor-piso2 {
  font-size: 7px;
}

.stand-label.powerbank {
  font-size: 4px;
}

.stand-separator {
  stroke: #231f20;
  stroke-width: .35;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.hotspot {
  fill: rgba(31, 122, 236, 0);
  stroke: rgba(31, 122, 236, 0);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
  transition: fill 140ms ease, stroke 140ms ease;
  pointer-events: all;
}

.hotspot:hover, .hotspot:focus {
  fill: rgba(31, 122, 236, .18);
  stroke: var(--accent);
}

.hotspot.selected {
  fill: rgba(31, 122, 236, .28);
  stroke: var(--accent-dark);
  stroke-width: 2;
}

.details {
  padding: 16px; min-width: 0; max-width: 100%; overflow: hidden; word-wrap: break-word;
}

.details h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.details p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Oculto por defecto, se muestra cuando hay stand seleccionado */
.meta.hidden { display: none; }
.meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
  font-size: 14px;
}

.meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #edf0f4;
}

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

/* === Estado badge (Noco colors) === */
.estado-badge {
  display: inline-block;
  padding: 3px 10px; max-width: 100%; word-break: break-word; white-space: normal;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.estado-DISPONIBLE  { background: #86c4a3; }
.estado-RESERVADO   { background: #e8a5b8; }
.estado-COMPRADO    { background: #a3bfd9; }
.estado-NEGOCIACION { background: #9aa59a; }

/* Loading & error states */
.loading-indicator {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 14px;
}

@media (max-width: 980px) {
  .topbar, .workspace { grid-template-columns: 1fr; }
  .controls { justify-content: stretch; }
  .tabs, .stand-select { width: 100%; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .meta { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app { padding: 12px; }
  .map-shell { padding: 8px; }
}

/* WhatsApp button */
.whatsapp-btn,
.whatsapp-btn:hover,
.whatsapp-btn:focus,
.whatsapp-btn:active,
.whatsapp-btn:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366 !important;
    color: #fff !important;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    margin: 12px auto 0;
    font-size: 14px;
    width: fit-content;
    outline: none;
    border: none;
}
.whatsapp-btn svg { display: block; }
