* {
    margin: 0;
    padding: 0;
}

.ContenedorCentral {
    flex: 1;
    width: auto;
    max-width: none;
    position: relative;
}

#map {
    margin-top: 0;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    z-index: 0;
    position: absolute;
    cursor: default;
}

/* Botón "Añadir actividad": pill verde de marca, simple como el resto de la app */
#boton {
    padding: 10px 22px;
    background-color: #35CB83;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background-color 0.15s ease;
}

#boton:hover {
    background-color: #2EAE6F;
}

#boton:active {
    background-color: #2EAE6F;
}

#oculto {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    /* Fijo en pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 3;
    justify-content: center;
    align-items: center;
}

#oculto.mostrar-modal {
    display: flex !important;
}

#form_actividad {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;

}

h2 {
    text-align: center;
    color: #00541C;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
}

#boton_crearActividad {
    width: 100%;
    padding: 14px;
    background: #00541C;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-right: 10%;
}

#boton_crearActividad:hover {
    transform: translateY(-3px);

}

.grupo-formulario {

    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 30px;
    font-size: 15px;
    transition: color 0.3s ease;
}

.grupo-formulario input,
.grupo-formulario textarea,
.grupo-formulario select {
    width: 100%;
    padding: 10px;
    background-color: #F8F9FA;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Estilos del buscador */
.search-container {
    display: flex;
    align-items: center;
    margin: 1%;
    z-index: 1;
    position: absolute;
    top: 68px;            /* debajo de la cabecera (.DivTextoFlecha, 60px) */
    left: 0;
    width: 100%;
    gap: 15px;
}

.filter-container {
    order: 1;
    margin: 0;
}

/* Geocoder integrado en el search-container, a la derecha del filtro */
.search-container .leaflet-control-geocoder {
    order: 2;
    margin: 0 !important;
    flex: 1;
    max-width: 360px;
    border-radius: 24px !important;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    position: relative;
    /* overflow:hidden cortaba el dropdown de sugerencias - quitado */
}
.search-container .leaflet-control-geocoder-form input {
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    color: #333 !important;
    outline: none !important;
}
.search-container .leaflet-control-geocoder-alternatives {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1100;            /* por encima de los controles Leaflet (1000) */
    list-style: none;
    padding: 4px 0;
    margin-left: 0;
    border: 1px solid rgba(0,0,0,0.08);
}
.search-container .leaflet-control-geocoder-alternatives li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    line-height: 1.35;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.search-container .leaflet-control-geocoder-alternatives li:last-child {
    border-bottom: none;
}
.search-container .leaflet-control-geocoder-alternatives li:hover,
.search-container .leaflet-control-geocoder-selected {
    background-color: #F4FFF9 !important;
}
.search-container .leaflet-control-geocoder-alternatives a {
    color: inherit;
    text-decoration: none;
    display: block;
}

#boton {
    order: 3;
    margin-left: auto;
}

.tipo-select {
    padding: 8px 10px;
    border: 2px solid #00541C;
    border-radius: 4px;
    background-color: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.tipo-select:hover {
    background-color: #f0f0f0;
    border-color: #00330F;
}

.tipo-select:focus {
    outline: none;
    border-color: #00330F;
    box-shadow: 0 0 0 2px rgba(0, 84, 28, 0.1);
}

.search-input {
    padding: 8px 10px;
    border: 2px solid #00541C;
    border-radius: 4px;
    width: 300px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-button {
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #00541C;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: bold;
}

.search-button:hover {
    background-color: #00330F;
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0px);
}

.ContenedorIzquierdaMapa {
    width: 18%;
    min-width: 220px;
    position: sticky;
    top: 0;
    overflow-y: auto;
    height: 100vh;
    justify-content: center;
    margin-left: 0px;
    border-right: 1px solid rgba(0, 0, 0, 0.268);
    background-color: #35CB83;
    z-index: 200;
}

/* Cada item del menú del mapa: una sola línea (icono + texto al lado) */
.ContenedorIzquierdaMapa .BotonBarra {
    white-space: nowrap;
    display: inline-block;
}

/* Dentro del menú del mapa los .Icono no deben ocupar 60% de ancho
   (regla heredada de Base.css que descoloca en el contexto del mapa) */
.ContenedorIzquierdaMapa .Icono {
    width: auto;
    display: inline;
    vertical-align: middle;
}

/* Espaciado consistente entre icono y texto */
.ContenedorIzquierdaMapa .Icono + .Icono {
    margin-left: 8px;
}

.ContenedorIzquierdaMapa ul li:last-child {
    position: absolute;
    bottom: 12px;
}
.ContenedorIzquierdaMapa ul li:last-child a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 30px;
    transition: background-color 0.15s ease;
}
.ContenedorIzquierdaMapa ul li:last-child a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ContenedorIzquierdaMapa ul li#Iniciar {
    position: absolute;
    bottom: 65px;
}

