/* styles-improvements.css
   Aquí añadiremos mejoras de diseño sin alterar la estructura base.
   Puedes agregar tus overrides y estilos adicionales aquí. */

/* Ejemplo: personaliza botones */
#mainNav button {
  background: var(--accent-color);
  transition: background 0.3s ease;
}
#mainNav button:hover {
  background: #004a99;
}

/* Ejemplo: mejorar sombras de tarjetas */
.expo-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.expo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}




/* ================================
   Rediseño Layout según Figma IA-map
   ================================ */

/* Header */

#exposicionesContainer {
  overflow: hidden;
  position: relative;
}

header h1 {
  color: #000;
  font-size: 1.75rem;
  font-weight: 500;
}
#mainNav button {
  font-weight: 500;
}

/* Exposiciones Section - Hero Carousel */

#inicioSection {
  position: fixed;
  top: 67px !important;
  left: 0;
  width: 100%;
  
  background: var(--main-bg);
  z-index: 2;
  display: none;
  flex-direction: column;
  overflow: hidden !important;
  height: 100vh !important;
  overscroll-behavior: contain!important; 
	
	padding: var(--spacing) 0;
/*  background: #000000;*/
}




#inicioSection > h2 {
  text-align: left;
  font-size: 2rem;
  margin: /*var(--spacing)*/ 20px;
  /*color: var(--primary-color);*/
	color: var(--map-bg);
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: italic;
 line-height: 0.8!important;
}
	

/* Carousel container overrides */
#inicioSection .grid-container {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
#inicioSection .grid-container::-webkit-scrollbar {
  display: none;
}

/* Expo cards style */
.expo-card {
  position: relative;
  width: 280px;
  height: 180px;
  flex: 0 0 auto;
  margin-right: var(--spacing);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.expo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
		overflow: hidden;
  position: relative;
}
.expo-card:hover img {
  transform: scale(1.05);

}

/* Overlay gradient and text */
.expo-card .expo-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing);
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
  color: #fff;
	transform: scale(1.05);
}

.expo-card .expo-artista{
	font-size: 1.5rem !important;
	
}
/* Navigation arrows (prev/next) */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  z-index: 10;

}
.carousel-nav.prev {
  left: var(--spacing);
}
.carousel-nav.next {
  right: var(--spacing);
}

.carousel-nav {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 10px 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.carousel-nav img {
  flex: 0 0 auto;
  scroll-snap-align: start;
  max-height: 80px;
  border-radius: 4px;
}



/* Responsive adjustments */
@media (min-width: 1024px) {
  .expo-card {
    width: 320px;
    height: 200px;
	  overflow: hidden;
  position: relative;
	  
  }
  header h1 {
    font-size: 2rem;
  }
}


/* ================================
   Ajustes según feedback: colores Figma y tarjetas full-screen
   ================================ */

 
/* Header con degradado Figma */



/* InicioSection carousel full-screen */
#inicioSection {
  padding: 0;
}
#inicioSection .grid-container {
  width: 100vw;
  height: calc(80vh - var(--header-height));
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0;
	 position: relative;
	
}


#inicioSection .grid-container::-webkit-scrollbar {
  display: none;
}




/* Expo cards full-screen */
.expo-card {
  flex: 0 0 100vw !important;
  height: 100% !important;
  margin: 0 !important;
  scroll-snap-align: start;
  position: relative;
}
.expo-card img {
  height: 100% !important;
  object-fit: cover;
}





/* ================================
   Ajustes v4: Expo-card full background y header lineal
   ================================ */

/* Expo-card como fondo */
.expo-card {
  position: relative !important;
  border-radius: 0 !important;
  margin: 0 !important;
  overflow: hidden ;
	
}
.expo-card .expo-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.expo-card .expo-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
/* Info text overlay */
.expo-card .expo-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* centra verticalmente h2 y p */
  align-items: center;     /* centra horizontalmente */
  text-align: center;
  padding: var(--spacing);
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.5) 100%);
  z-index: 2;
	text-decoration: none!important; 
}


.expo-card .expo-info h2 {
	display: flex;
  flex-direction: column;    /* eje principal = vertical */
  margin: 0;
  font-size: 2rem;
  color: #fff !important;
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
	line-height: 1;
  font-weight: 600;
 /* font-style: italic;*/
	transform: translateY(-10%)!important; /* súbelo un “poquito” (ajusta 3–10%) */
	
}
.expo-card .expo-info p {
	display: flex;
  flex-direction: column;    /* eje principal = vertical */
  font-size: 1rem;
  margin-top: 0.25rem;
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-style: italic;
  line-height: 0.8;
  color: #fff !important;
	transform: translateY(-10%)!important; /* súbelo un “poquito” (ajusta 3–10%) */
}



/* Header y nav lineal */
header {
  background: #2E42FF !important;
	position: sticky;
  top: 0;
  z-index: var(--header-z);
}




#mainNav button {
  background: rgba(0,0,0,0.2) !important;
  color: #fff !important;
  border: 1px solid #fff !important;
  border-radius: 40px !important;
  padding: 0.5rem 1rem !important;
  font-weight: 500;
  transition: background 0.3s, color 0.3s;
}
#mainNav button:hover {
  background: #000 !important;
  color: #fff !important;
}

/* Asegurar overlay de leyenda */
#inicioSection {
  z-index: 3 !important;
}


/* Botón activo en la botonera */
#mainNav button.active {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}


/* ================================
   Hotspot modal activo diseño Figma
   ================================ */
.active-marker-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.active-marker-wrapper .active-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  z-index: 5;
}
.active-marker-wrapper .active-line {
  width: 2px;
  height: 24px;
  background: var(--accent-color);
  z-index: 4;
}
.active-marker-wrapper .active-popup {
  display: flex;
  background: #fff;
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 4px;
  z-index: 3;
}
.active-popup .popup-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
}
.active-popup .popup-info {
  padding: var(--spacing);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/*.active-popup .popup-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: bold;
}*/
.active-popup .popup-info button {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  align-self: start;
}


/* Hotspot modal activo diseño Figma */
.active-marker-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; pointer-events: none; transform: translate(-50%, -100%); }
.active-marker-wrapper .active-circle { width: 16px; height: 16px; border-radius: 50%; background: var(--accent-color); z-index: 5; }
.active-marker-wrapper .active-line   { width: 2px;  height: 24px; background: var(--accent-color); z-index: 4; }
.active-marker-wrapper .active-popup  { display: flex; background: #fff; border: 2px solid var(--accent-color); border-radius: 12px; overflow: hidden; margin-top: 4px; z-index: 3; }
.active-popup .popup-image img        { width:80px; height:80px; object-fit:cover; }
.active-popup .popup-info { padding: var(--spacing); display:flex; flex-direction:column; justify-content:center; }
.active-popup .popup-info h3        { margin:0 0 0.25rem; font-size:1rem; font-weight:bold; }
.active-popup .popup-info button    { background:none; border:1px solid var(--accent-color); color:var(--accent-color); border-radius:4px; padding:0.25rem 0.5rem; font-size:0.875rem; cursor:pointer; align-self:start; }

/* Transparent icon for modal hotspots */
.transparent-icon {
  background: none !important;
  border: none !important;
}

/* Linear active popup styling */
.active-linear-icon .active-linear-popup {
  background: #fff;
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: var(--spacing);
  pointer-events: auto;
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  bottom: calc(100% + 16px);
  width: 280px;
  z-index: 9999;
}
.active-linear-icon .active-linear-popup .popup-image {
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  margin-right: var(--spacing);
  overflow: hidden;
}
.active-linear-icon .active-linear-popup .popup-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover!important;
}
.active-linear-icon .active-linear-popup .popup-info {
  flex: 1;
}
/*.active-linear-icon .active-linear-icon .active-linear-popup .popup-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: bold;
}*/
.active-linear-icon .active-linear-popup .popup-info button {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}




/* Dynamic legend styles */
.legend-item { display:flex; align-items:center; margin-bottom:0.5rem; }
.legend-icon, .legend-box { width:16px; height:16px; margin-right:0.5rem; }
.legend-box { background: var(--accent-color); }
.legend-label { font-size:0.875rem; color: var(--primary-color); }


