/* ================= BASE GENERAL ================= */
body {
    margin: 0;
    padding: 0;

    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #2c2c2c;
    background: #f4f6f8;
}

.leaflet-container {
    font-family: inherit;
}

/* ================= MAPA ================= */
#map {
    width: 100%;
    height: 100vh;
}

/* ================= PANEL LATERAL IZQUIERDO ================= */
.panel-capas {
    position: absolute;
    top: 15px;
    left: 15px;

    width: 260px;
    max-height: 80vh;
    overflow-y: auto;

    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);

    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);

    z-index: 1000;
    transition: all 0.25s ease;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.panel-capas::-webkit-scrollbar {
    display: none;
}

/* ================= HEADER ================= */
.panel-header {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    padding: 12px;
    border-radius: 14px 14px 0 0;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ================= GRUPOS ================= */
.grupo {
    border-bottom: 1px solid #e5e5e5;
}

.grupo h4 {
    margin: 0;
    padding: 10px 12px;

    cursor: pointer;
    background: transparent;

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 13px;
    font-weight: 600;
    color: #444;

    transition: background 0.2s;
}

.grupo h4:hover {
    background: rgba(0,0,0,0.05);
}

/* ================= SUBCAPAS ================= */
.subcapas {
    padding: 8px 12px 12px 12px;
    display: none;
}

.subcapas label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 13px;
}

/* ================= PANEL DERECHO ================= */
#infoParcela {
    display: none; /* 🔥 esto faltaba */

    position: absolute;
    right: 15px;
    top: 20px;

    width: 360px;
    max-height: 75vh;
    overflow-y: auto;

    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);

    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    padding: 14px;

    z-index: 1000;

    scrollbar-width: none;
    -ms-overflow-style: none;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* 🔧 FIX INPUT */
#buscarNomenclatura {
    box-sizing: border-box;
    width: 100%;
}

/* 🔧 FIX PANEL BODY */
.panel-body {
    max-height: 60vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.panel-body.oculto {
    max-height: 0;
    overflow: hidden;
    padding: 0;
}

#infoParcela::-webkit-scrollbar {
    display: none;
    overflow: hidden;
}

/* ================= TITULOS PANEL DERECHO ================= */
#infoParcela h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

/* ================= BLOQUES DE INFO ================= */
.info-item {
    margin-bottom: 8px;
}

.info-label {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

/* ================= INPUTS Y BOTONES ================= */
input, button {
    font-family: inherit;
    font-size: 14px;
}

input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    transition: border 0.2s;
}

input:focus {
    outline: none;
    border-color: #2e7d32;
}

button {
    background: linear-gradient(135deg, #0057a4, #003f7a);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ================= HR ================= */
hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 12px 0;
}

/* ================= ANIMACION ================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADER */
.panel-header-colapsable {
    display:flex;
    justify-content:space-between;
    align-items:center;

    background:#0057a4;
    color:white;

    padding:10px;
    font-weight:600;
}

/* BOTON */
.panel-header-colapsable button {
    background:transparent;
    border:none;
    color:white;
    font-size:18px;
    cursor:pointer;
}


/* COLAPSADO */
/* 🔥 cuando el panel está colapsado */
.panel-colapsable.colapsado .panel-body {
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* EXPANDIDO */
.panel-colapsable.expandido {
    height:auto;
}
.popup-central {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);

    z-index: 2000;

    width: 90%;        /* 🔥 clave */
    max-width: 250px;  /* 🔥 más ancho */

    max-height: 70vh;
    overflow-y: auto;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,0.4);
    z-index: 1999;
}

.img-overlay {
    position: fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;

    background: rgba(0,0,0,0.8);
    display:flex;
    align-items:center;
    justify-content:center;

    z-index:3000;
}

.img-ampliada {
    max-width:90%;
    max-height:90%;
    border-radius:10px;
    box-shadow:0 10px 40px rgba(0,0,0,0.5);
}

.img-ampliada {
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.1s ease;
    user-select: none;
}

#loaderParcelas {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: rgba(0,0,0,0.8);
    color: white;

    padding: 20px 30px;
    border-radius: 10px;

    font-size: 16px;
    font-weight: 500;

    z-index: 5000;

    display: none;
}

.leaflet-control-zoom {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border-radius: 12px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background-color: #1e1e2f;
    color: #fff;
    font-size: 18px;
    width: 38px;
    height: 38px;
    line-height: 38px;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background-color: #0057a4;
    color: white;
}

.leaflet-control-zoom-in {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}