html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

.toolbar {
    height: 50px;
    /*background: #2c3e50;*/
    background-color: #111C62;
    color: white;
    padding: 10px;
}






/* NAVBAR SUPERIOR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 60px;
    /*background: #1f2d3d;*/
    background: #005A9C;

    color: white;

    display: flex;
    align-items: center;
    /*justify-content: space-between;*/

    padding: 0 20px;
    z-index: 1000;
}



.navbar-left {

    display: flex;

    align-items: center;

    gap: 12px;
}








.navbar .logo {
    font-weight: bold;
    font-size: 18px;
}

.navbar .menu button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 10px;
    margin-left: 8px;
    cursor: pointer;
    border-radius: 4px;
}

.navbar .menu button:hover {
    background: rgba(255, 255, 255, 0.1);
}




/* MAPA A PANTALLA COMPLETA MENOS NAVBAR */
#map {
    position: absolute;
    top: 60px;
    /* altura navbar */
    left: 0;
    right: 0;
    bottom: 0;
}

/*
#map {
    width: 100%;
    height: calc(100vh - 50px);
}
*/





.floating-controls {
    position: absolute;
    right: 14px;
    bottom: 44px;


    /*
	bottom:calc(var(--bottom-panel-height) + 20px);
	*/

    z-index: 1100;

    display: flex;
    flex-direction: column;
    gap: 8px;
}


.floating-btn {
    width: 52px;
    height: 52px;

    border-radius: 50%;

    background: rgba(10, 15, 22, .85);

    border: 1px solid rgba(255, 255, 255, .12);

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;

    backdrop-filter: blur(10px);

    cursor: pointer;

    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
}





/*
#layers-panel {
    position: absolute;

    top: 80px;
    right: 10px;

    z-index: 1000;

    background: white;

    padding: 10px;

    border-radius: 4px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);

    display: none;
}
*/




.header-logo {

    padding-top: 5px;
    /*height: 42px;

    width: auto;*/
}



.burger-btn {

    width: 42px;
    height: 42px;

    background: transparent;

    border: none;

    cursor: pointer;

    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 5px;
}



.burger-btn span {

    width: 22px;

    height: 2px;

    background: white;

    border-radius: 2px;

    display: block;
}


#sidebar-overlay {

    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, .35);

    opacity: 0;

    visibility: hidden;

    transition: .25s;

    z-index: 1990;
}



#sidebar-overlay.active {

    opacity: 1;

    visibility: visible;
}





#layers-sidebar {

    position: fixed;

    /*top: 0;*/
    top: 60px;

    left: -320px;

    width: 320px;

    /*
	height: 100vh;
	*/
    height: calc(100vh - 60px);

    background: white;

    z-index: 2001;

    transition: left .25s ease;

    box-shadow:
        0 0 20px rgba(0, 0, 0, .25);

    overflow-y: auto;
}


#layers-sidebar.open {

    left: 0;
}



.sidebar-header {

    height: 60px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 16px;

    border-bottom: 1px solid #eee;

    background: #005A9C;

    color: white;
}



#btn-close-sidebar,
#btn-close-feature {

    background: transparent;

    border: none;

    color: white;

    font-size: 22px;

    cursor: pointer;
}


#layers-panel {

    padding: 10px;
}


.layer-group {

    /*
    border-bottom: 1px solid #eee;
	*/

    border-bottom: 1px solid #f5f5f5;


    /*
	border-bottom: 1px solid #f2f2f2;
	*/

    /*
    margin-bottom: 4px;
	*/
}


/*
.group-header {

    padding: 14px;

    font-weight: 600;

    cursor: pointer;

    display: flex;

    justify-content: space-between;

    align-items: center;

    user-select: none;
}
*/

/*
.group-header {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 12px 14px;

    font-weight: 600;

    cursor: pointer;

    user-select: none;
}
*/
/*
.group-header {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 12px 14px;

    font-weight: 600;

    cursor: pointer;

    user-select: none;
}




.group-header:hover {

    background: #f5f5f5;
}
*/


.group-header {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px 12px;

    font-weight: 600;

    font-size: 15px;

    cursor: pointer;

    transition: background .15s;
}

.group-header:hover {

    background: #f7f8fa;
}







/*
.group-toggle {

    width: 14px;

    text-align: center;

    color: #666;

    font-size: 12px;

    flex-shrink: 0;
}
*/




.group-toggle,
.legend-toggle {

    width: 10px;
    height: 10px;

    border-right: 2px solid #666;
    border-bottom: 2px solid #666;

    transform: rotate(-45deg);

    transition: transform .2s ease;

    flex-shrink: 0;
}

.layer-group.open .group-toggle {

    transform: rotate(45deg);
}