/* Legend dynamic styles */
.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}
.legend-icon, .legend-box {
  width: 25px !important;
  height: 25px!important;
  margin-right: 0.5rem;
}
.legend-box {
  background: var(--accent-color);
}
.legend-label {
  font-size: 0.875rem;
  color: var(--primary-color);
}




/* Force legend at bottom-right of viewport */


#leyenda-box .legend-toggle {
	display: flex !important;
	background: #2e42ff !important;
	color: #fff; 
	padding: 4px !important;
	width: 30px !important;
	height: 30px !important;
	align-items: center!important;   /* centra vertical */
	justify-content: center!important; /* opcional: centra horizontal */
	/*background: url(../assets/icons/simbologia-toggle.svg) no-repeat !important;*/
	
}

/* Style for espacio label in linear popup */
.popup-espacio {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

/* Nombre-espacio in expo card under title */
.expo-espacio {
  display: block;
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--secondary-color);
}
/* Nombre-espacio in modal extended under title */
.modal-espacio {
  display: block;
  margin: 0.5rem 0;
  font-size: 1rem;
  color: var(--secondary-color);
}

.leaflet-control-attribution {display: none!important}

.leaflet-popup {
	
	margin-bottom: 50px!important;
	
}


.expo-title{
	 margin: 0;
  font-size: 2rem;
  color: #fff !important;
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
	line-height: 1;
  font-weight: 600;
	
}

.expo-artist{
	
	 margin: 0;
	font-style: italic;
  font-size: 1.2rem;
  color: #fff !important;
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
	line-height: 1;
  font-weight: 600;
}

.expo-img { width: 100%; /* La imagen ocupa el 100% del ancho de su contenedor */
  height: 100%; /* La imagen ocupa el 100% de la altura de su contenedor */
  object-fit: cover; /* Escala la imagen para cubrir el div */}

.expo-button{
	margin: 0.5rem;
	background: rgba(0, 0, 0, 0.2) !important;
    color: #fff !important;
    border: 1px solid #fff !important;
    border-radius: 40px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}
/* Card activa (feedback) */
.expo-card.is-active-card{outline:2px solid var(--accent-color); outline-offset:2px; border-radius:12px}

/* Pin activo: realce sutil */
.leaflet-marker-icon.is-active-marker{transform: scale(1.12); z-index: 1000;}


/* === Refuerzo visual: globo y pin activo === */
.active-linear-popup{ z-index: 10000 !important; pointer-events: auto; }
.leaflet-marker-icon.is-active-marker{ transform: scale(1.15); z-index: 10000 !important; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35)); }
.leaflet-marker-icon.active-linear-icon{ z-index: 10050 !important; pointer-events: auto; }


/* === Estilos del botón Cerrar del globo (superior derecho) === */
.active-linear-popup{
  position: relative; /* para posicionar el botón dentro */
}

.active-linear-icon .active-linear-popup .popup-close{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: 1px solid var(--accent-color);
  background: #fff;
  color: var(--accent-color);
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform .12s ease, background .12s ease, color .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.active-linear-icon .active-linear-popup .popup-close:hover{
  background: var(--accent-color);
  color: #fff;
  transform: scale(1.06);
}

.active-linear-icon .active-linear-popup .popup-close:active{
  transform: scale(0.96);
}

.active-linear-icon .active-linear-popup .popup-close:focus-visible{
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Área táctil un poco más generosa en móviles */
@media (hover: none){
  .active-linear-icon .active-linear-popup .popup-close{ width: 32px; height: 32px; line-height: 30px; }
}


/* === Mejora visual: active-linear-popup con pestaña (estilo tooltip popup) === */
.active-linear-icon .active-linear-popup {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  bottom: calc(100% + 48px);
  width: 290px;
  background: #fff;
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

/* Pestaña doble (borde + interior) centrada apuntando al marcador */
.active-linear-icon .active-linear-popup::after,
.active-linear-icon .active-linear-popup::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  pointer-events: none;
}
/* Borde (debajo) */
.active-linear-icon .active-linear-popup::after {
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.18));
  bottom: -18px;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 18px solid #fff;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08));
}
/* Relleno (encima) */
.active-linear-icon .active-linear-popup::before {
  bottom: -16px;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 16px solid #fff;
}

/* Alineación interna para que se parezca al contenedor de .active-popup */
.active-linear-icon .active-linear-popup .popup-image {
  flex: none;
  width: 90px;
  height: 90px;
  border-radius: 2px;
  margin-right: 10px;
  overflow: hidden;
}
.active-linear-icon .active-linear-popup .popup-info {
  padding: 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
	width: 60%;
}
/*.active-linear-icon .active-linear-icon .active-linear-popup .popup-info h3 {
  margin: 0 0 0.25rem;
  font-size: 3rem !important;
  font-weight: bold;
}*/

.active-linear-popup > .popup-info > h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem !important;
  font-weight: bold;
	line-height: normal;
	width: auto; 

}

.active-linear-icon .active-linear-icon .active-linear-popup .popup-info .popup-espacio {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #555;
}
.active-linear-icon .active-linear-icon .active-linear-popup .popup-info .popup-open {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  align-self: start;
}

/* Botón cerrar discreto en esquina */
.active-linear-icon .active-linear-popup .popup-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

/* Responsivo: en pantallas pequeñas, ancho menor */
@media (max-width: 768px) {
  .active-linear-icon .active-linear-icon .active-linear-popup {
    width: min(86vw, 320px);
  }
}


/* === Animaciones de tooltips (similar a leyenda) — solo CSS === */
/* Entrada con fade + slide-up (funciona al insertarse en el DOM) */
@keyframes tooltipIn {
  0%   { opacity: 0; transform: translateY(18px) scale(0.985); }
  60%  { opacity: 1; transform: translateY(2px)  scale(1.000); }
  100% { opacity: 1; transform: translateY(0)    scale(1.000); }
}

/* Estilo aplicado a ambos tipos de globos (linear y popup) */
.active-linear-icon .active-linear-popup,
.active-marker-wrapper .active-popup {
  will-change: opacity, transform;
  animation: tooltipIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Opción: interacción sutil al pasar por encima (mouse/kiosk) */
.active-linear-icon .active-linear-popup:hover,
.active-marker-wrapper .active-popup:hover {
  transform: translateY(-1px) scale(1.005);
  transition: transform 220ms ease, box-shadow 220ms ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}

/* Respeto a usuarios con reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .active-linear-icon .active-linear-popup,
  .active-marker-wrapper .active-popup {
    animation: none !important;
    transition: none !important;
  }
}


/* === Centrado real sobre el marcador === */
.active-linear-icon {
  position: relative;
  width: 0;
  height: 0;
}


/* === Modal: usar alto de pantalla y siempre visible === */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
  z-index: 2147483647 !important; 
}
.modal[aria-hidden="false"] { display: flex; }

/* Contenedor del contenido: ocupa alto de pantalla con scroll interno */
.modal-content {
  width: min(920px, 96vw);
  max-height: calc(100dvh - 2rem); /* usa alto de pantalla dinámico (iOS/Android safe) */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  background: #fff;
  padding: var(--spacing);
  box-shadow: 0 12px 28px rgba(0,0,0,0.22);
}

/* En móviles, más compacto y casi pantalla completa */
@media (max-width: 768px) {
  .modal-content {
    width: 96vw;
    max-height: calc(100dvh - 1.5rem);
    margin: 0;
    padding: 1rem;
  }
  .modal-content .close {
    position: sticky;
    top: 0;
  }
}


/* === Modal: botón cerrar en esquina superior derecha con estilos consistentes === */
.modal-content {
  /* margen inferior extra para que el contenido no quede "aplastado" al final */
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0.75rem));
  scroll-padding-bottom: 1.25rem;
}
.modal-content .close {
  position: absolute;    /* esquina superior derecha del contenedor */
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: 1px solid var(--accent-color);
  background: #fff;
  color: var(--accent-color);
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}
.modal-content .close:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.modal-content .close:active {
  transform: translateY(0);
}
@media (max-width: 768px) {
  .modal-content .close {
    top: 6px;
    right: 6px;
  }
}

