.tcf-btn-count {
    background: transparent;
    color: var(--tcf-text-dark);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.tcf-filter-btn.active .tcf-btn-count,
.tcf-cat-btn.active .tcf-btn-count {
    background: rgba(255,255,255,0.3);
    color: var(--tcf-text-light);
}/* ==========================================================================
   Filtros Territorio Cueva - Estilos Multiselección
   ========================================================================== */

/* Variables CSS */
:root {
    --tcf-primary: #8B4513;
    --tcf-primary-hover: #A0522D;
    --tcf-secondary: #666;
    --tcf-background: transparent;
    --tcf-white: rgba(255, 255, 255, 0.9);
    --tcf-border: rgba(255, 255, 255, 0.3);
    --tcf-text-dark: #8B4513;
    --tcf-text-light: rgba(255, 255, 255, 0.9);
    --tcf-radius: 3px;
    --tcf-shadow: 0 4px 15px rgba(0,0,0,0.2);
    --tcf-transition: all 0.3s ease;
    --tcf-success: #28a745;
    --tcf-warning: #ffc107;
    --tcf-danger: #dc3545;
    --tcf-backdrop: rgba(0, 0, 0, 0.3);
}

/* Contenedor principal de filtros */
.tcf-filters {
    background: var(--tcf-background);
    padding: 20px;
    border-radius: var(--tcf-radius);
    margin-bottom: 30px;
    position: relative;
}

/* Grupos de filtros */
.tcf-filter-group {
    margin-bottom: 20px;
}

.tcf-filter-group:last-child {
    margin-bottom: 0;
}

.tcf-filter-group h4 {
    margin: 0 0 15px 0;
    color: var(--tcf-white);
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Subzonas */
.tcf-subzone-group {
    background: transparent;
    padding: 16px;
    border-radius: var(--tcf-radius);
    border: none;
    margin-bottom: 20px;
}

.tcf-subzone-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--tcf-border);
    border-radius: var(--tcf-radius);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--tcf-text-dark);
    font-size: 14px;
    font-weight: 500;
    transition: var(--tcf-transition);
}

.tcf-subzone-dropdown:focus {
    outline: none;
    border-color: var(--tcf-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.3);
    background: rgba(255, 255, 255, 1);
}

/* Información de multiselección */
.tcf-multiselect-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid var(--tcf-primary);
}

.tcf-multiselect-info small {
    color: var(--tcf-primary);
    font-size: 12px;
    font-weight: 500;
}

/* Contenedores de botones */
.tcf-filter-buttons,
.tcf-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Botones de filtro con contadores */
.tcf-filter-btn,
.tcf-cat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--tcf-text-light);
    border: 1px solid var(--tcf-border);
    border-radius: 3px !important;
    cursor: pointer;
    transition: var(--tcf-transition);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    min-height: 45px;
    gap: 10px;
    position: relative;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Indicador de multiselección */
.tcf-multi-btn.active::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--tcf-success);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--tcf-white);
}

.tcf-btn-text {
    flex: 1;
}