.ContenedorIzquierdaMapa ul {
    padding-left: 10%;
}

/* ============== Móvil ============== */
@media (max-width: 600px) {
    .ContenedorIzquierdaMapa {
        display: none;
    }

    /* El mapa deja hueco arriba para los controles y abajo para el footer móvil */
    #map {
        height: calc(100vh - 50px); /* 50px del Footer */
        height: calc(100dvh - 50px); /* dvh: ajusta con teclado virtual */
    }

    /* Input del geocoder a 16px para evitar zoom auto de iOS */
    .search-container .leaflet-control-geocoder-form input {
        font-size: 16px !important;
    }

    /* Fila 1: filtro Tipo (izquierda) + buscador más pequeño (derecha).
       Fila 2: botón "Añadir actividad" a todo el ancho.
       Así el filtro por tipo queda visible y no lo tapa el buscador. */
    .search-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        top: 68px;            /* debajo de la cabecera "Mapa" */
        left: 0;
        right: 0;
        width: auto;
        margin: 0 10px;
        padding: 0;
    }

    .filter-container {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .tipo-select {
        width: 100%;
        box-sizing: border-box;
    }

    /* Buscador: más pequeño y empujado a la derecha, en la misma fila.
       Lupa + input en una sola linea (el input al 100% empujaba la lupa abajo). */
    .search-container .leaflet-control-geocoder {
        order: 2;
        flex: 0 0 46%;
        max-width: 46%;
        margin: 0 !important;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }
    .search-container .leaflet-control-geocoder-icon {
        flex: 0 0 auto;
    }
    .search-container .leaflet-control-geocoder-form {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Botón "Añadir actividad": fila propia, ancho completo */
    #boton {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    /* El modal del formulario ocupa casi toda la pantalla en móvil */
    #form_actividad {
        width: 92%;
        max-width: none;
        padding: 20px;
        max-height: 85vh;
        max-height: 85dvh;
        overflow-y: auto;
    }

    h2 {
        font-size: 22px;
    }

    #boton_crearActividad {
        margin-right: 0;
    }
}

/* Tablet pequeña: solo apilar controles, dejar sidebar fuera por estética */
@media (min-width: 601px) and (max-width: 900px) {
    .search-input {
        width: 200px;
    }
    #boton {
        margin-left: 10px;
    }
}
/* ============== Pins de actividades coloreados ============== */
.PinActividad {
    width: 26px;
    height: 36px;
    position: relative;
    background: transparent !important;
}

.PinActividadCabeza {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.PinActividadPunta {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 12px solid #999;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.PinActividad:hover .PinActividadCabeza {
    transform: scale(1.08);
}

/* ============== Geocoder (búsqueda de lugares) ============== */
.leaflet-control-geocoder {
    border-radius: 24px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
.leaflet-control-geocoder-form input {
    border-radius: 24px !important;
    padding: 6px 12px !important;
    width: 240px !important;
}