
    body {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      position: relative;
      overflow-y: visible;
    }


    p.normal-display {
      line-height: 1.4em;
      hyphens: auto;
      font-size: 1.3em;
      margin-top: 1em;
    }


    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
    }
    .sub {
      font-size: 1.3em;
      font-weight: 100;
      line-height: 1.6;
    }

    #panel-container {
      position: relative;
      width: 100%;
      height: auto;
    }

    .map-container {
      position: absolute;
      top: 50px;
      left: 0;
      width: 100vw;
      height: calc(100vh - 50px);
      z-index: 1;
    }

    #mapContainer {
      height: 100vh;
    }

    #map {
      width: 100%;
      height: 100%;
    }

    #cardContainer {
      position: relative;
      width: 400px;
      margin-left: 130px;
      z-index: 20;
      margin-top: 30px;
    }

    .card {
      min-height: 300px;
      box-sizing: border-box;
      opacity: 0.8;
      cursor: pointer;
      transition: all 0.3s ease;
      background: white;
      font-size: 1.1em;
      line-height: 1.55;
      margin-top: 30px;
      position: relative;
      text-align: justify;
      hyphens: auto;
    }

    .card-id-icon {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 40px;
      height: 40px;
      background-color: black;
      border: 2px solid white;
      color: white;
      border-radius: 50%;
      text-align: center;
      font-size: 18px;
      font-weight: bold;
      z-index: 2;
      pointer-events: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .card.active {
      opacity: 1;
      background-color: #fff;
    }

    .card:hover {
      opacity: 1;
      background-color: #fff;
    }

    .card img {
      width: 100%;
      height: auto;
    }

    .card-texto {
      padding: 1em 2.5em 2em 2.5em;
    }

    .card-texto h3 {
      padding-top: 0px !important;

    }

    .casonas {
      align-items: stretch;
      /* en vez de flex-start, para que iguale altura */
      flex-wrap: wrap;
      /* permite que se acomode si se achica */
      min-height: 1px;
      background: white;
    }

    /* ANTES y DESPUÉS (SLIDER) */
    .ba-slider {
      position: relative;
      width: 100%;
      height: 500px;
      overflow: hidden;
    }

    .img-before,
    .img-after {
      position: absolute;
      offset-position: top -100px;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      user-select: none;
      pointer-events: none;
      object-position: center -300px;
    }

    .img-after {
      clip-path: inset(0 50% 0 0);
      z-index: 2;
    }

    .handle {
      position: absolute;
      top: 0;
      left: 50%;
      width: 3px;
      height: 100%;
      background: rgb(255 255 255);
      z-index: 3;
      cursor: ew-resize;
    }

    .handle::before,
    .handle::after {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      border: solid #fff;
      border-width: 0 3px 3px 0;
      padding: 6px;
      display: inline-block;
    }

    .handle::before {
      left: -20px;
      transform: translateY(-50%) rotate(135deg);
    }

    .handle::after {
      right: -20px;
      transform: translateY(-50%) rotate(-45deg);
    }

    .slider-desc {
      display: block;
      font-style: italic;
      font-size: 0.8em;
      padding: 0rem 3rem 0rem 3rem;
    }

    .casonas-icon {
      background-color: black;
      color: white;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      text-align: center;
      line-height: 30px;
      font-weight: bold;
      font-size: 14px;
      border: 2px solid white;
      box-shadow: 0 0 2px #000;
    }

    .custom-cluster-icon {
      background-color: #000000;
      color: white;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      text-align: center;
      line-height: 30px;
      font-weight: bold;
      font-size: 14px;
      border: 2px solid white;
      box-shadow: 0 0 2px #000;
    }

    .cluster-badge {
      position: absolute;
      top: -6px;
      right: -6px;
      background: white;
      color: #000000;
      font-size: 10px;
      font-weight: bold;
      width: 16px;
      height: 16px;
      line-height: 16px;
      text-align: center;
      border-radius: 50%;
      box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    }

    .custom-tooltip {
      background-color: #000;
      border: #000;
      color: white;
      font-size: 10px;
      line-height: 12px;
      opacity: 0.8;
      transition: ease-in;
    }

    /* Mapa casonas */

    #panel-casonas2-container {
      position: relative;
      display: flex;
      flex-direction: row;
      height: auto;
      min-height: 100vh;
      overflow: hidden;
      max-width: 100vw;
    }

    #mapa-casonas2-container {
      position: absolute;
      /* será modificado por JS */
      top: 0;
      right: 0;
      width: calc(100% - 600px);
      height: calc(100vh - 50px);
      z-index: 5;
    }

    #cardContainer3 {
      display: flex;
      flex-direction: row;
      width: 100%;
    }

    #galeria2-container {
      width: 600px;
      background: white;
      z-index: 2;
      overflow-y: auto;
      -ms-overflow-style: none;
      /* IE and Edge */
      scrollbar-width: none;
      /* Firefox */
      height: auto;
      padding: 1em;
      box-sizing: border-box;
    }

    #mapa3 {
      width: 100%;
      height: 100%;
    }

    .galeria-card {
      cursor: pointer;
      position:relative;
      overflow:hidden;
      background: white;
      padding: 0.5rem;
      width: 100%;
      box-sizing: border-box;
    }

    .galeria-card img {
      width: 100%;
      /* fuerza que use el ancho de la tarjeta */
      height: auto;
      object-fit: cover;
      
    }
    .img-wrap {overflow: hidden;
    }

    .galeria-card .img-wrap img:hover {
      transform: scale(1.02);
      transition: transform 0.2s;
    }


    #galeria2Grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
      width: 100%;
      box-sizing: border-box;
      height: 100%;
    }

    #detalle2 {
      position: sticky;
      margin-top: 50px;
      z-index: 3;
      background: white;
      padding: 3rem 1 rem 1 rem 1 rem;
      box-sizing: border-box;
      overflow-y: hidden;
      max-height: calc(100vh - 100px);
      display: none;
      top: 0;
    }

    #detalle2.visible {
      display: block;

    }

    #detalle2 img {
      width: 100%;
      height: auto;
      margin-bottom: 1rem;
      border-radius: 4px;
    }

    #detalle2 button {
      float: right;
      font-size: 1.5rem;
      background: none;
      border: none;
      cursor: pointer;
      color: #000;
      margin-bottom: 1rem;
    }

    /* Fin */
    #fin {
      display: block;
      height: auto;
    }


    /* CARRUSEL CASONAS */
    .carousel {
      position: relative;
      max-width: 100%;
      margin: 1em 0;
    }

    .carousel img {
      width: 100%;
    }

    .carrusel-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(0, 0, 0, 0.5);
      color: white;
      border: none;
      padding: 0rem;
      cursor: pointer;
      z-index: 10;
      font-size: 1.1rem;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .carousel-prev {
      left: 10px;
    }

    .carousel-next {
      right: 10px;
    }
