/* ============================================================
   Els Sibarites – Mapes (CA/ES/EN)
   Solución definitiva móvil + desktop
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

/* -------- BASE -------- */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  background: #fafafa;
  color: #333;
}

/* -------- CABECERA -------- */
header {
  background: rgba(123,17,19,0.97);
  color: #fff;
  padding: 0.6em 1em;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  border-bottom: 3px solid #ffc107;
  border-radius: 0 0 10px 10px;
}

label {
  font-weight: 600;
  display: block;
  margin: 0.2em 0 0.35em;
}

/* -------- GRUPOS -------- */
.poblacio-group,
.plat-group {
  margin-bottom: 0.7em;
  text-align: left;
}

/* -------- CONTROLES -------- */
.poblacio-controls,
.plat-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5em;
  flex-wrap: nowrap; /* evita salto de línea */
  width: 100%;
}

.poblacio-controls select,
.poblacio-controls input,
.plat-controls select,
.plat-controls button {
  flex: 1 1 auto;
  min-width: 110px;
  font-size: 0.95em;
  padding: 0.4em 0.6em;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* Botón buscar */
.plat-controls button {
  flex: 0 0 auto;
  background: #ffc107;
  color: #7b1113;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.plat-controls button:hover { background: #e0a800; }

select:focus,
input[type="text"]:focus {
  border-color: #7b1113;
  box-shadow: 0 0 4px rgba(123,17,19,0.3);
  outline: none;
}

/* -------- DISTANCIA -------- */
.distance-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin-top: 0.4em;
}

#radiusRange {
  width: 55%;
  max-width: 300px;
}
#radiusValue {
  font-weight: 600;
}

/* -------- ENLACE VOLVER -------- */
.back-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  margin-top: 0.4em;
}
.back-link:hover {
  color: #ffc107;
  text-decoration: underline;
}

/* -------- MAPA -------- */
#map {
  height: calc(100vh - 145px);
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  position: relative;
}

#map::after {
  content: "Els Sibarites";
  position: absolute;
  bottom: 8px;
  right: 12px;
  color: rgba(123,17,19,0.6);
  font-size: 0.8em;
  font-weight: bold;
  pointer-events: none;
}

/* ============================================================
   ✅ Ajuste responsive (iPhone y pantallas pequeñas)
   Mantiene los controles en una sola línea
   ============================================================ */
@media (max-width: 700px) {
  header {
    padding: 0.5em 0.8em;
  }

  .poblacio-controls,
  .plat-controls {
    flex-wrap: nowrap; /* fuerza una línea */
    gap: 0.4em;
  }

  .poblacio-controls select,
  .poblacio-controls input,
  .plat-controls select,
  .plat-controls button {
    font-size: 0.9em;
    padding: 0.35em 0.4em;
    min-width: 80px;
  }

  /* Reducir padding para más espacio al mapa */
  #map {
    height: calc(100vh - 155px);
  }
}

@media (max-width: 400px) {
  .poblacio-controls select,
  .poblacio-controls input,
  .plat-controls select,
  .plat-controls button {
    font-size: 0.85em;
    padding: 0.3em 0.3em;
  }
  #map {
    height: calc(100vh - 160px);
  }
}

/* ============================================================
   ✅ Barra inferior de distancia – transparente y compacta
   ============================================================ */
.distance-control {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.05); /* muy transparente */
  backdrop-filter: blur(3px);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 0.5em 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  z-index: 1000;
  font-size: 0.95em;
  width: 70%;               /* 🔹 menos ancha */
  max-width: 380px;         /* 🔹 límite en pantallas grandes */
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.distance-control label {
  color: #7b1113;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.distance-control input[type="range"] {
  flex: 1;
  width: 100%;
  max-width: 220px;
  accent-color: #7b1113; /* dorado sibarita */
  cursor: pointer;
}

.distance-control span {
  font-weight: 700;
  color: #7b1113;
  min-width: 3em;
  text-align: right;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

/* 📱 Ajustes móviles */
@media (max-width: 500px) {
  .distance-control {
    width: 85%;             /* 🔹 un poco más ancha en móvil */
    max-width: none;
    font-size: 0.9em;
    padding: 0.4em 0.8em;
    gap: 0.4em;
  }
  .distance-control input[type="range"] {
    max-width: 180px;
  }
}



/* -------- POPUPS LEAFLET -------- */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  border: 2px solid #7b1113;
}
.leaflet-popup-content {
  font-family: "Poppins", sans-serif;
  color: #333;
  font-size: 0.95em;
}
.leaflet-popup-tip {
  background: #7b1113;
}