.layer.legend-open .legend-toggle {
    transform: rotate(45deg);
}





.group-title {

    flex: 1;
}












/*
.group-content {

    max-height: 0;

    overflow: hidden;

    transition: .25s ease;
}



.layer-group.open .group-content {

    max-height: 500px;
}
*/

.group-content {

    max-height: 0;

    overflow: hidden;

    transition:
        max-height .25s ease;
}

.layer-group.open .group-content {

    max-height: 1000px;
}


.layer-group:not(.open) .group-title {
    color: #333;
    /*color: #222;*/
}

.layer-group.open .group-title {

    color: #005A9C;
}




/*
.layer-item {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px 16px;
}
*/
/*
.layer-item {

    display: flex;

    align-items: center;

    gap: 6px;

    padding: 6px 16px;

    cursor: pointer;
}
*/

.layer-item {

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 4px 12px;

    min-height: 30px;

    cursor: pointer;
}



.layer-item:hover {

    background: #fafafa;
}


.layer-item input {

    width: 18px;

    height: 18px;
}


/*
.layer-item img {

    width: 18px;

    height: 18px;

    object-fit: contain;

    flex-shrink: 0;
}
*/


.layer-item img {

    width: 30px;
    height: 30px;

    object-fit: contain;

    flex-shrink: 0;
}





.cat {
    font-weight: bold;
    margin-top: 10px;
}



/*
        .layer {
            display:flex;
            align-items:center;
            gap:6px;
            margin-left:10px;
        }
*/

/*
.layer {
    padding-left: 20px;
}

*/

.layer {
    padding-left: 10px;
}

input[type="checkbox" i] {
    width: 18px;
    height: 18px;
}



.category-checkbox,
.layer-checkbox {

    margin: 0;

    flex-shrink: 0;
}




#feature-sidebar {

    position: fixed;

    top: 60px;

    right: -360px;

    width: 360px;

    height: calc(100vh - 60px);

    background: white;

    transition: right .25s ease;

    z-index: 2000;

    box-shadow:
        -2px 0 20px rgba(0, 0, 0, .15);

    overflow-y: auto;
}

#feature-sidebar.open {

    right: 0;
}


#feature-content {

    padding: 20px;
}


.feature-title {

    font-size: 22px;

    font-weight: 600;

    margin-bottom: 20px;

    color: #222;
}




.feature-field {

    display: flex;

    align-items: flex-start;

    gap: 12px;

    margin-bottom: 14px;
}

.feature-icon {

    width: 24px;

    text-align: center;

    font-size: 18px;

    flex-shrink: 0;

    color: #005A9C;
}

.feature-value {

    flex: 1;

    line-height: 1.4;
}



#feature-content a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

#feature-content a:hover {
    text-decoration: underline;
}



/*
.material-symbols-rounded.feature-icon {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;

    font-size: 20px;
    color: #005A9C;
}

*/


.material-symbols-rounded.feature-icon {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;

    font-size: 20px;
    color: #005A9C;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}




#coords {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}


/* INFORMACIÓN DEL ELEMENTO */

.attr-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.attr-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attr-value {
    font-size: 14px;
    color: #111827;
    word-break: break-word;
    line-height: 1.4;
}

.attr-value a {
    color: #2563eb;
    text-decoration: none;
}

.attr-value a:hover {
    text-decoration: underline;
}

/* FIN INFORMACIÓN ELEMENTO */



/* LEYENDA */

.legend-fill {

    width: 16px;
    height: 16px;

    border: 1px solid #999;

    border-radius: 3px;

    display: inline-block;

    margin-right: 8px;

    flex-shrink: 0;
}

.legend-line {

    width: 20px;
    height: 4px;

    display: inline-block;

    margin-right: 8px;

    border-radius: 2px;

    flex-shrink: 0;
}

/*
.legend-toggle{

    width:10px;
    height:10px;

    border-right:2px solid #666;

    border-bottom:2px solid #666;

    transform:rotate(-45deg);

    margin-right:8px;

    display:inline-block;
}
    */

.legend-match {

    margin-left: 30px;

    display: none;
}

.layer.legend-open .legend-match {

    display: block;
}

.legend-row {

    display: flex;

    align-items: center;

    gap: 6px;

    margin: 4px 0;
}



/* FIN LEYENDA */






/* ==========================================================
   AUTOCOMPLETE (común para todos)
========================================================== */

.address-search,
.autocomplete-container {
    position: relative;
}

/* ---------- Lista de resultados ---------- */

.search-results,
.autocomplete-results {

    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;

    display: none;

    max-height: 320px;
    overflow-y: auto;

    background: #fff;

    border: 1px solid #e2e2e2;
    border-radius: 12px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, .15);

    z-index: 9999;

    padding: 6px 0;
}