/* BLOQUE SECCIONES IMG VID TXT */
.vidsec {
  display: block;
  width: 100% !important;
  margin: 0 auto;
  overflow: visible;
  transition: height 0.9s ease-in-out;
}
.trim {
  height: 500px;
  overflow:hidden !important;
}

.vidsec.fullscreen {
  height: 100vh;
}

.vidsec video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#fichaswrap .linkfichas { display:block; overflow:hidden; border-radius:8px; }
#fichaswrap .linkfichas img{
  width:100%; height:auto; display:block;
  transform-origin:center;
  transition:transform .3s ease;
  will-change:transform;
}
#fichaswrap .linkfichas:hover img{ transform:scale(2.02); }
@media (hover:none){ #fichaswrap .linkfichas:hover img{ transform:none; } }

    /*Forzar tipografías para unificar*/
    .custom-div-icon,
    .circle-icon,
    .card-id-icon,
    .casonas-icon,
    .custom-cluster-icon,
    .carrusel-central-btn,
    .carrusel-btn,
    .leaflet-div-icon {
      font-family: "Roboto", sans-serif !important;
    }


    /* Responsivo */
    @media (max-width: 1100px) {
      #panel-casonas2-container {
        flex-direction: column;
        min-height: auto;
      }

      #galeria2-container {
        width: 100%;
        height: auto;
        padding: 1rem;
      }

      #mapa-casonas2-container {
        position: relative !important;
        width: 100%;
        height: 100vh;
      }

      #galeria2Grid {
        display: none !important;
      }

      #galeria2-container {
        display: none !important;
      }

      #detalle2 {
        display: block !important;
        position: relative;
        max-height: none;
        margin-top: 1rem;
      }

      #popupDetalleMobile {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        justify-content: center;
        align-items: center;
      }

      #popupDetalleMobile .popup-contenido {
        background: white;
        padding: 1rem;
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
      }

      #popupDetalleMobile img {
        width: 100%;
        height: auto;
        margin-bottom: 1rem;
      }

      .cerrar-popup {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 2rem;
        background: none;
        border: none;
        cursor: pointer;
      }
    }

    @media (max-width: 768px) {
      #panel-container {
        flex-direction: column;
      }

      .map-container {
        position: relative;
        width: 100%;
        height: 300px;
        top: auto;
      }

      #cardContainer {
        width: 100%;
        padding: 1rem;
      }
    }