
.modal-layer-switcher-container {
    padding: 1px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
}

.layer-switcher-content {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    width: 100%;
    min-width: 400px;
    min-height: 350px;
}

.maplibregl-ctrl-switch-checkbox-label{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px !important;
}
.maplibregl-ctrl-switch-move-button{
 border: none !important;
}


.modal-system-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Agrega esto a tu CSS existente */
.modal-system-modal {
  position: absolute;
  width: 400px;
  max-width: 90%;
  background: #ffffff;
  border-radius: 12px;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 1050 !important;
  pointer-events: auto;
  touch-action: none;
  /* Transición suave para cambios de posición */
  /*transition: top 0.2s ease, left 0.2s ease;*/
    opacity: 0;
  transform: translateY(-8px) scale(0.98);
  visibility: hidden; /* ← OCULTA COMPLETAMENTE */
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s; /* ← visibility se activa al final */
    will-change: opacity, transform;
}

.daterangepicker {
  z-index: 1060 !important; /* Más alto que el modal */
}

.modal-system-modal.show {
  /*animation: modalSystemFadeIn 0.2s ease-out;*/
    opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0s; /* ← visibility inmediata */
}

/* ESTILOS CRÍTICOS PARA PANTALLA COMPLETA */
/* Comentados: JS ahora maneja el posicionamiento para evitar conflictos */
/*
.maplibregl-fullscreen .modal-system-modal:not(.fullscreen-manual),
.mapboxgl-fullscreen .modal-system-modal:not(.fullscreen-manual),
body.maplibregl-fullscreen .modal-system-modal:not(.fullscreen-manual),
body.mapboxgl-fullscreen .modal-system-modal:not(.fullscreen-manual) {
  position: fixed !important;
  z-index: 2147483647 !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}
*/

.maplibregl-fullscreen .modal-system-modal,
.mapboxgl-fullscreen .modal-system-modal,
.modal-system-modal.fullscreen-manual {
  transition: none !important;
}

.modal-system-modal:not(.fullscreen-manual) {
  position: absolute !important;
  transition: top 0.3s ease, left 0.3s ease;
}

/* Para cuando el body tiene la clase de pantalla completa */
/*
body.maplibregl-fullscreen .modal-system-modal,
body.mapboxgl-fullscreen .modal-system-modal {
  position: fixed !important;
  z-index: 2147483647 !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}
*/

/* Override para modales movidos manualmente en pantalla completa */
.modal-system-modal.fullscreen-manual {
  /*z-index: 2147483647 !important;*/
  position: fixed !important;
  transform: none !important; /* <- clave */
  transition: none !important;
}

.modal-system-modal.dragging {
  transition: none !important;
}

@keyframes modalSystemFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-system-header {
  background: #2c3e50;
  color: #fff;
  padding: 2px 15px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  user-select: none;
  -webkit-user-select: none;
}

.modal-system-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-system-close-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 28px;
    font-weight: 400;
  cursor: pointer;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  touch-action: manipulation;
}

.modal-system-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-system-body {
  padding: 15px;
  max-height: calc(80vh - 60px);
  overflow-y: auto;
  font-size: 15px;
    display: block !important; /* Asegura que no se oculte */
}

.modal-system-control-btn {
  position: absolute;
  z-index: 900;
  padding: 8px 16px;
  border: none;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}

/* Media queries responsive */
@media (max-width: 600px) {
  .modal-system-modal {
    width: 95%;
  }
  .modal-system-header {
    padding: 5px 15px;
  }
  .modal-system-title {
    font-size: 15px;
  }
  .modal-system-body {
    font-size: 14px;
    padding: 12px;
  }
  .modal-system-close-btn {
    font-size: 24px;
    width: 36px;
    height: 36px;
  }
  /* En móviles en pantalla completa */
  .maplibregl-fullscreen .modal-system-modal,
  .mapboxgl-fullscreen .modal-system-modal {
    width: 95% !important;
    max-width: 95% !important;
  }
}

/* CIERRE MÁS RÁPIDO */
.modal-system-modal:not(.show) {
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0s linear 0.15s;
}

/* modal-panel.css */
.modal-panel-content {
  font-family: 'Poppins', sans-serif;
}

/* Estilos para componentes comunes */
.modal-panel-form {
  padding: 15px;
}

.modal-panel-grid {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.modal-panel-section {
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

.modal-panel-section-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #495057;
  font-size: 14px;
}

/* Botones de acción */
.modal-panel-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

/* Listas y items */
.modal-panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-panel-list-item {
  padding: 8px 12px;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-panel-list-item:hover {
  background-color: #f8f9fa;
}

.modal-panel-list-item:last-child {
  border-bottom: none;
}

/* Tabs */
.modal-panel-tabs {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 15px;
}

.modal-panel-tab {
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
}

.modal-panel-tab.active {
  background: white;
  border-color: #dee2e6 #dee2e6 white;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-panel-content {
    padding: 10px !important;
  }
  .modal-panel-actions {
    flex-direction: column;
  }
  .modal-panel-actions .btn {
    width: 100%;
    margin-bottom: 5px;
  }
}


.modal-system-header-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.modal-system-minimize-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  touch-action: manipulation;
}

.modal-system-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-system-minimize-btn.minimized {
  transform: rotate(180deg); /* Opcional: girar al minimizar */
}

/* Estado minimizado */
.modal-system-modal.minimized {
  height: auto !important;
  max-height: none !important;
}

.modal-system-modal.minimized .modal-system-body {
  display: none !important;
}