/* ---------- Scroll ---------- */

.search-results::-webkit-scrollbar,
.autocomplete-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-thumb,
.autocomplete-results::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 20px;
}

/* ---------- Elementos ---------- */

.autocomplete-item {

    padding: 11px 14px;

    cursor: pointer;

    font-size: 14px;

    color: #222;

    transition: background .15s;

    user-select: none;
}

.autocomplete-item:hover {

    background: #f4f8ff;
}

.autocomplete-item strong {

    font-weight: 600;
}

/* ---------- Separador únicamente entre calles ---------- */

.autocomplete-item+.autocomplete-item {

    border-top: 1px solid #efefef;
}

/* ---------- Volver ---------- */

.back-item {

    font-weight: 600;

    color: #1a73e8;

    background: #fafafa;

    border-bottom: 1px solid #e8e8e8;
}

.back-item:hover {

    background: #eef5ff;
}







/* ==========================================================
   BUSCADOR SUPERIOR
========================================================== */

.address-search {

    flex: 1;

    min-width: 260px;
    max-width: 600px;
}

.address-search input {

    width: 100%;
    height: 42px;

    padding: 0 18px 0 46px;

    border: none;
    border-radius: 24px;

    background: #fff;

    font-size: 15px;

    color: #333;

    outline: none;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);

    transition: .2s;
    box-sizing: border-box;
}

.address-search input:focus {

    box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
}

.search-icon {

    position: absolute;

    top: 50%;
    left: 14px;

    transform: translateY(-50%);

    color: #666;

    pointer-events: none;
}





/* ==========================================================
   CONTENEDOR DEL INPUT
========================================================== */

.autocomplete-container {

    flex: 1;
}

.autocomplete-container input {

    width: 100%;

    padding: 11px 12px;

    font-size: 14px;

    border: 1px solid #dcdcdc;
    border-radius: 10px;

    background: #fff;

    outline: none;

    transition: .2s;

    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.autocomplete-container input:focus {

    border-color: #1a73e8;

    box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}

.autocomplete-container input::placeholder {

    color: #999;
}






/*
    MOVILIDAD REDUCIDA
*/

.pmr-sidebar{

    position:fixed;

    top:72px;
    right:20px;

    width:360px;

    background:#fff;

    border-radius:14px;

    box-shadow:0 12px 30px rgba(0,0,0,.18);

    z-index:2000;

    overflow:hidden;

    display:none;
}

.pmr-sidebar.open{
    display:block;
}

#pmr-content{

    padding:16px;

    display:flex;
    flex-direction:column;

    gap:12px;
}

.autocomplete-container{

    flex:1;
    min-width:0;
}


.autocomplete-container input{

    width:100%;

    box-sizing:border-box;
}

#btn-route{

    height:44px;

    border:none;

    border-radius:10px;

    background:#005A9C;

    color:white;

    font-size:15px;

    cursor:pointer;
}


/*
    FIN MOVILIDAD REDUCIDA
*/








@media (max-width:768px) {

    /* La barra mantiene solo el logo y el menú */

    .navbar {

        height: 60px;

        padding: 0 12px;

        display: flex;
        align-items: center;

        justify-content: flex-start;

        background: #005A9C;

        overflow: visible;
    }

    /* El buscador flota debajo */

    /*
    .address-search{

        position:fixed;

        top:68px;

        left:12px;
        right:12px;

        width:auto;

        max-width:none;

        margin:0;

        z-index:1100;

        background:transparent;
    }
*/

    /*
    .address-search input{
    box-sizing:border-box;
        width:100%;
    }
*/
    /* El mapa empieza debajo del buscador */

    #map {

        top: 120px;
    }


    .navbar {
        height: 60px;
        overflow: visible;
        align-items: center;
    }

    /*
    .address-search{
        position:absolute;
        top:68px;
        left:12px;
        right:12px;

        flex:none;
        max-width:none;
        margin:0;
    }
*/


    .address-search {

        position: fixed;

        top: 68px;
        left: 16px;

        width: calc(100vw - 32px);

        max-width: none;
    }


    .address-search {

        left: 16px;
        width: calc(100vw - 32px);

        right: auto;
    }



    #map {
        top: 60px;
    }





    .pmr-sidebar{

        left:12px;
        right:12px;

        top:70px;

        width:auto;

        border-radius:12px;

        max-height:220px;

        overflow:visible;
    }



    .pmr-sidebar.open {
        transform: translateY(0);
    }



}








.feature-header {
    margin: -16px -16px 16px -16px; /* opcional si quieres que ocupe todo el ancho */
}

.feature-header-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.feature-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
}