/**
 * ==========================================================
 * SIDV Theme
 * ----------------------------------------------------------
 * Component: Result Count
 * ----------------------------------------------------------
 * Estilos para el contador de resultados en catálogo y búsquedas.
 * Incluye badge con estética en cápsula, micro-interacciones,
 * estados de carga AJAX y tipografía optimizada.
 * ==========================================================
 */

:root {
  --sidv-result-count-font-size: 0.875rem;
  --sidv-result-count-bg: var(--sidv-color-bg-subtle, #F8FAFC);
  --sidv-result-count-border: var(--sidv-color-border-subtle, #E2E8F0);
  --sidv-result-count-color: var(--sidv-color-text-muted, #64748B);
  --sidv-result-count-primary-color: var(--sidv-color-primary, #0D2137);
  --sidv-result-count-accent-color: var(--sidv-color-accent, #FF9800);
  --sidv-result-count-separator-color: var(--sidv-color-border, #94A3B8);
  
  --sidv-result-count-empty-bg: #FEF3C7;
  --sidv-result-count-empty-border: #FDE68A;
  --sidv-result-count-empty-color: #92400E;
}

/* ==========================================================
   1. LAYOUT PRINCIPAL & CÁPSULA (PILL BADGE)
   ========================================================== */

.sidv-result-count {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  background-color: var(--sidv-result-count-bg);
  border: 1px solid var(--sidv-result-count-border);
  font-size: var(--sidv-result-count-font-size);
  font-weight: 500;
  line-height: 1.2;
  color: var(--sidv-result-count-color);
  font-variant-numeric: tabular-nums;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidv-result-count:hover {
  border-color: var(--sidv-color-border-hover, #CBD5E1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Estado visual durante carga/actualización AJAX */
.sidv-result-count.is-updating,
.sidv-result-count[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
  animation: sidv-result-count-pulse 1.2s ease-in-out infinite;
}

@keyframes sidv-result-count-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.98); }
}

/* ==========================================================
   2. ELEMENTOS TEXTUALES Y DESTACADOS
   ========================================================== */

.sidv-result-count__text {
  color: var(--sidv-result-count-color);
  font-weight: 400;
}

.sidv-result-count__range {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-weight: 700;
  color: var(--sidv-result-count-primary-color);
}

.sidv-result-count__dash {
  color: var(--sidv-result-count-separator-color);
  font-weight: 400;
  margin: 0 0.1rem;
}

.sidv-result-count__separator {
  color: var(--sidv-result-count-color);
  font-weight: 400;
  margin: 0 0.15rem;
}

.sidv-result-count__total {
  font-weight: 700;
  color: var(--sidv-result-count-primary-color);
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--sidv-result-count-primary-color) 0%, var(--sidv-result-count-accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidv-result-count__label {
  color: var(--sidv-result-count-color);
  font-weight: 500;
}

/* ==========================================================
   3. ESTADO VACÍO (SIN RESULTADOS)
   ========================================================== */

.sidv-result-count.is-empty,
.sidv-result-count__empty {
  background-color: var(--sidv-result-count-empty-bg);
  border-color: var(--sidv-result-count-empty-border);
  color: var(--sidv-result-count-empty-color);
  font-weight: 600;
  box-shadow: none;
}

.sidv-result-count__empty::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background-color: #D97706;
}

/* ==========================================================
   4. RESPONSIVE DESIGN
   ========================================================== */

@media (max-width: 768px) {
  .sidv-result-count {
    justify-content: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
  }
}