.modal-content .close {  z-index: 9999; pointer-events: auto; }

/* === Responsive hamburger menu === */
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
}
.hamburger-btn .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-color);
  margin: 3px 0;
  transition: transform .2s ease, opacity .2s ease;
}

/* Hide legacy top buttons when using hamburger */
#mainNav ul.nav-buttons {
  display: none;
}

.mobile-menu {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: min(80vw, 360px);
  height: calc(100dvh - var(--header-height));
  background: #fff;
  box-shadow: -8px 0 24px rgba(0,0,0,.15);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 1200;
  padding: 1rem 1rem 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open {
  transform: translateX(0);
}
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(1px);
  z-index: 1100;
}
.menu-backdrop[hidden] { display: none; }

.mobile-menu .menu-root,
.mobile-menu .submenu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mobile-menu .menu-item,
.mobile-menu .submenu-item {
  width: 100%;
  text-align: left;
  background: #f5f5f5;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  padding: .875rem 1rem;
  font: 500 1rem/1.1 var(--font-family);
  color: #111;
  margin-bottom: .75rem;
}
.mobile-menu .menu-item:focus,
.mobile-menu .submenu-item:focus { outline: 2px solid var(--accent-color); outline-offset: 2px; }

.mobile-menu .has-children > .menu-item {
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-menu .submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding-left: .25rem;
}
.mobile-menu .submenu.open {
  max-height: 400px;
  margin-top: .25rem;
}
.mobile-menu .submenu .submenu-item {
  background: #fff;
}

/* Larger screens: keep hamburger; header already flex aligns content */
@media (min-width: 1025px) {
  /* Optionally we could show the old buttons, but request was to replace them */
  #mainNav ul.nav-buttons { display: none; }
}


/* === Microinteracciones extra === */

/* Hamburger morph to X when open */
.hamburger-btn.open .bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger-btn.open .bar:nth-child(2) { opacity: 0; }
.hamburger-btn.open .bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Active states */
.mobile-menu .menu-item.is-active,
.mobile-menu .submenu-item.is-active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0,102,204,0.12);
}
.mobile-menu .menu-item.is-secondary {
  background: #fff;
}

/* Submenú: transición más suave y accesible */
.mobile-menu .submenu {
  transition: max-height .28s ease, margin .2s ease;
}

/* Quick actions fixed at top inside the panel */
.menu-quick-actions {
  position: sticky;
  top: 0;
  padding-bottom: .5rem;
 /* background: linear-gradient(#fff, #fff 85%, rgba(255,255,255,0));*/
  z-index: 1;
  margin-bottom: .25rem;
}

/* Reduce scroll-jump when keyboard navigating */
.mobile-menu :focus-visible {
  scroll-margin-top: 72px;
}