.modal-system-modal.minimized .modal-system-header {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/*popup*/


 .maplibregl-popup {
      padding: 0 !important;
      /* quita espacio interno */
      margin: 0 !important;
    }

    /*.maplibregl-popup-content {*/
    /*  padding: 0 !important;*/
    /*  !* elimina padding predeterminado *!*/
    /*  background: transparent !important;*/
    /*  !* evita borde blanco extra *!*/
    /*  border: none !important;*/
    /*  box-shadow: none !important;*/
    /*  !* evita sombra doble *!*/
    /*  border-radius: 10px !important;*/
    /*  overflow: visible;*/
    /*  max-width: unset !important;*/
    /*  !* dejamos que .popup-card controle su ancho *!*/
    /*  max-height: unset !important;*/
    /*}*/

    .mapboxgl-popup-content {
      padding: 0 !important;
      /* elimina padding predeterminado */
      background: transparent !important;
      /* evita borde blanco extra */
      border: none !important;
      box-shadow: none !important;
      /* evita sombra doble */
      border-radius: 10px !important;
      overflow: visible;
      /*max-width: 800px !important;*/
      /*  !*width: 800px !important;*!*/
      /*!* dejamos que .popup-card controle su ancho *!*/
      /*!*max-height: unset !important;*!*/
      /*width: 600px  !important;*/
    }

    /* --- Flecha (tip) más integrada --- */
    .maplibregl-popup-tip {
      border-top-color: #fff !important;
      /* mismo fondo que el popup */
      /*margin-top: -8px;*/
      /*  margin-left: 10px;*/
      /* se pega mejor al borde inferior */
      transform: scale(1.1);
      /* leve aumento para continuidad */
    }

    /* --- Contenedor principal --- */

    /* .popup-card {
  width: 100%;
  max-width: 600px;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
} */
    .popup-card {
      font-family: "Poppins";
      color: #222;
      min-width: 240px;
      /*max-width: 360px;*/
      border-radius: 10px;
      overflow: hidden;
      /*background: #fff;*/
      box-shadow: 0 3px 15px rgba(0, 0, 0, 0.25);
      /*transform: translateY(-6px);*/
      /* lo eleva un poco del pin */
    }

    /* --- Cabecera --- */
    .popup-card__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background-color: rgb(142, 22, 22);
      /* color vino más oscuro */
      color: #fff;
      padding: 10px 12px;
      font-weight: 600;
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .popup-card__title {
      font-size: 15px;
      line-height: 1.2;
      margin: 0;
      flex: 1;
    }


    .popup-card__close {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 3px 10px 3px 3px;

  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  box-shadow: none;
  transition: transform 0.15s, opacity 0.15s;
}
.popup-card__close:hover {
  opacity: 0.9;
  transform: scale(1.1);
}
.popup-card__close:focus,
.popup-card__close:active {
  outline: none;
  box-shadow: none;
}

    /* --- Botón de cierre --- */


    /* --- Cuerpo --- */
    .popup-card__body {
      padding: 10px 12px 12px;
      background: #fff;
      font-size: 12px;
      line-height: 1.5;
      border-radius: 0 0 10px 10px;
         max-height: 60vh;
    }

    /*.popup-card__body b {*/
    /*  color: #000;*/
    /*}*/

    .popup-card__body button {
      display: inline-block;
      padding: 5px 12px;
      margin-top: 6px;
      font-size: 0.85rem;
      background: #f6f6f6;
      border: 1px solid #ccc;
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.2s;
    }

    .popup-card__body button:hover {
      background: #eaeaea;
    }

    /* --- Ajustes visuales de la flecha (tip) --- */
    .maplibregl-popup-tip {
      border-top-color: #fff !important;
      /* asegura que coincida con el fondo */
    }

    /* --- Para pantallas pequeñas o zoom alto --- */
    @media (max-width: 600px) {
      .popup-card {
        max-width: 90vw;
          min-width: 280px !important;
      }
    }

    /* Opcional: enlaces y tablas dentro del body */
/*    .popup-card__body a {*/
/*      color: #0d6efd;*/
/*      text-decoration: none;*/
/*    }*/

/*    .popup-card__body a:hover {*/
/*      text-decoration: underline;*/
/*    }*/

/*    .popup-card__body table {*/
/*      width: 100%;*/
/*      border-collapse: collapse;*/
/*      font-size: .9rem;*/
/*    }*/

/*    .popup-card__body td,*/
/*    .popup-card__body th {*/
/*      padding: .35rem .5rem;*/
/*      border-bottom: 1px solid #eee;*/
/*    }*/

/*!* asta aca el popup *!*/

/*    !* --- Estilos de tabla interna --- *!*/
/*    .popup-table {*/
/*      width: 100%;*/
/*      border-collapse: collapse;*/
/*      margin: 5px 0;*/
/*      font-size: 0.88rem;*/
/*    }*/

/*    .popup-table th {*/
/*      background-color: #f0f0f0;*/
/*      text-align: left;*/
/*      padding: 6px 8px;*/
/*      font-weight: 600;*/
/*      color: #333;*/
/*      border-bottom: 1px solid #ddd;*/
/*    }*/

/*    .popup-table td {*/
/*      padding: 6px 8px;*/
/*      border-bottom: 1px solid #eee;*/
/*      vertical-align: top;*/
/*      color: #222;*/
/*    }*/

/*    .popup-table tr:last-child td {*/
/*      border-bottom: none;*/
/*    }*/

/*    !* Opcional: resalta la primera columna *!*/
/*    .popup-table td:first-child {*/
/*      width: 40%;*/
/*      color: #000;*/
/*    }*/