

.mapa-embed-home {
    height: 100%;
    position: relative;
    border-radius: 15px;
}



#territorio-map {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
}

/* Estilos específicos para OpenLayers */
#territorio-map .ol-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#territorio-map .ol-unselectable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#territorio-map .ol-layers {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Loading indicator styles */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #27568A;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 15px;
}

.map-loading i {
    color: white;
    font-size: 48px;
    animation: spin 1.5s linear infinite;
}

.map-loading span {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-error {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}



/* Estilos para los popups */
.map-popup {
    padding: 0;
    font-family: "Source Sans 3", sans-serif;
}

.popup-header {
    background: rgba(39, 86, 138, 0.9);
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
}

.popup-header h3 {
    margin: 0;
    color: var(--color-white, #fff);
    font-weight: 500;
    font-size: 18px;
    font-family: "Source Sans 3", sans-serif;
    line-height: 1.2em;
    text-align: left;
}

.popup-body {
    padding: 15px;
}

.popup-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.popup-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.popup-link {
    display: inline-block;
    background: rgba(39, 86, 138, 0.9);
    color: var(--color-white, #fff);
    font-weight: 500;
    padding: 8px 20px;
    font-size: 14px;
    font-family: "Source Sans 3", sans-serif;
    border: none;
    border-radius: 8px;
    line-height: 1em;
    text-decoration: none;
    text-align: center;
}

.popup-link:hover {
    background: rgba(39, 86, 138, 1);
    color: var(--color-white, #fff);
    text-decoration: none;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 300px !important;
}

/* Estilos del popup del mapa */
.map-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 280px;
    max-width: 320px;
    font-family: "Source Sans 3", sans-serif;
}

.popup-header {
    background: rgba(39, 86, 138, 0.9)
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
}

.popup-title-header {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.popup-body {
    padding: 16px;
    background: white;
}

.popup-field {
    margin-bottom: 12px;
    line-height: 1.4;
}

.popup-field:last-of-type {
    margin-bottom: 16px;
}

.popup-field strong {
    font-weight: 700;
    color: #212529;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.popup-field:not(strong) {
    color: #495057;
    font-size: 14px;
}

.popup-actions {
    border-top: 1px solid #e9ecef;
}

.popup-button {
    display: inline-block;
    background-color: rgba(39, 85, 138, 0);   
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-size: 1rem;
    text-decoration: none;
}
.popup-button:hover {
    background-color: rgba(39, 86, 138, 0.9);
}



/* Estilos para overlay de OpenLayers */
.ol-popup {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
    border: none;
    min-width: 280px;
    max-width: 320px;
}

.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.ol-popup:after {
    border-color: rgba(255, 255, 255, 0);
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}

.ol-popup:before {
    border-color: rgba(0, 0, 0, 0);
    border-top-color: rgba(0,0,0,0.15);
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}

.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 8px;
    right: 8px;
    color: #999;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
}

.ol-popup-closer:after {
    content: "✕";
}

.ol-popup-closer:hover {
    color: #666;
}

/* Control de capas personalizado */
.custom-layer-control {
    background: rgba(255, 255, 255, 0);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.403);
    padding: 2px;
    display: flex;
    gap: 4px;
}

.layer-btn {
    background: white;
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.layer-btn:hover {
    background: #f5f5f5;
}

.layer-btn.active {
    background: rgba(39, 86, 138, 0.9)
    color: white;
    border-color: rgba(39, 86, 138, 0.9)
}

/* Mensajes de estado */
.map-message {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
    background-color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    font-family: "Source Sans 3", sans-serif;
}

.map-message-error {
    color: #c62828;
}

.map-message-info {
    color: #1565c0;
}

.map-message-warning {
    color: #ef6c00;
}


.mapa-embed-home {
	background: #d8d8d8;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border: 1px solid rgba(85, 85, 85, 0.7);
	border-radius: 15px;
	position: relative;
}

/* Media queries para dispositivos móviles */
@media (max-width: 768px) {
	.mapa-embed-home {
		height: 350px;
		margin: 0;
	}
	
	.cifras_mapa-section {
		padding: 20px 0;
	}
	
	.mapa-territorio-widget {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.mapa-embed-home {
		height: 300px;
		border-radius: 10px;
	}
	
	.btn_titulo {
		font-size: 18px;
		padding: 0.8rem 1.5rem;
	}
}

/* Estilos para el popup */
.map-popup {
    width: 280px;
    font-family: "Source Sans 3", sans-serif;
}

.popup-header {
    background: rgba(39, 86, 138, 0.9);
    color: white;
    padding: 10px;
    border-top-left-radius: 1px;
    border-top-right-radius: 1px;
}

.popup-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.popup-body {
    padding: 12px;
    background: white;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.popup-location {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

.popup-link {
    display: inline-block;
    background: #27568a;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
}

.popup-link:hover {
    background: #1e446d;
}

/* Estilos para el control de capas personalizado */
.custom-layer-control-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
}

.custom-layer-control {
    background: rgba(255, 255, 255, 0);
    border-radius: 6px;
    display: flex;
    gap: 6px;
}

.layer-preview {
    width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s;
}

.layer-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layer-preview.active {
    border-color: #007cba;
    border-width: 2px;
}

.layer-preview:hover:not(.active) {
    border-color: #dadce0;
}

/* Estilos para mensajes de error */
.map-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #d32f2f;
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
}

/* Media queries para dispositivos móviles */
@media (max-width: 768px) {
    .mapa-embed-home {
        height: 350px;
    }
    
    .titulo-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .mapa-embed-home {
        height: 300px;
        margin: 10px 0;
    }
    
    .titulo-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}