/* === UX style update (Romina request) === */
/* Azul para botonera del desplegable + textos blancos */
:root {
  --menu-blue: var(--map-bg, #2E42FF); /* azul fuerte y legible */
  --menu-blue-pressed: #084f97;
  --menu-blue-border: #075aa8;
}

/* Botones principales del panel */
.mobile-menu .menu-item,
.mobile-menu .submenu-item {
  background: var(--menu-blue) !important;
  color: #fff !important;
  border: 1px solid var(--menu-blue-border) !important;
}

/* Submenú ligeramente elevado pero mismo color */
.mobile-menu .submenu .submenu-item {
  background: var(--menu-blue) !important;
}

/* Estados de foco y activo para accesibilidad */
.mobile-menu .menu-item:focus,
.mobile-menu .submenu-item:focus,
.mobile-menu .menu-item.is-active,
.mobile-menu .submenu-item.is-active {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

/* Hover/active */
.mobile-menu .menu-item:hover,
.mobile-menu .submenu-item:hover {
  filter: brightness(1.05);
}
.mobile-menu .menu-item:active,
.mobile-menu .submenu-item:active {
  background: var(--menu-blue-pressed) !important;
}

/* Quick action arriba mantiene el mismo estilo */
.menu-quick-actions .menu-item {
  background: var(--menu-blue) !important;
  color: #fff !important;
  border-color: var(--menu-blue-border) !important;
}

/* === Botón hamburguesa: blanco con barras visibles === */
.hamburger-btn {
  background: #fff !important;          /* botón blanco */
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hamburger-btn .bar {
  background: #111 !important;          /* barras oscuras para máxima visibilidad */
  width: 24px;
  height: 2px;
  margin: 3.5px 0;
  border-radius: 2px;
}

/* Mantener animación a X al abrir */
.hamburger-btn.open .bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger-btn.open .bar:nth-child(2) { opacity: 0; }
.hamburger-btn.open .bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }


/* --- flat theme overrides --- */

/* === FLAT MENU THEME (white bars, blue panel, white text & square borders) === */
:root{
  --menu-blue: var(--map-bg, #2E42FF); /* Ajusta si tu bg usa otro azul exacto */
}

/* Panel del menú: fondo azul */
.mobile-menu{
  background: var(--menu-blue) !important;
}

/* Botones: flat, texto blanco, borde blanco cuadrado */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  background: transparent !important;
  color: #fff !important;
  border: 1.5px solid #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.mobile-menu .submenu .submenu-item{ background: transparent !important; }

/* Estados */
.mobile-menu .menu-item:hover,
.mobile-menu .submenu-item:hover{ background: rgba(255,255,255,0.08) !important; }
.mobile-menu .menu-item:active,
.mobile-menu .submenu-item:active{ background: rgba(255,255,255,0.16) !important; }
.mobile-menu .menu-item:focus,
.mobile-menu .submenu-item:focus,
.mobile-menu .menu-item.is-active,
.mobile-menu .submenu-item.is-active{
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* Quick action arriba */
.menu-quick-actions .menu-item{
  background: transparent !important;
  color: #fff !important;
  border: 1.5px solid #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Icono hamburguesa: fondo transparente, barras blancas */
.hamburger-btn{
  background: transparent !important;
  border: none !important;
  width: 44px; height: 44px;
  box-shadow: none !important;
}
.hamburger-btn .bar{
  background: #fff !important;
  width: 26px; height: 3px;
  margin: 4.5px 0;
  border-radius: 3px;
}
.hamburger-btn.open .bar:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.hamburger-btn.open .bar:nth-child(2){ opacity: 0; }
.hamburger-btn.open .bar:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }


/* --- diesel-like overrides --- */

/* === Diesel-like flat aesthetic (blue/white) === */
:root{ --menu-blue: var(--map-bg, #2E42FF); }

/* Panel del menú full-bleed y editorial */
/*.mobile-menu{
  background: var(--menu-blue) !important;
  width: min(86vw, 420px) !important;
  border-left: 2px solid #fff;
}*/

/* Botones flat en mayúsculas, bold, tracking, borde blanco cuadrado */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  text-transform: uppercase !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  font-size: .95rem !important;
  line-height: 1.1 !important;
  padding: 14px 14px !important;
  background: transparent !important;
  color: #fff !important;
  /*border: 2px solid #fff !important;*/
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px !important;
}
.mobile-menu .submenu .submenu-item{ background: transparent !important; }
.mobile-menu .menu-item:hover,
.mobile-menu .submenu-item:hover{ background: rgba(255,255,255,0.08) !important; }
.mobile-menu .menu-item:active,
.mobile-menu .submenu-item:active{ background: rgba(255,255,255,0.16) !important; }
.mobile-menu .menu-item:focus,
.mobile-menu .submenu-item:focus,
.mobile-menu .menu-item.is-active,
.mobile-menu .submenu-item.is-active{
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* Subrayado tipo barra en hover (marca Diesel) */
.mobile-menu .menu-item::after,
.mobile-menu .submenu-item::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease-out;
}
.mobile-menu .menu-item:hover::after,
.mobile-menu .submenu-item:hover::after{ transform: scaleX(1); }

/* Quick action arriba consistente */
.menu-quick-actions .menu-item{
  background: transparent !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  border-radius: 0 !important;
}

/* Icono hamburguesa con 3 barras blancas más gruesas, fondo transparente */
.hamburger-btn{ background: transparent !important; border: none !important; width: 50px; height: 50px; box-shadow: none !important; }
.hamburger-btn .bar{ background: #fff !important; width: 28px; height: 3px; margin: 5px 0; border-radius: 3px; }
.hamburger-btn.open .bar:nth-child(1){ transform: translateY(8px) rotate(45deg); }
.hamburger-btn.open .bar:nth-child(2){ opacity: 0; }
.hamburger-btn.open .bar:nth-child(3){ transform: translateY(-8px) rotate(-45deg); }

/* Backdrop más oscuro para contraste */
.menu-backdrop{ background: rgba(0,0,0,.4) !important; }



/* === Header coherence when menu is open === */
body.menu-open header{ background: var(--menu-blue, var(--map-bg, #2E42FF)) !important; }
/* Invert logo to white when on blue header */
body.menu-open header .logo img,
body.menu-open header img.logo,
body.menu-open header .logo svg {
  filter: brightness(0) invert(1);
}
/* Make header links/icons white for contrast */
body.menu-open header a,
body.menu-open header .nav-buttons button,
body.menu-open header .nav-buttons a,
body.menu-open header .icon,
body.menu-open .hamburger-btn .bar{
  color: #fff !important;
  fill: #fff !important;
  stroke: #fff !important;
  background: #0f3aef !important;
}
/* Keep hamburger background transparent on open */
body.menu-open .hamburger-btn{ background: transparent !important; border-color: transparent !important; }



/* === Full-bleed header stripe when menu is open === */
/* removed full-bleed stripe */
/* ensure header itself stays above the stripe */
header{ position: sticky; z-index: 999; }
/* removed fixed header override on mobile */

/* === Vertical hamburger icon (three vertical white bars) === */
.hamburger-btn{
  background: transparent !important;
  border: none !important;
  width: 48px; height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px; /* spacing between columns */
}
.hamburger-btn .bar{
  display: inline-block;
  width: 3px;              /* vertical stroke */
  height: 22px;
  background: #fff !important;
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease;
}

/* Close (X) state: outer bars cross, middle disappears */
.hamburger-btn.open .bar:nth-child(1){
  transform: translateY(0) rotate(45deg) scaleY(1.2);
}
.hamburger-btn.open .bar:nth-child(2){
  opacity: 0;
}
.hamburger-btn.open .bar:nth-child(3){
  transform: translateY(0) rotate(-45deg) scaleY(1.2);
}


/* --- classic hamburger overrides --- */

/* === Classic hamburger (horizontal) with clear X overlay === */
.hamburger-btn{ width:48px; height:48px; display:inline-grid; place-items:center; position:relative; border:0; background:transparent; }
.hamburger--classic .hamburger__bar{
  display:block; width:26px; height:3px; background:#fff; margin:4px 0; border-radius:2px;
  transition:transform .18s ease, opacity .18s ease;
}
.hamburger--classic .hamburger__close{
  position:absolute; inset:0; display:grid; place-items:center;
  color:#fff; font:700 22px/1 sans-serif; opacity:0; transition:opacity .12s ease;
}
/* morph to X and fade-in the close glyph */
.hamburger--classic.open .hamburger__bar:nth-child(1){ transform:translateY(7px) rotate(45deg); }
.hamburger--classic.open .hamburger__bar:nth-child(2){ opacity:0; }
.hamburger--classic.open .hamburger__bar:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }
.hamburger--classic.open .hamburger__close{ opacity:1; }


/* header normalize */
header{
  position: sticky;
  top: 0;
  z-index: 999;
  margin: 0;
  border: 0;
}
body{ margin:0; }

/* Ensure the close X is clearly visible and above bars */
.hamburger--classic .hamburger__close{
  z-index: 2;
  color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,.35);
  pointer-events: none;
}
/* Fully hide all bars on open for clarity */
.hamburger--classic.open .hamburger__bar{ opacity: 0; }
.hamburger--classic.open .hamburger__bar:nth-child(1){ transform: none; }
.hamburger--classic.open .hamburger__bar:nth-child(3){ transform: none; }

/* --- svg toggle icons (integrated) --- */

/* === SVG toggle icons (clásico ≡/✕) === */
.hamburger-btn{
  width: 48px; height: 48px;
  display: inline-grid; place-items: center;
  position: relative;
  border: 0; background: transparent;
  color: #fff;
}
.hamburger-btn .icon{
  display: block;
  transition: opacity .14s ease, transform .18s ease;
}
.hamburger-btn .icon-menu{ opacity: 1; transform: scale(1); }
.hamburger-btn .icon-close{ opacity: 0; position: absolute; transform: scale(.9); }
.hamburger-btn.open .icon-menu{ opacity: 0; transform: scale(.9); }
.hamburger-btn.open .icon-close{ opacity: 1; transform: scale(1); }
.hamburger-btn:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }
body.menu-open .hamburger-btn{ color: #fff; }



/* === Toggle SVG: bigger, above panel; Mobile panel full-top === */
.hamburger-btn{
  width: 56px; height: 56px;
  position: fixed; top: 12px; right: 12px;
  z-index: 10010; /* Above menu panel/backdrop */
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: #fff;
}
.hamburger-btn .icon{ width: 32px; height: 32px; }
.hamburger-btn .icon-menu{ opacity: 1; transform: scale(1); transition: opacity .14s, transform .18s; }
.hamburger-btn .icon-close{ opacity: 0; position: absolute; transform: scale(.9); transition: opacity .14s, transform .18s; }
.hamburger-btn.open .icon-menu{ opacity: 0 !important; transform: scale(.9); }
.hamburger-btn.open .icon-close{ opacity: 1 !important; transform: scale(1); }

/* Ensure button stays visible even when menu is open */
body.menu-open .hamburger-btn{ color:#fff; }

/* Mobile menu panel covers from very top */
/*.mobile-menu{
  position: fixed !important;
  top: 0 !important; right: 0; bottom: 0;
  height: 80vh !important;
  z-index: 10000;
}*/

/* Optional: add top padding inside the panel so content doesn't hide behind the toggle */
.mobile-menu .menu-content,
.mobile-menu .menu-inner{ padding-top: 72px; } /* adjust if your structure differs */

/* Backdrop below toggle, above page */
.menu-backdrop{ z-index: 9990; }


/* --- top-down menu overrides --- */



/* Toggle fijo arriba a la derecha, siempre visible */
.hamburger-btn{
  position: fixed;
  top: 12px; right: 12px;
  z-index: var(--toggle-z);
}

/* Backdrop con blur por debajo del header y del menú */
.menu-backdrop{
  position: fixed !important;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  z-index: var(--backdrop-z);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.25);
}

/* Menú desplegable desde arriba hacia abajo (full width, altura % viewport) */
/*#mobileMenu.mobile-menu{
  position: fixed !important;
  top: var(--header-height);
  left: 0; right: 0;
  height: var(--menu-height);
  z-index: var(--menu-z);
  transform: translateY(-110%);
  transition: transform .25s ease;
  width: 100%;
  
  background: var(--menu-blue, var(--map-bg, #2E42FF)) !important;
  border-bottom: 2px solid #fff;
  overflow: auto;
}*/

/* Estado abierto: baja desde el top */
#mobileMenu.mobile-menu.open{
  transform: translateY(0);
}

/* Ajuste de padding interno para no quedar debajo del toggle */
#mobileMenu .menu-content, 
#mobileMenu .menu-inner{
  padding-top: 12px;
}

/* Opcional: en pantallas grandes mantiene el comportamiento */
@media (min-width: 1024px){
  #mobileMenu.mobile-menu{
    height: var(--menu-height);
  }
}

/* Sobrescribir posibles estilos antiguos de panel lateral */
/*#mobileMenu.mobile-menu{
  right: 0 !important; 
  width: 100% !important;
}*/


/* --- integrated: top-down + toggle fixes --- */

/* === Top-down mobile menu (below header), toggle always visible, backdrop under menu/header === */
:root{
  --header-height: 64px;
  --menu-height: 72vh;
}

header{ position: sticky; top: 0; z-index: 11000; }

.hamburger-btn{
  position: fixed; top: 12px; right: 12px;
  z-index: 12000;
  width: 56px; height: 56px;
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: #fff;
}
.hamburger-btn .icon{ width: 35px; height: 35px; transition: opacity .14s, transform .18s; }
.hamburger-btn .icon-menu{ opacity: 1; transform: scale(1); }
.hamburger-btn .icon-close{ opacity: 0; position: absolute; transform: scale(.9); }
.hamburger-btn.open .icon-menu{ opacity: 0 !important; transform: scale(.9); }
.hamburger-btn.open .icon-close{ opacity: 1 !important; transform: scale(1); }

.menu-backdrop{
  position: fixed !important;
  top: var(--header-height); left: 0; right: 0; bottom: 0;
  z-index: 10000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.25);
}

/*#mobileMenu.mobile-menu{
  position: fixed !important;
  top: var(--header-height);
  left: 0; right: 0;
  height: var(--menu-height);
  transform: translateY(-110%);
  transition: transform .25s ease;
  z-index: 11000; /* above backdrop, below toggle */
  width: 100% !important;
  background: var(--menu-blue, var(--map-bg, #2E42FF)) !important;
  border-bottom: 2px solid #fff;
  overflow: auto;
}*/
#mobileMenu.mobile-menu.open{ transform: translateY(0); }

#mobileMenu .menu-content,
#mobileMenu .menu-inner{ padding-top: 16px; }

/* "Volver al mapa" flat, sin fondo blanco */
#menuVolverMapa,
#menuVolverMapa.menu-item{
  background: transparent !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#menuVolverMapa:hover{ background: rgba(255,255,255,0.08) !important; }
#menuVolverMapa:active{ background: rgba(255,255,255,0.16) !important; }


/* -- header/menu stacking & volver azul overrides -- */

/* === enforce header/logo on top and menu below header === */
:root{
  --header-height: 72px; /* ajusta si tu header es más alto */
  --menu-height: 72vh;
  --z-toggle: 21000;
  --z-header: 20000;
  --z-menu: 15000;
  --z-backdrop: 14000;
}

header{
  position: sticky !important;
  top: 0 !important;
  z-index: var(--z-header) !important;
}

/* Toggle always over everything */
.hamburger-btn{
  position: fixed !important;
  top: 12px !important; right: 12px !important;
  z-index: var(--z-toggle) !important;
}

/* Backdrop under header/menu */
.menu-backdrop{
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: var(--z-backdrop) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.25);
}

/* Menu starts strictly below header */
/*#mobileMenu.mobile-menu{
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important; right: 0 !important;
  height: var(--menu-height) !important;
  width: 100% !important;
  transform: translateY(-110%) !important;
  transition: transform .25s ease !important;
  z-index: var(--z-menu) !important; 
  background: var(--menu-blue, var(--map-bg, #2E42FF)) !important;
  border-bottom: 2px solid #fff !important;
  overflow: auto !important;
}*/
#mobileMenu.mobile-menu.open{ transform: translateY(0) !important; }

/* Push items to clear header area */
#mobileMenu .menu-content,
#mobileMenu .menu-inner{
  padding-top: 20px !important;
}

/* --- "Volver al mapa" to blue background, white text --- */
#menuVolverMapa,
#menuVolverMapa.menu-item{
  background: var(--menu-blue, var(--map-bg, #2E42FF)) !important;
  color: #fff !important;
  border: 1.5px solid #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#menuVolverMapa:hover{ filter: brightness(1.05) !important; }
#menuVolverMapa:active{ filter: brightness(0.95) !important; }



/* === FORCE: header/toggle above menu; menu below header === */
/*:root{
  --header-height: 72px;
  --z-toggle: 3000000;
  --z-header: 2999990;
  --z-menu: 1000000;
  --z-backdrop: 900000;
}*/

header, body > header, .site-header{
  position: sticky !important;
  top: 0 !important;
  z-index: var(--z-header) !important;
}

#menuToggle, .hamburger-btn{
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
  z-index: var(--z-toggle) !important;
}

.menu-backdrop{
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: var(--z-backdrop) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.25);
}

#mobileMenu.mobile-menu,
.mobile-menu#mobileMenu{
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important; right: 0 !important;
  height: auto !important;
  width: 100% !important;
  transform: translateY(-150%) !important;
  transition: transform .25s ease !important;
  z-index: var(--z-menu) !important;
  background: var(--menu-blue, var(--map-bg, #2E42FF)) !important;
  /*border-bottom: 2px solid #fff !important;*/
  overflow: auto !important;
}
#mobileMenu.mobile-menu.open,
.mobile-menu#mobileMenu.open{ transform: translateY(0) !important; }

#mobileMenu .menu-content, #mobileMenu .menu-inner{
  padding-top: 20px !important;
}

/* botones zoom ubicaccion .....*/

.leaflet-top, .leaflet-bottom {
   position: fixed !important;
    bottom: 7.2em !important;
    z-index: 1000;
    pointer-events: none;

	
}
.leaflet-bar a {
    background-color: var(--map-bg, #2E42FF);
    border-bottom: 1px solid #fff;
    width: 26px;
    height: 26px;
    line-height: 26px;
    display: block;
    text-align: center;
    text-decoration: none;
    color: #fff;
}

.leaflet-bar a.leaflet-disabled {
    cursor: default;
    background-color: #0f3aef; /* azul hover*/
    color: #fff;
	
}


.leaflet-bar a:hover, .leaflet-bar a:focus {
    background-color: #0f3aef;
}
.bottomleft {
	
	
	
}




/* === Mobile menu polish === */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
/* Auto height with safe viewport and scrolling when needed */
.mobile-menu{
  max-height: calc(100vh - 64px) !important; /* leave room for header */
  height: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
/* Ensure submenu also scrolls if it exceeds viewport */
.mobile-menu .submenu{
  max-height: 60vh;
  overflow-y: auto;
}
/* Avoid white separators if any list uses borders */
.mobile-menu .menu-root > li,
.mobile-menu .submenu > li{
  border: none !important;
}
/* Make tap areas comfy without increasing borders */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  padding: 12px 14px;
}

/* === Mobile menu polish (v2) === */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 8px 12px !important; /* reduced vertical padding */
}
.mobile-menu{
  max-height: calc(100vh - 64px) !important;
  height: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu .menu-root > li,
.mobile-menu .submenu > li{
  border: none !important;
}
.mobile-menu .submenu{
  max-height: 60vh;
  overflow-y: auto;
}


/* === Menu UX polish (focus/underline/scroll stability) === */
.mobile-menu .menu-item,
.mobile-menu .submenu-item,
.mobile-menu .menu-item:focus,
.mobile-menu .submenu-item:focus,
.mobile-menu .menu-item:active,
.mobile-menu .submenu-item:active,
.mobile-menu .menu-item:focus-visible,
.mobile-menu .submenu-item:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}
/* Remove underline for 'Sitio web' link styled as menu-item */
.mobile-menu a.menu-item,
.mobile-menu a.menu-item:hover,
.mobile-menu a.menu-item:focus{
  text-decoration: none !important;
}

/* Reduce vertical padding a bit más */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  padding: 8px 12px !important;
}

/* Sticky header/footer + no layout jump on scroll */
html{ overflow-y: scroll; } /* evita salto por aparición/desaparición del scroll */
body{ overscroll-behavior-y: none; }
header{ position: sticky; top: 0; z-index: 1000; }
.footer{ position: sticky; bottom: 0; z-index: 999; }

/* Si el contenido tapiza toda la pantalla, permitimos scroll suave sin mover header/footer */
main{ padding-bottom: 56px; } /* reserva espacio para el footer sticky */


/* === Cross-device reinforcement: menu size, sticky fallback, safe areas === */

/* Consistent vertical rhythm for menu items */
:root{
  --menu-item-vpad: 10px;     /* vertical padding */
  --menu-item-hpad: 14px;     /* horizontal padding */
  --menu-item-minh: 48px;     /* recommended tap target */
  --menu-font-size: 16px;
}

/* Normalize menu items (buttons & links) */
.mobile-menu .menu-item,
.mobile-menu .submenu-item{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--menu-item-vpad) var(--menu-item-hpad) !important;
  min-height: var(--menu-item-minh);
  line-height: 1.25;
  font-size: var(--menu-font-size);
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* Submenu inherits same rhythm */
.mobile-menu .submenu .submenu-item{
  padding: var(--menu-item-vpad) var(--menu-item-hpad) !important;
  min-height: var(--menu-item-minh);
}

/* Equal spacing for LI wrappers if they had borders */
.mobile-menu .menu-root > li,
.mobile-menu .submenu > li{
  border: none !important;
  margin: 0;
  padding: 0;
}

/* Scroll behavior + viewport safety */
html{ overflow-y: scroll; scroll-padding-top: 64px; } /* room for sticky header when jumping via anchors */
body{ overscroll-behavior-y: none; }

/* Sticky header/footer with safe-area support (modern) */
@supports (position: sticky){
  header{ position: sticky; top: 0; z-index: 1000; padding-top: env(safe-area-inset-top); }
  .footer{ position: sticky; bottom: 0; z-index:2147483647 !important;; padding-bottom: env(safe-area-inset-bottom); }
}

/* Fallback for old browsers: fixed header/footer */
@supports not (position: sticky){
  header{ position: fixed; top: 0; left: 0; right: 0; z-index: 1000; }
  .footer{ position: fixed; bottom: 0; left: 0; right: 0; z-index: 999; }
  main{ padding-top: 56px; padding-bottom: 56px; }
}

/* Prevent layout jumps when mobile browser UI shows/hides */
@media (max-width: 820px){
  .mobile-menu{
    max-height: calc(100dvh - 64px) !important; /* dVH handles dynamic viewport on mobile */
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* Slightly smaller type on very small phones, keeping min tap size */
@media (max-width: 360px){
  :root{ --menu-font-size: 15px; }
}

/* Focus states accessible but subtle (no visual "marco") */
.mobile-menu .menu-item:focus-visible,
.mobile-menu .submenu-item:focus-visible{
  outline: none !important;
  box-shadow: 0 0 0 0 rgba(0,0,0,0) !important;
}


/* === Modal caption under image === */
.modal-extended{ display:flex; gap:16px; }
.modal-left{ flex: 0 0 auto; }
.modal-left img{ display:block; max-width: 100%; height:auto; }
.modal-caption{ margin-top:8px; display:flex; flex-direction:column; gap:6px; }
.cap-line{ display:flex; gap:8px; align-items:baseline; }
.cap-label{ min-width: 130px; font-size: 0.88rem; opacity: .85; }
.cap-value{ font-size: 0.95rem; line-height: 1.35; }
@media (max-width: 720px){
  .modal-extended{ flex-direction: column; }
  .cap-label{ min-width: 110px; }
}


/* === Modal caption robust === */
.modal-caption{ margin-top:8px; display:flex; flex-direction:column; gap:8px; }
.cap-line{ display:flex; gap:10px; align-items:baseline; }
.cap-label{ min-width: 120px; font-weight: 500; opacity:.9; }
.cap-value{ flex:1; }


/* === Modal caption layout === */
.modal-extended{ display:flex; gap:16px; }
.modal-left{ flex:0 0 auto; max-width: 50%; }
.modal-left img{ display:block; max-width:100%; height:auto; }
.modal-caption{ margin-top:8px; display:flex; flex-direction:column; gap:8px; }
.cap-line{ display:flex; gap:10px; align-items:baseline; }
.cap-label{ min-width: 120px; font-weight: 600; opacity:.9; }
.cap-value{ flex:1; }
@media (max-width: 800px){
  .modal-extended{ flex-direction: column; }
  .modal-left{ max-width: 100%; }
}


/* === Modal caption plain (ordered fields under image) === */
.modal-caption--plain{ margin-top:10px; display:flex; flex-direction:column; gap:6px; }
.cap-line--plain{ font-size: 0.95rem; line-height: 1.35; }
.modal-left img{ display:block; max-width:100%; height:auto; }
.modal-extended{ display:flex; gap:16px; }
@media (max-width: 800px){
  .modal-extended{ flex-direction: column; }
}


/* === Modal: campos bajo imagen (título encabezado + artista en negrita) === */
.modal-extended{ display:flex; gap:16px; }
.modal-left{ flex:1 1 auto; max-width:100%; }
.modal-left img{ display:block; max-width:100%; height:auto; }
.modal-caption--plain{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }
.cap-title{ font-size:1.35rem; line-height:1.25; margin:0 0 2px 0; }
.cap-artist strong{ font-weight:700; }
.cap-line{ font-size:0.95rem; line-height:1.35; }
@media (max-width: 800px){
  .modal-extended{ flex-direction: column; }
  .cap-title{ font-size:1.25rem; }
}


/* === Modal image: at least half-screen height without distortion === */
.modal-image-frame{
  height: 50vh; /* fallback */
  height: 80svh; /* modern small viewport unit */
  max-height: 94svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}
.modal-image-frame img{
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
/* Ensure caption/right column can scroll if needed */
.modal-left,
.modal-right{
  overflow: visible;
}
@media (max-width: 820px){
  .modal-image-frame{
    margin-top: 10px !important;
    height: 92svh;
    max-height: 94svh;
  }
}


/* === Modal layout: prioritize image (wider left, taller frame) === */
.modal-extended{
  display:flex;
  gap:20px;
  align-items:flex-start;
}
.modal-left{
  flex: 0 1 62%;
  max-width: 62%;
}
.modal-right{
  flex: 1 1 38%;
  max-width: 38%;
  max-height: 78svh;
  overflow: auto;
}
/* Taller image frame */
.modal-image-frame{
  height: 80svh;
  max-height: 94svh;
}
/* Make sure the image remains undistorted */
.modal-image-frame img{
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
}
@media (max-width: 1024px){
  .modal-left{ flex-basis: 60%; max-width: 60%; }
  .modal-right{ flex-basis: 40%; max-width: 40%; }
}
@media (max-width: 820px){
  .modal-extended{ flex-direction: column; 
  padding-top: 8px;
}
  .modal-left, .modal-right{ flex-basis: 100%; max-width: 100%; }
  .modal-image-frame{ height: 80svh; max-height: 94svh; }
  .modal-right{ max-height: unset; overflow: visible; }
}



/* === Modal-left taller, higher placement, no image distortion === */
.modal-extended{
  align-items: flex-start;      /* asegura tope superior */
  padding-top: 0;               /* arriba, sin relleno extra */
}
.modal-left{
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 80svh;           /* contenedor más alto */
  margin-top: 0;               /* ubicado más arriba */
}
/* Mantiene imagen sin deformación y prioriza altura */
.modal-image-frame{
  height: 80svh;
  max-height: 94svh;
  margin-top: 0;
}
.modal-image-frame img{
  object-fit: contain;
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  display: block;
	
}
@media (max-width: 820px){
  .modal-left{ min-height: 92svh; margin-top: 0; }
  .modal-image-frame{ height: 80svh; max-height: 94svh; margin-top: 20px; } /* asegura visibilidad del cerrar */
}



/* === Modal image cleanup (no rounded border, no shadow) === */
.modal-left img,
.modal-image-frame img{
  border-radius: 0 !important;
  box-shadow: none !important;
object-fit: cover;      /* <- clave para cubrir */
  object-position: center;/* centra la imagen (ajústalo si el foco no está al centro) */
  /*max-height: 100%;*/
  
 /* height: auto;*/
  
   display: block;	
	height: 60svh; max-height: 64svh; margin-top: 5px; 
}



/* === Small-screen modal layout: prioritize image near top === */
@media (max-width: 820px){
  .modal-extended{ 
    flex-direction: column; 
    align-items: flex-start; 
    padding-top: 0; 
    margin-top: 0;
  }
  .modal-left{
    min-height: 80svh !important;   /* taller container on small screens */
    margin-top: 0 !important;       /* hug the top */
  }
  .modal-image-frame{
    height: 80svh !important;       /* show mostly image */
    max-height: 94svh !important;
    margin-top: 20px !important;    /* keep close button visible */
  }
  .modal-right{
    max-height: unset !important;
    overflow: visible !important;
  }
}







/* === Active popup artist line === */
.active-linear-popup .popup-artist{
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}


/* === Z-INDEX Header LAYER =========================================== */
/* Header siempre visible; solo por debajo de modal/overlay e install prompts */
header, .app-header, #appHeader {
  position: sticky;     /* o fixed según tu implementación */
  top: 0;
  z-index: 820 !important;  /* > footer(800) si quieres que quede encima; ajustable */
}

/* Si el header contiene el switcher de idioma, no dejar que salte por encima del modal */
header #mnba-lang-switcher, .app-header #mnba-lang-switcher {
  z-index: 821 !important; /* apenas sobre contenido del header */
}

/* Asegurar que modales y prompts sigan arriba de todo */
#modalOverlay, #modalRoot, .modal, .modal-backdrop,
.pwa-install-tip, #iosInstallTip, #installPrompt {
  z-index: 1000 !important;
}


/* Splash por debajo de header y footer */
#welcome-screen, .welcome-screen {
  z-index: 700 !important;
  position: fixed;
}