.tcf-btn-count {
    background: transparent;
    color: var(--tcf-text-light);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.tcf-filter-btn.active .tcf-btn-count,
.tcf-cat-btn.active .tcf-btn-count {
    background: rgba(255,255,255,0.3);
    color: var(--tcf-white);
}

/* Estados de hover y activo */
.tcf-filter-btn:hover,
.tcf-cat-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.tcf-filter-btn.active,
.tcf-cat-btn.active {
    background: var(--tcf-primary);
    color: var(--tcf-white);
    border-color: var(--tcf-primary);
    box-shadow: 0 4px 15px rgba(210, 105, 30, 0.4);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Estados de carga para filtros */
/* Eliminar reglas que afectan a los filtros en estado loading */

.tcf-filter-btn:focus,
.tcf-cat-btn:focus {
    outline: 2px solid var(--tcf-primary);
    outline-offset: 2px;
}

/* Filtros de categoría */
.tcf-category-filters {
    background: transparent;
    padding: 16px;
    border-radius: var(--tcf-radius);
    margin-top: 15px;
    border: none;
    animation: tcfSlideDown 0.3s ease;
}

@keyframes tcfSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filtros activos */
.tcf-active-filters {
    background: rgba(255, 243, 205, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: var(--tcf-radius);
    border: 1px solid rgba(255, 234, 167, 0.8);
    margin-top: 20px;
    animation: tcfSlideDown 0.3s ease;
}

.tcf-active-filters h4 {
    margin: 0 0 12px 0;
    color: #856404;
    font-size: 14px;
    font-weight: 600;
}

.tcf-filter-tag-group {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.tcf-filter-tag-group:last-child {
    margin-bottom: 12px;
}

.tcf-filter-label {
    font-weight: 600;
    color: #856404;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.tcf-filter-tag {
    display: inline-flex;
    align-items: center;
    background: #856404;
    color: var(--tcf-white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
}

.tcf-remove-filter {
    background: none;
    border: none;
    color: var(--tcf-white);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tcf-transition);
}

.tcf-remove-filter:hover {
    background: rgba(255,255,255,0.2);
}

.tcf-clear-all-filters {
    background: var(--tcf-danger);
    color: var(--tcf-white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--tcf-radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--tcf-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tcf-clear-all-filters:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Indicador de carga */
.tcf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: var(--tcf-secondary);
    font-style: italic;
}

.tcf-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--tcf-border);
    border-top: 2px solid var(--tcf-primary);
    border-radius: 50%;
    animation: tcfSpin 1s linear infinite;
    margin-right: 8px;
}

@keyframes tcfSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contenedor de resultados */
.tcf-results {
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.tcf-results.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Grid de resultados */
.tcf-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
}

/* Items de post */
.tcf-post-item {
    background: var(--tcf-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--tcf-shadow);
    transition: var(--tcf-transition);
    display: flex;
    flex-direction: column;
}

.tcf-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Thumbnail */
.tcf-post-thumb {
    position: relative;
    overflow: hidden;
}

.tcf-post-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: var(--tcf-transition);
}

.tcf-post-item:hover .tcf-post-thumb img {
    transform: scale(1.05);
}

/* Contenido del post */
.tcf-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tcf-post-type {
    background: var(--tcf-primary);
    color: var(--tcf-white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
    margin-bottom: 8px;
}

.tcf-post-item h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.4;
}

.tcf-post-item h3 a {
    color: var(--tcf-text-dark);
    text-decoration: none;
    transition: var(--tcf-transition);
}

.tcf-post-item h3 a:hover {
    color: var(--tcf-primary);
}

.tcf-post-excerpt {
    color: var(--tcf-text-light);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.tcf-read-more {
    color: var(--tcf-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    align-self: flex-start;
    transition: var(--tcf-transition);
}

.tcf-read-more:hover {
    text-decoration: underline;
    color: var(--tcf-primary-hover);
}

/* Estados sin resultados */
.tcf-no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--tcf-background);
    border-radius: 8px;
    color: var(--tcf-text-light);
}

.tcf-no-results p {
    margin-bottom: 20px;
    font-size: 16px;
}

.tcf-clear-filters {
    background: var(--tcf-primary);
    color: var(--tcf-white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--tcf-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--tcf-transition);
}

.tcf-clear-filters:hover {
    background: var(--tcf-primary-hover);
    transform: translateY(-1px);
}

/* Información adicional */
.tcf-more-results {
    text-align: center;
    color: var(--tcf-text-light);
    font-size: 14px;
    margin-top: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: var(--tcf-radius);
}

/* Indicadores visuales para multiselección */
.tcf-filter-btn.active {
    position: relative;
}

/* Efecto hover mejorado para multiselección */
.tcf-multi-btn:hover::after {
    content: 'Clic para activar/desactivar';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: tcfTooltip 0.3s ease forwards;
}

@keyframes tcfTooltip {
    to {
        opacity: 1;
        bottom: -25px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .tcf-filters {
        padding: 20px 16px;
        margin-bottom: 20px;
    }
    
    .tcf-filter-buttons,
    .tcf-category-buttons {
        flex-direction: column;
    }
    
    .tcf-filter-btn,
    .tcf-cat-btn {
        text-align: center;
        justify-content: center;
        width: 100%;
    }
    
    .tcf-subzone-dropdown {
        font-size: 16px; /* Evitar zoom en iOS */
    }
    
    .tcf-filter-tag-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tcf-filter-label {
        margin-bottom: 4px;
    }
    
    .tcf-results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tcf-post-content {
        padding: 16px;
    }
    
    .tcf-post-item h3 {
        font-size: 16px;
    }
    
    /* Ocultar tooltip en móvil */
    .tcf-multi-btn:hover::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .tcf-filters {
        padding: 16px 12px;
    }
    
    .tcf-filter-group h4 {
        font-size: 14px;
    }
    
    .tcf-filter-btn,
    .tcf-cat-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .tcf-post-content {
        padding: 12px;
    }
    
    .tcf-active-filters {
        padding: 12px;
    }
    
    .tcf-filter-tag {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* Utilidades */
.tcf-hidden {
    display: none !important;
}

.tcf-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Animaciones adicionales */
@keyframes tcfFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tcf-results-grid {
    animation: tcfFadeIn 0.5s ease;
}

.tcf-filter-tag {
    animation: tcfFadeIn 0.3s ease;
}

/* Estados de focus para accesibilidad */
.tcf-filter-btn:focus-visible,
.tcf-cat-btn:focus-visible,
.tcf-clear-filters:focus-visible,
.tcf-clear-all-filters:focus-visible,
.tcf-subzone-dropdown:focus-visible {
    outline: 2px solid var(--tcf-primary);
    outline-offset: 2px;
}

.tcf-remove-filter:focus-visible {
    outline: 2px solid var(--tcf-white);
    outline-offset: 2px;
}

/* Mejoras para temas oscuros */
@media (prefers-color-scheme: dark) {
    :root {
        --tcf-background: #2a2a2a;
        --tcf-white: #333;
        --tcf-border: #555;
        --tcf-text-dark: #fff;
        --tcf-text-light: #ccc;
    }
    
    .tcf-active-filters {
        background: #3a3a2a;
        border-color: #5a5a2a;
    }
    
    .tcf-multiselect-info {
        background: #1a2a3a;
        border-left-color: var(--tcf-primary);
    }
}

/* Mejorar contraste en filtros activos */
.tcf-filter-btn.active,
.tcf-cat-btn.active {
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,124,186,0.4);
}

/* Estado de disabled para botones durante carga */
.tcf-filters.loading .tcf-remove-filter,
.tcf-filters.loading .tcf-clear-all-filters {
    pointer-events: auto;
    opacity: 1;
}

.tcf-show-filters-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    background: #fff;
    border: 1px solid #8B4513;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    color: #8B4513;
    transition: background 0.2s, border 0.2s;
    background-color: #834E00 !important;
}
.tcf-show-filters-btn:hover {
    background: #f5e8df;
    border-color: #A0522D;
}
.tcf-hamburger-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

/* Forzar visibilidad del contenedor de Elementor cuando hay filtros TCF */
.elementor-widget-container {
    display: block !important;
}