html,
body{
    height:100%;
    margin:0;
    overflow:hidden;
    font-family:'Segoe UI', Arial, sans-serif;
    background:#111;
}

#mapa{
    width:100%;
    height:100vh;
}

.panel-atlas{
    position:absolute;
    top:20px;
    left:20px;
    width:410px;
    max-height:calc(100vh - 40px);
    z-index:1000;
    background:#fff;
    border-radius:26px;
    box-shadow:0 18px 55px rgba(0,0,0,.30);
    overflow:hidden;
    transform:translateX(0);
    opacity:1;
    transition:all .28s ease;
}

.panel-atlas.animando{
    transform:translateX(-16px);
    opacity:.92;
}

.panel-inner{
    padding:22px;
    overflow-y:auto;
    max-height:calc(100vh - 40px);
}

.panel-title{
    font-weight:800;
    margin:0;
    letter-spacing:-.5px;
}

.panel-subtitle{
    color:#666;
    margin-bottom:18px;
}

.marker-custom{
    width:22px;
    height:22px;
    border-radius:50%;
    border:3px solid #fff;
    box-shadow:0 3px 10px rgba(0,0,0,.40);
}

.lugar-header{
    position:relative;
    background:#111;
}

.hero-img{
    width:100%;
    height:260px;
    object-fit:cover;
    display:block;
}

.hero-overlay{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:45%;
    background:linear-gradient(
        to top,
        rgba(0,0,0,.70),
        rgba(0,0,0,0)
    );
}

.btn-volver{
    position:absolute;
    top:14px;
    left:14px;
    z-index:3;
    border-radius:999px;
    box-shadow:0 4px 14px rgba(0,0,0,.25);
}

.lugar-titulo-flotante{
    position:absolute;
    left:22px;
    right:22px;
    bottom:18px;
    z-index:2;
    color:#fff;
}

.lugar-titulo-flotante h3{
    margin:0;
    font-weight:800;
    text-shadow:0 3px 12px rgba(0,0,0,.45);
}

.badge-soft{
    border-radius:999px;
    padding:7px 10px;
    font-weight:600;
}

.descripcion-lugar{
    color:#444;
    line-height:1.55;
}

.galeria-scroll{
    display:flex;
    gap:10px;
    overflow-x:auto;
    padding-bottom:6px;
}

.galeria-scroll img{
    min-width:95px;
    width:95px;
    height:75px;
    object-fit:cover;
    border-radius:14px;
    cursor:pointer;
    border:3px solid transparent;
    transition:all .2s ease;
}

.galeria-scroll img:hover{
    transform:scale(1.04);
}

.galeria-scroll img.activa{
    border-color:#0d6efd;
}

.lista-lugar-btn{
    border:1px solid #eee;
    border-radius:14px;
    padding:12px;
    background:#fff;
    transition:all .18s ease;
}

.lista-lugar-btn:hover{
    background:#f8f9fa;
    transform:translateY(-1px);
}

.panel-actions .btn{
    border-radius:14px;
}

@media(max-width:768px){
    .panel-atlas{
        width:calc(100% - 30px);
        left:15px;
        top:15px;
        max-height:55vh;
        border-radius:22px;
    }

    .panel-inner{
        max-height:55vh;
    }

    .hero-img{
        height:210px;
    }
}
.lightbox-atlas{
    position:fixed;
    inset:0;
    z-index:5000;
    background:rgba(0,0,0,.92);
    display:none;
    align-items:center;
    justify-content:center;
}

.lightbox-atlas.activo{
    display:flex;
}

.lightbox-img{
    max-width:90vw;
    max-height:85vh;
    object-fit:contain;
    border-radius:12px;
    box-shadow:0 20px 60px rgba(0,0,0,.5);
}

.lightbox-btn{
    position:absolute;
    border:0;
    background:rgba(255,255,255,.15);
    color:#fff;
    width:48px;
    height:48px;
    border-radius:50%;
    font-size:26px;
    cursor:pointer;
}

.lightbox-btn:hover{
    background:rgba(255,255,255,.28);
}

.lightbox-cerrar{
    top:24px;
    right:24px;
}

.lightbox-prev{
    left:24px;
}

.lightbox-next{
    right:24px;
}