/* Controles flotantes por encima de header/footer */
.leaflet-top, .leaflet-control, .floating-msg, .toast {
  z-index: 900 !important;
}

/* === Z-INDEX LAYERS (override) ====================================== */
/* Footer visible above splash, below modals & install prompts */
.footer {
  position: sticky; /* or fixed depending on your setup */
  bottom: 0;
  z-index: 800 !important;
}

/* Splash under footer */
#welcome-screen, .welcome-screen {
  z-index: 700 !important;
  position: fixed;
}

/* Language switcher should not sit above modals */
#mnba-lang-switcher, .lang-switcher, .language-switcher {
  z-index: 805 !important; /* slightly above footer content if inside it */
}

/* Leaflet controls / floating ui */
.leaflet-top, .leaflet-control, .floating-msg, .toast {
  z-index: 900 !important;
}

/* Modal + overlay (top layer) */
#modalOverlay, #modalRoot, .modal, .modal-backdrop, .pwa-install-tip, #iosInstallTip, #installPrompt {
  z-index: 1000 !important;
  position: fixed;
}

/* Hard override if any element had INT_MAX z-index */
*[style*="2147483647"], .z-max, .max-z, .over-max {
  z-index: 900 !important; /* cap it to a sane layer by default */
}



/* =========================
   Filters Panel — normalized animation (reuses legend/popup motion)
   Keeps existing functionality; only adds visual entrance animation.
   ========================= */
