/* ============================================
   DIRECTORIO CND + REGIONAL + INSTITUCIONES + COORDINACIONES
   ESTILOS UNIFICADOS - VERSIÓN SOBRÍA
   ============================================ */

/* ========== ESTILOS DEL MAPA ========== */
.mapa-container {
    margin: 1.5rem 0;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef2f6;
}

.mapa-header {
    background: linear-gradient(135deg, #cd0000 0%, #9b2c2c 100%);
    padding: 0.85rem 1.5rem;
}

.mapa-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: white;
    font-weight: 600;
}

.mapa-leaflet {
    height: 450px;
    width: 100%;
    z-index: 1;
}

/* Leyenda de colores */
.leyenda-colores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.85rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #eef2f6;
    justify-content: center;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #1e293b;
    padding: 0.25rem 0.7rem;
    border-radius: 30px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
}

.leyenda-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.leyenda-item.activo {
    background: #eef2ff;
    border-left: 3px solid #cd0000;
}

.color-dot {
    width: 13px;
    height: 13px;
    border-radius: 4px;
}

.tooltip-estado {
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
}

.error-mapa {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    color: #475569;
}

/* ========== RESULTADOS - SIN RECTÁNGULO EXTERIOR ========== */
.resultados-container {
    margin-top: 1.5rem;
    /* Eliminado: background, border-radius, box-shadow, border */
}

.resultados-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.resultados-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.resultados-header h3 i {
    color: #cd0000;
    margin-right: 0.5rem;
}

