.fecafeb-georref {
    max-width: 1800px;
    margin: 0 auto;
    --fecafeb-col-listado: 360px;
    --fecafeb-gap: 18px;
    font-size: 15px;
    color: #222;
    line-height: 1.5;
}

.fecafeb-georref *,
.fecafeb-georref *::before,
.fecafeb-georref *::after {
    box-sizing: border-box;
}

/* =========================================================
   RESET DE CONTROLES DE FORMULARIO (pelea contra el tema WP)
   ========================================================= */
.fecafeb-georref input,
.fecafeb-georref select,
.fecafeb-georref button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    color: #222;
    box-sizing: border-box;
}

.fecafeb-georref select option {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.35;
    padding: 6px 10px;
    color: #222;
    background: #fff;
}

/* =========================================================
   LAYOUT: mapa grande + listado a la derecha
   ========================================================= */
.fecafeb-georref-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--fecafeb-col-listado);
    gap: var(--fecafeb-gap);
    align-items: start;
}

.fecafeb-georref-col--mapa {
    min-width: 0;
}

.fecafeb-georref-col--listado {
    position: sticky;
    top: 90px;
    height: clamp(620px, 80vh, 900px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

/* =========================================================
   FILTROS: barra horizontal arriba
   ========================================================= */
.fecafeb-georref-filtros {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(0, 4fr) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    margin-bottom: var(--fecafeb-gap);
    background: #f5f5f4;
    border-radius: 8px;
    overflow: visible;
}

/* ---------- Buscador ---------- */
.fecafeb-georref-busqueda {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fecafeb-georref-busqueda label,
.fecafeb-georref .fecafeb-georref-filtro-campo label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 5px 0;
    color: #222;
    overflow: visible;
}

.fecafeb-georref-busqueda-caja {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.fecafeb-georref .fecafeb-georref-busqueda-caja input[type="search"],
.fecafeb-georref .fecafeb-georref-busqueda-caja input[type="text"] {
    width: 100%;
    height: auto !important;
    min-height: 41px;
    padding: 8px 12px 8px 34px;
    font-size: 13px;
    line-height: 1.35;
    font-family: inherit;
    color: #222;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: visible;
}

.fecafeb-georref-busqueda-caja input[type="search"]::placeholder,
.fecafeb-georref-busqueda-caja input[type="text"]::placeholder {
    color: #888;
    opacity: 1;
    font-size: 13px;
    line-height: 1.35;
}

.fecafeb-georref-busqueda-caja input[type="search"]:focus,
.fecafeb-georref-busqueda-caja input[type="text"]:focus {
    outline: none;
    border-color: #1d4d3f;
    box-shadow: 0 0 0 3px rgba(29,77,63,0.15);
}

.fecafeb-georref-icono-lupa {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #777;
    pointer-events: none;
}

/* ---------- Grid de selects ---------- */
.fecafeb-georref-filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.fecafeb-georref-filtro-campo {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: none;
    margin: 0;
}

/* ---------- Select con flecha SVG de fondo ---------- */
.fecafeb-georref .fecafeb-georref-filtro-campo select {
    width: 100%;
    height: auto !important;
    min-height: 41px;
    padding: 8px 36px 8px 12px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.35;
    color: #222;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 11px 7px;
    border: 1px solid #ccc;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.fecafeb-georref .fecafeb-georref-filtro-campo select:focus {
    outline: none;
    border-color: #1d4d3f;
    box-shadow: 0 0 0 3px rgba(29,77,63,0.15);
}

.fecafeb-georref .fecafeb-georref-filtro-campo select:disabled {
    background-color: #f0f0f0;
    color: #888;
    cursor: not-allowed;
}

/* ---------- Campo dinámico "Producto" ---------- */
.fecafeb-georref-filtro-producto[hidden] {
    display: none !important;
}

.fecafeb-georref-filtro-producto {
    animation: fecafeb-fade-in 0.2s ease-out;
}

@keyframes fecafeb-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Botón limpiar ---------- */
.fecafeb-georref-btn-limpiar {
    width: auto;
    align-self: end;
    white-space: nowrap;
    height: auto !important;
    min-height: 41px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #222;
    border: 1px solid #999;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.fecafeb-georref-btn-limpiar:hover {
    background: #eee;
    border-color: #666;
}

/* =========================================================
   MAPA
   ========================================================= */
.fecafeb-georref-mapa-wrap {
    position: relative;
}

#fecafeb-georref-mapa {
    width: 100%;
    height: clamp(620px, 80vh, 900px);
    border-radius: 6px;
    z-index: 1;
}

.fecafeb-georref-leyenda {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(255,255,255,0.92);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    max-width: 240px;
}

.fecafeb-georref-leyenda strong {
    font-size: 13px;
    margin-bottom: 2px;
}

.fecafeb-georref-leyenda-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fecafeb-georref-punto {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
    flex: 0 0 auto;
}

.fecafeb-georref-punto--organizacion { background: #1d4d3f; }
.fecafeb-georref-punto--productor     { background: #c47f17; }
.fecafeb-georref-punto--pendiente {
    background: #999;
    border-style: dashed;
}

.fecafeb-georref-nota-precision {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    margin-top: 10px;
    font-style: italic;
}

/* =========================================================
   LISTADO LATERAL
   ========================================================= */
.fecafeb-georref-estado {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    min-height: 1.2em;
    margin-bottom: 10px;
}

.fecafeb-georref-listado {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fecafeb-georref-ficha {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    background: #fff;
}

.fecafeb-georref-ficha:hover,
.fecafeb-georref-ficha.is-activa {
    border-color: #1d4d3f;
    box-shadow: 0 0 0 2px rgba(29,77,63,0.15);
}

.fecafeb-georref-ficha h4 {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.35;
}

.fecafeb-georref-ficha p {
    margin: 2px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

.fecafeb-georref-ficha .fecafeb-georref-badge {
    display: inline-block;
    font-size: 13px;
    line-height: 1.4;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eee;
    margin-top: 6px;
}

.fecafeb-georref-badge--pendiente {
    background: #fdf1d6;
    color: #8a5c00;
}

/* =========================================================
   MARCADORES LEAFLET (más grandes y centrados)
   ========================================================= */
.fecafeb-georref-divicon {
    background: transparent;
    border: none;
    overflow: visible;
}

.fecafeb-georref-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 2px 5px rgba(0,0,0,0.35);
    transition: transform 0.12s ease;
}

.fecafeb-georref-marker:hover {
    transform: translate(-50%, -50%) scale(1.25);
}

.fecafeb-georref-marker--organizacion { background: #1d4d3f; }
.fecafeb-georref-marker--productor     { background: #c47f17; }
.fecafeb-georref-marker--pendiente {
    background: #999;
    border-style: dashed;
}

/* Clusters más visibles */
.fecafeb-georref .marker-cluster div {
    width: 40px;
    height: 40px;
    margin-left: 5px;
    margin-top: 5px;
    font-size: 14px;
    font-weight: 700;
    line-height: 40px;
}

.fecafeb-georref-popup h4 {
    margin: 0 0 4px;
    line-height: 1.35;
}

.fecafeb-georref-popup p {
    margin: 2px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1200px) {
    .fecafeb-georref-filtros {
        grid-template-columns: 1fr;
    }
    .fecafeb-georref-btn-limpiar {
        width: 100%;
    }
    .fecafeb-georref-layout {
        grid-template-columns: 1fr;
    }
    .fecafeb-georref-col--listado {
        position: static;
        height: auto;
        overflow: visible;
    }
    .fecafeb-georref-listado {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 782px) {
    #fecafeb-georref-mapa {
        height: 65vh;
        min-height: 420px;
    }
    .fecafeb-georref-leyenda {
        position: static;
        margin-top: 10px;
        max-width: none;
    }
}