#filters-panel {
  will-change: opacity, transform;
}

#filters-panel.active {
  animation: tooltipIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Respect accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  #filters-panel.active { animation: none; }
}




.modal-photo-figure { margin: 0 0 .75rem 0; }
.modal-photo-figure > img { display: block; width: 100%; height: auto; border-radius: 8px; }
.modal-photo-caption {
  margin-top: .35rem;
  font-size: .875rem;
  line-height: 1.35;
  color: var(--caption-color, rgba(255,255,255,.92));
  background: rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: .5rem .65rem;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}
@media (prefers-color-scheme: light) {
  .modal-photo-caption {
    color: rgba(16,33,43,.9);
    background: rgba(255,255,255,.6);
    border-color: rgba(0,0,0,.06);
  }
}
.modal-photo-caption .photo-desc { margin-bottom: .25rem; }
.modal-photo-caption .photo-credit .label {
  opacity: .8;
  font-weight: 600;
  margin-right: .35rem;
}



/* bottom overlay */
  padding: .35rem .55rem;
  background: transparent; /* same as panel/background; no band effect */
  color: var(--caption-fg, rgba(128, 140, 150, .95)); /* smaller gray */
  font-size: .78rem;
  line-height: 1.25;
  border: 0; 
  border-radius: 0 0 8px 8px; /* aligns with image corners */
  box-shadow: none;
  backdrop-filter: none; 
  -webkit-backdrop-filter: none;
  pointer-events: none; /* don't block interactions */
  text-shadow: 0 1px 2px rgba(0,0,0,.25); /* legibility without background strip */
}
@media (prefers-color-scheme: light) {
  .modal-photo-caption {
    color: rgba(90, 100, 110, .95);
    text-shadow: 0 1px 2px rgba(255,255,255,.35);
  }
}
.modal-photo-caption .photo-desc { margin: 0; }
.modal-photo-caption .photo-credit { margin-top: .15rem; opacity: .9; }
.modal-photo-caption .photo-credit .label { 
  opacity: .8; 
  font-weight: 600; 
  margin-right: .35rem; 
}



