/* ===== MODAL DE FILTROS - MOBILE-FIRST UX MÁXIMA ===== */
/* Diseñado para aprovechar al máximo el espacio en móviles */

/* ===== RESET Y BASE MOBILE-FIRST ===== */
.modal-filters-container {
    padding: 0;
    background: #fff;
    min-height: auto;
}

.filters-content {
    padding: 12px;
}

/* ===== SECCIONES COMPACTAS ===== */
.filter-section,
.sort-section,
.tags-section-modal {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    min-height: auto;
}

/* Header clickeable para colapsar */
.tags-header-collapsible,
.filter-header-collapsible {
    position: relative;
    cursor: pointer;
    padding: 8px 40px 8px 8px;
    transition: all 0.2s ease;
    text-align: center;
}

.tags-header-collapsible:hover,
.filter-header-collapsible:hover {
    opacity: 0.8;
}

.tags-header-collapsible h6,
.filter-header-collapsible h6 {
    margin: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

/* Icono de colapsar: círculo con flecha */
.tags-header-collapsible .collapse-icon,
.filter-header-collapsible .collapse-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #667eea;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
}

/* ===== BOTONES DE CATEGORÍA DE TAGS - ESTILO PUBLICAR ANIMAL ===== */
.btn-categoria-tag-filtro {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border: 2px solid;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 75px;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-categoria-tag-filtro .categoria-nombre {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-align: center;
}

.btn-categoria-tag-filtro .badge-contador {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 50rem;
    background: transparent;
    border: 1.5px solid;
    line-height: 1;
    min-width: 28px;
}

/* Estados y colores de los botones de categoría */
.btn-categoria-tag-filtro[data-color="secondary"] { --cat-color: #6c757d; }
.btn-categoria-tag-filtro[data-color="primary"]   { --cat-color: #0d6efd; }
.btn-categoria-tag-filtro[data-color="info"]      { --cat-color: #0dcaf0; }
.btn-categoria-tag-filtro[data-color="success"]   { --cat-color: #198754; }
.btn-categoria-tag-filtro[data-color="warning"]   { --cat-color: #ffc107; }
.btn-categoria-tag-filtro[data-color="danger"]    { --cat-color: #dc3545; }
.btn-categoria-tag-filtro[data-color="dark"]      { --cat-color: #212529; }
.btn-categoria-tag-filtro[data-color="cyan"]      { --cat-color: #17a2b8; }
.btn-categoria-tag-filtro[data-color="purple"]    { --cat-color: #9b59b6; }
.btn-categoria-tag-filtro[data-color="teal"]      { --cat-color: #20c997; }

.btn-categoria-tag-filtro {
    border-color: var(--cat-color);
    color: var(--cat-color);
}

.btn-categoria-tag-filtro .badge-contador {
    border-color: var(--cat-color);
    color: var(--cat-color);
}

/* Botón activo */
.btn-categoria-tag-filtro.active {
    background: var(--cat-color);
    color: white;
}

.btn-categoria-tag-filtro.active .categoria-nombre,
.btn-categoria-tag-filtro.active .badge-contador {
    color: white;
    border-color: white;
}

/* Hover */
.btn-categoria-tag-filtro:hover:not(.active) {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Helper text */
#tags-helper-modal {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Contenido colapsable con padding */
#collapseEtiquetas {
    padding-top: 8px;
}

/* Títulos de sección compactos */
.filter-section h6,
.sort-section h6,
.tags-section-modal h6 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-section h6 i,
.sort-section h6 i,
.tags-section-modal h6 i {
    color: #f39c12;
    font-size: 1rem;
}

/* Separador minimalista */
.filter-section hr,
.sort-section hr,
.tags-section-modal hr {
    margin: 8px 0 12px;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, #f39c12, transparent);
    opacity: 0.6;
}

/* ===== LABELS ULTRA COMPACTOS ===== */
.modern-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #495057;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.modern-label i {
    font-size: 0.45rem;
}

/* ===== SELECTS OPTIMIZADOS PARA TOUCH ===== */
.modern-select,
.modern-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
    /* Tamaño mínimo para touch targets (44px recomendado) */
    min-height: 44px;
}

.modern-select:focus,
.modern-input:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}

/* Icono de flecha para selects */
.modern-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 36px;
}

/* ===== GRID ESPECIE-ESTADO (2 columnas en móvil) ===== */
.especie-estado-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

/* ===== GRID PROVINCIA-LOCALIDAD (2 columnas en móvil) ===== */
.provincia-localidad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

/* ===== GRID ORDENAR (1 columna completa) ===== */
.ordenar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* ===== SECCIÓN DE TAGS COMPACTA ===== */
.tags-pills-container-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Scrollbar minimalista */
.tags-pills-container-modal::-webkit-scrollbar {
    width: 4px;
}

.tags-pills-container-modal::-webkit-scrollbar-track {
    background: transparent;
}

.tags-pills-container-modal::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

/* Pills de tags compactas */
.tag-pill-modal {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    color: #fff;
    white-space: nowrap;
    min-height: 28px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tag-pill-modal:active {
    transform: scale(0.95);
}

.tag-pill-modal.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f39c12;
}

/* Colores de tags */
.tag-pill-modal:nth-child(6n+1) { background: #667eea; }
.tag-pill-modal:nth-child(6n+2) { background: #f5576c; }
.tag-pill-modal:nth-child(6n+3) { background: #00b4d8; }
.tag-pill-modal:nth-child(6n+4) { background: #2ecc71; color: #1a5928; }
.tag-pill-modal:nth-child(6n+5) { background: #f39c12; color: #5c3d00; }
.tag-pill-modal:nth-child(6n+6) { background: #9b59b6; }

.tag-pill-modal .tag-count {
    background: rgba(255,255,255,0.25);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.65rem;
    margin-left: 4px;
}

/* ===== RESUMEN DE RESULTADOS COMPACTO ===== */
.results-summary {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #fff;
}

.summary-content {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.summary-content i {
    color: #f39c12;
    margin-right: 6px;
}

#contador-animales {
    color: #f39c12;
    font-weight: 700;
    font-size: 1.1rem;
}

.summary-details {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.85;
}

#filter-description {
    color: rgba(255,255,255,0.85);
}

/* ===== BOTONES DE ACCIÓN ===== */
.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-modern {
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px; /* Touch target óptimo */
    transition: transform 0.1s ease;
    position: relative;
    overflow: hidden;
}

.btn-modern:active {
    transform: scale(0.97);
}

.btn-reset {
    background: #6c757d;
    color: #fff;
}

.btn-apply {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

/* Ripple effect */
.btn-modern .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    opacity: 0.3;
    background: rgba(255,255,255,0.4);
    pointer-events: none;
}

/* Botón legacy */
.btn-apply-filters {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    min-height: 48px;
}

/* ===== CONTADORES ===== */
.counter-badge {
    background: #f39c12;
    color: #fff;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 4px;
    font-weight: 600;
}

/* ===== FORM CHECKS ===== */
.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

/* ===== UTILIDADES ===== */
.d-block { display: block; }
.d-none { display: none; }
.w-100 { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.mt-1 { margin-top: 4px; }

/* Grid de filtros */
.filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* ===================================================
   📱 BREAKPOINTS RESPONSIVE - MOBILE FIRST
   =================================================== */

/* ===== MÓVILES PEQUEÑOS (< 360px) ===== */
@media (max-width: 359px) {
    .filters-content {
        padding: 8px;
    }
    
    .filter-section,
    .sort-section,
    .tags-section-modal {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .especie-estado-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .modern-select,
    .modern-input {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
    
    .btn-modern {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

/* ===== MÓVILES ESTÁNDAR (360px - 575px) ===== */
@media (min-width: 360px) and (max-width: 575px) {
    .tags-pills-container-modal {
        max-height: 140px;
    }
}

/* ===== TABLETS PEQUEÑAS (576px - 767px) ===== */
@media (min-width: 576px) {
    .filters-content {
        padding: 16px;
    }
    
    .filter-section,
    .sort-section,
    .tags-section-modal {
        padding: 14px;
        margin-bottom: 12px;
    }
    
    .filter-section h6,
    .sort-section h6,
    .tags-section-modal h6 {
        font-size: 1rem;
    }
    
    .modern-label {
        font-size: 0.85rem;
    }
    
    .tags-pills-container-modal {
        max-height: 160px;
    }
    
    .tag-pill-modal {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== TABLETS (768px - 991px) ===== */
@media (min-width: 768px) {
    #ModalFiltros .modal-dialog {
        max-width: 600px;
        width: 85%;
        margin: 1.5rem auto;
    }
    
    .filters-content {
        padding: 20px;
    }
    
    /* Grid de 3 columnas para filtros principales */
    .filters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .filter-section,
    .sort-section,
    .tags-section-modal {
        padding: 16px;
        border-radius: 12px;
    }
    
    .tags-pills-container-modal {
        max-height: 180px;
    }
    
    .btn-modern {
        font-size: 1rem;
        min-height: 50px;
    }
    
    /* Transiciones suaves solo en tablet+ */
    .modern-select,
    .modern-input,
    .btn-modern,
    .tag-pill-modal {
        transition: all 0.2s ease;
    }
    
    .tag-pill-modal:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .btn-reset:hover {
        background: #5a6268;
    }
    
    .btn-apply:hover {
        background: linear-gradient(135deg, #e67e22, #d35400);
        box-shadow: 0 4px 12px rgba(243, 156, 18, 0.35);
    }
    
    .btn-apply-filters:hover {
        background: linear-gradient(135deg, #e67e22, #d35400);
    }
}

/* ===== DESKTOP (992px - 1199px) ===== */
@media (min-width: 992px) {
    #ModalFiltros .modal-dialog {
        max-width: 720px;
        width: 70%;
    }
    
    .filters-content {
        padding: 24px;
    }
    
    .filter-section,
    .sort-section,
    .tags-section-modal {
        padding: 18px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .modern-select,
    .modern-input {
        padding: 12px 14px;
    }
    
    .tags-pills-container-modal {
        max-height: 200px;
    }
    
    .filter-actions {
        gap: 12px;
    }
}

/* ===== DESKTOP GRANDE (1200px+) ===== */
@media (min-width: 1200px) {
    #ModalFiltros .modal-dialog {
        max-width: 800px;
        width: 60%;
    }
    
    .filter-section h6,
    .sort-section h6,
    .tags-section-modal h6 {
        font-size: 1.1rem;
    }
    
    .tag-pill-modal {
        font-size: 0.85rem;
        padding: 7px 14px;
    }
}

/* ===== ULTRA WIDE (1400px+) ===== */
@media (min-width: 1400px) {
    #ModalFiltros .modal-dialog {
        max-width: 850px;
    }
}

/* ===================================================
   🎨 MEJORAS UX ADICIONALES
   =================================================== */

/* Indicador visual de carga */
.filters-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.filters-loading::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #e9ecef;
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estado deshabilitado para selects sin opciones */
.modern-select:disabled,
.modern-input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Feedback táctil mejorado */
@media (hover: none) and (pointer: coarse) {
    .modern-select:active,
    .modern-input:active {
        background: #f8f9fa;
    }
    
    .btn-modern:active {
        transform: scale(0.95);
    }
}

/* Focus visible para accesibilidad */
.modern-select:focus-visible,
.modern-input:focus-visible,
.btn-modern:focus-visible {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

/* Reducir motion para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================================
   📍 MODAL DIALOG MOBILE FULLSCREEN
   =================================================== */

/* En móviles pequeños, modal casi fullscreen */
@media (max-width: 575px) {
    #ModalFiltros .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
        width: calc(100% - 1rem);
    }
    
    #ModalFiltros .modal-content {
        border-radius: 12px;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem); /* Dynamic viewport height */
    }
    
    #ModalFiltros .modal-body-filtros {
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Safe area para dispositivos con notch */
@supports (padding: max(0px)) {
    @media (max-width: 575px) {
        .filters-content {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }
}

/* ===================================================
   🏷️ TAGIFY INTEGRATION (si se usa)
   =================================================== */

/* Input base para Tagify */
#filtro_tags_modal {
    min-height: 44px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
}

#filtro_tags_modal:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
    outline: none;
}

/* Contenedor Tagify en el modal - IGUAL QUE PUBLICAR ANIMAL */
.tags-section-modal .tagify {
    min-height: 50px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    background: #fff !important;
    width: 100% !important;
    max-width: 100% !important;
    transition: border-color 0.2s ease !important;
    font-size: 1rem !important;
}

.tags-section-modal .tagify:hover {
    border-color: #0d6efd !important;
}

/* Tagify cuando tiene foco - IGUAL QUE PUBLICAR ANIMAL */
.tags-section-modal .tagify--focus,
#ModalFiltros .tagify--focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15) !important;
}

/* Input dentro de Tagify - IGUAL QUE PUBLICAR ANIMAL */
.tags-section-modal .tagify__input {
    min-width: 120px;
    padding: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Tags seleccionados dentro del modal - IGUAL QUE PUBLICAR ANIMAL */
.tags-section-modal .tagify__tag {
    --tag-color: #6c757d;
    margin: 3px !important;
    border-radius: 0.25rem !important;
    background-color: transparent !important;
    color: var(--tag-color) !important;
    border: 2px solid var(--tag-color) !important;
    padding: 0.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.5 !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: none !important;
}

/* Colores por categoría - IGUAL QUE PUBLICAR ANIMAL */
.tags-section-modal .tagify__tag--primary   { --tag-color: #0d6efd !important; }
.tags-section-modal .tagify__tag--info      { --tag-color: #0dcaf0 !important; }
.tags-section-modal .tagify__tag--secondary { --tag-color: #6c757d !important; }
.tags-section-modal .tagify__tag--success   { --tag-color: #198754 !important; }
.tags-section-modal .tagify__tag--warning   { --tag-color: #ffc107 !important; }
.tags-section-modal .tagify__tag--danger    { --tag-color: #dc3545 !important; }
.tags-section-modal .tagify__tag--dark      { --tag-color: #212529 !important; }
.tags-section-modal .tagify__tag--cyan      { --tag-color: #17a2b8 !important; }

.tags-section-modal .tagify__tag:hover {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Ocultar pseudo-elementos de Tagify que crean fondos/rayas */
.tags-section-modal .tagify__tag::before,
.tags-section-modal .tagify__tag::after,
.tags-section-modal .tagify__tag:hover::before,
.tags-section-modal .tagify__tag:hover::after,
.tags-section-modal .tagify__tag > div::before,
.tags-section-modal .tagify__tag > div::after {
    display: none !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

.tags-section-modal .tagify__tag__removeBtn {
    margin-right: 6px !important;
    margin-left: -2px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    text-align: center !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    transition: all 0.15s ease !important;
    opacity: 0.5 !important;
    color: #6c757d !important;
    background: transparent !important;
}

.tags-section-modal .tagify__tag__removeBtn:hover {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
    opacity: 1 !important;
}

.tags-section-modal .tagify__tag > div {
    padding: 0 !important;
    margin: 0 !important;
}

.tags-section-modal .tagify__tag > div > span {
    line-height: 1.5 !important;
}

/* ===== DROPDOWN DE TAGS CON CONTADOR - ESTILO LIMPIO ===== */

/* Contenedor del dropdown - asegurar visibilidad en modales */
.tagify__dropdown {
    position: absolute !important;
    z-index: 99999 !important;
    background: white !important;
}

.tags-section-modal .tagify__dropdown,
.tags-with-count.tagify__dropdown,
#ModalFiltros .tagify__dropdown {
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid #dee2e6 !important;
    max-height: 280px !important;
    overflow: hidden !important;
    z-index: 99999 !important;
    -webkit-overflow-scrolling: touch;
    margin-top: 4px !important;
    background: white !important;
}

.tags-section-modal .tagify__dropdown__wrapper,
.tags-with-count .tagify__dropdown__wrapper,
#ModalFiltros .tagify__dropdown__wrapper {
    background: white !important;
    border-radius: 8px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    padding: 0 !important;
}

/* Items del dropdown - diseño limpio y legible, alineado izquierda */
.tags-section-modal .tagify__dropdown__item,
.tags-with-count .tagify__dropdown__item,
#ModalFiltros .tagify__dropdown__item,
.tagify__dropdown__item {
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    color: #212529 !important;
    background: white !important;
    transition: background 0.15s ease !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 4px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
}

/* Texto del dropdown: nombre del tag sin flex grow para que el contador quede pegado */
.tagify-item-text {
    flex: 0 0 auto !important;
    text-align: left !important;
    font-weight: 500 !important;
}

/* Forzar alineación izquierda en wrappers internos (por si Tagify inyecta spans/divs con estilos) */
.tagify__dropdown__item,
.tagify__dropdown__item * {
    text-align: left !important;
}

.tagify__dropdown__wrapper {
    text-align: left !important;
}

.tags-section-modal .tagify__dropdown__item:last-child,
.tags-with-count .tagify__dropdown__item:last-child,
#ModalFiltros .tagify__dropdown__item:last-child,
.tagify__dropdown__item:last-child {
    border-bottom: none !important;
}

/* Hover y active state */
.tags-section-modal .tagify__dropdown__item:hover,
.tags-section-modal .tagify__dropdown__item--active,
.tags-with-count .tagify__dropdown__item:hover,
.tags-with-count .tagify__dropdown__item--active,
#ModalFiltros .tagify__dropdown__item:hover,
#ModalFiltros .tagify__dropdown__item--active,
.tagify__dropdown__item:hover,
.tagify__dropdown__item--active {
    background: #f8f9fa !important;
}

/* Texto del tag - alineado izquierda */
.tagify__dropdown__item > span:first-child,
.tagify__dropdown__item .tagify__dropdown__item__text {
    flex: 1 !important;
    color: #212529 !important;
    font-weight: 500 !important;
    text-align: left !important;
}

/* Contador entre paréntesis - estilo sutil, pegado al nombre */
.tagify__dropdown__item-count {
    color: #888 !important;
    font-size: 0.85em !important;
    font-weight: 500 !important;
    margin-left: 4px !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Icono del tag - ocultar para diseño más limpio */
.tags-section-modal .tagify__dropdown__item i,
.tags-with-count .tagify__dropdown__item i,
#ModalFiltros .tagify__dropdown__item i,
.tagify__dropdown__item i.bi-tag {
    display: none !important;
}

/* No results message */
.tagify__dropdown__item--noMatch {
    color: #6c757d !important;
    font-style: italic !important;
    justify-content: center !important;
}

/* Scrollbar personalizado del dropdown */
.tags-section-modal .tagify__dropdown::-webkit-scrollbar,
.tags-with-count.tagify__dropdown::-webkit-scrollbar,
#ModalFiltros .tagify__dropdown::-webkit-scrollbar {
    width: 8px !important;
}

.tags-section-modal .tagify__dropdown::-webkit-scrollbar-track,
.tags-with-count.tagify__dropdown::-webkit-scrollbar-track,
#ModalFiltros .tagify__dropdown::-webkit-scrollbar-track {
    background: #f8f9fa !important;
    border-radius: 4px !important;
}

.tags-section-modal .tagify__dropdown::-webkit-scrollbar-thumb,
.tags-with-count.tagify__dropdown::-webkit-scrollbar-thumb,
#ModalFiltros .tagify__dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 4px !important;
}

.tags-section-modal .tagify__dropdown::-webkit-scrollbar-thumb:hover,
.tags-with-count.tagify__dropdown::-webkit-scrollbar-thumb:hover,
#ModalFiltros .tagify__dropdown::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1 !important;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .tags-section-modal .tagify__dropdown__item,
    .tags-with-count .tagify__dropdown__item,
    #ModalFiltros .tagify__dropdown__item {
        padding: 0.65rem 0.85rem !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
    }
    
    .tags-section-modal .tagify__dropdown,
    .tags-with-count.tagify__dropdown,
    #ModalFiltros .tagify__dropdown {
        max-height: 250px !important;
    }
}

/* ===== CUSTOM SELECT CON ICONOS ===== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    height: 44px;
    transition: all 0.2s ease;
}

.custom-select-trigger .selected-value {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.custom-select-trigger:hover {
    border-color: #adb5bd;
}

.custom-select.open .custom-select-trigger {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-trigger .bi-chevron-down {
    transition: transform 0.2s ease;
    color: #6c757d;
}

.custom-select.open .custom-select-trigger .bi-chevron-down {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #f39c12;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-select.open .custom-options {
    display: block;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 44px;
    border-bottom: 1px solid #f8f9fa;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: #f8f9fa;
}

.custom-option.active,
.custom-option.selected {
    background: #fff3e0;
    color: #e65100;
    font-weight: 500;
}

.custom-option .option-icon,
.custom-select-trigger .option-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-option .option-icon img,
.custom-select-trigger .option-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.custom-option .option-icon img[src*="animales-granja"],
.custom-select-trigger .option-icon img[src*="animales-granja"] {
    transform: scale(1.4);
    transform-origin: center;
}

.custom-option span:not(.option-icon) {
    flex: 1;
}

/* Scroll suave en opciones */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-bottom-right-radius: 8px;
}

.custom-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive para tablets y desktop */
@media (min-width: 768px) {
    .custom-option {
        padding: 8px 12px;
        min-height: 40px;
    }
    
    .custom-options {
        max-height: 320px;
    }
}
