/* =========================
   Base
========================= */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =========================
   Layout app
========================= */
#app{
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header fijo */
header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.3px;
  z-index: 1000;
}

/* Deja espacio para el header */
body{
  padding-top: 56px;
}

/* Mapa siempre visible */
#map{
  width: 100%;
  height: calc(100vh - 56px);
  position: relative;
  z-index: 0;
}

/* Cuando el modal está abierto, el mapa no debe capturar taps */
body.modal-open #map{
  pointer-events: none !important;
}

/* =========================
   FAB (Afegir bar)
========================= */
.fab{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1500; /* por encima del mapa */
}

/* Ocultar FAB cuando el modal está abierto */
body.modal-open .fab{
  display: none !important;
}

/* =========================
   Modal (bottom sheet)
========================= */
.modal.hidden{ display: none !important; }

#modal.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;           /* por encima del header y del botón */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
}

/* Tarjeta tipo panel inferior */
.modalCard{
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

/* Cabecera */
.modalHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px 16px;
  border-bottom: 1px solid #eee;
}

.modalHeader h2{
  margin: 0;
  font-size: 26px;
}

/* Cuerpo scrollable */
.modalBody{
  padding: 12px 16px 16px 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modalBody label{
  display: block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
}

.modalBody input{
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #ddd;
  margin-top: 8px;
  font-size: 16px;
}

/* Footer */
.modalFooter{
  padding: 14px 16px 18px 16px;
  border-top: 1px solid #eee;
  background: #fff;
}

/* Botón principal */
.primary{
  width: 100%;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  background: #f3f3f3;
  color: #111;
  box-shadow: none;
}

/* Botón cerrar */
.close{
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