/* ===== Modal image caption below the image (darker gray, small type) ===== */
.modal-photo-figure { margin: 0 0 .75rem 0; position: relative; }
.modal-photo-figure > img { display: block; width: 100%; height: auto; border-radius: 8px; }

.modal-photo-caption {
  position: static;            /* below image */
  margin-top: -0.5rem;
  padding: 0 .55rem 0 .55rem; /* soft spacing, no heavy band */
  background: transparent;
  color: var(--caption-fg, #333);   /* darker gray */
  font-size: .8rem;
  line-height: 1.35;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (prefers-color-scheme: dark) {
  .modal-photo-caption { color: #333; }
}

.modal-photo-caption .photo-desc { margin: 0 ; }
.modal-photo-caption .photo-credit { opacity: .9; }
.modal-photo-caption .photo-credit .label { opacity: .85; font-weight: 600; margin-right: .35rem; }


#leyenda-box.collapsed {
  display: none !important;
}


/* Forzar que el botón de simbología sea visible sobre el mapa */
.leaflet-control.legend-toggle-control,
.leaflet-control.legend-toggle-control.leaflet-bar,
.leaflet-bottom.leaflet-right .legend-toggle-control {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 1004;
}


/* Leyenda como panel tipo bottom-sheet (similar a filtros) */
#leyenda-box {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 16px 20px;
  border-radius: 18px 18px 0 0;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #000;
  z-index: 2147483646; /* justo debajo de #filters-panel */
}

/* Ocultar completamente cuando está colapsado */
#leyenda-box.collapsed {
  display: none !important;
}

/* Asegurar que el contenido de la lista pueda hacer scroll si es largo */
#leyenda-box .legend-content,
#leyenda-box .legend-spaces {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Alinear cabecera y dar aire */
#leyenda-box .legend-titlebar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:12px;
}

#leyenda-box .legend-title {
  font-weight:600;
  text-transform:uppercase;
  font-size:0.9rem;
  letter-spacing:.04em;
}

/* Botón cerrar dentro del panel */
#cerrar-leyenda {
  position: relative;
  top: 0;
  left: 0;
  margin: 0 0 0 8px;
}

/* (rule removed: footer remains active under legend) */


/* Ajuste final: leyenda como panel full-width que cubre footer */
#leyenda-box {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  border-radius: 18px 18px 0 0;
  z-index: 2147483647 !important;
}

/* (legend-open footer opacity rule removed) */


/* Glass style for leyenda/simbología panel (azul oscuro semi-transparente, alto >= 50vh) */
#leyenda-box {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 14px 18px 22px !important;
  border-radius: 20px 20px 0 0 !important;
  background: linear-gradient(
    135deg,
    rgba(15, 40, 120, 0.44),
    rgba(18, 82, 185, 0.38)
  ) !important;
  backdrop-filter: blur(22px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(155%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.38) !important;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.30) !important;
  color: #f5f8ff !important;
  z-index: 2147483646 !important;
  min-height: 50vh !important;
}

/* Mantener comportamiento de colapsado desde JS */
#leyenda-box.collapsed {
  display: none !important;
}

/* Panel alto con scroll interno suave para contenidos largos */
#leyenda-box .legend-content,
#leyenda-box .legend-spaces {
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ajustes visuales para el título de la leyenda */
.legend-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.legend-title {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5f8ff;
}


