/* ============================================================
   SISTEMA DE BADGES Y ETIQUETAS
   Inventario TX
   ============================================================
   Badges compactos para estados, tipos y categorias.
   Usar junto con Font Awesome para iconos.
   ============================================================ */

/* ── BADGE BASE ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-full);
    white-space: nowrap;
    vertical-align: middle;
}

/* ── BADGE SUCCESS (ESMERALDA) ─────────────────────────── */
.badge-success {
    background: var(--color-esmeralda-light);
    color: var(--color-esmeralda);
}

/* ── BADGE DANGER (RUBI) ──────────────────────────────── */
.badge-danger {
    background: var(--color-rubi-light);
    color: var(--color-rubi);
}

/* ── BADGE WARNING (NARANJA) ──────────────────────────── */
.badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

/* ── BADGE INFO (CYAN) ────────────────────────────────── */
.badge-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

/* ── BADGE PRIMARY (AZUL) ─────────────────────────────── */
.badge-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ── BADGE MUTED (GRIS) ───────────────────────────────── */
.badge-muted {
    background: var(--color-bg);
    color: var(--color-muted);
    border: 1px solid var(--color-border);
}

/* ── BADGE CON ICONO ──────────────────────────────────── */
.badge .badge-icon {
    font-size: 0.65rem;
}

/* Badge con icono SOLO */
.badge-icon-only {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    justify-content: center;
}

.badge-icon-only .badge-icon {
    font-size: 0.7rem;
}

/* ── BADGE DOT (INDICADOR) ────────────────────────────── */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-muted);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: currentColor;
    animation: badge-pulso 2s ease-in-out infinite;
}

.badge-dot.dot-success {
    color: var(--color-esmeralda);
}

.badge-dot.dot-success::before {
    background: var(--color-esmeralda);
}

.badge-dot.dot-danger {
    color: var(--color-rubi);
}

.badge-dot.dot-danger::before {
    background: var(--color-rubi);
}

.badge-dot.dot-warning {
    color: var(--color-warning);
}

.badge-dot.dot-warning::before {
    background: var(--color-warning);
}

.badge-dot.dot-info {
    color: var(--color-info);
}

.badge-dot.dot-info::before {
    background: var(--color-info);
}

.badge-dot.dot-muted {
    color: var(--color-muted);
}

.badge-dot.dot-muted::before {
    background: var(--color-muted);
}

/* ── BADGE TIPO PRODUCTO ──────────────────────────────── */
.badge-tipo {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: var(--radius-sm);
}

.badge-tipo.badge-individual {
    background: var(--color-info-light);
    color: var(--color-info);
}

.badge-tipo.badge-paquete {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-tipo.badge-en-paquete {
    background: var(--color-bg);
    color: var(--color-muted);
    border: 1px solid var(--color-border);
}

/* ── BADGE COUNT (CONTADOR) ───────────────────────────── */
.badge-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-full);
    background: var(--color-rubi);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Badge sobrepuesto a icono */
.badge-wrapper {
    position: relative;
    display: inline-flex;
}

.badge-wrapper .badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
}

/* ── BADGE LARGE (PARA ESTADISTICAS) ─────────────────── */
.badge-large {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 700;
    border-radius: var(--radius-md);
}

.badge-large i {
    font-size: 0.875rem;
}

/* ── GROUP BADGE ──────────────────────────────────────── */
.badge-group {
    display: inline-flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.badge-group > * {
    margin-bottom: 0.25rem;
}

/* ── STATUS INDICATOR ───────────────────────────────────
   Para mostrar estado de conexion o disponibilidad */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.status-indicator.online::before {
    background: var(--color-esmeralda);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.status-indicator.offline::before {
    background: var(--color-muted);
}

.status-indicator.busy::before {
    background: var(--color-warning);
    animation: badge-pulso 1s ease-in-out infinite;
}

.status-indicator.error::before {
    background: var(--color-rubi);
    animation: badge-pulso 0.8s ease-in-out infinite;
}

/* ── PIL BADGE ───────────────────────────────────────────
   Para listas de tags/categorias */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: default;
    transition: all var(--transition-fast);
}

.pill:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.pill.pill-active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.pill .pill-remove {
    margin-left: 0.25rem;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.pill .pill-remove:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.15);
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 576px) {
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .badge-large {
        padding: 0.375rem 0.75rem;
        font-size: var(--font-size-xs);
    }
}