.lightbox-caption{
    position:absolute;
    bottom:24px;
    color:#fff;
    text-align:center;
    max-width:80vw;
}
.tabs-atlas{
    display:flex;
    gap:6px;
    overflow-x:auto;
    padding-bottom:6px;
}

.tab-atlas{
    border:0;
    background:#f1f3f5;
    color:#444;
    padding:8px 12px;
    border-radius:999px;
    font-size:13px;
    white-space:nowrap;
    cursor:pointer;
}

.tab-atlas.activo{
    background:#0d6efd;
    color:#fff;
}

.info-mini{
    background:#f8f9fa;
    border-radius:14px;
    padding:14px;
}

.info-mini p{
    margin-bottom:10px;
}

.galeria-grande{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
}

.galeria-grande img{
    width:100%;
    height:135px;
    object-fit:cover;
    border-radius:14px;
    cursor:pointer;
    transition:all .18s ease;
}

.galeria-grande img:hover{
    transform:scale(1.03);
}
.marker-ilustrado{
    width:42px;
    height:42px;
    border-radius:50% 50% 50% 8px;
    background:var(--marker-color, #0d6efd);
    display:flex;
    align-items:center;
    justify-content:center;
    transform:rotate(-45deg);
    box-shadow:0 6px 16px rgba(0,0,0,.35);
    border:3px solid #fff;
    transition:all .18s ease;
}

.marker-ilustrado span{
    transform:rotate(45deg);
    font-size:20px;
    line-height:1;
}

.marker-ilustrado:hover{
    transform:rotate(-45deg) scale(1.14);
    box-shadow:0 10px 24px rgba(0,0,0,.45);
}
.marker-ilustrado.activo{
    transform:rotate(-45deg) scale(1.22);
    box-shadow:
        0 0 0 8px rgba(13,110,253,.22),
        0 10px 28px rgba(0,0,0,.45);
    z-index:9999;
}

.marker-ilustrado.activo span{
    transform:rotate(45deg) scale(1.08);
}

.leaflet-marker-icon.marker-hover .marker-ilustrado,
.marker-ilustrado:hover{
    transform:rotate(-45deg) scale(1.16);
}

.marker-ilustrado.activo::after{
    content:'';
    position:absolute;
    inset:-10px;
    border-radius:50% 50% 50% 8px;
    border:2px solid rgba(13,110,253,.45);
    animation:pulsoMarcador 1.6s infinite;
}

@keyframes pulsoMarcador{
    0%{
        transform:scale(.8);
        opacity:.8;
    }

    100%{
        transform:scale(1.35);
        opacity:0;
    }
}

.seccion-dinamica{
    border-left:5px solid var(--seccion-color, #0d6efd);
    background:#f8f9fa;
    border-radius:16px;
    padding:16px;
}

.seccion-header{
    display:flex;
    align-items:center;
    gap:12px;
}

.seccion-icono{
    width:42px;
    height:42px;
    border-radius:14px;
    background:var(--seccion-color, #0d6efd);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
}
.btn-toggle-lista{
    width:100%;
    border:0;
    background:#f1f3f5;
    border-radius:14px;
    padding:12px 14px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-weight:700;
    color:#1f2937;
    cursor:pointer;
}

.btn-toggle-lista:hover{
    background:#e9ecef;
}

.lista-colapsada{
    display:none;
}

.lista-colapsada.abierta{
    display:block;
}
.contenido-html ul,
.contenido-html ol{
    padding-left:22px;
}

.contenido-html a{
    color:#0d6efd;
    font-weight:600;
    text-decoration:none;
}

.contenido-html a:hover{
    text-decoration:underline;
}
.btn-panel-movil{
    display:none;
}

@media (max-width: 768px){

    #mapa{
        height:100vh;
        width:100vw;
    }

    .panel-atlas{
        position:fixed;
        left:0;
        right:0;
        bottom:0;
        top:auto;
        width:100%;
        height:38vh;
        max-height:90vh;
        border-radius:24px 24px 0 0;
        z-index:1200;
        overflow:hidden;
        transition:height .28s ease;
        box-shadow:0 -10px 35px rgba(0,0,0,.25);
    }

    .panel-atlas.panel-movil-expandido{
        height:88vh;
    }

    .btn-panel-movil{
        display:flex;
        width:48px;
        height:28px;
        border:0;
        background:#f1f3f5;
        color:#1f2937;
        border-radius:0 0 14px 14px;
        align-items:center;
        justify-content:center;
        margin:0 auto 4px auto;
        font-weight:bold;
        cursor:pointer;
    }

    #panelContenido{
        height:calc(100% - 34px);
        overflow-y:auto;
        padding-bottom:14px;
    }

    .lugar-header{
        height:190px;
    }

    .hero-img{
        height:190px;
    }

    .galeria-grande{
        grid-template-columns:repeat(2, 1fr);
    }

    .galeria-grande img{
        height:120px;
    }

    .tabs-atlas{
        position:sticky;
        top:0;
        background:#fff;
        z-index:5;
        padding-top:6px;
    }
}
.lightbox-atlas{
    touch-action:pan-y;
}

@media (max-width:768px){

    .lightbox-btn{
        width:42px;
        height:42px;
        font-size:24px;
    }

    .lightbox-prev,
    .lightbox-next{
        display:none;
    }

    .lightbox-img{
        max-width:94vw;
        max-height:78vh;
    }

    .lightbox-caption{
        bottom:18px;
        font-size:14px;
        padding:0 14px;
    }
}
.hero-img-click{
    width:100%;
    height:100%;
    cursor:pointer;
}

.hero-img-click .hero-img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.hero-overlay{
    pointer-events:none;
}

.lugar-titulo-flotante{
    pointer-events:none;
}

.hero-img-click{
    pointer-events:auto;
    position:relative;
    z-index:2;
}
.lugar-header{
    cursor:pointer;
}

.lugar-header *{
    -webkit-tap-highlight-color:transparent;
}

.hero-overlay,
.lugar-titulo-flotante{
    pointer-events:none;
}

.btn-volver{
    pointer-events:auto;
}
.btn-cerrar-panel{
    position:absolute;
    top:14px;
    right:14px;
    z-index:4;
    width:34px;
    height:34px;
    border-radius:999px;
    font-size:22px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 14px rgba(0,0,0,.25);
}

.btn-volver,
.btn-cerrar-panel{
    z-index:50 !important;
    pointer-events:auto !important;
    touch-action:manipulation;
}

.hero-img-click{
    z-index:1 !important;
}

.hero-overlay,
.lugar-titulo-flotante{
    pointer-events:none !important;
}


@media (max-width:768px){

    .panel-atlas:not(.panel-movil-expandido) .panel-subtitle,
    .panel-atlas:not(.panel-movil-expandido) hr,
    .panel-atlas:not(.panel-movil-expandido) .btn-toggle-lista,
    .panel-atlas:not(.panel-movil-expandido) .lista-colapsada{
        display:none !important;
    }

    .panel-atlas:not(.panel-movil-expandido){
        height:auto;
        min-height:0;
        max-height:none;
    }

    .panel-atlas:not(.panel-movil-expandido) #panelContenido{
        height:auto;
        overflow:visible;
    }

    .panel-atlas:not(.panel-movil-expandido) .panel-inner{
        padding:14px 16px 16px 16px;
        max-height:none;
    }

    .panel-atlas:not(.panel-movil-expandido) .panel-title{
        font-size:18px;
        margin-bottom:10px;
    }

    .panel-atlas:not(.panel-movil-expandido) #buscar{
        margin-bottom:8px !important;
    }

    .panel-atlas:not(.panel-movil-expandido) #resultados{
        margin-bottom:0 !important;
        font-size:12px;
    }
}

.lista-categoria-grupo{
    border:1px solid #e5e7eb;
    border-radius:16px;
    overflow:hidden;
    background:#fff;
}

.lista-categoria-titulo{
    background:#f8f9fa;
    padding:10px 12px;
    font-weight:800;
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:#1f2937;
}

.lista-categoria-titulo span{
    background:#1f2937;
    color:#fff;
    border-radius:999px;
    font-size:12px;
    padding:3px 8px;
}

.lista-categoria-items{
    padding:10px;
}

.marker-ilustrado{
    cursor:pointer;
    touch-action:manipulation;
    pointer-events:auto;
}