/* --- Leyenda / Simbología: bottom sheet alto con scroll cómodo --- */
#leyenda-box {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  max-height: 60vh !important;
  min-height: 50vh !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 14px 18px 22px !important;
  border-radius: 20px 20px 0 0 !important;
  background: linear-gradient(
    135deg,
    rgba(15, 40, 120, 0.44),
    rgba(18, 82, 185, 0.38)
  ) !important;
  backdrop-filter: blur(22px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(155%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.38) !important;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.30) !important;
  color: #f5f8ff !important;
  z-index: 2147483646 !important;
}

#leyenda-box.collapsed {
  display: none !important;
}

/* Cabecera + contenido en columna */
#leyenda-box .legend-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

#leyenda-box .legend-title {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5f8ff;
}

/* Área principal de contenido: ocupa todo el alto disponible y hace scroll */
#leyenda-content {
  flex: 1 1 auto;
  margin-top: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: none !important; /* anulamos max-height anteriores */
}

/* Por si hay listas internas, respetar el scroll del contenedor principal */
#leyenda-content .legend-spaces {
  padding-bottom: 8px;
}

/* === Panel de filtros: bottom-sheet glass desde abajo (override) === */
#filters-panel {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 auto !important;
  padding: 14px 18px 20px !important;
  border-radius: 20px 20px 0 0 !important;
  background: linear-gradient(
    135deg,
    rgba(10, 35, 96, 0.76),
    rgba(18, 82, 185, 0.68)
  ) !important;
  backdrop-filter: blur(22px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.32) !important;
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.40) !important;
  color: #f5f8ff !important;
  z-index: 2147483646 !important;
}

/* Contenido interno con scroll si se llena mucho */
#filters-panel .filters-content,
#filters-panel .filters-body,
#filters-panel .filters-inner {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================
   Title bars (sticky) — Filtros + Simbología
   ========================= */

/* Filtros: titlebar siempre visible y scroll solo en el contenido */
#filters-panel {
  display: flex;
  flex-direction: column !important;
  overflow: hidden !important;
  max-height: 60vh !important;
}

#filters-panel .filters-titlebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0 10px;
  margin-bottom: 4px;
  background: linear-gradient(
    135deg,
    rgba(10, 35, 96, 0.92),
    rgba(18, 82, 185, 0.86)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

#filters-panel .filters-title {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}

#filters-panel .filters-close {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 1.15rem;
}

#filters-panel .filters-inner {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: none !important;
  padding-bottom: 10px;
}

/* Simbología: mostrar título (override de styles.css) y mantener cabecera siempre visible */
#leyenda-box {
  overflow: hidden !important;
}

/* Simbología: mismo comportamiento/animación tipo "bottom sheet" que Filtros */
#leyenda-box {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;

  width: 100% !important;
  max-width: none !important;
  max-height: 60vh !important;

  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;

  border-radius: 18px 18px 0 0 !important;

  transform: translateY(100%);
  opacity: 0.98;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease, box-shadow 280ms ease;
}

#leyenda-box:not(.collapsed) {
  transform: translateY(0);
  pointer-events: auto;
}

#leyenda-box.collapsed {
  transform: translateY(100%);
  pointer-events: none;
}

/* En móvil, asegurar que no quede como "caja flotante" del CSS base */
@media (max-width: 768px) {
  #leyenda-box {
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-height: 60vh !important;
  }
}

#leyenda-box .legend-title {
  display: block !important;
}

#leyenda-box .legend-titlebar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  margin-bottom: 4px;
  background: linear-gradient(
    135deg,
    rgba(15, 40, 120, 0.62),
    rgba(18, 82, 185, 0.52)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

#leyenda-box .legend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#leyenda-box #cerrar-leyenda {
  position: static !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 1.15rem;
}

#leyenda-content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Columna flotante derecha unificada: iconos filtros, simbología, zoom, piso === */

/* Posición base de la columna (desktop) */
:root {
  --ui-column-right: 16px;
  --ui-column-center-v: 56vh;
}

/* En móviles, bajar un poco la columna */
@media (max-width: 768px) {
  :root {
    --ui-column-center-v: 57vh;
  }
}

/* Botón de filtros (header) arriba de la columna */
#filters-header-btn {
  position: fixed !important;
  right: var(--ui-column-right) !important;
  margin-right: 5px!important;
  left: auto !important;
  top: calc(var(--ui-column-center-v) - 170px) !important;
  z-index: 1001 !important;
  padding: 5px !important;

	
  width: 40px; 
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  background: #0A5BD7;
  border-radius: 30px;
  display: grid; 
	place-items: center;
  line-height: 0;
	
  cursor: pointer;
	
	
}

/* Botón de simbología debajo del filtro */
.leaflet-bottom.leaflet-right .legend-toggle-control {
  position: fixed !important;
  right: var(--ui-column-right) !important;
  top: calc(var(--ui-column-center-v) - 105px) !important;
	margin-right: 5px!important;
 /* margin: 0 !important;*/
  z-index: 1000 !important;
	padding: 5px;
}

/* Zoom en el centro de la columna, con + y - apilados verticalmente */
.leaflet-control-zoom.leaflet-bar {
  position: fixed !important;
  right: var(--ui-column-right) !important;
  top: calc(var(--ui-column-center-v) - 40px) !important;
  z-index: 1000 !important;
  display: flex !important;
  flex-direction: column !important;
}


/* Unificar estilo visual: azul de fondo, iconos blancos, mismo tamaño */
#filters-header-btn,
.leaflet-bottom.leaflet-right .legend-toggle-control button,
.leaflet-control-zoom.leaflet-bar a,
#floorSelectForm select {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #0A5BD7 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  text-align: center;
}

/* Ajustes finos por tipo de control */
#filters-header-btn {
  font-size: 1.1rem;
}

.leaflet-bottom.leaflet-right .legend-toggle-control button {
  font-size: 1.1rem;
}

.leaflet-control-zoom.leaflet-bar a {
  line-height: 1;
}

#floorSelectForm select {
  font-size: 0.85rem;
}

/* Ocultar cualquier FAB de filtros flotante inferior */
#filters-fab,
#fab-filtros,
.filters-fab {
  display: none !important;
}

/* Social icons inside mobile menu */
.mobile-menu .menu-social {
  margin-top: 1.2rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.mobile-menu .menu-social .footer__social {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.mobile-menu .menu-social .social-link {
  opacity: 0.96;
}

/* Ensure footer bar is always visible (background color) */
.footer#app-footer {
  background: var(--map-bg, #2E42FF);
}


/* =====================================================
   OVERRIDE FINAL — Panel de Simbología (leyenda)
   - Elimina uso de .legend-header-btn
   - Scroll vertical habilitado en el contenido
   - Animación de abrir/cerrar igual a panel de filtros
   ===================================================== */

/* Seguridad: si existiera por caché/merge, ocultarlo */
#leyenda-box .legend-header-btn{ display:none !important; }

/* Misma lógica visual del panel de filtros (bottom-sheet + slide) */
#leyenda-box{
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;

  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;

  max-height: 60vh !important;
  border-radius: 20px 20px 0 0 !important;

  transform: translateY(100%) !important;
  opacity: .98 !important;
  pointer-events: none !important;
  will-change: transform, opacity !important;
  transition: transform .28s ease, opacity .2s ease, box-shadow .28s ease !important;
}

#leyenda-box:not(.collapsed){
  transform: translateY(0) !important;
  pointer-events: auto !important;
  animation: tooltipIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#leyenda-box.collapsed{
  transform: translateY(100%) !important;
  pointer-events: none !important;
}

/* Titlebar fijo (visible) */
#leyenda-box .legend-titlebar{
  flex: 0 0 auto !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}

/* Scroll vertical REAL: en flex containers, min-height:0 es clave */
#leyenda-content{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: none !important;
}

/* Si CSS base intenta colapsar #leyenda-content con max-height/opacity, lo anulamos al abrir */
#leyenda-box:not(.collapsed) #leyenda-content{
  max-height: none !important;
  opacity: 1 !important;
  transform: none !important;
  overflow-y: auto !important;
}