.zona-activa,
.coordinacion-activa {
    background: linear-gradient(135deg, #cd0000 0%, #9b2c2c 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ========== BOTONES DE DESCARGA - OCULTOS ========== */
.download-buttons-container {
    display: none !important;
}

.btn-download {
    display: none !important;
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #eef2f6;
    color: #1e293b;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 2rem;
}

.btn-volver:hover {
    background: #e2e8f0;
    transform: translateX(-4px);
}

/* ========== TARJETAS DE MIEMBROS - ESTILO SOBRÍO ========== */
.directorio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.tarjeta-miembro {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #eef2f6;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tarjeta-miembro:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* HEADER SOBRÍO */
.tarjeta-header {
    background: #f8fafc;
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid #eef2f6;
}

.tarjeta-header .nombre {
    color: var(--color-gray);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* Badge de afiliación */
.no-afiliacion-header {
    background: #f1f5f9;
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.afiliacion-label {
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 500;
}

.afiliacion-numero {
    background: white;
    color: var(--color-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
}

/* CUERPO DE LA TARJETA */
.tarjeta-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* Badge de cargo */
.cargo-badge {
    background: #f1f5f9;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    display: inline-block;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.cargo-badge i {
    margin-right: 0.4rem;
    color: #64748b;
}

/* Items de información */
.info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
}

.info-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--color-primary);
}

.info-item .value {
    flex: 1;
    word-break: break-word;
}

.info-item .value strong {
    color: #1e293b;
    font-weight: 600;
}

/* Listas de contacto */
.telefonos-list,
.correos-list,
.webs-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.telefono-item {
    padding: 0.2rem 0;
    color: #475569;
    font-size: 0.75rem;
    border-bottom: 1px dashed #f1f5f9;
}

.telefono-item:last-child {
    border-bottom: none;
}

.correo-item {
    display: block;
    padding: 0.25rem 0;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.75rem;
    word-break: break-all;
    transition: all 0.2s ease;
}

.correo-item:hover {
    color: #cd0000;
    padding-left: 0.2rem;
}

.web-item {
    display: block;
    padding: 0.25rem 0;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.7rem;
    word-break: break-all;
    transition: all 0.2s ease;
}

.web-item:hover {
    color: #cd0000;
    text-decoration: underline;
}

/* Secciones por cargo */
.seccion-cargo {
    margin-bottom: 2.5rem;
}

.seccion-titulo {
    font-size: 1.3rem;
    font-weight: 600;
    color: #cd0000;
    border-left: 4px solid #cd0000;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.seccion-titulo i {
    margin-right: 0.5rem;
    color: #cd0000;
}

/* Estados de carga */
.loading-grid,
.error-message,
.empty-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    text-align: center;
    gap: 1rem;
    width: 100%;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.loading-spinner i {
    font-size: 2rem;
    color: #cd0000;
    opacity: 0.5;
}

.loading-spinner p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.error-message {
    background: #fef2f2;
    border-radius: 12px;
    color: #dc2626;
    padding: 2rem;
}

.empty-message {
    color: #94a3b8;
    padding: 2rem;
}

/* Animación */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tarjeta-miembro {
    animation: fadeInUp 0.3s ease backwards;
}

/* ========== COORDINACIONES - CARRUSEL HORIZONTAL ========== */
.coordinaciones-carrusel-wrapper {
    position: relative;
    margin: 1rem 0 1.5rem;
    padding: 0 40px;
}

.coordinaciones-swiper {
    overflow: hidden;
    padding: 10px 5px;
}

.swiper-button-prev,
.swiper-button-next {
    background: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #cd0000;
    box-shadow: 0 4px 12px rgba(205, 0, 0, 0.2);
}

.swiper-button-prev:hover::after,
.swiper-button-next:hover::after {
    color: white;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 18px;
    font-weight: bold;
    color: #cd0000;
    transition: color 0.2s ease;
}

.swiper-button-prev.swiper-button-disabled,
.swiper-button-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Tarjeta dentro del carrusel */
.coordinacion-card-carrusel {
    background: white;
    border-radius: 16px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    border: 1px solid #eef2f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    height: 100%;
}

.coordinacion-card-carrusel:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #cd0000;
}

.coordinacion-card-carrusel.activo {
    background: linear-gradient(135deg, #fff5f5 0%, white 100%);
    border-color: #cd0000;
    border-width: 2px;
    box-shadow: 0 4px 15px rgba(205, 0, 0, 0.15);
}

.coordinacion-icon-carrusel {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coordinacion-icon-carrusel img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.icon-placeholder-carrusel {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 50%;
    color: #cd0000;
    font-size: 1.8rem;
}

.coordinacion-nombre-carrusel {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 0.25rem;
}

.coordinacion-card-carrusel.activo .coordinacion-nombre-carrusel {
    color: #cd0000;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
    .coordinaciones-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 900px) {
    .directorio-grid {
        gap: 1.25rem;
    }
}

@media (max-width: 800px) {
    .coordinaciones-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .coordinacion-card-carrusel {
        padding: 0.75rem 0.5rem;
    }
    
    .coordinacion-icon-carrusel {
        width: 50px;
        height: 50px;
    }
    
    .icon-placeholder-carrusel {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .coordinacion-nombre-carrusel {
        font-size: 0.7rem;
    }
    
    .coordinaciones-carrusel-wrapper {
        padding: 0 35px;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        width: 30px;
        height: 30px;
    }
    
    .swiper-button-prev::after,
    .swiper-button-next::after {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .directorio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tarjeta-header .nombre {
        font-size: 1rem;
    }
    
    .tarjeta-body {
        padding: 1rem;
    }
    
    .info-item {
        gap: 8px;
    }
    
    .info-item svg {
        width: 12px;
        height: 12px;
    }
    
    .mapa-leaflet {
        height: 350px;
    }
    
    .leyenda-colores {
        gap: 0.5rem;
        padding: 0.6rem 1rem;
    }
    
    .leyenda-item {
        font-size: 0.7rem;
        padding: 0.2rem 0.55rem;
    }
    
    .mapa-header h3 {
        font-size: 0.9rem;
    }
    
    .mapa-header {
        padding: 0.6rem 1rem;
    }
    
    .resultados-header {
        padding: 0.75rem 1rem;
    }
    
    .resultados-header h3 {
        font-size: 0.9rem;
    }
    
    .coordinacion-activa,
    .zona-activa {
        font-size: 0.7rem;
        padding: 0.3rem 0.8rem;
    }
    
    .cargo-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.7rem;
    }
}

@media (max-width: 550px) {
    .coordinaciones-carrusel-wrapper {
        padding: 0 30px;
    }
}

@media (max-width: 480px) {
    .mapa-leaflet {
        height: 300px;
    }
    
    .leyenda-colores {
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }
    
    .leyenda-item {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    .color-dot {
        width: 10px;
        height: 10px;
    }
    
    .tarjeta-body {
        padding: 0.875rem;
    }
    
    .no-afiliacion-header {
        padding: 0.25rem 0.6rem;
    }
    
    .afiliacion-numero {
        font-size: 0.65rem;
    }
    
    .loading-spinner i {
        font-size: 1.8rem;
    }
    
    .loading-spinner p {
        font-size: 0.85rem;
    }
    
    .coordinacion-icon-carrusel {
        width: 45px;
        height: 45px;
    }
    
    .icon-placeholder-carrusel {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .coordinacion-nombre-carrusel {
        font-size: 0.65rem;
    }
    
    .coordinaciones-carrusel-wrapper {
        padding: 0 25px;
    }
}